Ring Local Area Network Ring interface (1-bit buffer) Ring interface To station From station Ring LANs The ring is a series of bit repeaters, each connected by a unidirectional transmission link All arriving data is copied into a 1-bit buffer and then copied out again (1-bit delay) Data in the buffer can be modified before transmission Ring interface can be in one of three states: Listen State Transmit State Bypass State 1
States of the Ring Interface Listen State: Incoming bits are copied to output with 1- bit delay To station From station Transmit State: Write data to the ring To station From station States of the Ring Interface Bypass State: Idle station does not incur bit-delay 2
Ring LANs If a frame has traveled once around the ring it is removed by the sender Ring LANs have a simple acknowledgment scheme: Each frame has one bit for acknowledgment. If the destination receives the frame it sets the bit to 1. Since the sender will see the returning frame, it can tell if the frame was received correctly. What is the Length of a Ring? The length of a ring LAN, measured in bits, gives the total number of bits which are can be in transmission on the ring at a time Note: Frame size is not limited to the length of the ring since entire frame may not appear on the ring at one time. Why? Bit length = propagation speed length of ring data rate + + No. of stations bit delay at repeater 3
Example : Calculate the length of the following ring LAN: 3 km ring 1 Mbps data rate 5 µs/km propagation speed 20 stations @ 1 bit delay Bit length = Ring LAN Advantages: Can achieve 100 % utilization No collisions Can achieve deterministic delay bounds Can be made efficient at high speeds Disadvantages: Long delays due to bit-delays Solution: Bypass state eliminates bit-delay at idle station Reliability Problems Solution 1: Use a wire center Solution 2: Use a second ring (opposite flow) 4
Ring LANS: Wire Center (802.5) Bypass Relay Station Connector Station Station Wire Center Cable Station Ring LANS: Use a second ring failure This is known as a dual-redundant counter-rotating ring 5
Token Ring LANS A Token B C Token is a small packet that rotates around the ring When all stations are idle, the token is free and circulates around the ring D Possible Problem: All stations are idle and in the Bypass state. What is the problem? 802.5(Token Ring) MAC Protocol In order to transmit a station must catch a free token The station changes the token from free to busy The station transmits its frame immediately following the busy token IF station has completed transmission of the frame AND the busy token has returned to the station THEN station inserts a new free token into the ring 6
Token Ring LANs Note: If the bit length of the ring is less than the packet length, then the completion of a packet transmission implies return of busy token Only one station can transmit at a time. If a station releases a free token, the next station downstream can capture the token Transmission in a Token Ring Free token B Sender looks for free token A C D 7
Transmission in a Token Ring B Sender changes free token to busy token and appends data to the token A C Data Busy token D Transmission in a Token Ring A B Busy token C Receiver recognizes that it is the destination of the frame Receiver copies frame to station Note: Frame also returns to sender D Data 8
Transmission in a Token Ring A B C Receiver recognizes that it is the destination of the frame Receiver copies frame to station Note: Frame also returns to sender D Data Transmission in a Token Ring A Data B C Sender generates free token when it is done transmitting (Note: The busy token has returned) Free token D 9
Properties of the 802.5 Token Ring No collisions of frames Full utilization of bandwidth is feasible Transmission can be regulated by controlling access to token Recovery protocols is needed if token is not handled properly, e.g., token is corrupted, station does not change to free, etc Token Format / Data Frame Format: Bytes 1 1 1 SD AC ED 1 1 1 2 or 6 2 or 6 No Limit 4 Bytes SD AC FC Destination address Source address Data Checksum ED FS Frame control Start delimiter Preamble End delimiter Frame status 10
IEEE 802.5 Frame Format One 3-byte token circulates if all stations are idle. AC = PPPTMRRR where PPP Priority fields RRR Reservation fields T Indicates Token or Data frame SD, ED: FC: FS: Start/End delimiter of a frame Identifies type of a control frame Contains address recognized bit (A bit) and frame copied bit (C bit) Receiver sets A=1 when frame arrives Receiver sets C=1 when frame has been copied Priority of Transmission in 802.5 Eight levels of priorities Priorities handled by 3-bit priority field and 3-bit reservation field Define: P m = priority of the message to be transmitted P r = token priority of received token R r = reservation priority of received token 11
IEEE 802.5 ( Token Ring) 1. A station wishing to transmit a frame with priority P m must wait for a free token with P r P m 2. The station can reserve a future priority-p m token as follows: If busy token comes by, then set R r P m (if R r < P m ) If free token comes by, then set R r P m (if R r < P m and P m < P r ) IEEE 802.5 ( Token Ring) 3. If a station gets a free token, it sets the reservation field to 0, and leaves the priority field unchanged and transmits 4. After transmission send a free token with Priority = max (P r, R r, P m ) Reservation = max (R r, P m ) 5. Station which upgraded the priority level of a token must also downgrade the priority (if no one used the token) 12
Ring Maintenance Token ring selects one station as the monitor station Duties of the monitor: Check that there is a token Recover ring if it is broken Detect garbled frames Make sure the token (24-bit) is shorter than the ring length Terms in IEEE 802.5 IEEE 802.5 requires to maintain a large number of counters THT: Token Holding Timer (one per station) Limits the time that a station can transmit (Default 10 ms) TRR: Time-to-Repeat Timer (one per station) Limits the time that a station waits for return of own message (Default 2.5 ms) TVX: Valid Transmission Timer (in monitor station) Verifies that station which accessed the token actually used it (Default: THT + TRR = 12.5 ms) TNT: No-Token Timer (one per station) If expire, a new token is generated (Default: N * (THT + TRR)) 13
Performance of Token Rings Parameters and Assumption: End-to-end propagation delay a Packet transmission time 1 Number of stations N Assume that each station always has a packet waiting for transmission Note: The ring is used either for data transmission or for passing the token Performance of Token Rings Define: T 1 = Average time to transmit a frame. Per assumption, T 1 =1 T 2 = Average time to pass the token Maximum Throughput = Frame Time = Frame Time + Overhead T1 = T + T 1 2 14
Effect of propagation delay Effect of propagation delay on throughput: Case 1: a < 1 (Packet longer than ring) T 2 = time to pass token to the next station = a/n Case 2: a > 1 (Packet shorter than ring) Note: Sender finishes transmission after T 1 = 1, but cannot release the token until the token returns T 1 + T 2 = min (1, a) + a/n S = 1 1 + a N S = a + 1 a N Performance of Token Rings Illustration of Analysis ( a>1 ) t 0 t 0 +1 Workstation Workstation t 0 +a t 0 +a+1 Workstation Workstation 15
Performance of Token Rings Illustration of Analysis ( a<1 ) t 0 t 0 +a Workstation Workstation t 0 +1 t 0 +a+1 Workstation Workstation Ethernet vs. Token Ring Maximum throughput as a function of a 16
Ethernet vs. Token Ring Maximum throughput as a function of N FDDI Some Facts: FDDI = Fiber Distributed Data Interface FDDI is a high-speed token ring Fiber-optic (dual redundant counter rotating) ring LAN Multimode fiber Standardized by ANSI and ISO X3T9.5 committee 100 Mbps data rate Maximum frame size is 4500 bytes Allows up to 1000 connected stations Maximum ring circumference 200 km 17
FDDI FDDI distinguishes 4 Service Classes: Asynchronous Synchronous Immediate (for monitor and control) Isochronous (only in FDDI-II) FDDI - Protocol Architecture LLC (IEEE 802.2) Logical Link Control SMT initialization performance monitoring maintenance allocation of bandwidth configuration MAC ring access data transfer PHY coding / decoding transmit / receive data stream PMD Conversion to optical signal SMT: Station Management MAC: Medium Access Control PHY: PMD: Physical Layer Protocol Physical Layer Medium Dependent 18
Dual Redundant Counter Rotating Ring Second ring adds a certain level of fault tolerance Station Types - Class A Station Two PHY (and one or two MAC) entities Connects to another Class A station or to a concentrator LLC LLC MAC PHY MAC PHY SMT BYPASS From Last Station To Next Station 19
Station Types - Class B Station Class B station has one PHY (and one MAC) entity Connects to a concentrator LLC MAC PHY SMT To Concentrator Station Types - Concentrator Connects Class A and Class B stations into one of the counter rotating rings. Concentrator can bypass failing stations. To Class B Stations PHY PHY PHY LLC MAC PHY PHY SMT BYPASS From Last Station To Next Station 20
Topology Example Node 6 M Node 5 M Node 4 M M P P P P P=PHY M=MAC P P P Node 3 P P P P P P M M P FDDI Media Access Control FDDI uses a Token Ring Protocol, similar to 802.5 Differences of FDDI and 802.5: To release a token, a station does not need to wait until the token comes back after a transmission. The token is released right after the end of transmission In FDDI, multiple frames can be attached to the token FDDI has a different priority scheme 21
FDDI Token Ring Protocol A 1. A awaits token T B A F1 2. A seizes token, begins transmitting frame F1 addressed to C B FDDI Token Ring Protocol A D 3. A appends token to end of transmission T B F1 C A D 4. C copies frames F1 as it goes by T B F1 C 22
FDDI Token Ring Protocol A F1 D 5. C continues to copy F1; B seizes token and transmits frame F2 addressed to D B A F2 C D 6. B emits token; D copies F2; A absorbs F1 F1 T F2 B C FDDI Token Ring Protocol A D 7. A lets F2 and token pass; B absorbs F2 T F2 B C A D 8. B lets token pass B T C 23
Frame and Token Format Bits 64 8 8 16 or 48 >=0 32 4 12 Preamble SD FC DA SA Info FCS ED FS Bits 64 8 8 General Frame Format Preamble SD FC Token Frame Format SD Starting Delimiter FC Frame Control (type of frame) DA Destination Address SA Source Address FCS Frame Check Sequence (CRC) ED End Delimiter FS Frame Status Total Frame length 4500bytes Timed Token Protocol FDDI has a timed token protocol which determines how long a station can transmit Each station has timers to measure the time elapsed since a token was last received TTRT Target Token Rotation Time Value of TTRT is negotiated during initialization (default is 8 ms) Set to the maximum desired rotation time 24
Parameters of Timed Token Protocol Station Parameters: TRT Token Rotation Time Time of the last rotation of the token. If TRT < TTRT, then token is early, asynchronous traffic can be transmitted If TRT > TTRT then token is late, asynchronous traffic cannot be transmitted. THT Token Holding Time Controls the time that a station may transmit asynchronous traffic. fi Percentage of the TTRT that is allocated for synchronous traffic at station i. Timed Token Protocol If a station receives the token it sets THT:= TRT TRT:= TTRT Enable TRT (i.e., start the timer) If the station has synchronous frames are waiting the transmit synchronous traffic for up to time TTRT fi (with Σi <1) If the station has asynchronous traffic enable THT while THT > 0 transmit asynchronous traffic. 25
Timed Token Protocol Note: Transmission is not interrupted if THT expires during a transmission. If a station does not utilize its maximum transmission time (i.e., THT), the next station can use it. Analysis of FDDI Annalysis of Synchronous traffic Asynchronous trafic Synchronous Traffic: Recall that each station can transmit synchronous traffic for up to time TTRT fi (with Σi fi 1) If Σ i f i = 1, the maximum throughput of synchronous traffic is 100%. One can show that the maximum delay until a frame is completely transmitted is: Maximum Access Delay 2 TTRT 26
Analysis of FDDI Station 1 Station 1 Station 3 Asynchronous Traffic Parameters: D T-D D n Ring latency Number of active sessions (all 3T-D T heavily loaded) Value of TTRT Assumption: No synchronous traffic Analysis of FDDI From the Example we see: Cycle in a system has a length of: nt + D Time in a cycle used for transmission: n(t - D) We obtain for the maximum throughput for asynchronous traffic is: n(t - D) Max.Throughput = nt + D... and the maximum access delay for asynchronous traffic: Max. Access Delay = T(n -1) + 2D 27
Analysis of FDDI Numerical Example Number of stations: 16 Length of fiber: 200 km Speed of Signal 5 ms/km Delay per station: 1 ms/station TTRT: 5 msec Ring Latency D = (20 km) (5 msec/km) + + (16 stations) 1 msec/station = 0.12 ms. Analysis of FDDI Synchronous Traffic Asynchronous Traffic Max.Throughput = = 100% Max.Access Delay = = 2 5ms = 10ms Max.Throughput = 16(5-0.12) = 16 5 + 0.12 = 97.5% Max.Access Delay = = 5(16-1) + = 75.24ms 2 0.12 28
Numerical Results We show plots for 3 different FDDI networks. Typical FDDI: 20 stations (single MAC) 4 km ring Big FDDI: 100 stations (single MAC) 200 km ring Largest FDDI: 500 stations (dual MAC) 200 km ring Throughput vs. TTRT 29
Maximum Access Delay vs. TTRT Supplemental Material (Token Bus ) 30
IEEE 802.4 (Token Bus) Problems with 802.3: Collisions of frames can lead to unpredictable delays In some real-time scenarios, collisions and unpredictable delays can be catastrophic Solution via Token Bus: A control packet (Token) regulates access to the bus A station must have the token in order to transmit A station can hold the token only for a limited time The token is passed among the stations in a cyclic order This structures the bus as a logical ring IEEE 802.4 (Token Bus) Stations form a logical ring Each station knows its successor and predecessor in the ring Succ=D Pred=C Succ=A Pred=B A B Succ=C Pred=D C Token Bus D Succ=B Pred=A 31
Feature of Token Bus Bandwidth is 1, 5, or 10 Mbps The token bus MAC protocol is very complex Typically, token bus is free of collisions Defines priority transmissions and can offer bounded transmission delays IEEE 802.4 (Token Bus) 802.4 requires each station to implement the following management functions: Ring Initialization Addition to ring Deletion from ring Fault management 32
Adding a Station to the Token Bus Each node periodically sends a solicit successor packet which invites nodes with an address between itself and the next node to join the ring Sending node waits for response for one round trip One of the following three cases apply (1) No Response: Pass token (2) Response from one node: Reset successor node Pass token to new successor node (3) Response from more than one node: Collision has occurred Node tries to resolve contention Add a station to the Token Bus Assume: Response from more than one node has resulted in a collision. Station sends a resolve contention packet and waits for four windows (window = 1 round trip time) for a response: In window 1, stations with address prefix 00 can reply In window 2, stations with address prefix 01 can reply In window 3, stations with address prefix 10 can reply In window 4, stations with address prefix 11 can reply If there is a another collision, procedure is repeated for the second pair of bits. Only the nodes which replied earlier can join the next round First successful reply joins the ring 33
IEEE 802.4 (Token Bus) Four priority levels: Levels 6, 4, 2, 0 Priority 6 is the highest level Token Holding Time (THT): Maximum time a node can hold a token Token Rotation Time for class i (TRTi): Maximum time of a full token circulation at which priority i transmissions are still permitted Token Bus Transmission Rules Each station can transmit class 6 data for a time THT For i= 4, 2, 0: Transmit class i traffic if all traffic from class i+2 or higher is transmitted and the time of the last token circulation (including the transmission time of higher priority packets during the current holding of the token) is less than TRT i. 34
Token Bus Priority Scheme Use Token Class 6 To Send? Y THT Timer expired? N Send Frame N Y Class 4 To Send? Y TRT 4 Timer expired? N Send Frame N Y Class 2 To Send? Y TRT 2 Timer expired? N Send Frame N Y Class 0 To Send? Y TRT 0 Timer expired? N Send Frame N Y More Data To Send? N Want To Stay in Ring? N Send Set- Successor Frame to Predecessor Y Y Use Token 35