Introduction
In the design of embedded systems, real-time constraints are not merely goals but hard requirements. This paper presents a landmark industrial case study where formal methods were used to solve a decade-old mystery in a Bang & Olufsen (B&O) communication protocol. Despite being in production for years, the protocol suffered from rare, unexplained data loss that traditional engineering and testing methods could not diagnose.
The Industrial Challenge
The protocol in question was designed to manage communication between various audio and video components—such as TVs, VCRs, and audio centers—over a single shared broadcast bus.
The system's complexity stems from its concurrent nature and the tight timing required for signal processing. With approximately 2,800 lines of assembler code, the protocol's occasional failures were suspected to be rooted in elusive timing interactions and race conditions, making them nearly impossible to reproduce in a standard laboratory environment.
Formal Modeling with UPPAAL
To address this, researchers employed UPPAAL, a toolset designed for the symbolic simulation and automatic verification of real-time systems. The methodology centered on modeling the protocol as a network of timed automata—finite state machines extended with real-valued clocks and integer variables.
Over three months, the team iteratively abstracted the assembler code into nine core automata, representing functional units like the Bus, Sender, Detector, and Frame Generator. They utilized UPPAAL’s "committed nodes" feature to model atomic sequences of actions, ensuring that critical procedures occurred without time passing or interference from other processes. This allowed for an exhaustive reachability analysis of the system's state space.
Key Insights: Finding the "Needle"
The formal model revealed two critical flaws that had escaped detection for years:
- The "Mutual Ignorance" Window: The analysis identified a fatal 40µs delay between when a sender samples the bus and when it outputs its own signal. If a second sender starts within this tiny window, both proceed without realizing they are colliding.
- The Detection Stop Rule: The most significant discovery was that the protocol's collision detection was too aggressive. It stopped checking for interference 781µs after the start of the final symbol, leaving a window where late-arriving jamming signals could destroy a message undetected.
Results and Validation
UPPAAL automatically generated a diagnostic "error trace" showing exactly how the protocol could fail. This trace was nearly 2,000 transition steps long—a sequence far too complex for a human to find through manual inspection or random testing.
Following this discovery, the authors proposed moving the collision detection cutoff to a later point in the frame. By updating the model, they were able to mathematically prove that the new version was correct. The verification of the corrected protocol took only 30 minutes on a standard workstation. Crucially, B&O was able to use this diagnostic information to successfully provoke the error in their physical laboratory, confirming the model's accuracy.
Conclusion
This study demonstrates that formal verification is a powerful tool for solving complex industrial problems where traditional testing fails. Beyond fixing the B&O protocol, the project led to improvements in the UPPAAL tool itself, highlighting the value of applying formal methods to real-world, large-scale software systems.
Summary updated