You are on page 1of 27

Computer Networks Page: 1

Unit – II
 Error Detection
 Error Correction
 Line Discipline
 Flow Control
 Error Control
 IEEE 802 Standards – 802.3 Ethernet
 Token Ring & Token Bus (IEEE 802.4, 802.5)
 Switching
Error Detection
When data is transmitted from one device to another device, the system does not guarantee whether the data
received by the device is identical to the data transmitted by another device. An Error is a situation when the
message received at the receiver end is not identical to the message transmitted. There are many reasons
such as noise, cross-talk etc., which may help data to get corrupted during transmission. Data-link layer uses
some error control mechanism to ensure that frames (data bit streams) are transmitted with certain level of
accuracy. But to understand how errors is controlled, it is essential to know what types of errors may occur.
Types Of Errors
Errors can be classified into two categories:
 Single-Bit Error
 Burst Error
Single-Bit Error:
The only one bit of a given data unit is changed from 1 to 0 or from 0 to 1.

In the above figure, the message which is sent is corrupted as single-bit, i.e., 0 bit is changed to 1.
Single-Bit Error does not appear more likely in Serial Data Transmission. For example, Sender sends the
data at 10 Mbps, this means that the bit lasts only for 1 ?s and for a single-bit error to occurred, a noise must
be more than 1 ?s.
Single-Bit Error mainly occurs in Parallel Data Transmission. For example, if eight wires are used to send the
eight bits of a byte, if one of the wire is noisy, then single-bit is corrupted per byte.
Burst Error:
The two or more bits are changed from 0 to 1 or from 1 to 0 is known as Burst Error.The Burst Error is
determined from the first corrupted bit to the last corrupted bit.

The duration of noise in Burst Error is more than the duration of noise in Single-Bit. Burst Errors are most likely
to occur in Serial Data Transmission.The number of affected bits depends on the duration of the noise and
data rate.

Error Detection Techniques :

Vertical Redundancy Check(VRC) :


 Most common and inexpensive mechanism error detection which also called parity check.
Computer Networks Page: 2

 A redundant bit (parity bit) is appended to every data unit so that the total number of 1s in the unit
becomes even, if there is even-parity check used.

 There are even-parity check and odd-parity check. For odd-parity check, the total number of 1s in the
unit is odd.

Suppose we want to transmit the binary data unit 1100001, adding the number of 1s gives us 3, an odd
number. Before transmitting, a parity generator counts the 1s and appends the parity bit (a 1 in this case) to
the end. The total number of 1 becomes 4 now (even number). The system now transmits the entire appended
unit across the network link.

 When the data unit is reached its destination, the receiver puts all eight bits through an even-parity
checking function. If the receiver sees 11100001, it counts and gets four 1s, an even number.

 But if the receiver sees 11100101, or total number of 1s is odd. The receiver knows that an error has
been occurred into the data somewhere and therefore rejects the whole unit.

 For the odd-parity checking, the principle is same but the calculation is different.

 The advantages of VRC are it can detect all single-bit errors. It also can detect burst errors as long as
the total number of bits changed is odd (1,3,5, etc). The same holds true for any odd number of errors.

 The limitation is it cannot detect errors where the total number of bits changed is even, where the two
bits of the data unit are changed. In this case, the total number of 1s is still even. The VRC checker will
add them and return an even number although the data unit contains two errors. Then the unit will pass
a parity check even through the data unit is damaged. The same holds true for any even number of
errors.

Longitudinal Redundancy Check (LRC)

In this error detection method, a block of bits is organized in a table with rows and columns. Then the parity bit
for each column is calculated and a new row of eight bits, which are the parity bits for the whole block, is
created. After that the new calculated parity bits are attached to the original data and sends to the receiver.
Computer Networks Page: 3

LRC increases the likelihood of detecting burst error. An LRC of n bits can easily detects a burst error
of n bits.

However, if two bits in one data unit are damaged and two bits in exactly the same positions in another data
unit are also damaged, the LRC checker will not detect an error.

Notice that although the 5th bit and the 7th bit for 1st and 2 nd data unit have been changed but the LRC
calculated by receiver is still the same as the LRC received. Thus the receiver checker cannot detect this burst
error.

Cyclic Redundancy Check (CRC)


Cyclic Redundancy Check (CRC) An error detection mechanism in which a special number is appended to a
block of data in order to detect any changes introduced during storage (or transmission). The CRC is
recalculated on retrieval (or reception) and compared to the value originally transmitted, which can reveal
certain types of error. For example, a single corrupted bit in the data results in a one-bit change in the
calculated CRC, but multiple corrupt bits may cancel each other out.
A CRC is derived using a more complex algorithm than the simple CHECKSUM, involving MODULO
ARITHMETIC (hence the 'cyclic' name) and treating each input word as a set of coefficients for a polynomial.
CRC is more powerful than VRC and LRC in detecting errors.
• It is not based on binary addition like VRC and LRC. Rather it is based on binary division.
• At the sender side, the data unit to be transmitted IS divided by a predetermined divisor (binary number) in
order to obtain the remainder. This remainder is called CRC.
• The CRC has one bit less than the divisor. It means that if CRC is of n bits, divisor is of n+ 1 bit.
• The sender appends this CRC to the end of data unit such that the resulting data unit becomes exactly
divisible by predetermined divisor i.e. remainder becomes zero.
• At the destination, the incoming data unit i.e. data + CRC is divided by the same number (predetermined
binary divisor).
If the remainder after division is zero then there is no error in the data unit & receiver accepts it.
• If remainder after division is not zero, it indicates that the data unit has been damaged in transit and therefore
it is rejected.
• This technique is more powerful than the parity check and checksum error detection.
• CRC is based on binary division. A sequence of redundant bits called CRC or CRC remainder is appended at
the end of a data unit such as byte.
The various steps followed in the CRC method are
1. A string of n as is appended to the data unit. The length of predetermined divisor is n+ 1.
2. The newly formed data unit i.e. original data + string of n as are divided by the divisor using binary division
and remainder is obtained. This remainder is called CRC.
Computer Networks Page: 4

Now, string of n Os appended to data unit is replaced by the CRC remainder (which is also of n bit).
4. The data unit + CRC is then transmitted to receiver.
5. The receiver on receiving it divides data unit + CRC by the same divisor & checks the remainder.
6. If the remainder of division is zero, receiver assumes that there is no error in data and it accepts it.
7. If remainder is non-zero then there is an error in data and receiver rejects it.
For example, if data to be transmitted is 1001 and predetermined divisor is 1011. The procedure given below is
used:
1. String of 3 zeroes is appended to 1011 as divisor is of 4 bits. Now newly formed data is 1011000.

1. Data unit 1011000 is divided by 1011.

2. During this process of division, whenever the leftmost bit of dividend or remainder is 0, we use a string of Os
of same length as divisor. Thus in this case divisor 1011 is replaced by 0000.
3. At the receiver side, data received is 1001110.
Computer Networks Page: 5

4. This data is again divided by a divisor 1011.


5. The remainder obtained is 000; it means there is no error.

CRC can detect all the burst errors that affect an odd number of bits.
• The probability of error detection and the types of detectable errors depends on the choice of divisor.
Two major requirement of CRC are:
(a) CRC should have exactly one bit less than divisor.
(b) Appending the CRC to the end of the data unit should result in the bit sequence which is exactly divisible by
the divisor.

CheckSum :

Checksum is an error detection method. Assume that the message is a sequence of bytes. Before
transmission, a Checksum byte or fixed number of bytes is computed and appended to the message. The
receiver performs the same calculation on the received message minus the Checksum byte or bytes. This
result is checked against the received Checksum and if they agree then it is assumed that the message is error
free.

Error detection using checksum method involves the following steps-


Step-01:
At sender side,
 If m bit checksum is used, the data unit to be transmitted is divided into segments of m bits.
 All the m bit segments are added.
 The result of the sum is then complemented using 1’s complement arithmetic.
 The value so obtained is called as checksum.
Step-02:
 The data along with the checksum value is transmitted to the receiver.
Step-03:

At receiver side,
 If m bit checksum is being used, the received data unit is divided into segments of m bits.
 All the m bit segments are added along with the checksum value.
Computer Networks Page: 6

 The value so obtained is complemented and the result is checked.


Then, following two cases are possible-
Case-01: Result = 0
If the result is zero,
 Receiver assumes that no error occurred in the data during the transmission.
 Receiver accepts the data.
Case-02: Result ≠ 0

If the result is non-zero,


 Receiver assumes that error occurred in the data during the transmission.
 Receiver discards the data and asks the sender for retransmission.
Checksum Example-
Consider the data unit to be transmitted is-

10011001111000100010010010000100
Consider 8 bit checksum is used.
Step-01:
At sender side,
The given data unit is divided into segments of 8 bits as-

Now, all the segments are added and the result is obtained as-
 10011001 + 11100010 + 00100100 + 10000100 = 1000100011
 Since the result consists of 10 bits, so extra 2 bits are wrapped around.
 00100011 + 10 = 00100101 (8 bits)
 Now, 1’s complement is taken which is 11011010.
 Thus, checksum value = 11011010
Step-02:
 The data along with the checksum value is transmitted to the receiver.
Step-03:
At receiver side,
 The received data unit is divided into segments of 8 bits.
 All the segments along with the checksum value are added.
 Sum of all segments + Checksum value = 00100101 + 11011010 = 11111111
 Complemented value = 00000000
 Since the result is 0, receiver assumes no error occurred in the data and therefore accepts it.
Computer Networks Page: 7

Error Correction
Error Correction codes are used to detect and correct the errors when data is transmitted from the sender to
the receiver.
Error Correction can be handled in two ways:
o Backward error correction: Once the error is discovered, the receiver requests the sender to
retransmit the entire data unit.
o Forward error correction: In this case, the receiver uses the error-correcting code which automatically
corrects the errors.

A single additional bit can detect the error, but cannot correct it.

For correcting the errors, one has to know the exact position of the error. For example, If we want to calculate
a single-bit error, the error correction code will determine which one of seven bits is in error. To achieve this,
we have to add some additional redundant bits.

Suppose r is the number of redundant bits and d is the total number of the data bits. The number of redundant
bits r can be calculated by using the formula:

2r>=d+r+1

The value of r is calculated by using the above formula. For example, if the value of d is 4, then the possible
smallest value that satisfies the above relation would be 3.

To determine the position of the bit which is in error, a technique developed by R.W Hamming is Hamming
code which can be applied to any length of the data unit and uses the relationship between data units and
redundant units.

Hamming Code :
Hamming code is technique developed by R.W. Hamming for error correction. This method corrects the error
by finding the state at which the error has occurred.

Determining the positions of redundancy bits


Till now, we know the exact number of redundancy bits required to be embedded with the particular data unit.
We know that to detect errors in a 7 bit code, 4 redundant bits are required.
Now, the next task is to determine the positions at which these redundancy bits will be placed within the data
unit.
• These redundancy bits are placed at the positions which correspond to the power of2.
• For example in case of 7 bit data, 4 redundancy bits are required, so making total number of bits as 11. The
redundancy bits are placed in position 1, 2, 4 and 8 as shown in fig.

Generating parity information


• In Hamming code, each r bit is the VRC for one combination of data bits. rl is the VRC bit for one combination
of data bits, r2 is the VRC for another combination of data bits and so on.
Computer Networks Page: 8

• Each data bit may be included in more than one VRC calculation.
• rl bit is calculated using all bits positions whose binary representation includes a 1 in the rightmost position.
• r2 bit calculated using all the bit positions with a 1 in the second position and so on.
• Therefore the various r bits are parity bits for different combination of bits.
The various combinations are:

rl : bits 1,3,5, 7, 9, 11
r2 : bits 2, 3, 6, 7, 10, 11
r4 : bits 4, 5, 6, 7
r8 : bits 8, 9, 10, 11

Example of Hamming Code Generation


Suppose a binary data 1001101 is to be transmitted. To implement hamming code for this, following steps are
used:
Computer Networks Page: 9

1. Calculating the number of redundancy bits required. Since number of data bits is 7, the value of r is
calculated as
2r > m + r + 1
24 > 7 + 4 + 1
Therefore no. of redundancy bits = 4

2. Determining the positions of various data bits and redundancy bits. The various r bits are placed at the
position that corresponds to the power of 2 i.e. 1, 2, 4, 8

4. Thus data 1 0 0 1 1 1 0 0 1 0 1 with be transmitted.


Error Detection & Correction
Considering a case of above discussed example, if bit number 7 has been changed from 1 to 0.The data will
be erroneous.
Computer Networks Page: 10

Data sent: 1 0 0 1 1 1 0 0 1 0 1
Data received: 1 00 1 0 1 00 1 0 1 (seventh bit changed)
The receive takes the transmission and recalculates four new VRCs using the same set of bits used by sender
plus the relevant parity (r) bit for each set as shown in fig.
Then it assembles the new parity values into a binary number in order of r position (r8, r4, r2, r1).
In this example, this step gives us the binary number 0111. This corresponds to decimal 7. Therefore bit
number 7 contains an error. To correct this error, bit 7 is reversed from 0 to 1.

Data Link Controls


Data Link Control is the service provided by the Data Link Layer to provide reliable data transfer over the
physical medium. For example, In the half-duplex transmission mode, one device can only transmit the
data at a time. If both the devices at the end of the links transmit the data simultaneously, they will
collide and leads to the loss of the information. The Data link layer provides the coordination among the
devices so that no collision occurs.

The Data link layer provides three functions:


 Line discipline
 Flow Control
 Error Control
Computer Networks Page: 11

Line Discipline
Line Discipline is a functionality of the Data link layer that provides the coordination among the link systems. It
determines which device can send, and when it can send the data.
Line Discipline can be achieved in two ways:
 ENQ/ACK
 Poll/select
ENQ/ACK
An ENQ/ACK stand for Enquiry/Acknowledgement is used when there is no wrong receiver available on the
link and having a dedicated path between the two devices so that the device capable of receiving the
transmission is the intended one.
ENQ/ACK coordinates which device will start the transmission and whether the recipient is ready or not.
Working of ENQ/ACK
The transmitter transmits the frame called an Enquiry (ENQ) asking whether the receiver is available to receive
the data or not.
The receiver responses either with the positive acknowledgement(ACK) or with the negative
acknowledgement(NACK) where positive acknowledgement means that the receiver is ready to receive the
transmission and negative acknowledgement means that the receiver is unable to accept the transmission.
Following are the responses of the receiver:
1) If the response to the ENQ is positive, the sender will transmit its data, and once all of its data has been
transmitted, the device finishes its transmission with an EOT (END-of-Transmission) frame.
2) If the response to the ENQ is negative, then the sender disconnects and restarts the transmission at
another time.
3) If the response is neither negative nor positive, the sender assumes that the ENQ frame was lost during
the transmission and makes three attempts to establish a link before giving up.
Computer Networks Page: 12

Poll/Select
The Poll/Select method of line discipline works with those topologies where one device is designated as a
primary station, and other devices are secondary stations.
Working of Poll/Select
 In this, the primary device and multiple secondary devices consist of a single transmission line, and
all the exchanges are made through the primary device even though the destination is a secondary
device.
 The primary device has control over the communication link, and the secondary device follows the
instructions of the primary device.
 The primary device determines which device is allowed to use the communication channel.
Therefore, we can say that it is an initiator of the session.
 If the primary device wants to receive the data from the secondary device, it asks the secondary
device that they anything to send, this process is known as polling.
 If the primary device wants to send some data to the secondary device, then it tells the target
secondary to get ready to receive the data, this process is known as selecting.
Select
 The select mode is used when the primary device has something to send.
 When the primary device wants to send some data, then it alerts the secondary device for the
upcoming transmission by transmitting a Select (SEL) frame, one field of the frame includes the
address of the intended secondary device.
 When the secondary device receives the SEL frame, it sends an acknowledgement that indicates
the secondary ready status.
 If the secondary device is ready to accept the data, then the primary device sends two or more data
frames to the intended secondary device. Once the data has been transmitted, the secondary
sends an acknowledgement specifies that the data has been received.
Computer Networks Page: 13

Poll

 The Poll mode is used when the primary device wants to receive some data from the secondary device.
 When a primary device wants to receive the data, then it asks each device whether it has anything to send.
 Firstly, the primary asks (poll) the first secondary device, if it responds with the NACK (Negative
Acknowledgement) means that it has nothing to send. Now, it approaches the second secondary device, it
responds with the ACK means that it has the data to send. The secondary device can send more than one
frame one after another or sometimes it may be required to send ACK before sending each one, depending
on the type of the protocol being used.

Flow Control
 It is a set of procedures that tells the sender how much data it can transmit before the data
overwhelms the receiver.
 The receiving device has limited speed and limited memory to store the data. Therefore, the
receiving device must be able to inform the sending device to stop the transmission temporarily
before the limits are reached.
 It requires a buffer, a block of memory for storing the information until they are processed.
Two methods have been developed to control the flow of data:
 Stop-and-wait
 Sliding window
Stop-and-wait
 In the Stop-and-wait method, the sender waits for an acknowledgement after every frame it sends.
 When acknowledgement is received, then only next frame is sent. The process of alternately
sending and waiting of a frame continues until the sender transmits the EOT (End of transmission)
frame.
Advantage of Stop-and-wait
The Stop-and-wait method is simple as each frame is checked and acknowledged before the next frame is
sent.
Computer Networks Page: 14

Disadvantage of Stop-and-wait
Stop-and-wait technique is inefficient to use as each frame must travel across all the way to the receiver, and
an acknowledgement travels all the way before the next frame is sent. Each frame sent and received uses the
entire time needed to traverse the link.
Sliding Window
 The Sliding Window is a method of flow control in which a sender can transmit the several frames
before getting an acknowledgement.
 In Sliding Window Control, multiple frames can be sent one after the another due to which capacity
of the communication channel can be utilized efficiently.
 A single ACK acknowledge multiple frames.
 Sliding Window refers to imaginary boxes at both the sender and receiver end.
 The window can hold the frames at either end, and it provides the upper limit on the number of
frames that can be transmitted before the acknowledgement.
 Frames can be acknowledged even when the window is not completely filled.
 The window has a specific size in which they are numbered as modulo-n means that they are
numbered from 0 to n-1. For example, if n = 8, the frames are numbered from
0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1........
 The size of the window is represented as n-1. Therefore, maximum n-1 frames can be sent before
acknowledgement.
 When the receiver sends the ACK, it includes the number of the next frame that it wants to receive.
For example, to acknowledge the string of frames ending with frame number 4, the receiver will
send the ACK containing the number 5. When the sender sees the ACK with the number 5, it got to
know that the frames from 0 through 4 have been received.
Sender Window
 At the beginning of a transmission, the sender window contains n-1 frames, and when they are sent
out, the left boundary moves inward shrinking the size of the window. For example, if the size of the
window is w if three frames are sent out, then the number of frames left out in the sender window is
w-3.
 Once the ACK has arrived, then the sender window expands to the number which will be equal to
the number of frames acknowledged by ACK.
 For example, the size of the window is 7, and if frames 0 through 4 have been sent out and no
acknowledgement has arrived, then the sender window contains only two frames, i.e., 5 and 6.
Now, if ACK has arrived with a number 4 which means that 0 through 3 frames have arrived
undamaged and the sender window is expanded to include the next four frames. Therefore, the
sender window contains six frames (5,6,7,0,1,2).
Computer Networks Page: 15

Receiver Window

 At the beginning of transmission, the receiver window does not contain n frames, but it contains n-1 spaces
for frames.
 When the new frame arrives, the size of the window shrinks.
 The receiver window does not represent the number of frames received, but it represents the number of
frames that can be received before an ACK is sent. For example, the size of the window is w, if three
frames are received then the number of spaces available in the window is (w-3).
 Once the acknowledgement is sent, the receiver window expands by the number equal to the number of
frames acknowledged.
 Suppose the size of the window is 7 means that the receiver window contains seven spaces for seven
frames. If the one frame is received, then the receiver window shrinks and moving the boundary from 0 to 1.
In this way, window shrinks one by one, so window now contains the six spaces. If frames from 0 through 4
have sent, then the window contains two spaces before an acknowledgement is sent.

Error Control
Error Control is a technique of error detection and retransmission.
Categories of Error Control:

Stop-and-wait ARQ

Stop-and-wait ARQ is a technique used to retransmit the data in case of damaged or lost frames.
This technique works on the principle that the sender will not transmit the next frame until it receives the
acknowledgement of the last transmitted frame.
Computer Networks Page: 16

Four features are required for the retransmission:


 The sending device keeps a copy of the last transmitted frame until the acknowledgement is received.
Keeping the copy allows the sender to retransmit the data if the frame is not received correctly.
 Both the data frames and the ACK frames are numbered alternately 0 and 1 so that they can be identified
individually. Suppose data 1 frame acknowledges the data 0 frame means that the data 0 frame has been
arrived correctly and expects to receive data 1 frame.
 If an error occurs in the last transmitted frame, then the receiver sends the NAK frame which is not
numbered. On receiving the NAK frame, sender retransmits the data.
 It works with the timer. If the acknowledgement is not received within the allotted time, then the sender
assumes that the frame is lost during the transmission, so it will retransmit the frame.
Two possibilities of the retransmission:
o Damaged Frame: When the receiver receives a damaged frame, i.e., the frame contains an error, then it
returns the NAK frame. For example, when the data 0 frame is sent, and then the receiver sends the ACK 1
frame means that the data 0 has arrived correctly, and transmits the data 1 frame. The sender transmits the
next frame: data 1. It reaches undamaged, and the receiver returns ACK 0. The sender transmits the next
frame: data 0. The receiver reports an error and returns the NAK frame. The sender retransmits the data 0
frame.
o Lost Frame: Sender is equipped with the timer and starts when the frame is transmitted. Sometimes the
frame has not arrived at the receiving end so that it can be acknowledged neither positively nor negatively.
The sender waits for acknowledgement until the timer goes off. If the timer goes off, it retransmits the last
transmitted frame.

Sliding Window ARQ

SlidingWindow ARQ is a technique used for continuous transmission error control.


Three Features used for retransmission:
 In this case, the sender keeps the copies of all the transmitted frames until they have been acknowledged.
Suppose the frames from 0 through 4 have been transmitted, and the last acknowledgement was for frame
2, the sender has to keep the copies of frames 3 and 4 until they receive correctly.
 The receiver can send either NAK or ACK depending on the conditions. The NAK frame tells the sender that
the data have been received damaged. Since the sliding window is a continuous transmission mechanism,
both ACK and NAK must be numbered for the identification of a frame. The ACK frame consists of a
number that represents the next frame which the receiver expects to receive. The NAK frame consists of a
number that represents the damaged frame.
 The sliding window ARQ is equipped with the timer to handle the lost acknowledgements. Suppose then n-1
frames have been sent before receiving any acknowledgement. The sender waits for the acknowledgement,
so it starts the timer and waits before sending any more. If the allotted time runs out, the sender retransmits
one or all the frames depending upon the protocol used.
Two protocols used in sliding window ARQ:
Go-Back-n ARQ: In Go-Back-N ARQ protocol, if one frame is lost or damaged, then it retransmits all the
frames after which it does not receive the positive ACK.
Three possibilities can occur for retransmission:
 Damaged Frame: When the frame is damaged, then the receiver sends a NAK frame.
Computer Networks Page: 17

In the above figure, three frames have been transmitted before an error discovered in the third frame. In
this case, ACK 2 has been returned telling that the frames 0,1 have been received successfully without
any error. The receiver discovers the error in data 2 frame, so it returns the NAK 2 frame. The frame 3 is
also discarded as it is transmitted after the damaged frame. Therefore, the sender retransmits the frames
2,3.

 Lost Data Frame: In Sliding window protocols, data frames are sent sequentially. If any of the frames is
lost, then the next frame arrive at the receiver is out of sequence. The receiver checks the sequence
number of each of the frame, discovers the frame that has been skipped, and returns the NAK for the
missing frame. The sending device retransmits the frame indicated by NAK as well as the frames
transmitted after the lost frame.
 Lost Acknowledgement: The sender can send as many frames as the windows allow before waiting for
any acknowledgement. Once the limit of the window is reached, the sender has no more frames to send; it
must wait for the acknowledgement. If the acknowledgement is lost, then the sender could wait forever. To
avoid such situation, the sender is equipped with the timer that starts counting whenever the window
capacity is reached. If the acknowledgement has not been received within the time limit, then the sender
retransmits the frame since the last ACK.
Selective-Reject ARQ
 Selective-Reject ARQ technique is more efficient than Go-Back-n ARQ.
 In this technique, only those frames are retransmitted for which negative acknowledgement (NAK) has
been received.
 The receiver storage buffer keeps all the damaged frames on hold until the frame in error is correctly
received.
 The receiver must have an appropriate logic for reinserting the frames in a correct order.
 The sender must consist of a searching mechanism that selects only the requested frame for
retransmission.
Computer Networks Page: 18

Local Area Networks


IEEE 802 Standards
IEEE 802 is a family of IEEE standards dealing with local area networks and metropolitan area networks.
More specifically, the IEEE 802 standards are restricted to networks carrying variable-size packets. By
contrast, in cell relay networks data is transmitted in short, uniformly sized units called
cells. Isochronous networks, where data is transmitted as a steady stream of octets, or groups of octets, at
regular time intervals, are also out of the scope of this standard. The number 802 was simply the next free
number IEEE could assign,[1] though "802" is sometimes associated with the date the first meeting was held —
February 1980.
The services and protocols specified in IEEE 802 map to the lower two layers (Data Link and Physical) of the
seven-layer OSI networking reference model. In fact, IEEE 802 splits the OSI Data Link Layer into two sub-
layers named logical link control (LLC) and media access control (MAC), so the layers can be listed like this:
 Data link layer
 LLC sublayer
 MAC sublayer
 Physical layer
The IEEE 802 family of standards is maintained by the IEEE 802 LAN/MAN Standards Committee (LMSC).
The most widely used standards are for the Ethernet family, Token Ring, Wireless LAN, Bridging and Virtual
Bridged LANs. An individual working group provides the focus for each area.its starts with 802.1 to 802.12

Ethernet : IEEE 802.3 Local Area Network (LAN) Protocols

Ethernet protocols refer to the family of local-area network (LAN) technology covered by the IEEE 802.3. It is
working examplc of the more general carrier sense multiple access with collision detect (CSMA/CD). In the
Ethernet Computer Network standard, there are two modes of operation: half-duplex and full-duplex modes.
Computer Networks Page: 19

In the half duplex mode, data are transmitted using the popular Carrier-SenseMultiple Access/Collision
Detection (CSMA/CD) protocol on as hared medium.

The main disadvantages of the half-duplex are the efficiency and distance limitation, in which the link distance
islimited by the minimum MAC frame size. This restriction reducesthe efficiency drastically for high-rate
transmission. Therefore, thecarrier extension technique is used to ensure the minimum framesize of 512 bytes
in Gigabit Ethernet to achieve a reasonable linkdistance.Four data rates are currently defined for operation
over opticalfiber and twisted-pair cables :
• 10 Mbps - 10Base-T Ethernet (IEEE 802.3)
• 100 Mbps - Fast Ethernet (IEEE 802.3u)
• 1000 Mbps - Gigabit Ethernet (IEEE 802.3z)
• 10-Gigabit - 10 Gbps Ethernet (IEEE 802.3ae).
The Ethernet is a multi-access network, meaning that a set of nodes send and receive frames over a shared
link you can, therefore, think of an Ethernet or being like a bus that has multiple stations plugged into it. The
"carrier sense" in CSMA/CD means that all the nodes can distinguish between an idle and a busy link and
"collision detect" means that a node listens as it transmits and can therefore detect when a frame it is
transmitting has collided with a frame transmitted by another node.
The Ethernet has its root in an early packet radio network, called ALOHA, like, the ALOHA, the problem faced
by the Ethernet is how to mediate access to a shared medium fairly and efficiently. In ALOHA, the medium was
the atmosphere, while in Ethernet the medium is coax cable.
In the earliest days, 10-Mbps Ethernet war used, but now it has been extended to include a 100-Mbps version
called Fast Ethernet and a 1000-Mbps version called Gigabit Ethernet.

The Ethernet System consists of three basic elements


(1) The physical medium used to carry Ethernet signals between computers,
(2) a set of medium access control rules embedded in each Ethernet interface that allow multiple computers to
fairly arbitrate access to the shared Ethernet channel, and
(3) an Ethernet frame that consists of a standardized set of bits used to carry data over the system.
As with all IEEE 802 protocols, the ISO data link layer is divided into two IEEE 802 sub-layers, the Media
Access Control (MAC) sub-layer and the MAC-client sub-layer. The IEEE 802.3 physical layer corresponds to
the ISO physical layer.
Each Ethernet-equipped computer operates independently of all other stations on the network: there is no
central controller. All stations attached to an Ethernet are connected to a shared signaling system, also called
the medium. To send data a station first listens to the channel, and when the channel is idle the station
transmits its data in the form of an Ethernet frame, or packet.
After each frame transmission, all stations on the network must contend equally for the next frame
transmission opportunity. Access to the shared channel is determined by the medium access control (MAC)
mechanism embedded in the Ethernet interface located in each station. The medium access control
mechanism is based on a system called Carrier Sense Multiple Access with Collision Detection (CSMA/CD).
As each Ethernet frame is sent onto the shared signal channel, all Ethernet interfaces look at the destination
address. If the destination address of the frame matches with the interface address, the frame will be read
entirely and be delivered to the networking software running on that computer. All other network interfaces will
stop reading the frame when they discover that the destination address does not match their own address.
Ethernet Frame Format

Basic frame format which is required for all MAC implementation is defined in IEEE 802.3 standard. Though
several optional formats are being used to extend the protocol’s basic capability.
Computer Networks Page: 20

Ethernet frame starts with Preamble and SFD, both works at physical layer. Ethernet header contains both
Source and Destination MAC address, after which the payload of frame is present. The last field is CRC which
is used to detect the error. Let’s discuss each field of basic frame format.

 PREAMBLE – Ethernet frame starts with 7-Bytes Preamble. This is pattern of alternative 0’s and 1’s
which indicates starting of the frame and allow sender and receiver to establish bit synchronization.
Initially, PRE (Preamble) was introduced to allow for the loss of few bits due to signal delays. But todays
high-speed Ethernet don’t need Preamble to protect the frame bits.
PRE (Preamble) indicates the receiver that frame is coming and allow the receiver to lock onto the data
stream before the actual frame begins.
 Start of frame delimiter (SFD) – This is a 1-Byte field which is always set to 10101011. SFD indicates
that upcoming bits are starting of frame, which is destination address. Sometimes SFD is considered the
part of PRE, this is the reason Preamble is described as 8 Bytes in many places.
 Destination Address – This is 6-Byte field which contains the MAC address of machine for which data is
destined.
 Source Address – This is a 6-Byte field which contains the MAC address of source machine. As Source
Address is always an individual address (Unicast), the least significant bit of first byte is always 0.
 Length – Length is a 2-Byte field, which indicates the length of entire Ethernet frame. This 16-bit field can
hold the length value between 0 to 65534, but length can not be larger than 1500 because of some own
limitations of Ethernet.
 Data – This is the place where actual data is inserted, also known as Payload. Both IP header and data
will be inserted here, if Internet Protocol is used over Ethernet. The maximum data present may be as
long as 1500 Bytes. In case data length is less than minimum length i.e. 46 bytes, then padding 0’s is
added to meet the minimum possible length.
 Cyclic Redundancy Check (CRC) – CRC is 4 Byte field. This field contains 32-bits hash code of data,
which is generated over Destination Address, Source Address, Length and Data field. If the checksum
computed by destination is not same as sent checksum value, data received is corrupted.

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.
Computer Networks Page: 21

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 nstations, 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
Computer Networks Page: 22

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

IEEE 802.5 Token Ring


IEEE 802.5 Token Ring: Token ring is the IEEE 802.5 standard for a token-passing ring in Communication
networks. A ring consists of a collection of ring interfaces connected by point-to-point lines i.e. ring interface of
one station is connected to the ring interfaces of its left station as well as right station. Internally, signals travel
around the Communication network from one station to the next in a ring.These point-to-point links can be
created with twisted pair, coaxial cable or fiber optics. Each bit arriving at an interface is copied into a 1-bit
buffer. In this buffer the bit is checked and may be modified and is then copied out to the ring again. This
copying of bit in the buffer introduces a 1-bit delay at each interface.
Token Ring is a LAN protocol defined in the IEEE 802.5 where all stations are connected in a ring and each
station can directly hear transmissions only from its immediate neighbor. Permission to transmit is granted by a
message (token) that circulates around the ring. A token is a special bit pattern (3 bytes long). There is only
one token in the network.

Token-passing networks move a small frame, called a token, around the network. Possession of the token
grants the right to transmit. If a node receiving the token in order to transmit data, it seizes the token, alters 1
bit of the token (which turns the token into a start-of-frame sequence), appends the information that it wants to
transmit, and sends this information to the next station on the ring. Since only one station can possess the
token and transmit data at any given time, there are no collisions.
There are two operating modes of ring interfaces. There are listen and transmit. In listen mode, the input bits
are simply copied to output with a delay of 1- bit time. In transmit mode the connection between input and
output is broken by the interface so that is can insert its own data. The station comes in transmit mode when it
captures the token.
The frames are acknowledged by the destination in a very simple manner. The sender sends frames to
receiver with ACK bit 0. The receiver on receiving frames, copies data into its buffer, verifies the checksum and
set the ACK bit to 1. The verified frames come back to sender, where they are removed from the ring.
The information frame circulates the ring until it reaches the intended destination station, which copies the
information for further processing. The information frame continues to circle the ring and is finally removed
Computer Networks Page: 23

when it reaches the sending station. The sending station can check the returning frame to see whether the
frame was seen and subsequently copied by the destination.
A station can hold a token for a specific duration of time. During this time, it has to complete its transmission
and regenerates the token in ring. Whenever a station finishes its transmissions, the other station grabs the
token and starts its own transmission.
Handling cable breakage in ring networks

• If the cable breaks, the entire ring network goes down. This can completely stop the propagation of token in
the ring.
• This problem can be solved by using wire centre as shown in fig.
• This wire centre bypasses the terminal that has gone down in following manner:
(a) Each station is connected to wire center by a cable containing two twisted pairs, one for data to station and
one for data from the station.
(b) Inside the wire center are bypass relays that are energized by the current from the stations.
(c) If the ring breaks or a station goes down loss of drive current will release the relay and bypass the station.

Switching

Switching is process to forward packets coming in from one port to a port leading towards the destination.
When data comes on a port it is called ingress, and when data leaves a port or goes out it is called egress. A
communication system may include number of switches and nodes. At broad level, switching can be divided
into two major categories:
 Connectionless: The data is forwarded on behalf of forwarding tables. No previous handshaking is
required and acknowledgements are optional.
 Connection Oriented: Before switching data to be forwarded to destination, there is a need to pre-
establish circuit along the path between both endpoints. Data is then forwarded on that circuit. After
the transfer is completed, circuits can be kept for future use or can be turned down immediately.

For data transfer, different types of switching methods are available.


Computer Networks Page: 24

Circuit Switching
 Circuit switched network consists of a set of switches connected by physical links.
 In circuit switched network, two nodes communicate with each other over a dedicated communication path.
 There is a need of pre-specified route from which data will travel and no other data is permitted.
 Before starting communication, the nodes must make a reservation for the resources to be used during the
communication.
 In this type of switching, once a connection is established, a dedicated path exists between both ends until the
connection is terminated.

 The end systems, such as telephones or computers are directly connected to a switch.
 When system A needs to communicate with system B, system A needs to request a connection to system B
that must be accepted by all switches as well as by B itself.
 This is called as setup phase in which a circuit is reserved on each link, and the combination of circuits or
channels defines a dedicated path.
 After the establishment of the dedicated circuit, the data transfer can take place.
 After all data has been transferred, the circuit is torn down.

Packet Switching
 In packet switching, messages are divided into packets of fixed or variable size.
Computer Networks Page: 25

 The size of packet is decided by the network and the governing protocol.
 Resource allocation for a packet is not done in packet switching.
 Resources are allocated on demand.
 The resource allocation is done on first-come, first-served basis.
 Each switching node has a small amount of buffer space to hold packets temporarily.
 If the outgoing line is busy, the packet stays in queue until the line becomes available.
Packet switching method uses two routing methods:
1. Datagram Packet Switching
 Datagram packet switching is normally implemented in the network layer.
 In datagram network, each packet is routed independently through the network.
 Each packet carries a header that contains the full information about the destination.
 When the switch receives the packet, the destination address in the header of the packet is examined; the
routing table is consulted to find the corresponding port through which the packet should be forwarded.

2. Virtual Circuit Packet Switching

 Virtual circuit packet switching is normally done at the data link layer.
 Virtual circuit packet switching establishes a fixed path between a source and a destination to transfer the
packets.
 It is also called as connection oriented network.
Computer Networks Page: 26

A source and destination have to go through three phases in a virtual circuit packet switching:
I. Setup phase
ii. Data transfer phase
iii. Connection release phase
 A logical connection is established when a sender sends a setup request to the receiver and the receiver
sends back an acknowledgement to the sender if the receiver agree.
 All packets belonging to the same source and destination travel the same path.
 The information is delivered to the receiver in the same order as transmitted by the sender.

Message Switching
 In message switching, it is not necessary to establish a dedicated path between transmitter and receiver.
 In this, each message is routed independently through the network.
 Each message carries a header that contains the full information about the destination.
 Each intermediate device receives the whole message and buffers it until there are resources available to
transfer it to the next hop.
 If the next hop does not have enough resources to accommodate large size message, the message is stored
and switch waits.
 For this reason a message switching is sometimes called as Store and Forward Switching.
 Message switching is very slow because of store-and-forward technique.
 Message switching is not recommended for real time applications like voice and video.
Computer Networks Page: 27

You might also like