You are on page 1of 18

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.

Error Detection Methods


Following are the error detection methods or techniques of error detection in
networking.

1. VRC Method 2. LRC method 3. CRC method 4. Checksum method

Vertical Redundancy Check (VRC) Method


In this error detection technique, a redundant bit called parity bit is appended to
every data unit so that total number of 1's in the unit becomes even. The system
now transmits entire extended unit across the network link. At the receiver, all
eight received bits are checked through even parity checking function. If it counts
even 1's data unit passes. If it counts odd number of 1's, it means error has been
introduced in the data somewhere.

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.

Error Correction can be handled in two ways:

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.

Techniques of Flow Control in Data Link Layer :

1. Stop-and-Wait Flow Control:

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 –

This method is fairly slow.


Only one packet or frame can be sent at a time.

2. Sliding Window Flow Control :

This method is required where reliable in-order delivery of packets or frames


is very much needed like in data link layer. It is point to point protocol that
assumes that none of the other entity tries to communicate until current data
or frame transfer gets completed.

Advantages –

This method increases efficiency.


Multiples frames can be sent one after another.

6
Disadvantages –

The receiver might receive data frames.


The main issue is complexity at the sender and receiver due to the transferring
of multiple frames.

Go-Back-N ARQ Protocol:

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:

Multiple frames can be simultaneous to the receiver side.

Time delay is less for sharing data frames.

9
Disadvantages

The storage of data frames at the receiver side.

Retransmission of frames.

Selective Repeat ARQ

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.

Different methods of random-access protocols.

ALOHA Random Access Protocol

It is designed for wireless LAN (Local Area Network) but can also be used in a shared
medium to transmit data.

Aloha Rules

Any station can transmit data to a channel at any time.

It does not require any carrier sensing.

Collision and data frames may be lost during the transmission.

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.

CSMA Access Modes

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

It is a carrier 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.

13
CSMA/ CA

It is a carrier sense multiple access/collision avoidance network protocol for carrier


transmission of data frames. It is a protocol that works with a medium access control layer.
When a data frame is sent to a channel, it receives an acknowledgment to check whether
the channel is clear. If the station receives only a single (own) acknowledgments, that
means the data frame has been successfully transmitted to the receiver.

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

Token represents permission to send. If a station has a frame queued for


transmission when it receives the token.

16
17
18

You might also like