Image Processing Reference
In-Depth Information
15.2.3 Medium Access Technique
he MAC mechanism, which CAN relies on, is basically the CSMA scheme. When no frame is being
exchanged the network is idle and the level on the bus is recessive. Before transmitting a frame, nodes
havetosensethestateofthenetwork.Ifthenetworkisfoundidletheframetransmissionbegins
immediately, otherwise the node must wait for the end of the current frame transmission. Each frame
starts with the SOF bit at the dominant level, which informs all the other nodes that the network has
switched to the busy state.
Although a very unlikely event, two or more nodes might start sending their frames exactly at
thesametime.hismayactuallyoccur,becausepropagationdelaysonthebus—eventhoughvery
small—are anyway greater than zero. hus, one node might start its transmission while the SOF bit of
another frame is already traveling on the bus. In this case, a collision occurs. In CSMA networks that
are based on collision detection such as, for example, nonswitched Ethernet, this unavoidably leads to
the corruption of all frames involved, which means they have to be retransmitted. he consequence
is a waste of time and a net decrease of the available system bandwidth. In high load conditions, this
mayleadtocongestion:whenthenumberofcollisionsissohighthatthenetthroughputonthe
Ethernet network falls below the arrival rate, the network is stalled.
Unlike Ethernet, CAN is able to resolve contentions in a deterministic way, so that neither time
nor bandwidth is wasted. herefore, congestion conditions can no longer occur and all the theoretical
system bandwidth is effectively available for communications.
For the sake of truth, it should be said that contentions in CAN occur more often than one may
think. In fact, when a node that has a frame to transmit finds the bus busy or loses the contention, it
waitsfortheendofthecurrentframeexchangeand,immediatelyatertheintermissionhaselapsed,
it starts transmitting. Here, the node may compete with other nodes for which—in the meanwhile—a
transmission request has been issued. In this case, different nodes synchronize on the falling edge of
the first SOF bit which is sensed on the network.
This implies that CAN effectively behaves like a network-wide distributed transmission queue
where messages are selected for transmission according to a priority order.
15.2.3.1 Bus Arbitration
The most distinctive feature of the medium access technique of CAN is the ability to resolve any
collisionthatmayoccuronthebusinadeterministicway.Inturn,thisismadepossiblebythearbi-
tration mechanism, which effectively finds out the most urgent frame each time there is a contention
for the bus.
The CAN arbitration scheme allows collisions to be resolved by stopping transmissions of all
frames involved except the one which is assigned the highest priority (i.e., the lowest identifier). The
arbitration technique exploits the peculiarity of the physical layer of CAN, which conceptually pro-
vides a wired-and connection scheme among all nodes. In particular, the level on the bus is dominant
if at least one node is sending a dominant bit; vice versa, the level on the bus is recessive if all nodes
are transmitting recessive bits.
Bymeansoftheso-calledbinarycountdowntechniqueeachnodetransmitsthemessageidenti-
ierseriallyonthebusimmediatelyatertheSOFbit,startingfromthemostsigniicantbit.When
transmitting, each node compares the level sensed on the bus to the value of the bit which is being
written out. If the node is transmitting a recessive value whereas the level on the bus is domi-
nant, the node understands it has lost the contention and withdraws immediately. In particular, it
ceases transmitting and sets its output port to the recessive level so as not to interfere with other
contending nodes. At the same time it switches to the receiving state so as to read the incoming
(winning) frame.
The binary countdown techniques ensures that, in the case of a collision, all nodes that are sending
lower priority frames will abort their transmissions by the end of the arbitration field, except for the
 
Search WWH ::




Custom Search