Paranor logo

Token Ring (IEEE 802.5)

Computer Networks

Chris Wells, October 9, 2022

Token Ring was developed by IBM in the 1970s and is described in the IEEE 802.5 specification. It is no longer widely used in LANs. Token passing is the method of medium access, with only one token allowed to exist on the network at any one time. Network devices must acquire the token to transmit data, and may only transmit a single frame before releasing the token to the next station on the ring. When a station has data to transmit, it acquires the token at the earliest opportunity, marks it as busy, and attaches the data and control information to the token to create a data frame, which is then transmitted to the next station on the ring. The frame will be relayed around the ring until it reaches the destination station, which reads the data, marks the frame as having been read, and sends it on around the ring. When the sender receives the acknowledged data frame, it generates a new token, marks it as being available for use, and sends it to the next station. In this way, each of the other stations on the ring will get an opportunity to transmit data (even if they don't have any data to transmit!).

Token Ring networks provide a priority system that allows administrators to designate specific stations as having a higher priority than others, allowing those stations to use the network more frequently by setting the priority level of the token so that only stations with the same priority or higher can use the token (or reserve the token for future use). Stations that raise a token's priority must reinstate the priority level previously in force once they have used the token. In a Token Ring network, one station is arbitrarily selected to be the active monitor. The active monitor acts as a source of timing information for other stations, and performs various maintenance functions, such as generating a new token as and when required, or preventing rogue data frames from endlessly circulating around the ring. All of the stations on the ring have a role to play in managing the network, however. Any station that detects a serious problem will generate a beacon frame that alerts other stations to the fault condition, prompting them to carry out diagnostic activities and attempt to re-configure the network.

Frame format

Two basic frame types are used - tokens, and data/command frames. The token is three bytes long and consists of a start delimiter, an access control byte, and an end delimiter. The format of the token is shown below.

The Token Ring token
The Token Ring token

A data/command frame has the same fields as the token, plus several additional fields. The format of the data/command frame is shown below.

The Token Ring frame format
The Token Ring frame format
  • Start delimiter - alerts each station of the arrival of a token or frame.
  • Access control byte - contains the priority field, the reservation field, the token bit and a monitor bit.
  • Frame control byte - indicates whether the frame contains data or control information. In a control frame, this byte specifies the type of control information carried.
  • Destination and source addresses - two six-byte fields that identify the destination and source station MAC addresses.
  • Data - the maximum length is limited by the ring token holding time, which defines the maximum time a station can hold the token
  • Frame check sequence (FCS) - filled by the source station with a calculated value dependent on the frame contents. The destination station recalculates the value to determine whether the frame was damaged in transit. If so, the frame is discarded.
  • End delimiter - signals the end of the token or frame, and contains bits that may be used to indicate a damaged frame, and to identify the last frame in a logical sequence.
  • Frame status - a one-byte field that terminates a frame, and includes the one-bit address-recognized and frame-copied fields. These one-bit fields, if set, provide confirmation that the frame has been delivered to the source address and the data read. Both fields are duplicated within the frame status byte.

If the network is quiet and none of the stations has any data to transmit, the token simply circulates around the ring continuously. When a station has data to transmit, it waits until it receives the token, marks it as "busy" by setting the token bit, adds the data and/or control information to create a data or command frame, and transmits the frame to the next station. Each station that receives the frame will re-transmit the frame to the next staion until it reaches the destination station. This station reads the data, sets the address recognised and frame copied bits in the frame status field, and transmits the frame to the next node.

When the frame arrives back at its point of origin, the originating station generates a new token, which it transmits to the next station, even if it has further data to send. In this way, each station network has an equal number of opportunities to transmit data. Because only one token is allowed to exist on the network, only one station can transmit at any one time, and collisions cannot occur. Although the IEEE 802.5 specification reflects IBM's Token Ring technology, the specifications differ slightly. IBM specifies a star topology, with all end stations star-wired to a multi-station access unit (MSAU), wheras IEEE 802.5 does not specify a topology (although virtually all IEEE 802.5 implementations were based on a star). In addition, IEEE 802.5 does not specify a media type, while IBM originally specified shielded twisted pair cable. The table below summarises the IBM and IEEE 802.5 specifications.


IBM Token Ring v. IEEE 802.5
 IBM Token RingIEEE 802.5
Data rate4 or 16 Mbps4 or 16 Mbps
Stations per segmentSTP - 260
UTP - 72
250
TopologyStarNot specified
MediaTwisted pairNot specified
SignallingBasebandBaseband
Access methodToken passingToken passing
EncodingDifferential ManchesterDifferential Manchester


Priority Syste

Token Ring networks provide a user-configurable priority system that allows stations that are designated as having a high-priority to use the network more frequently. Token Ring frames have two fields that control priority - the priority field, and the reservation field. Only stations with a priority equal to, or higher than, the value contained in a token's priority field can aquire the token. Once the token is in use, only stations with a priority value higher than that of the transmitting station can reserve the token for the next pass around the network. When the next token is generated, it is set to the priority of the reserving station. Any station that raises the token's priority level must restore it to the previous level after use.

Fault Management

One station (it can be any station on the network) is selected to be the active monitor. The active monitor acts as a central source of timing information for the other stations on the network, and performs various maintenance functions, including making sure that there is always a token available on the network. The active monitor also sets the monitor bit on any data or command frame it encounters on the ring so that, in the event that a sending device fails after transmitting a frame, the frame can be prevented from circling the ring endlessly and thereby denying access to the network for other stations. If the active monitor receives a frame with the monitor bit already set, it removes the frame from the ring and generates a new token.

The use of a multi station access unit (or wiring center) in a star topology contributes to network reliability, since these devices can be configured to check for problems and remove faulty stations from the ring if necessary. A Token Ring algorithm called beaconingcan be used to detect certain types of network fault. When a station detects a serious problem on the network (a cable break, for example), it transmits a beacon frame which initiates an auto-reconfiguration process. Stations that receive a beacon frame perform diagnostic procedures and attempt to reconfigure the network around the failed areas. Much of this reconfiguration process can be handled internally by the MSAU. The MSAU contains relays that switch a computer into the ring when it is turned on, or out of the ring when the computer is powered off. A MSAU has a number of ports to which network devices can be connected, a ring-out port allowing the unit to be connected to another MSAU, and a ring-in port that can accept an incoming connection from another MSAU. A number of MSAUs can thus be connected together in daisy-chain fashion to create a larger network. The ring-out port of the last MSAU in the chain must be connected back to the ring-in port of the first MSAU.

Connections in a multi-station access unit
Connections in a multi-station access unit

This article was first published on the TechnologyUK.net website in January 2009.

Token Bus (IEEE 802.4)

Computer Networks

Chris Wells, October 9, 2022

Token Bus is described in the IEEE 802.4 specification, and is a Local Area Network (LAN) in which the stations on the bus or tree form a logical ring. Each station is assigned a place in an ordered sequence, with the last station in the sequence being followed by the first, as shown below. Each station knows the address of the station to its "left" and "right" in the sequence.

A Token Bus network
A Token Bus network

This type of network, like a Token Ring network, employs a small data frame only a few bytes in size, known as a token, to grant individual stations exclusive access to the network transmission medium. Token-passing networks are deterministic in the way that they control access to the network, with each node playing an active role in the process. When a station acqires control of the token, it is allowed to transmit one or more data frames, depending on the time limit imposed by the network. When the station has finished using the token to transmit data, or the time limit has expired, it relinquishes control of the token, which is then available to the next station in the logical sequence. When the ring is initialised, the station with the highest number in the sequence has control of the token.

The physical.topology of the network is either a bus or a tree, although the order in which stations are connected to the network is not important. The network topology means that the we are essentially dealing with a broadcast network, and every frame transmitted is received by all attached stations. With the exception of broacast frames, however, frames will only be read by the station to which they are addressed, and ignored by all other stations. As the token frame is transmitted, it icarries the destination address of the next station in the logical sequence. As each individual station is powered on, it is allocated a place in the ring sequence (note that in the diagram above, station two is not participating in the ring). The Token Bus medium access control protocol allows stations to join the ring or leave the ring on an ad-hoc basis.

Token Bus networks were conceived to meet the needs of automated industrial manufacturing systems and owe much to a proposal by General Motors for a networking system to be used in their own manufacturing plants - Manufacturing Automation Protocol (MAP). Ethernet was not considered suitable for factory automation systems because of the contention-based nature of its medium access control protocol, which meant that the length of time a station might have to wait to send a frame was unpredictable. Ethernet also lacked a priority system, so there was no way to ensure that more important data would not be held up by less urgent traffic.

A token-passing system in which each station takes turns to transmit a frame was considered a better option, because if there are n stations, and each station takes T seconds to send a frame, no station has to wait longer than nT seconds to acquire the token. The ring topology of existing token-passing systems, however, was not such an attractive idea, since a break in the ring would cause a general network failure. A ring topology was also considered to be incompatible with the linear topology of assembly-line or process control systems. Token Bus was a hybrid system that provided the robustness and linearity of a bus or tree topology, whilst retaining the known worst-case performance of a token-passing medium access control method.

The transmission medium most often used for broadband Token Bus networks is 75 Ohm coaxial cable (the same type of cable used for cable TV), although alternative cabling configurations are available. Both single and dual cable systems may be used, with or without head-ends. Transmission speeds vary, with data rates of 1, 5 and 10 Mbps being common. The analogue modulation schemes that can be used include:

  • Phase continuous frequency shift keying
  • Phase coherent frequency shift keying
  • Multilevel duobinary amplitude modulated phase shift keying

The Token Bus MAC layer protocol

When the ring is initialised, tokens are inserted into it in station address order, starting with the highest. The token itself is passed from higher to lower addresses. Once a station aquires the token, it has a fixed time period during which it may transmit frames, and the number of frames which can be transmitted by each station during this time period will depend on the length of each frame. If a station has no data to send, it simply passes the token to the next station without delay.

The Token Bus standard defines four classes of priority for traffic - 0, 2, 4, and 6 - with 6 representing the highest priority and 0 the lowest. Each station maintains four internal queues that correspond to the four priority levels. As a frame is passed down to the MAC sublayer from a higher-layer protocol, its priority level is determined, and it is assigned to the appropriate queue. When a station acquires the token, frames are transmitted from each of the four queues in strict order of priority. Each queue is allocated a specific time slot, during which frames from that queue may be transmitted. If there are no frames waiting in a particular queue, the token immediately becomes available to the next queue. If the token reaches level 0 and there are no frames waiting, it is immediately passed to the next station in the logical ring. The whole process is controlled by timers that are used to allocate time slots to each priority level. If any queue is empty, its time slot may be allocated for use by the remaining queues.

The priority scheme guarantees level 6 data a known fraction of the network bandwith, and can therefore be used to implement a real-time control system. As an example, if a network running at 10 Mbps and having fifty stations has been configured so that level 6 traffic is allocated one-third of the bandwidth, each station has a guaranteed bandwidth of 67 kbps for level 6 traffic. The available high priority bandwidth could thus be used to synchronise robots on an assembly line, or to carry one digital voice channel per station, with some bandwidth left over for control information.

The Token Bus frame format
The Token Bus frame format

The Token Bus frame format is shown above. The Preamble field is used to synchronise the receiver's clock. The Start Delimeter and End Delimeter fields are used to mark the start and end of the frame, and contain an analogue encoding of symbols other than 0s and 1s that cannot occur accidentally within the frame data. For this reason, a length field is not required.

The Frame Control field identifies the frame as either a data frame or a control frame. For data frames, it includes the priority level of the frame, and may also include an indicator requiring the destination station to acknowledge correct or incorrect receipt of the frame. For control frames, the field specifies the frame type.

The Destination and Source address fields contain either a 2-byte or a 6-byte hardware address for the destination and source stations respectively (a given network must use either 2-byte or 6-byte addresses consistently, not a mixture of the two). If 2-byte addresses are used, the Data Field can be up t0 8,182 bytes. If 6-byte addresses are used, it is limited to 8,174 bytes. The Checksum is used to detect transmission errors. The various control frames used are shown in the table below.


Token Bus Control Frames
Frame control fieldNameMeaning
00000000Claim_tokenClaim token during ring initialisation
00000001Solicit_successor_1Allow stations to enter the ring
00000010Solicit_successor_2Allow stations to enter the ring
00000011Who_followsRecover from lost token
00000100Resolve_contentionUsed when multiple stations want to
enter the ring
00001000TokenPass the token
00001100Set_successorAllow stations to leave the ring


Periodically, a station will transmit a SOLIT_SUCCESSOR frame to solicit bids from stations wishing to join the ring. The frame includes the sender's address, and that of its current successor in the ring. Only stations with an address falling between these two addresses may bid to enter the ring (in order to maintain the logical order of station addresses on the ring). If no station bids to enter within a slot time, the response window is closed, and the token holder returns to its normal business. If only one station bids to enter, it is inserted into the ring and becomes the token holder's successor. If two or more stations bid to enter, their frames will collide and be garbled. The token holder then runs an arbitration process, that begins with the broadcast of a RESOLVE_CONTENTION frame. The algorithm is a variation of binary countdown, using two bits at a time.

All station interfaces maintain two random bits which are used to delay all bids by 0, 1, 2 or 3 slot times to further reduce contention. Two stations will only collide on a bid, therefore, if the current two address bits being used are the same and they happen to have the same two random bits. To prevent stations that must wait 3 slot times from being at a permanent disadvantage, the random bits are regenerated either every time they are used, or every 50 msec.

The solicitation of new stations is not allowed to interfere with the guaranteed worst case for token rotation. Each station has a timer that is reset whenever it aquires the token. When the token arrives, the existing value of this timer (i.e. the previous token rotation time) is inspected before the timer is reset. If a pre-determined threshold value has been exceeded, recent levels of traffichave been considered to be too high, and no bids may be solicited this time round. In any case, only one station can enter the ring during each solicitation, to limit the amount of time that can be used for ring maintenance. There is no guaranteed time limit set on how long a station has to wait to enter the ring when traffic is heavy, but in practice it is not normally longer than a few seconds.

To leave the ring, a station X with a predecessor P and a successor S simply sends a SET_SUCCESSOR frame to P telling it that from now on its successor is S. Station X then just stops transmitting.

Ring initialisation is a special case of adding new stations. When the first station comes on line, it registers the fact that there is no traffic for a specified period. It then broadcasts a CLAIM_TOKEN frame. Not receiving a reply, it creates a token and sets up a ring consisting of just itself, and periodically solicits bids for new stations. As new stations are powered on, they will respond and join the ring, if necessary using the contention algorithm described above. If the first two stations are powered on simultaneously, they are allowed to bid for the token using the standard modified binary countdown algorithm and the two random bits.

Problems sometimes arise with the token or the logical ring due to transmission errors (for example a station tries to pass a token to a station which has been taken offline). After passing the token, therefore, a station monitors the network to determine wther its successor has either transmitted a frame or passed the token. If neither of these events occurs, it generates a second token. If that also fails to produce the required outcome, the station transmits a WHO_FOLLOWS frame specifying the address of its successor. When the failed station's successor sees a WHO_FOLLOWS frame naming its predecessor, it responds with a SET_SUCCESSOR frame, naming itself as the new successor. The failed station is then removed from the ring.

If two consecutive stations go offline, the WHO_FOLLOWS frame will fail to ellicit a response. In this situation, the station that originally passed the token sends a SOLICIT_SUCCESSOR_2 frame to see if any other stations are still active. The standard connection protocol is run once again, with all active stations bidding for a place until the ring is re-established. A problem can also occur if the token holder goes down and takes the frame with it. In this case, the ring initialisation algorithm is used to re-establish the ring.

Multiple tokens on the ring are another problem, and if a station currently holding a token notices a transmission from another station, it discards its token. If multiple tokens are present on the network at the same time, this process is repeated until all but one of the tokens are discarded. If all of the tokens are discarded by accident, the lack of activity will cause one or more of the stations to try and claim the token.

This article was first published on the TechnologyUK.net website in January 2009.

ARCNet

Computer Networks

Chris Wells, October 9, 2022

ARCnet is a LAN protocol similar to Ethernet or Token Ring. It was the first widely available networking system for microcomputers, and became popular in the 1980s for office automation tasks. It has since gained a following in the embedded systems market. ARCnet was originally developed by Datapoint Corporation in 1977 to enable groups of Datapoint 2200 terminals to talk to a shared 8" floppy disk system, and was eventually standardised as ANSI ARCnet 878.1.

ARCnet uses a bus topology together with a token-passing scheme which mediates access to the bus. For embedded applications, a bus topology is much more convenient, since hubs are not required. Nodes on the network are organised into a logical ring. When nodes are inactive, the token is passed around the network from node to node. A node is not allowed to use the bus unless it has the token. If a node wishes to send data, it waits for the token to appear, adds the data and control information to the token, and modifies it so that other nodes will not attempt to use it. When the destination node has received the data, it generates a new token and passes it to the next node.

This system guarantees access to the bus for all nodes on the network. Each node will receive the token within a predictable time frame. This is important for control or robotic applications where timely responses or coordinated motion are required. An ARCnet controller handles the communication protocol, including token passing, network configuration, error handling and flow control. A new node joins the ring automatically without software intervention. The standard data rate for ARCnet networks is 2.5 Mbps, but speeds can range from 19 kbps to 10 Mbps. The maximum packet size is 508 Bytes.

ARCnet is an ideal real-time networking system, which explains its use in the embedded systems and process control markets. ARCnet was originally deployed using coaxial cable but now supports twisted-pair and fibre. ARCnet is frequently found in applications such as industrial control, building automation, transportation, robotics and gaming. Like Ethernet, ARCnet is a data-link layer technology.

This article was first published on the TechnologyUK.net website in January 2009.

AppleTalk

Computer Networks

Chris Wells, October 8, 2022

AppleTalk is a protocol suite developed by Apple Computer in the early 1980s to allow multiple users to share resources such as files and printers, and is one of the early implementations of a distributed client/server networking system. Phase 1 was designed for use with workgroups only, but Phase 2 was designed to support both client-server LANs and internetworking. Up to 253 hosts or servers can be accommodated on a single AppleTalk network segment. AppleTalk networks are arranged hierarchically and consist of four basic components: sockets, nodes, networks, and zones. The following diagram illustrates the hierarchical organisation of these components.

A typical AppleTalk network
A typical AppleTalk network

A node is any device (e.g. a client computer, printer, router, or some other device) connected to an AppleTalk network. Each node belongs to a single network and a specific zone. Software processes running on a node are identified by sockets, and are known as socket clients. An AppleTalk node can contain up to 254 socket numbers.

AppleTalk networks can be extended or non-extended. A non-extended network is a physical network segment that is assigned a single network number between 1 and 1024. Each node number in the network must be unique An extended network is a physical network segment that can be assigned multiple network numbers. Extended networks can have multiple zones configured on a single network segment. A zone is a logical group of nodes or networks defined by the network administrator. Nodes or networks need not be physically contiguous to belong to the same zone. The following diagram illustrates an AppleTalk internetwork composed of three non-contiguous zones.

Zones in an AppleTalk network
Zones in an AppleTalk network

AppleTalk uses addresses to identify devices on a network. Each address is composed of a 16-bit network number that identifies a specific network, and an 8-bit node number that identifies a node attached to the specified network. A socket number identifies a specific process running on a network node. Addresses are usually written as decimal values separated by a period. For example, 10.1.50 means network 10, node 1, socket 50.

This article was first published on the TechnologyUK.net website in January 2009.