Introduction

• LANs have a direct application in factory automation and process control, where nodes are computers controlling the manufacturing Chapt er 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

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 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

• 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

• 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 llillogically 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 tok en 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 resp,ponse, 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 lltargest address in receiving station. the ring. A station with an address smaller than the • Token‐recovery procedure is used to generate iitiinviting stttiation or larger than the ltlargest address in a new token (see next slide). the ring can respond to the invitation. • The remaining steps are the same as case 1. 27 28 Table 12-2 Token Recovery Claim-Token Frame Padding

1) Every station has a token‐recovery timer. When the First two bits Length timer expires and the station doesn’t sense any activity on the line, it knows the token is lost. 00 0 × tilime slot 2) The station sends a claim‐token frame to indicate 01 2 × time slot that it wants to generate a new token. Multiple stations may want to be the token claimant. To 10 4 × time slot resolve the contention, each station pads the data field of the claim‐token frame with an amount 11 6 × time slot determined by the first two bits of its address (see Table 12‐2).

29 30

Token Recovery Removing Duplicate Tokens

3) Each station that has sent a claim‐token frame • If a token holding station detects some activity listens to the bus. If it senses a frame longer than on the bus, it knows that some other station is the frame it has sent, it gives up the claim. The also holding a token. station that has sent the longest frame is responsible for generating a new token. • The station that has detected the activity on 4) If two or more stations send frames of the same the bus drops the token and moves to the length, the contention continues this time with the listening state. second two bits. 5) Finally one station will emerge as the token claimant, since each address is unique in the LAN.

31 32 Figure 12-5 Ring Initialization Token Bus Layers Defined by IEEE 802. 4

• At the initial startup, each station knows only its own address, and there is no token and no logical ring. • The ring initialization procedure makes use of two previously discussed procedures to create the ring: – When the stations start up, each sends a token‐recovery frame to contend for access to the token (token recovery). – The winning station uses solict‐successor‐2 frame to start adding the next station to the ring (adding station/case 2). – After the successor is found, the token is passed to that station and the process continues until all stations are added to the ring.

33 34

MAC Sublayer Frame Format

• Access Method – uses token passing access method ƒ Preamble – a predefined pattern to synchronize the over a physical bus topology (see ring management sender and receiver; added by the physical layer and discussion before). not part of MAC frame • Frame Format – contains eight fields; slightly ƒ Start delimiter – used to alert the receiving station different from which has seven fields. to the arrival of a frame; made of 0 or N bits where N is not the regular encoding for binary 1, such that an SD bit pattern will not be confused with any regular data pattern (Fig. 12‐7); SD is added by physical layer. ƒ Frame control –defines the type of frame (Fig. 12‐8).

Figure 12‐6: Token Bus Frame 35 36 Figure 12-7 Figure 12-8

SD Fi eld FC Field Format

37 38

Table 12-3 Frame Format Destination Address for Each Frame T ype

ƒ Destination address – contains the physical address Frame DtitiAddDestination Address of the frame’s next destination; may or may not be claim-token ignored valid base on the type of frame (see Table 12.3). solici t-successor-1 address of successor ƒ Source address – contains the physical address of the solicit-successor-2 address of successor sending station; address is present in all frame types. who-follows ignored ƒ Data – con tain s data from ttehe LLC layer for a data resolve-contention ignored frame or extra information for some control frames token address of successor based on the type of frame (see Table 12.4). set-successor address of station that has sent solicit-successor frame ƒ FCS –CRC‐32 error detection sequence. data address of recipient of data

39 40 Table 12-4 Data Field Contents Frame Format

Frame DtData ƒ End delimiter – used to alert the receiving claim-token length of frame station to the termination of a frame; made of solicit-successor-1 missing 1 or N (nondata) bits where N is not the solicit-successor-2 missing regular encoding for binary 0, such that an ED who-follows missing bit pattern will not be confused with any resolve-contention missing regular data pattern (see Fig. 12‐9); ED is token missing added by physical layer. set-successor new address of successor data data from LLC level

41 42

Figure 12-9 Figure 12-10 Physical Layer Specification ED Field Format

IEEE 802.4 defines four specifications for the physical layer of Token Bus.

43 44 Table 12-5 Carrier Band, Phase Continuous Parameters for Carrier Band , Phase Continuous • Based on carrier band modulation – analog modulation using the whole capacity of the medium Parameter Value without multiplexing. EdiEncoding MhtManchester • Encoding and Signaling – data is first encoded using Modulation FSK (3.75 and 6.25 MHz) Manchester encoding and then modulated using FSK Data rate 1 Mbps modulation (Fig. 12‐11) Toppgyology Bidirectional bus (()two buses) – Bit 0: frequency range is from high (H) to low (L) Medium Thin (75 ohm) – Bit 1: frequency range is from low (L) to high (H) Medium Interface T connector and drop cables • The N bit is encoded in pair (NN) as LLHH. up to 35 cm in length

45 46

Figure 12-11 Encoding and Signaling for Carrier Band, Carrier Band, Phase Coherent Phase Continuous • Also based on carrier band modulation – analog modulation using the whole capacity of the medium without multiplexing. • Encoding and Signaling – data is first encoded using Manchester encoding and then modulated using FSK modulation (see Fig. 12‐12) – Bit 1: modulated by low (L) frequency – Bit 0: modulated by high (H) frequency • NN pair is encoded as: ½ period of H + 1 period of L + ½ period of H 47 48 Table 12-6 Figure 12-12 Parameters for Carrier Band , Encoding and Signaling for Carrier Band, Phase Coherent Phase Coherent

Parameter Value EdiEncoding MhManchester Modulation FSK (5/10 and 10/20 MHz) Data rate 5 and 10 Mbps Topology Bidirectional bus (two buses) Medium Semi-rigid Coaxial Cable (75 ohm) Medium Interface Taps

49 50

Table 12-7 Broadband Parameters for Broadband

• Defines an analog transmission with multiplexing PtParameter VlValue • Encoding and Signaling – data is first encoded using Encoding Multivalue duobinary multilevel duobinary encoding and then modulated Modulation ASK/PSK using a combination of ASK/PSK encoding (Fig. 12‐13) Data rate 1, 5, and 10 Mbps – Three levels of encoding used: 0, 2, and 4 Bandwidth 1.5 MHz, 5 MHz, 12 MHz – Bit 0 is encoded as signal value 0 Topology Uni dir ectio nal bus (o n e bus with a frequency converter) – Bit 1 is encoded as signal value 4 Medium Semi-rigid – Signal value 2 is for nondata bits (such as the N bits) Coaxial Cable (75 ohm) • Uses one bus with a frequency converter or two buses. Medium Interface Taps

51 52 Figure 12-13 Encoding and Signaling for Broadband Optical Fiber

• Defines a broadband transmission with multiplexing • Encoding and Signaling –data is first encoded using Manchester encoding and then modulated using ASK. – Bit 1 is represented as high amplitude – Bit 0 is represented as zero amplitude • The N bit is represented as a third amplitude level.

53 54

Table 12-7 Figure 12-14 Parameters for Broadband Encoding and Signaling for Optical Fiber

Parameter Value Encoding Manchester Modulation ASK (on/off) Data rate 5, 10, 20 Mbps Bandwidth 10 MHz,,, 20 MHz, 40 MHz Topology Star MdiMedium Fiber-opticcable

55 56 Summary Summary

• Token Bus combines the physical configuration of • The ring is managed through the use of seven special Ethernet (a bus topology) with the collision‐free frames. These frames handle station removal, station (predictable delay) feature of Token Ring. addition, token recovery, duplicate token removal, • Manufacturing processes requiring automation and and ring initialization. process control can use a Token Bus network. • The MAC sublayer is responsible for the token • The tok en cccuatesirculates from ppyscahysical addr ess to ppyscahysical passing operations. address around the ring in the descending order. • The IEEE 802.4 defines four specifications for the • Each station can prioritize its data into four classes: 0, ppyhysical layer: carrier band with continuous p,phase, 2, 4, and 6. Timers control the classes. carrier band with coherent phase, broadband, and optic fiber.

57 58