Data Link Layer
Data Link Layer
The main responsibility of the Data Link Layer is to transfer the datagram across an
individual link.
The Data link layer protocol defines the format of the packet exchanged across the nodes
as well as the actions such as Error detection, retransmission, flow control, and random
access.
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.
1
Longitudinal Redundancy Check (LRC) Method
In this error detection method, a block of bits are organized in a table (of rows
and columns). For example, instead of sending block of 32 bits, first it is
organized into four rows and eight columns. Then parity bits for each column is
calculated and new row of eight parity bits is formed.
2
CRC Error Detection
CRC is calculated based on received block and compared with CRC appended
by transmitter. When calculated CRC and original CRC is equal, frame is
considered to be error free.
3
Checksum Method
There are two modules in this error detection method viz. checksum generator
and checksum checker. In the transmitter, checksum generator subdivides data
unit into equal segments of n bits (usually 16). These segments are added
together using one's complement arithmatic in such a way that total is also n bits
long.
Error Correction
Error Correction codes are used to detect and correct the errors when data is transmitted
from the sender to the receiver.
Backward error correction: Once the error is discovered, the receiver requests the sender
to retransmit the entire data unit.
4
Forward error correction: In this case, the receiver uses the error-correcting code which
automatically corrects the errors.
Types Of Errors
Errors can be classified into two categories:
Single-Bit Error:
The only one bit of a given data unit is changed from 1 to 0 or from 0 to 1
Burst Error:
The two or more bits are changed from 0 to 1 or from 1 to 0 is known as Burst Error.
5
Flow control
It is a technique that generally observes the proper flow of data from sender to
receiver. It is very essential because it is possible for sender to transmit data or
information at very fast rate and hence receiver can receive this information and
process it.
This method is the easiest and simplest form of flow control. In this
method, basically message or data is broken down into various multiple
frames, and then receiver indicates its readiness to receive frame of data.
then only sender will send or transfer the next frame. This process is
continued until sender transmits EOT (End of Transmission) frame.
Advantages –
This method is very easiest and simple and each of the frames.
This method is also very accurate.
Disadvantages –
Advantages –
6
Disadvantages –
This protocol is based on the method of using the Sliding Window Protocol as the basis
of data exchange, where the ’N’ in the protocol represents the window size.
The term ARQ represents the Automatic Repeat Request, which refers to sending
multiple frames simultaneously from the sender to the receiver end.
7
Important Features:
The working of the Go-Back-N ARQ protocol involves applying the sliding window
method for the basis of sharing data.
1. To begin with, the sender side will share the data frames simultaneously.
2. After the sender receive’s the acknowledgment for the first frame, the sender will
share the next frame with the receiver.
8
3. This exchange continues until, due to some external or internal interruption in the
network
Advantages:
9
Disadvantages
Retransmission of frames.
It is also known as Sliding Window Protocol and used for error detection and
control in the data link layer.
In Selective Repeat ARQ only the lost or error frames are retransmitted, whereas
correct frames are received and buffered.
The receiver while keeping track of sequence numbers buffers the frames in
memory and sends NACK for only frames which are missing or damage.
10
Random Access Protocol
In this protocol, all the station has the equal priority to send the data over a channel. In
random access protocol, one or more stations cannot depend on another station nor any
station control another station. Depending on the channel's state.
It is designed for wireless LAN (Local Area Network) but can also be used in a shared
medium to transmit data.
Aloha Rules
11
CSMA :
It is a carrier sense multiple access based on media access protocol to sense the traffic
on a channel (idle or busy) before transmitting the data.
12
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.
Non-Persistent: It is the access mode of CSMA that defines before transmitting the data,
each node must sense the channel, and if the channel is inactive, it immediately sends the
data.
CSMA/ CD
13
CSMA/ CA
Following are the methods used in the CSMA/ CA to avoid the collision:
Interframe space: In this method, the station waits for the channel to become idle, and
if it gets the channel is idle, it does not immediately send the data.
Contention window: In the Contention window, the total time is divided into different
slots. When the station/ sender is ready to transmit the data frame.
Acknowledgment: In the acknowledgment method, the sender station sends the data
frame to the shared.
Channelization Protocols
FDMA
It is a frequency division multiple access (FDMA) method used to divide the available
bandwidth into equal bands so that multiple users can send data through a different
frequency.
14
TDMA
Time Division Multiple Access (TDMA) is a channel access method. It allows the same
frequency bandwidth to be shared across multiple stations. And to avoid collisions in the
shared channel, it divides the channel into different frequency slots that allocate stations
to transmit the data frames.
CDMA
The code division multiple access (CDMA) is a channel access method. In CDMA, all
stations can simultaneously send the data over the same channel. It means that it allows
each station to transmit the data frames with full frequency on the shared channel at all
times. It does not require the division of bandwidth on a shared channel based on time
slots.
15
Token Passing
The stations are connected logically to each other in form of ring and access to
stations is governed by tokens.
Which circulate from one station to the next in some predefined order.
In Token ring, token is passed from one station to another adjacent station in
the ring whereas incase of Token bus
16
17
18