In this system, the nodes are physically connected as a bus, but logically form a ring with tokens passed around to determine the turns for sending. It has the robustness of the 802.3 broadcast cable and the known worst case behavior of a ring. The structure of a token bus network is as follows:
Frame Structure:-
A 802.4 frame has the following fields:
After the ring is set up, new nodes which are powered up may wish to join the ring. For this a node sends Solicit_successor_1 packets from time to time, inviting bids from new nodes to join the ring. This packet contains the address of the current node and its current successor, and asks for nodes in between these two addresses to reply. If more than one nodes respond, there will be collision. The node then sends a Resolve_contention packet, and the contention is resolved using a similar mechanism as described previously. Thus at a time only one node gets to enter the ring. The last node in the ring will send a Solicit_successor_2 packet containing the addresses of it and its successor. This packet asks nodes not having addresses in between these two addresses to respond.
A question arises that how frequently should a node send a Solicit_successor packet? If it is sent too frequently, then overhead will be too high. Again if it is sent too rarely, nodes will have to wait for a long time before joining the ring. If the channel is not busy, a node will send a Solicit_successor packet after a fixed number of token rotations. This number can be configured by the network administrator. However if there is heavy traffic in the network, then a node would defer the sending of bids for successors to join in.
There may be problems in the logical ring due to sudden failure of a node. What happens when a node goes down along with the token? After passing the token, a node, say node A, listens to the channel to see if its successor either transmits the token or passes a frame. If neither happens, it re-sends a token. Still if nothing happens, A sends a Who_follows packet, containing the address of the down node. The successor of the down node, say node C, will now respond with a Set_successor packet, containing its own address. This causes A to set its successor node to C, and the logical ring is restored. However, if two successive nodes go down suddenly, the ring will be dead and will have to be built afresh, starting from a Claim_token packet.
When a node wants to shutdown normally, it sends a Set_successor packet to its predecessor, naming its own successor. The ring then continues unbroken, and the node goes out of the ring.
The various control frames used for ring maintenance are shown below:
0 is the lowest priority level and 6 the highest. The following times are defined by the token bus:
- Preamble: The Preamble is used to synchronize the receiver's clock.
- Starting Delimiter (SD) and End Delimiter (ED): The Starting Delimiter and Ending Delimiter fields are used to mark frame boundaries. Both of them contain analog encoding of symbols other than 1 or 0 so that they cannot occur accidentally in the user data. Hence no length field is needed.
- Frame Control (FC): This field is used to distinguish data frames from control frames. For data frames, it carries the frame's priority as well as a bit which the destination can set as an acknowledgement. For control frames, the Frame Control field is used to specify the frame type. The allowed types include token passing and various ring maintenance frames.
- Destination and Source Address: The Destination and Source address fields may be 2 bytes (for a local address) or 6 bytes (for a global address).
- Data: The Data field carries the actual data and it may be 8182 bytes when 2 byte addresses are used and 8174 bytes for 6 byte addresses.
- Check sum: A 4-byte check sum calculated for the data. Used in error detection.
Ring Maintenance:
Mechanism:
When the first node on the token bus comes up, it sends a Claim_token packet to initialize the ring. If more than one station send this packet at the same time, there is a collision. Collision is resolved by a contention mechanism, in which the contending nodes send random data for 1, 2, 3 and 4 units of time depending on the first two bits of their address. The node sending data for the longest time wins. If two nodes have the same first two bits in their addresses, then contention is done again based on the next two bits of their address and so on.After the ring is set up, new nodes which are powered up may wish to join the ring. For this a node sends Solicit_successor_1 packets from time to time, inviting bids from new nodes to join the ring. This packet contains the address of the current node and its current successor, and asks for nodes in between these two addresses to reply. If more than one nodes respond, there will be collision. The node then sends a Resolve_contention packet, and the contention is resolved using a similar mechanism as described previously. Thus at a time only one node gets to enter the ring. The last node in the ring will send a Solicit_successor_2 packet containing the addresses of it and its successor. This packet asks nodes not having addresses in between these two addresses to respond.
A question arises that how frequently should a node send a Solicit_successor packet? If it is sent too frequently, then overhead will be too high. Again if it is sent too rarely, nodes will have to wait for a long time before joining the ring. If the channel is not busy, a node will send a Solicit_successor packet after a fixed number of token rotations. This number can be configured by the network administrator. However if there is heavy traffic in the network, then a node would defer the sending of bids for successors to join in.
There may be problems in the logical ring due to sudden failure of a node. What happens when a node goes down along with the token? After passing the token, a node, say node A, listens to the channel to see if its successor either transmits the token or passes a frame. If neither happens, it re-sends a token. Still if nothing happens, A sends a Who_follows packet, containing the address of the down node. The successor of the down node, say node C, will now respond with a Set_successor packet, containing its own address. This causes A to set its successor node to C, and the logical ring is restored. However, if two successive nodes go down suddenly, the ring will be dead and will have to be built afresh, starting from a Claim_token packet.
When a node wants to shutdown normally, it sends a Set_successor packet to its predecessor, naming its own successor. The ring then continues unbroken, and the node goes out of the ring.
The various control frames used for ring maintenance are shown below:
Frame Control Field |
Name |
Meaning |
00000000
|
Claim_token
|
Claim token during ring maintenance
|
00000001
|
Solicit_successor_1
|
Allow stations to enter the ring
|
00000010
|
Solicit_successor_2
|
Allow stations to enter the ring
|
00000011
|
Who_follows
|
Recover from lost token
|
00000100
|
Resolve_contention
|
Used when multiple stations want to enter
|
00001000
|
Token
|
Pass the token
|
00001100
|
Set_successor
|
Allow the stations leave the ring
|
Priority Scheme:
Token bus supports four distinct priority levels: 0, 2, 4 and 6.0 is the lowest priority level and 6 the highest. The following times are defined by the token bus:
- THT: Token Holding Time. A node holding the token can send priority 6 data for a maximum of this amount of time.
- TRT_4: Token Rotation Time for class 4 data. This is the maximum time a token can take to circulate and still allow transmission of class 4 data.
- TRT_2 and TRT_0: Similar to TRT_4.
- It transmits priority 6 data for at most THT time, or as long as it has data.
- Now if the time for the token to come back to it is less than TRT_4, it will transmit priority 4 data, and for the amount of time allowed by TRT_4. Therefore the maximum time for which it can send priority 4 data is= Actual TRT - THT - TRT_4
- Similarly for priority 2 and priority 0 data.


No comments:
Post a Comment