How CAN Bus Bitwise Arbitration Prioritizes Messages
In modern automotive electronics, dozens of Electronic Control Units (ECUs) communicate simultaneously over a single shared network known as the Controller Area Network (CAN) bus. To prevent data loss when multiple ECUs transmit at the exact same moment, the CAN protocol uses a mechanism called non-destructive bitwise arbitration. This article provides a straightforward explanation of how the physical properties of the CAN bus, combined with message identifiers, allow the highest-priority automotive messages to win network access instantly without losing data or wasting time.
The Physical Layer: Dominant and Recessive Bits
To understand bitwise arbitration, you first need to understand how binary data is physically represented on the CAN bus wiring. The bus uses two states:
- Dominant (Logical 0): Driven actively by a transmitter using differential voltage.
- Recessive (Logical 1): The idle state of the bus, where transmitters simply release the lines.
Because of how the transceivers are wired, the CAN bus acts like a large "wired-AND" gate. If one node transmits a dominant bit (0) and another transmits a recessive bit (1) at the exact same time, the physical state of the bus becomes dominant (0). The dominant bit always overwrites the recessive bit.
Message Identifiers Determine Priority
In a CAN network, nodes do not have specific addresses. Instead, every message begins with an Arbitration Field containing an Identifier (11 bits for Standard CAN, 29 bits for Extended CAN). This identifier describes the content of the data and dictates its priority.
Because a logical 0 is dominant over a logical 1, a lower
binary number in the Identifier represents a higher priority.
For example, a critical brake system message might be assigned the ID
001, while a non-critical climate control message might be
assigned the ID 500.
The Step-by-Step Arbitration Process
Every node on the CAN bus constantly monitors the physical bus state, even while it is actively transmitting its own message. Non-destructive bitwise arbitration occurs through the following steps:
- Simultaneous Start: Two or more ECUs detect that the bus is idle and begin transmitting their messages at the exact same microsecond, starting with the Start of Frame (SOF) bit.
- Bit-by-Bit Comparison: Following the SOF bit, the nodes begin transmitting their Identifiers, starting with the Most Significant Bit (MSB). As each node puts a bit on the bus, it simultaneously reads the bus to see what the actual resulting state is.
- Matching Bits: As long as the transmitting nodes send the exact same bits (both send 0, or both send 1), they read back what they sent and continue transmitting the next bit of their Identifier.
- Collision Detection: Eventually, a bit position is reached where one node transmits a dominant bit (0) and another transmits a recessive bit (1).
- Winning and Losing: Because the bus defaults to the dominant state, the wire carries a 0. The node that transmitted the 1 reads the 0 on the bus. Recognizing that its recessive bit was overwritten by a higher-priority message, this node loses arbitration.
- Yielding the Bus: The losing node immediately stops transmitting and switches to receiver mode to listen to the winning message. It will automatically attempt to retransmit its message as soon as the bus becomes idle again.
Why It Is "Non-Destructive"
In traditional networks like classic Ethernet, simultaneous transmissions result in a destructive collision. Both messages are corrupted, everything stops, and both nodes must wait a random amount of time before trying again.
In a CAN bus, the arbitration is non-destructive. The node sending the highest-priority message (the one with the most leading zeros) never sees its dominant bits overwritten. It doesn't even know a collision occurred. It continues transmitting its message seamlessly without delay, corruption, or the need to restart. This ensures that critical automotive systems, such as airbag deployments or anti-lock braking commands, are guaranteed immediate bus access with zero latency.