0% found this document useful (0 votes)
35 views17 pages

Understanding the Data Link Layer

The Data Link Layer is the second layer of the OSI model responsible for transferring datagrams across individual links, providing services like framing, reliable delivery, flow control, error detection, and correction. It utilizes various protocols such as Ethernet and PPP, and offers services including unacknowledged connectionless, acknowledged connectionless, and acknowledged connection-oriented services. Error detection techniques include single parity checks, checksums, and cyclic redundancy checks, while error correction can be achieved using methods like Hamming code.

Uploaded by

hlshreeshanthi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views17 pages

Understanding the Data Link Layer

The Data Link Layer is the second layer of the OSI model responsible for transferring datagrams across individual links, providing services like framing, reliable delivery, flow control, error detection, and correction. It utilizes various protocols such as Ethernet and PPP, and offers services including unacknowledged connectionless, acknowledged connectionless, and acknowledged connection-oriented services. Error detection techniques include single parity checks, checksums, and cyclic redundancy checks, while error correction can be achieved using methods like Hamming code.

Uploaded by

hlshreeshanthi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Data Link Layer

(Note: This is just a reference notes,


please do refer text book as well as other
sources)
o In the OSI model, the data link layer is a 4 th layer from the top and
2nd layer from the bottom.
o The communication channel that connects the adjacent nodes is
known as links, and in order to move the datagram from source to
the destination, the datagram must be moved across an individual
link.
o The main responsibility of the Data Link Layer is to transfer the
datagram across an individual link.
o 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.
o The Data Link Layer protocols are Ethernet, token ring, FDDI and
PPP.
o An important characteristic of a Data Link Layer is that datagram
can be handled by different link layer protocols on different links in
a path. For example, the datagram is handled by Ethernet on the
first link, PPP on the second link.
Following services are provided by the Data Link Layer:

Following services are provided by the Data Link Layer:

o Framing & Link access: Data Link Layer protocols encapsulate each
network frame within a Link layer frame before the transmission across
the link. A frame consists of a data field in which network layer datagram
is inserted and a number of data fields. It specifies the structure of the
frame as well as a channel access protocol by which frame is to be
transmitted over the link.
o Reliable delivery: Data Link Layer provides a reliable delivery service,
i.e., transmits the network layer datagram without any error. A reliable
delivery service is accomplished with transmissions and
acknowledgements. A data link layer mainly provides the reliable delivery
service over the links as they have higher error rates and they can be
corrected locally, link at which an error occurs rather than forcing to
retransmit the data.
o Flow control: A receiving node can receive the frames at a faster rate
than it can process the frame. Without flow control, the receiver's buffer
can overflow, and frames can get lost. To overcome this problem, the data
link layer uses the flow control to prevent the sending node on one side of
the link from overwhelming the receiving node on another side of the link.
o Error detection: Errors can be introduced by signal attenuation and
noise. Data Link Layer protocol provides a mechanism to detect one or
more errors. This is achieved by adding error detection bits in the frame
and then receiving node can perform an error check.
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.

Types of Services provided by Data Link Layer to the network layer:


The Data link layer generally provides or offers three types of services as
given below :
1. Unacknowledged Connectionless Service
2. Acknowledged Connectionless Service
3. Acknowledged Connection-Oriented Service
1. Unacknowledged Connectionless Service :
Unacknowledged connectionless service simply provides datagram
styles delivery without any error, issue, or flow control. In this
service, source machine generally transmits independent frames to
destination machine without having destination machine to
acknowledge these frames.
This service is called as connectionless service because there is no
connection established among sending or source machine and
destination or receiving machine before data transfer or release after
data transfer.
In Data Link Layer, if anyhow frame is lost due to noise, there will
be no attempt made just to detect or determine loss or recovery
from it. This simply means that there will be no error or flow control.
An example can be Ethernet.
2. Acknowledged Connectionless Service :
This service simply provides acknowledged connectionless service i.e.
packet delivery is simply acknowledged, with help of stop and wait for
protocol.
In this service, each frame that is transmitted by Data Link Layer is
simply acknowledged individually and then sender usually knows
whether or not these transmitted data frames received safely. There
is no logical connection established and each frame that is
transmitted is acknowledged individually.
This mode simply provides means by which user of data link can
just send or transfer data and request return of data at the same
time. It also uses particular time period that if it has passed frame
without getting acknowledgment, then it will resend data frame on
time period.
This service is more reliable than unacknowledged connectionless
service. This service is generally useful over several unreliable
channels, like wireless systems, Wi-Fi services, etc.
3. Acknowledged Connection-Oriented Service :
In this type of service, connection is established first among sender
and receiver or source and destination before data is transferred.
Then data is transferred or transmitted along with this established
connection. In this service, each of frames that are transmitted is
provided individual numbers first, so as to confirm and guarantee
that each of frames is received only once that too in an appropriate
order and sequence.

FRAMING
is function of Data Link Layer that is used to separate message from source
or sender to destination or receiver or simply from all other messages to all
other destinations just by adding sender address and destination address.
The destination or receiver address is simply used to represent where
message or packet is to go and sender or source address is simply used to
help recipient to acknowledge receipt.
Frames are generally data unit of data link layer that is transmitted or
transferred among various network points. It includes complete and full
addressing, protocols that are essential, and information under control.
Physical layers only just accept and transfer stream of bits without any
regard to meaning or structure. Therefore it is up to data link layer to simply
develop and recognize frame boundaries.
This can be achieved by attaching special types of bit patterns to start and
end of the frame. If all of these bit patterns might accidentally occur in data,
special care is needed to be taken to simply make sure that these bit
patterns are not interpreted incorrectly or wrong as frame delimiters.
Framing is simply point-to-point connection among two computers or devices
that consists or includes wire in which data is transferred as stream of bits.
However, all of these bits should be framed into discernible blocks of
information.

Methods of Framing :
There are basically four methods of framing as given below –
1. Character Count
2. Flag Byte with Character Stuffing
3. Starting and Ending Flags, with Bit Stuffing
4. Encoding Violations
These are explained as following below.
1. Character Count :
This method is rarely used and is generally required to count total
number of characters that are present in frame. This is be done by
using field in header. Character count method ensures data link
layer at the receiver or destination about total number of characters
that follow, and about where the frame ends.
There is disadvantage also of using this method i.e., if anyhow
character count is disturbed or distorted by an error occurring
during transmission, then destination or receiver might lose
synchronization. The destination or receiver might also be not able
to locate or identify beginning of next frame.
2. Character Stuffing :
Character stuffing is also known as byte stuffing or character-
oriented framing and is same as that of bit stuffing but byte stuffing
actually operates on bytes whereas bit stuffing operates on bits. In
byte stuffing, special byte that is basically known as ESC (Escape
Character) that has predefined pattern is generally added to data
section of the data stream or frame when there is message or
character that has same pattern as that of flag byte.
But receiver removes this ESC and keeps data part that causes
some problems or issues. In simple words, we can say that
character stuffing is addition of 1 additional byte if there is presence
of ESC or flag in text.
3. Bit Stuffing :
Bit stuffing is also known as bit-oriented framing or bit-oriented
approach. In bit stuffing, extra bits are being added by network
protocol designers to data streams. It is generally insertion or
addition of extra bits into transmission unit or message to be
transmitted as simple way to provide and give signaling information
and data to receiver and to avoid or ignore appearance of
unintended or unnecessary control sequences.
It is type of protocol management simply performed to break up bit
pattern that results in transmission to go out of synchronization. Bit
stuffing is very essential part of transmission process in network
and communication protocol. It is also required in USB.
4. Physical Layer Coding Violations :
Encoding violation is method that is used only for network in which
encoding on physical medium includes some sort of redundancy
i.e., use of more than one graphical or visual structure to simply
encode or represent one variable of data.

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:

o Single-Bit Error
o 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 occurr in Serial Data Transmission.

The number of affected bits depends on the duration of the noise and data
rate.

Error Detecting Techniques:


The most popular Error Detecting Techniques are:

o Single parity check


o Checksum
o Cyclic redundancy check

Single Parity Check


o Single Parity checking is the simple mechanism and inexpensive to detect
the errors.
o In this technique, a redundant bit is also known as a parity bit which is
appended at the end of the data unit so that the number of 1s becomes
even. Therefore, the total number of transmitted bits would be 9 bits.
o If the number of 1s bits is odd, then parity bit 1 is appended and if the
number of 1s bits is even, then parity bit 0 is appended at the end of the
data unit.
o At the receiving end, the parity bit is calculated from the received data
bits and compared with the received parity bit.
o This technique generates the total number of 1s even, so it is known as
even-parity checking.

Drawbacks Of Single Parity Checking


o It can only detect single-bit errors which are very rare.
o If two bits are interchanged, then it cannot detect the errors.
Checksum
A Checksum is an error detection technique based on the concept of
redundancy.

It is divided into two parts:

Checksum Generator

A Checksum is generated at the sending side. Checksum generator


subdivides the data into equal segments of n bits each, and all these
segments are added together by using one's complement arithmetic. The
sum is complemented and appended to the original data, known as
checksum field. The extended data is transmitted across the network.

Suppose L is the total sum of the data segments, then the checksum
would be ?L

1. The Sender 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 t
o get the sum.
4. The sum is complemented and it becomes the checksum field.
5. The original data and checksum field are sent across the network.
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 al
gorithm 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 discarded.
Cyclic Redundancy Check (CRC)
CRC is a redundancy error technique used to determine the error.

Following are the steps used in CRC for error detection:

o In CRC technique, a string of n 0s is appended to the data unit, and this n


number is less than the number of bits in a predetermined number, known
as division which is n+1 bits.
o Secondly, the newly extended data is divided by a divisor using a process
is known as binary division. The remainder generated from this division is
known as CRC remainder.
o Thirdly, the CRC remainder replaces the appended 0s at the end of the
original data. This newly generated unit is sent to the receiver.
o The receiver receives the data followed by the CRC remainder. The
receiver will treat this whole unit as a single unit, and it is divided by the
same 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 is accepted.
If the resultant of this division is not zero which means that the data
consists of an error. Therefore, the data is discarded.

Let's understand this concept through an example:

Suppose the original data is 11100 and divisor is 1001.

CRC Generator
o A CRC generator uses a modulo-2 division. Firstly, three zeroes are
appended at the end of the data as the length of the divisor is 4 and we
know that the length of the string 0s to be appended is always one less
than the length of the divisor.
o Now, the string becomes 11100000, and the resultant string is divided by
the 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.
CRC Checker
o The functionality of the CRC checker is similar to the CRC generator.
o When the string 11100111 is received at the receiving end, then CRC
checker performs the modulo-2 division.
o A string is divided by the same divisor, i.e., 1001.
o In this case, CRC checker generates the remainder of zero. Therefore, the
data is accepted.
Error Correction
Error Correction codes are used to detect and correct the errors when
data is transmitted from the sender to the receiver.

Hamming Code
In Computer Networks, Hamming code is used for the set of error-correction
codes which may occur when the data is moved from the sender to the receiver.
The hamming method corrects the error by finding the state at which the error
has occurred.

Parity bits: The bit which is appended to the original data of binary bits
so that the total number of 1s is even or odd.

Even parity: To check for even parity, if the total number of 1s is even,
then the value of the parity bit is 0. If the total number of 1s occurrences
is odd, then the value of the parity bit is 1.

Odd Parity: To check for odd parity, if the total number of 1s is even,
then the value of parity bit is 1. If the total number of 1s is odd, then the
value of parity bit is 0.
Unrestricted Simplex Protocol
Data transmitting is carried out in one direction only. The transmission
(Tx) and receiving (Rx) are always ready and the processing time can be
ignored. In this protocol, infinite buffer space is available, and no errors
are occurring that is no damage frames and no lost frames.
The Unrestricted Simplex Protocol is diagrammatically represented as
follows −

Simplex Stop and Wait protocol


In this protocol we assume that data is transmitted in one direction only.
No error occurs; the receiver can only process the received information at
finite rate. These assumptions imply that the transmitter cannot send
frames at rate faster than the receiver can process them.
The main problem here is how to prevent the sender from flooding the
receiver. The general solution for this problem is to have the receiver
send some sort of feedback to sender, the process is as follows −
Step1 − The receiver send the acknowledgement frame back to the
sender telling the sender that the last received frame has been processed
and passed to the host.
Step 2 − Permission to send the next frame is granted.
Step 3 − The sender after sending the sent frame has to wait for an
acknowledge frame from the receiver before sending another frame.
This protocol is called Simplex Stop and wait protocol, the sender sends
one frame and waits for feedback from the receiver. When the ACK
arrives, the sender sends the next frame.
The Simplex Stop and Wait Protocol is diagrammatically represented as
follows −

(Note: More about unrestricted simplex protocol and


stop and wait protocol refer class notes.)
Assignment questions.
1. Define the following
i. Flow control
ii. Error control
iii. Framing
iv. Hamming codes
v. Error detection codes
vi. Crc
vii. Checksum
[Link] design issues in DLL.
3. Explain framing methods.
4. Explain elementary data link protocols in detail.

You might also like