Token Bus Occur in Real‐Time with Minimum Delay, and at the Same Speed As the Objects Moving Along the Assembly Line
Total Page:16
File Type:pdf, Size:1020Kb
Introduction • LANs have a direct application in factory automation and process control, where nodes are computers controlling the manufacturing Chap ter 12 process. • In this type of application, processing must Token Bus occur in real‐time with minimum delay, and at the same speed as the objects moving along the assembly line. 2 Introduction Introduction • Ethernet is not suitable for this purpose, • Token Bus is the solution to this type of because the number of collisions is not problem. predictable and delay in sending data from the • It combines the physical configuration of control center to the computers along the Ethernet (a bus topology) and the collision‐ assembly line is not a fixed value. free (predictable delay) feature of Token Ring. • Token Ring is not suitable either, because an • It is a physical bus operating as a logical ring assembly line resembles a bus topology and using tokens. not a ring topology. 3 4 Figure 12-1 Physical Versus Logical Topology A Token Bus Network • The logical ring is formed based on the physical address of the stations in descending order. • Each station considers the station with the immediate lower address as the next station and the station with the immediate higher address as the previous station. • The station with the lowest address considers the station with the highest address the next station, and the station with the highest address considers the station with the lowest address the previous station. 5 6 Token Passing Token Passing • To control access to the shared medium, a • After sending all its frames or after the time small token frame circulates from station to period expires (whichever comes first), the station in the logical ring. station releases the token to the next station. • If a station has data frame to send, it keeps • The token frame contains the address of the next the token and sends its data frame. station in the logical ring, because Token Bus is physically a bus and the token is received by all • To prevent monopolization of the medium by stations. any one station, each station can only keep • Only the next station in the lillogical ring has the the token for a specified period of time. right to keep the token and sends its data frames. 7 8 Figure 12-2 a and b Figure 12-2 c and d Token Passing in a Token Bus Network Token Passing in a Token Bus Network 9 10 Figure 12-3 Service Classes Queues for Service Classes • In Token Bus all stations have the same priority. • But each station can categorize its data into four classes: 0, 2, 4, and 6. Class 0 has the lowest priority and class 6 has the highest. • If a station does not classify its data, all data belong to class 6. • If a station wants to classify its data, it should have four queues, one for each class. 11 12 Timers Ring Management • To handle different data classes, Token Bus defines • The whole Token Bus protocol depends on the four timers: THT, TRT4, TRT2 and TRT0. maintenance of the logical ring and the • The token holding timer (THT) is set to the maximum controlling of the token. time that a station can send class 6 data. The setting • The logical ring must be maintained when of this timer is the same for all stations. – a station leaves the ring; • The toke n rotatio n ttesimers ((,TRT4, TRT2, aadnd TRT0) – a station joins the ring; are set to the maximum token circulation tome plus – a token is lost; the time to send either class 4, 2, or 0 data. E.g. if – more than one token is created; TRT4 = 20 µs and it takes 18 µs for a token to come back, the station has 2 µs to send class‐4 data if any. – the ring is initialized at startup. 13 14 Figure 12-4 Ring Management Ring Management • For management purpose, seven specilial frames are used: 1. Token 2. claim‐token 3. set‐successor 4.solic iit‐successor‐1 5. solicit‐successor‐2 6. resolve‐contention Different Types Of Procedures Used In Ring Management 7. who‐follows 15 16 Removing Stations Voluntary Leaving • When a sttitation leaves the ring, its predecessor • Assume 5 sttitations (A → B → C → D → E → A) are in a should be informed to bypass that station and Token Bus. If station C leaves the ring voluntarily, the reform the logical ring. procedure is as fllfollows: 1. Station C waits until it receives a token from its • → → → → → Assume 5 stations (A B C D E A) predecessor (station B) are in a Token Bus. If C leaves the ring, its 2. Station C sends a set‐successor frame to station B predecessor (B) shldhould know how to lilllogically identifying station D as the successor to station B rebuild the ring (A → B → D → E → A). 3. B updates its record to set its successor to D • A station may leave the ring either voluntarily 4. Station C sends the token to station D or unexpectedly (due to a malfunction). 5. Sta tion C leaves the ring 17 18 Unexpected Leaving Unexpected Leaving • Assume 5 stations (A → B → C → D → E → A) Steps to follow after station B sends a token to are in a Token Bus. If station C leaves the ring station C: unexpectedly (due to a malfunction), station C 1) Station B listens for activity on the bus. If station C cannot inform station B of the problem, and is fiifunctioning, B will sense actiiivity on the bus, and station B needs to find out by itself. the following steps do not occur. • When station B sends a token to station C, it 2) If B does not sense any activity on the bus, it waits a always follows a procedure to monitor the bus predetermined amount of time (response window activity and to make sure station C is time). If there is no news, B sends the token again functioning properly (see next slide). to be sure that there is no transmission problem. 19 20 Unexpected Leaving Adding Stations (Case 1) 3) If B does not hear anything during the second • Each station in the ring must provide an opportunity response window time, it assumes C is not working. periodically for other stations to join the ring. B sends a who‐follows control frame containing the • Case 1: If the joining station’s address is within the address of C, trying to find the next station after C. range of the addresses of the stations already in the 4) Station D responds with a set‐successor frame and ring, the following procedure is followed: specifies itself as the successor of station B. 1) A toke n hoodldin g statio n sends a soli ci t‐successor‐ 5) Station B now changes its records and defines D to 1 frame, containing the address of the sender be its successor. and its successor, as an invitation to stations that 6) Station B sends a token to station D. want to join the ring. 21 22 Adding Stations (Case 1) Adding Stations (Case 1) 2) The token holding station waits a response window The added station also sets its predecessor (inviting time. A station whose address is between the station) and successor (previous successor of the addresses of the sender and its successor can inviting station) and becomes part of the ring. respond with a set‐successor frame. 5) If there is more than one respp,onse, the inviting 3) If the inviting station receives no response during station sends a resolve‐contention frame and waits the response window time, it closes the window for four response window times. and sends the token to its successor in the ring. 6) Each station who has sent a set‐successor frame 4) If the inviting station receives a respp,onse, it changes earlier responds to the resolve‐contention frame in its successor to the responding station and sends one of the response windows according to the first the token to it. two bits of its address (see Table 12‐1). 23 24 Table 12-1 Response to Resol u tion-Contention Frame Adding Stations (Case 1) 7) If two or more stations respond in the same First two bits Responding Waiting time response window, collision will occur again. The window inviting station then sends another resolve‐ 00 1 None contention frame. This time only stations involved in the second collision may respond based on their 01 2 One response window time second two address bits. 10 3 Two response window time 8) Step 7 will be repeated if there are more collisions. 11 4 Three response window time Since no two stations have identical address bits, finally one station will be added to the ring. 25 26 Adding Stations (Case 2) Token Recovery • Case 2: If a station has an address outside the range • A token may get lost due to: of the addresses of the stations already in the ring, it must wait for an invitation from the station with the – The ring is set up for the first time; lowest address. The following steps occur: – The token holding station fails and takes the token • When the tktoken hldiholding sttitation has the ltlowest down with itself; address in the ring, it sends solicit‐successor‐2 frame, – The token is corrupted and discarded by the dfiidefining its own address and the ltlargest address in receiving station. the ring. A station with an address smaller than the • Token‐recovery procedure is used to generate iitiinviting sttitation or larger than the ltlargest address in a new token (see next slide).