CMSC 406, MSCS 560
Computer Networks
Lecture # 5
Controlled Access -- Token Passing
1.
Listing of Topics --
Token passing is a mechanism for controlling access to a shared medium. Only the station holding the token is allowed to transmit. If it is not ready to transmit when the token arrives it immediately passes the token to its successor without wasting bandwidth. Token passing schemes make efficient use of the bandwidth under moderate to high load, and they are fair -- every station gets its turn. Priority can be assigned to different classes of traffic with token passing schemes, and a maximum time between token access can be fixed (token passing schemes are deterministic whereas contention based schemes cannot be.)
There are two general forms of token passing schemes -- token ring and token bus. In token ring, the ring is essentially a closed set of point-to-point connections between active repeaters that forward packets around the ring. One station's successor is the next node in this link and the free token does not have to be specifically addressed to a successor. Traffic on the ring is unidirectional.
In the token bus, a logical ring is created on a physical bus. Stations attach to the bus with a passive tap as in Ethernet, but instead of contending for access, each station keeps in a table the address of its current successor and predecessor and passes the free token in a packet addressed to its successor. Only active stations are part of the token passing logical ring. Before a station relinquishes the token to its successor, it sends a solicit successor packet with its own address and the address of its current successor. Inactive stations with an address in this range that are now ready to transmit may respond with a claim token packet, and if a new successor is established the token holding station updates its table and sends the token to the successor. When a station holding the token is ready to become inactive, it performs the solicit successor activity described above, sends a message to its predecessor listing its successor, and relinquishes the token to this successor. The token bus is bi-directional, and the timed token algorithm was originally developed for the token bus IEEE 802.4 standard to support traffic priorities and fairness.
A list of the topics considered in this lecture include:
a. IEEE 802.5 (IBM Token Ring)
b. IEEE 802.5 Packet format
c. The Role of the Monitor
d. Immediate vs. Delayed Token Release
e. FDDI
f. The Timed Token Algorithm
2.
IEEE 802.5 (IBM
Token Ring)
The token ring standard supports a 4-Mbit/sec and 16 Mbit/sec data rate with Manchester encoding. It allows for priority traffic, it has automatic acknowledgement using the status frame, and it is deterministic for high priority traffic. Token rings generally perform better for high traffic than ethernets, but are more expensive, are more prone to problems. The IEEE standard for token rings is described in more detail below.
3.
IEEE 802.5
Packet format -- Reservations and priorities

The access control field of the token ring packet consists of 8 bits arranged as
follows: The first three bits indicate the priority of the token (free or connector);
the next bit is the token bit -- set to 0 if a free token or 1 if a connector; next comes
the monitor bit which is initially set to zero when the token is re-issued, and set to 1
by the monitor when a new connector passes; and finally, the last three bits are used
to make a reservation by indicating the requested priority.
When a station waiting to transmit sees a new frame circulating on the ring, it compares the priority of the circulating token/connector with the priority of the message it wants to transmit. Let pt = the priority of the token and pm the priority of the message. Also let rt be the reservation currently on the token.
a. If pm ³ pt and the token is free, claim the token and transmit.
b. If pm > rt and token is a connector, set reservation to pm
c. else do nothing
d. When the sending station releases the token, it sets the priority, pt, to the higher of the values (pm, rt) where pm is the priority of the message it has sent, and rt is the reserved priority level.
e. When a station that set the token to priority pt sees a free token return at this priority level, it re-issues a free token with the priority set to the previous (lower) value it had before that station increased it. Each station will have to keep a stack of previous priority levels that it adds to every time it increases the priority. (A token that circulates around the ring at a priority pt has allowed every station with a message with this priority a chance to claim it and can now be reset down to its previous lower value.)
The frame status field has two bits (repeated) called A and C that are both initially
set to 0. When a station that is the destination sees a frame addressed to it, it sets the A bit to 1. If it copies that frame, it also sets the C bit to 1. This piggybacks an automatic acknowledgement to the sender (if the sender is local to the ring).
4.
The Monitor
Frames must be removed from the ring by the sending station. One station is the monitor for the ring. When the monitor sees a transmitted frame for the first time, it sets the monitor bit in the access control field to 1. If the frame becomes "orphaned" (not removed by the station that transmitted it, the frame (with both the token and monitor bit set) will circulate past the monitor again, and the monitor must remove the frame and reissue a free token.
The monitor makes sure there is always a token somewhere in the ring. To detect a missing token, the monitor watches for a passing token and maintains a timer equal to the maximum possible token rotation time. The monitor also detects dead stations. If any station suspects a failure on the ring, it can send a beacon frame to the suspect destination. Based on how far this frame gets, the status of the ring can be established and malfunctioning stations bypassed by relays in the MAU. The monitor must also insert additional delay bits when many stations are inactive to ensure that the free token can fit on the ring.
The procedures for "electing" a monitor are as follows: When a station decides that a new monitor is needed (startup or no monitor present) it transmits a "claim token" frame with its address. If this frame circulates back to the sender with the same address, it becomes the monitor. If some other station is also trying to become the monitor, the first station will circulate the other "claim token" frame if the address of the sender is higher than its own, else it removes the claim from the ring. Only the contending frame with the highest address will circulate all the way around the ring.
5.
Immediate vs. Delayed Release
A token ring may adopt one of two strategies for reissuing the token -- a) delayed release -- reissuing the token when the frame has circulated around the ring and been removed, or b) early release -- reissuing the free token immediately after the last bit of the preceding frame has been transmitted. IEEE 802.5 originally supported only delayed release but now supports both. Early release makes much better use of the bandwidth.
6.
FDDI
FDDI - Fiber Distributed Data Interface -- A 100 Mb/s ring with a dual fiber outer and inner ring that can be used to isolate a single break or node failure. Each network adapter can hold between 9 to 80 bit in its buffer. The standard limits a single network to 500 stations with a maximum distance of 2 km between any two stations. The total amount of cable is limited to 100 km, and the standard calls for 4B/5B encoding.
7.
The FDDI Timed Token Algorithm
Define the following terms:
THT = token holding time -- the (minimum) time each station can hold the token
TRT = token rotation time -- elapsed time between successive arrivals of the token
TTRT = target token rotation time -- a negotiated value for the upper limit on TRT
synchronous traffic -- delay sensitive high priority traffic
asynchronous traffic -- delay insensitive traffic.
Each station has the right to transmit synchronous traffic for a time THT when it acquires the token no matter what the measured TRT. A station can only transmit asynchronous traffic as long as TRT < TTRT. If TRT > TTRT when a station receives the token, it can transmit no asynchronous traffic. (If the difference between TTRT and TRT is less than the time to transmit one frame, the sender can still proceed with sending the frame even though "its time will run over") This algorithm has the effect of partitioning the bandwidth between the two types of traffic and reducing the bandwidth for asynchronous traffic when there is a heavy traffic of synchronous traffic. It also has the effect of allocating the asynchronous bandwidth on a round robin basis so each station gets access to the limited bandwidth in turn.
Each station should see a token after a period no greater than the ring latency + THT < 2.5 ms on a maximum sized ring. Therefore, each station sets a timer and issues a claim token frame if the token does no reappear before the timer event occurs. with the claim token, the station makes a bid for the TTRT -- the target time that it needs so the application running on it can meet its timing constraints. Claim frames can be sent without holding the token, and are issued whenever a station suspects a failure or when it joins the ring. The claim frame that makes it all the way around the ring is the one with the lowest bid for TTRT. When a station receives a claim frame, it compares the bid with its own bid or requirements. If the bid is less than its own, it sets its own TTRT value to the bid value and retransmits the frame. If it has a requirement for a lower TTRT, it issues its own claim frame with this value and drops the one it was sent.
8. Example of the
Timed-Token Algorithm
In the example below, we assume that the token holding time is 610 units, where a unit is the amount of time needed to transmit 610 bytes, and the target token rotation time is 1600 bytes. Assume that there are four stations active and the token circulates from right to left in the picture. Inside the box denoting each station is listed the station number and the number and size of packets that it has ready to transmit on each round. Station number 9 will transmit three 128-byte synchronous packets each time it acquires the token. Station 1 will initially transmit two synchronous packets each rotation, but will be ready to transmit only 1 packet in later rotations. Stations 5 and 7 have asynchronous packets to transmit, and will transmit as many of their packets during each rotation as they can. Each station requires 19 units to pass the token. We assume that no station was active before the first rotation period. In the columns below, we list the TRT (token rotation time) for each station-- the time that has elapsed since the that station last acquired the token (including any previous activity for that station on the previous round) -- and the number of packets that station transmits during the time it holds the token.

TS 9 TS
7 TS 5 TS 1
Token Rot. Round TRT #Xmit TRT #Xmit TRT #Xmit TRT #Xmit
1 76 3 460 3 1660 0 1660 2
2 2270 3 2270 0 1070 2 1782 2
3 1782 3 1782 0 1782 0 1070 2
4 1070 3 1070 2 1870 0 1870 2
5 1870 3 1870 0 1070 2 1782 2
6 1782 3 1782 0 1782 0 1070 2
7 1070 3 1070 2 1870 0 1870 2
8 1870 3 1870 0 1070 2 1782 1
9 1477 3 1477 1 1165 2 1572 1
10 2077 3 2077 0 1677 0 765 1
11 765 3 765 3 1965 0 1965 1
Notice, that no matter what the TRT, each station may transmit up to 610 bytes of synchronous traffic. When the
synchronous traffic drops after the seventh rotation, more bandwidth becomes available for asynchronous traffic.
Notice also, that permission to transmit the limited asynchronous traffic circulates in a round-robin fashion between the
two stations with asynch. packets to send.