CS485 Sylabus

### The collision resolution protocol of the Token Bus network

• Collisions on the token bus network

• Recall:

• Multiple nodes can be invited to join the token bus network

• When multiple nodes tries to join:

 Their simultaneous message transmissions will result in a collision

• Cause of the collision:

• Collisions on the token bus network is cause by:

 Multiple nodes believe they have the permission to transmit on the network

• Resolving collision:

 Resolving collision = making the colliding nodes decide on which (one) node has the permission to transmit on the network

Fact:

 The Token Bus network defines a distributed algorithm to resolve a collision

• The collision resolution protocol of the Token Bus network

• The Collision Resolution Protocol: (Executed by nodes that are involved in the collision)

 ``` 1. Let NodeID = address (ID) of the node in binary 2. Divide the NodeID into groups of 2 bits each: NodeID = 11223344556677..... /* =============================================================== This distributed algorithm will identify the node with the largest node ID !!! ================================================================ */ while ( true ) { x = next 2 bits in NodeID; // x = bits 11 or bits 22, and so on Transmit a jam signal for (x + 1)*τ sec // τ = end to end delay Listen on the transmission medium if ( transmission medium is busy for > τ sec ) { /* ============================================= Some other node has an x value > my x value ============================================= */ winner = false; // Node will stop competing !! exit; } else ( transmission medium is busy for < τ sec ) { /* ============================================= Some other node has an x value == my x value ============================================= */ continue; // Try again with next group of bits } else // The transmission medium is clear !!! { /* ============================================= This node transmits the jam for the longest time !! I.e.: This node has the highest x value !!! ============================================= */ winner = true; // This node is the winner exit; } } ```

• Outcome of the Collision Resolution Protocol:

 The node that has the largest value for ID will be the winner of the Collision Resolution protocol !!!      (And this node will then execute the node insertion protocol to add itself into the ring)

• Example:

• Suppose nodes 2 and 3 want to insert into the ring:

Their transmissions will collide....

 We will use 4 bits (binary numbers) for node IDs in the example

• Round 1:

 Node 0010 (2) will use x = 00 Node 0011 (3) will use x = 00

Therefore:

 Node 0010 (2) will transmit for 1×τ sec Node 0011 (3) will transmit for 1×τ sec

Graphically:

Then:

• Both nodes will listen on the transmission medium:

and both nodes will detect a transmission

• The transmission will end in < τ sec:

Therefore:

 The nodes 2 and 3 will repeat and use their next group (pair) of bits

• Round 2:

 Node 0010 (2) will use x = 10 (= 2) Node 0011 (3) will use x = 11 (= 3)

Therefore:

 Node 0010 (2) will transmit for 3×τ sec Node 0011 (3) will transmit for 4×τ sec

Graphically:

Result:

• Node 2 will hear a transmission for > τ sec after node 2 has stopped:

 Node 2 will withdraw itself from the collision resolution protocol

• Node 3 will hear no transmission after node 3 has stopped !!!

 Node 3 will detect that itself is the winner !!!