Arbitration of CAN messages on the bus
As every node within a CAN network can start sending a message as soon as the bus is free, it is possible that several nodes simultaneously wish to send a new message. To prevent CAN nodes from 'talking over one another', an arbitration mechanism determines which message takes precedence.
Conflicting nodes that wish to send a message at the same time are common in many networks. It happens very regularly. The bus is currently occupied, so other nodes must wait to send a message as well. Logically, they attempt to do so simultaneously as soon as the bus becomes free again. What makes CAN unique, however, is that the process of determining who may transmit first takes place without any time delay or data loss. This is what makes CAN’s behaviour truly real-time.
Assigning a master without data loss or delay
The ID is the most important factor during arbitration. Only the node wishing to send the message with the highest priority at that moment is permitted to continue the transmission process. The message with the lowest (!) identifier therefore has the highest priority. The figure below illustrates how this principle is applied to bus arbitration. The arbitration phase consists of the transmission of the identifier and the so-called RTR bit.
When a node, despite having itself transitioned to a recessive state (recessive bit, the ‘ 1’)) detects a dominant bus level (dominant bit, the ‘0’) in the network, it will immediately abort the transmission process and return to the receiver state, as in this case a message with a higher priority is evidently being transmitted simultaneously. At the same time, this node realises that it has, in fact, already received the bits it had sent from the node to which it lost the arbitration.
Nodes 1, 2 and 3 wish to send a message simultaneously: Nodes 1 and 2 drop out during the arbitration because they wish to send a recessive bit ('1') at bit 2 and bit 5 respectively, but read a dominant bit ('0') on the bus. Node 3 wins the arbitration and that message can also be read on the bus (by all nodes).
The winning node becomes the master and transmits the complete CAN message. The losing node(s), together with all other nodes, are the slaves. This is possible because the losing nodes know exactly which bits they placed on the bus right up until the moment they lost. They therefore also received these from the winning node. As a message is sent with every bus arbitration, this process guarantees access to the bus without data loss or delay.
The node(s) that attempted to send a message with a lower ID will try again as soon as the bus is free.
CAN Standard versus Extended
If arbitration takes place between a standard and an extended message with the same identifiers, the standard message will take priority. This is because the first bit, which determines the difference between the two formats, is a dominant ‘0’ for a standard message.
Priority-based message dispatch
The arbitration process described above ensures that the message with the highest priority is always transmitted as soon as the bus is free. The priority of the message is determined by the value of the message identifier. The lower this value, the higher the priority of the message. The message with ID 0 therefore has the highest priority. The principle of priority-oriented messaging makes it possible to utilise the bandwidth available for data transmission in an extremely efficient manner. This allows low-priority messages to occupy the bus without substantially delaying the transmission of higher-priority messages. For messages with the highest priority – that is, ID = 0 – a maximum latency of 130 µs applies, for example, at a transmission rate of 1 Mbit/s.
On the other hand, when designing a CAN system, care must be taken to ensure that high-priority messages do not constantly occupy the bus. This can be prevented, for example, by implementing a transmission time-out via software. In CANopen, for instance, this is known as the ‘blocking time’.
For a balanced bus, a bus load of no more than 80 1s recommended. A higher bus load is only advisable if the timing implications have been taken into account in the communication model. Otherwise, there is a risk that low-priority messages will continuously lose the arbitration and never be transmitted.
Note that arbitration and priority only apply to nodes attempting to simultaneously send messages. As already mentioned, a node that loses arbitration will attempt to resend the message as soon as the bus is free again. Suppose that, in the meantime, this node wishes to send a higher-priority message first; this will need to be managed via software.






