Unit 2
Unit 2
network frame within a Link layer frame before the transmission across the
o In the OSI model, the data link layer is a 4th layer from the top and 2nd layer
link. A frame consists of a data field in which network layer datagram is
from the bottom.
inserted and a number of data fields.
o The communication channel that connects the adjacent nodes is known as
o Reliable delivery: Data Link Layer provides a reliable delivery service, i.e.,
links, and in order to move the datagram from source to the destination, the
transmits the network layer datagram without any error. A reliable delivery
datagram must be moved across an individual link.
service is accomplished with transmissions and acknowledgements.
o The main responsibility of the Data Link Layer is to transfer the datagram
o Flow control: A receiving node can receive the frames at a faster rate than it
across an individual link.
can process the frame. Without flow control, the receiver's buffer can
o The Data link layer protocol defines the format of the packet exchanged
overflow, and frames can get lost.
across the nodes as well as the actions such as Error detection,
o Error detection: Errors can be introduced by signal attenuation and noise.
retransmission, flow control, and random access.
Data Link Layer protocol provides a mechanism to detect one or more
o The Data Link Layer protocols are Ethernet, token ring, FDDI and PPP.
errors. This is achieved by adding error detection bits in the frame and then
Following services are provided by the Data Link
receiving node can perform an error check.
Layer:
o Error correction: Error correction is similar to the Error detection, except
that receiving node not only detect the errors but also determine where the
errors have occurred in the frame.
o Half-Duplex & Full-Duplex: In a Full-Duplex mode, both the nodes can
transmit the data at the same time. In a Half-Duplex mode, only one node
can transmit the data at the same time.
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.
Types Of Errors
Errors can be classified into two categories: The duration of noise in Burst Error is more than the duration of noise in Single-Bit.
o Single-Bit Error Burst Errors are most likely to occurr in Serial Data Transmission.
The number of affected bits depends on the duration of the noise and data rate.
o Burst Error
o If two bits are interchanged, then it cannot detect the errors. position in another data unit are also corrupted, then 2D Parity checker will
not be able to detect the error.
o This technique cannot be used to detect the 4-bit errors or more in some
cases.
Checksum
A Checksum is an error detection technique based on the concept of redundancy.
3. All the k sections are added together by using one's complement to get the sum. divisor that was used to find the CRC remainder.
If the resultant of this division is zero which means that it has no error, and the data
4. The sum is complemented and it becomes the checksum field. is accepted.
5. The original data and checksum field are sent across the network. If the resultant of this division is not zero which means that the data consists of an
error. Therefore, the data is discarded.
Checksum Checker
A Checksum is verified at the receiving side. The receiver subdivides the incoming
data into equal segments of n bits each, and all these segments are added together,
and then this sum is complemented. If the complement of the sum is zero, then the
data is accepted otherwise data is rejected.
1. The Receiver follows the given steps:
2. The block unit is divided into k sections and each of n bits.
3. All the k sections are added together by using one's complement algorithm to get
the sum.
4. The sum is complemented.
5. If the result of the sum is zero, then the data is accepted otherwise the data is disc
arded.
Let's understand this concept through an example:
Suppose the original data is 11100 and divisor is 1001.
Cyclic Redundancy Check (CRC) CRC Generator
CRC is a redundancy error technique used to determine the error.
o A CRC generator uses a modulo-2 division. Firstly, three zeroes are o When the string 11100111 is received at the receiving end, then CRC
appended at the end of the data as the length of the divisor is 4 and we know checker performs the modulo-2 division.
that the length of the string 0s to be appended is always one less than the o A string is divided by the same divisor, i.e., 1001.
length of the divisor. o In this case, CRC checker generates the remainder of zero. Therefore, the
o Now, the string becomes 11100000, and the resultant string is divided by the data is accepted.
divisor 1001.
o The remainder generated from the binary division is known as CRC
remainder. The generated value of the CRC remainder is 111.
o CRC remainder replaces the appended string of 0s at the end of the data unit,
and the final string would be 11100111 which is sent across the network.
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
CRC Checker 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
o The functionality of the CRC checker is similar to the CRC generator. additional redundant bits.
Suppose r is the number of redundant bits and d is the total number of the data bits. Total number of bits = d+r = 4+3 = 7;
The number of redundant bits r can be calculated by using the formula:
2r>=d+r+1
We observe from the above figure that the bit positions that includes 1 in the first
position are 1, 3, 5, 7. Now, we perform the even-parity check at these bit positions.
Let's understand the concept of Hamming code through an example:
The total number of 1 at these bit positions corresponding to r1 is even, therefore,
Suppose the original data is 1010 which is to be sent.
the value of the r1 bit is 0.
Total number of data bits 'd' = 4
Number of redundant bits r : 2r >= d+r+1
2r>= 4+r+1 Determining r2 bit
The r2 bit is calculated by performing a parity check on the bit positions whose
Therefore, the value of r is 3 that satisfies the above relation. binary representation includes 1 in the second position.
R1 bit
The bit positions of the r1 bit are 1,3,5,7
We observe from the above figure that the bit positions that includes 1 in the second
position are 2, 3, 6, 7. Now, we perform the even-parity check at these bit positions.
The total number of 1 at these bit positions corresponding to r2 is odd, therefore, We observe from the above figure that the binary representation of r1 is 1100. Now,
the value of the r2 bit is 1. we perform the even-parity check, the total number of 1s appearing in the r1 bit is an
even number. Therefore, the value of r1 is 0.
We observe from the above figure that the binary representation of r2 is 1001. Now,
we perform the even-parity check, the total number of 1s appearing in the r2 bit is an
even number. Therefore, the value of r2 is 0.
We observe from the above figure that the bit positions that includes 1 in the third
position are 4, 5, 6, 7. Now, we perform the even-parity check at these bit positions.
The total number of 1 at these bit positions corresponding to r4 is even, therefore,
the value of the r4 bit is 0.
R4 bit
Data transferred is given below: The bit positions of r4 bit are 4,5,6,7.
Suppose the 4th bit is changed from 0 to 1 at the receiving end, then parity bits are
recalculated.
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:
o 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
We observe from the above figure that the binary representation of r4 is 1011. Now,
with an EOT (END-of-Transmission) frame.
we perform the even-parity check, the total number of 1s appearing in the r4 bit is an
odd number. Therefore, the value of r4 is 1. o If the response to the ENQ is negative, then the sender disconnects and
Sliding Window frames are sent out, then the number of frames left out in the sender window
o The Sliding Window is a method of flow control in which a sender can is w-3.
transmit the several frames before getting an acknowledgement. o Once the ACK has arrived, then the sender window expands to the number
o In Sliding Window Control, multiple frames can be sent one after the which will be equal to the number of frames acknowledged by ACK.
another due to which capacity of the communication channel can be utilized o For example, the size of the window is 7, and if frames 0 through 4 have
efficiently. been sent out and no acknowledgement has arrived, then the sender window
o A single ACK acknowledge multiple frames. contains only two frames, i.e., 5 and 6. Now, if ACK has arrived with a
o Sliding Window refers to imaginary boxes at both the sender and receiver number 4 which means that 0 through 3 frames have arrived undamaged and
end. the sender window is expanded to include the next four frames. Therefore,
o The window can hold the frames at either end, and it provides the upper the sender window contains six frames (5,6,7,0,1,2).
limit on the number of frames that can be transmitted before the
acknowledgement.
o Frames can be acknowledged even when the window is not completely
filled.
o 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........
Receiver Window
o At the beginning of transmission, the receiver window does not contain n
frames, but it contains n-1 spaces for frames. Error Control
o When the new frame arrives, the size of the window shrinks. Error Control is a technique of error detection and retransmission.
o The receiver window does not represent the number of frames received, but
Categories of Error Control:
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).
o Once the acknowledgement is sent, the receiver window expands by the
number equal to the number of frames acknowledged.
o 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.
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.
o Selective-Reject ARQ
Selective-Reject ARQ technique is more efficient than Go-Back-n ARQ.
o In this technique, only those frames are retransmitted for which negative
acknowledgement (NAK) has been received.
o The receiver storage buffer keeps all the damaged frames on hold until the
frame in error is correctly received.
o The receiver must have an appropriate logic for reinserting the frames in a
correct order.
o The sender must consist of a searching mechanism that selects only the
requested frame for retransmission.
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.
o 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.
algorithm, STP provides redundant paths through the LAN while preventing
Network Standards loops in the LAN that are created by multiple active paths between stations.
IEEE 802.1q? virtual LANs (VLANs)? A VLAN is a network of computers
If the different network standards in place today were in print, they would fill that behaves as if the computers are connected to the same physical network
volumes upon volumes of text. These network standards serve specific purposes, as segment, even though these computers might be physically located on
defined by the standard itself. different segments of a LAN.
IEEE 802.3 Ethernet Standards
ITU (International Telecommunication Union) Several Ethernet standards are used in today's network environment. Some of these
The three sectors of the ITU are Radio communication (ITU-R), Telecommunication standards dictate the bandwidth and operation of the Ethernet LAN, such as Ethernet
Standardization (ITU-T), and Telecommunication Development (ITU-D). and Fast Ethernet, whereas other standards dictate how these Ethernet networks
ITU-R draws up the technical characteristics of terrestrial and space-based function, such as the STP.
wireless services and systems, and develops operational procedures. It also
undertakes the important technical studies, which serve as a basis for the
regulatory decisions made at radio communication conferences.
ITU-T experts prepare the technical specifications for telecommunication
systems, networks, and services, including their operation, performance, and
maintenance. Their work also covers the tariff principles and accounting
methods used to provide international service.
ITU-D experts focus their work on the preparation and development of
recommendations, opinions, guidelines, handbooks, manuals and reports.
These documents provide decision makers with "best business practices"
relating to a host of issues ranging from development strategies and policies
to network management.
The IEEE 802.3 standards define how the Ethernet standard is used in the networking
IEEE 802 Group environment. These 802.3 standards are as follows:
The Institute of Electrical and Electronics Engineers (IEEE, pronounced "eye-triple- IEEE 802.3 (Ethernet)? 10-Mbps Ethernet specification developed by
E") is a nonprofit, technical professional association in 150 countries. The IEEE is a Xerox, served as the basis for the IEEE 802.3 standard. This specification
leading authority in technical areas ranging from computer engineering, to describes the use of carrier sense multiple access collision detect
biomedical technology, to telecommunications, to electric power, to aerospace and (CSMA/CD) in handling the simultaneous demands for network access.
consumer electronics. The IEEE produces 30 percent of the world's published Often used in LAN environments.
literature in electrical engineering, computers, and control technology and has nearly IEEE 802.3u (Fast Ethernet)? 100-Mbps Ethernet specification working at
900 active standards with 700 under development. 10 times the speed of 10-Mbps Ethernet. Often used in LAN environments.
Some of the best-known IEEE standards are as follows: IEEE 802.3z (Gigabit Ethernet)? 1000-Mbps/1-Gbps Ethernet
IEEE 802.1 (LAN/MAN) specification that transfers data at 1 gigabit per second (1000 Mbps). Often
IEEE 802.3 (Ethernet) used in large LAN environments at the core layer.
IEEE 802.5 (Token Ring) IEEE 802.3ae (10Gigabit Ethernet)? 10,000-Mbps/10-Gbps Ethernet
IEEE 802.11 (Wireless LAN) specification that transfers data at 10 gigabits per second (10,000 Mbps).
Often used in metropolitan-area networks (MANs).
IEEE 802.1 LAN/MAN Standards
The IEEE 802.1 group defined internetworking standards, with IEEE 802.1d and IEEE 802.5 Token Ring Standards
IEEE 802.1q used in the local-area networking environment. The standards are as With Ethernet, any host on the network can send data at any time, as long as no one
follows: else is on the line. In contrast, the Token Ring works by passing a token around the
IEEE 802.1d? Spanning Tree Protocol (STP)? STP is a link-management network, almost like a relay-race runner passing the baton to the next runner.
protocol that is part of the IEEE 802.1 standard for Media Access Control IEEE 802.5 is a related specification and compatible with the Token Ring standard
bridges and is used for Layer 2 redundancy. Using the spanning-tree developed by IBM. Token Ring refers to both IBM Token Ring and IEEE 802.5
network implementations. IBM originally developed the Token Ring network in the Switching by Bridges
1970s; however, IBM gave up on Token Ring in favor of Ethernet several years ago.
When a data frame arrives at a particular port of a bridge, the bridge
examines the frame’s data link address, or more specifically, the MAC
IEEE 802.11 Wireless LAN (WLAN) Standards
The IEEE 802.11 standard refers to a family of specifications developed for wireless
address. If the destination address as well as the required switching is
LAN technology. IEEE 802.11 specifies an over-the-air interface between a wireless valid, the bridge sends the frame to the destined port. Otherwise, the frame
client and a base station, such as a wireless laptop and a wireless base unit or is discarded.
between two wireless clients, such as between two wireless laptops. If any segment of the bridged network is wireless, a wireless bridge is
used to perform the switching.
There are three main ways for bridging −
simple bridging
multi-port bridging
learning or transparent bridging
As we can see in the figure above, there are four stations for accessing a
shared channel and transmitting data frames. Some frames collide because
most stations send their frames at the same time. Only two frames, frame
1.1 and frame 2.2, are successfully transmitted to the receiver end. At the
same time, other frames are lost or destroyed. Whenever two frames fall
on a shared channel simultaneously, collisions can occur, and both will
suffer damage. If the new frame's first bit enters the channel before
finishing the last bit of the second frame. Both frames are completely
finished, and both stations must retransmit the data frame. CSMA (Carrier Sense Multiple Access)
Slotted Aloha It is a carrier sense multiple access based on media access protocol to
The slotted Aloha is designed to overcome the pure Aloha's efficiency sense the traffic on a channel (idle or busy) before transmitting the data. It
because pure Aloha has a very high possibility of frame hitting. In slotted means that if the channel is idle, the station can send data to the channel.
Aloha, the shared channel is divided into a fixed time interval called slots. Otherwise, it must wait until the channel becomes idle. Hence, it reduces
So that, if a station wants to send a frame to a shared channel, the frame the chances of a collision on a transmission medium.
can only be sent at the beginning of the slot, and only one frame is allowed
to be sent to each slot. And if the stations are unable to send data to the CSMA Access Modes
beginning of the slot, the station will have to wait until the beginning of
the slot for the next time. However, the possibility of a collision remains 1- Persistent: In the 1-Persistent mode of CSMA that defines each node,
first sense the shared channel and if the channel is idle, it immediately
sends the data. Else it must wait and keep track of the status of the channel and if the channel is inactive, it sends a frame with a P probability. If the
to be idle and broadcast the frame unconditionally as soon as the channel data is not transmitted, it waits for a (q = 1-p probability) random time
is idle. and resumes the frame with the next time slot.
Non-Persistent: It is the access mode of CSMA that defines before O- Persistent: It is an O-persistent method that defines the superiority of
transmitting the data, each node must sense the channel, and if the channel the station before the transmission of the frame on the shared channel. If it
is inactive, it immediately sends the data. Otherwise, the station must wait is found that the channel is inactive, each station waits for its turn to
for a random time (not continuously), and when the channel is found to be retransmit the data.
idle, it transmits the frames.
CSMA/ CD
It is carriers sense multiple access/ collision detection network
protocol to transmit data frames.
The CSMA/CD protocol works with a medium access control
layer.
Therefore, it first senses the shared channel before broadcasting the
frames, and if the channel is idle, it transmits a frame to check
whether the transmission was successful.
If the frame is successfully received, the station sends another
frame.
If any collision is detected in the CSMA/CD, the station sends a
jam/ stop signal to the shared channel to terminate data
transmission.
After that, it waits for a random time before sending a frame to a
channel.
CSMA/ CA