[Link]
net/
Ethernet (IEEE 802.3)
Ethernet is the networking technology used by most modern LANs, and was
developed in the early 1970s at Xerox PARC by Doctor Robert Metcalfe.
Metcalfe persuaded Xerox to allow Ethernet to become an open technology,
which led to it becoming the most widely adopted networking technology. The
transmission medium originally used for the network backbone was 10Base5
coaxial cable, with the network arranged in a bus topology. 10Base5 was later
replaced by the cheaper 10Base2 coaxial cable as the backbone medium.
Modern Ethernet networks typically use a star topology. Ethernet uses carrier
sense multiple access with collision detection (CSMA/CD) as the method of
medium access, and has been standardised by the IEEE as IEEE 802.3.
Standard Ethernet has a data rate of 10 Mbps and allows frame sizes of
between 64 and 1518 bytes. The frame format can be seen below.
IEE 802.3 CSMA/CD frame format
The table below describes the Ethernet frame fields.
Ethernet Frame Fields
Field Description
Preambl Alternating 1s and 0s (used for synchronisation)
e
SD Start Delimiter - signals start of valid frame
DA Destination Address (48 bits)
SA Source Address (48 bits)
Lng Length - indicates number of bytes in data
Data Minimum 46 bytes to maximum 1,500 bytes
Pad Bytes added to achieve minimum frame length
- needed for reliable collision detection
FCS Frame Check Sequence - algorithm for error
detection
How Ethernet works
The term multiple access refers to the fact that stations on the network share a
common transmission medium. Carrier sense refers to the manner in which
stations monitor the transmission medium, and attempt to transmit only when
they sense that the medium is free. Collision detection is achieved by monitoring
an outgoing transmission in order to detect any other signals on the line which
may interfere (or collide ) with the signal being transmitted. If a collision is
detected, all of the stations involved will back off for a random period of time
(the deferral time ) before attempting to retransmit. CSMA/CD is described as a
contentious method of medium access, because stations are essentially
competing with each other for use of the transmission medium. This works well
for networks carrying only light traffic, but a significant increase in traffic will
result in a higher number of collisions. This will create additional network
overhead in terms of dealing with the collisions, and even more network traffic
due to the need for re-transmission of lost frames. The net result will be a
degredation of the overall performance of the network.
If the network is quiet, a station will transmit the preamble (alternate 1s and 0s)
so that active stations can synchronise on this signal. The last two bits of the
start delimiter are both binary 1, signalling that the frame proper is about to start.
The next thing to be transmitted is the destination address (DA), which all
stations compare with their own destination address. The station with the
matching address reads the frame data, while all other stations simply ignore
the frame. After transmitting the start delimiter, the sending station begins
monitoring its outgoing transmission to enable it to detect a collision condition. If
no collision has occurred during transmission of the first 64 bytes, the station
has "acquired" the channel (i.e. no collisions will occur thereafter). After
successful transmission, all stations wait for a specified time before attempting
to transmit, to allow the system to settle before another frame is transmitted.
Ethernet networks normally operate at 10 Mbps ( Standard Ethernet ), 100
Mbps ( Fast Ethernet ) or 1,000 Mbps ( Gigabit Ethernet ). Gigabit Ethernet is
currently used primarily as a high-speed backbone for existing LANs, while
unshielded twisted pair cable (Cat5E or Cat6) is used to connect end-user
equipment (i.e. workstations, printers etc.) to network switches in a star
configuration.
Standard Ethernet rules
The following rules apply to Standard Ethernet (10 Mbps):
Standard Ethernet Rules
Minimum frame size (excluding 64
preamble): bytes
Maximum transceiver-transceiver 2,500 M
distance:
Maximum number of segments: 5
Maximum number of repeaters: 4
Maximum number of populated 3
segments:
The rules are designed both to optimise the performance of the Ethernet
network and to ensure that collisions that do occur on the network do not go
undetected. Consider a worst-case scenario in which five segments are used,
each 500 metres in length, connected together using four repeaters, as shown
below.
Ethernet segments connected by repeaters
In order to detect a collision, the transmitting station must monitor its own
transmitted signal. It can only, therefore, detect a collision if the collision signal
reaches it before it stops transmitting. Consider the worst-case scenario in
which station A transmits a 64-byte frame which propagates along the network
almost (but not quite) as far as station B. If B has some data to transmit, it will
do so, not yet having detected A's transmission. The two signals will collide
almost immediately at B's end of the network, but the collision signal must travel
all the way back to A in order for A to detect it. How long does this take? Given
that signals propagate at (circa) 2x10 8 metres per second, and that there is a
delay in each repeater of approximately 1.5 µs in both directions, the round trip
delay will be:
(2 x 4 x 1.5 ms) + (2 x ((25 x 10 2 )/(2 x 10 8 ))) = 37 µs
The time taken to transmit the frame will be:
(64 x 8)/(10 x 10 6 ) = 51.2 µs
So, even in a worst-case scenario, a collision will be detected
Token Bus (IEEE 802.4)
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
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 [Link] 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 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
Name Meaning
field
00000000 Claim_token Claim token during ring
initialisation
00000001 Solicit_successor Allow stations to enter the ring
_1
00000010 Solicit_successor Allow stations to enter the ring
_2
00000011 Who_follows Recover from lost token
00000100 Resolve_contenti Used when multiple stations
on want to
enter the ring
00001000 Token Pass the token
00001100 Set_successor Allow 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.
Token Ring (IEEE 802.5)
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
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
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 Ring IEEE 802.5
Data rate 4 or 16 Mbps 4 or 16 Mbps
STP - 260 250
Stations per segment
UTP - 72
Topology Star Not specified
Media Twisted pair Not specified
Signalling Baseband Baseband
Access method Token passing Token passing
Encoding Differential Manchester Differential Manchester
Priority System
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