0% found this document useful (0 votes)
14 views5 pages

DLL Basics and Framing 2023-24

The data link layer (DLL) transforms raw transmission facilities into error-free lines by encapsulating data from the network layer into frames and managing transmission errors through error detection and correction. It provides various services, including unacknowledged connectionless, acknowledged connectionless, and connection-oriented services, each catering to different reliability needs. Framing methods such as byte count, byte stuffing, bit stuffing, and physical layer coding violations are employed to ensure proper data transmission and synchronization.

Uploaded by

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

DLL Basics and Framing 2023-24

The data link layer (DLL) transforms raw transmission facilities into error-free lines by encapsulating data from the network layer into frames and managing transmission errors through error detection and correction. It provides various services, including unacknowledged connectionless, acknowledged connectionless, and connection-oriented services, each catering to different reliability needs. Framing methods such as byte count, byte stuffing, bit stuffing, and physical layer coding violations are employed to ensure proper data transmission and synchronization.

Uploaded by

ligeg56283
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Data Link Layer

As we know the main task of the data link layer is to transform a raw transmission facility into a line
that appears free of undetected transmission errors. It does so by masking the real errors so the network
layer does not see them. To accomplishes this DLL breaks up the input data into data frames
(typically a few hundred or a few thousand bytes) and transmit the frames sequentially.

If the service is reliable, the receiver confirms correct receipt of each frame by sending back an
acknowledgement frame.

Data link layer also deals with mechanism to manage the transmission between fast sender and slow
receiver.

The data link layer uses the services of the physical layer to send and receive bits over communication
channels. It performs following functions,
1. Providing a well-defined service interface to the network layer.
2. Dealing with transmission errors, i.e. Error Detection and Error Correction.
3. Regulating the flow of data between fast sender and slow receivers, i.e. Flow Control.

To accomplish above functions, DLL carries out following tasks,

Gets packet from the Network Layer and encapsulate them into frames for transmission.
Includes/Adds Header and Trailer for packet and forms the Frame.

The function of the data link layer is to provide services to the network layer. The principal service is
transferring data from the network layer on the source machine to the network layer on the destination
machine.

Following block represents virtual data path (a) and Actual data path (b).
DLL can de designed to offer various services and services may vary protocol to protocol. Following
are few services,

1. Unacknowledged connectionless service.


2. Acknowledged connectionless service.
3. Acknowledged connection-oriented service.

Unacknowledged connectionless service consists of having the source machine send independent
frames to the destination machine without having the destination machine acknowledge them.
Ethernet is a good example of a data link layer that provides this class of service. More on Ethernet will be
covered later...

No logical connection is established beforehand or released afterward. If a frame is lost due to noise on
the line, no attempt is made to detect the loss or recover from it in the data link layer. This class of
service is appropriate when the error rate is very low, so recovery is left to higher layers. It is also
appropriate for real-time traffic, such as voice, in which late data are worse than bad data.

Acknowledged connectionless service, there are still no logical connections used, but each frame sent is
individually acknowledged. In this way, the sender knows whether a frame has arrived correctly or been lost. If
it has not arrived within a specified time interval, it can be sent again.

This service is useful over unreliable channels, such as wireless systems. 802.11 (WiFi) is a good example of
this class of service.

Connection-oriented service. With this service, the source and destination machines establish a connection
before any data are transferred. Each frame sent over the connection is numbered, and the data link layer
guarantees that each frame sent is indeed received. Furthermore, it guarantees that each frame is received
exactly once and that all frames are received in the right order. Connection-oriented service thus provides the
network layer processes with the equivalent of a reliable bit stream.

When connection-oriented service is used, transfers go through three distinct phases.

First phase, the connection is established by having both sides initialize variables and counters needed to keep
track of which frames have been received and which ones have not.

Second phase, one or more frames are actually transmitted.

Third phase, the connection is released, freeing up the variables, buffers, and other resources used to maintain
the connection.

Framing
Framing is a function of the data link layer. It provides a way for a sender to transmit a set of bits
that are meaningful to the receiver.
Ethernet, token ring, frame relay, and other data link layer technologies have their own frame
structures.
Frames have headers that contain information such as error-checking codes. The advantage of using
frames is that data is broken up into recoverable chunks that can easily be checked for corruption.

The data link layer to break up the bit stream into discrete frames, compute a short token called a
checksum for each frame, and include the checksum in the frame when it is transmitted. (Checksum
algorithms will be discussed later...) When a frame arrives at the destination, the checksum is
recomputed. If the newly computed checksum is different from the one contained in the frame, the data
link layer knows that an error has occurred and takes steps to deal with it like, for example discarding
the bad frame and possibly also sending back an error report.
Breaking up the bit stream into frames is more difficult than it appears. A good design must make it
easy for a receiver to find the start of new frames while using little of the channel bandwidth.

Following are four methods for Framing,


1. Byte count.
2. Flag bytes with byte stuffing.
3. Flag bits with bit stuffing.
4. Physical layer coding violations.

Byte Count, The first framing method uses a field in the header to specify the number of bytes in the
frame. When the data link layer at the destination sees the byte count, it knows how many bytes follow
and hence where the end of the frame is.

This technique is shown in following figure a, for four small example frames of sizes 5, 5, 8, and 8
bytes, respectively.

The trouble with this algorithm is that the count can be garbled by a transmission error. For example, if
the byte count of 5 in the second frame of above figure b becomes a 7 due to a single bit flip 0 to 1,
the destination will get out of synchronization.

It will then be unable to locate the correct start of the next frame. Even if the checksum is incorrect so
the destination knows that the frame is bad, it still has no way of telling where the next frame starts.
Sending a frame back to the source asking for a retransmission does not help either, since the
destination does not know how many bytes to skip over to get to the start of the retransmission.
For this reason, the byte count method is rarely used by itself.

Flag bytes with byte stuffing, this framing method solve the problem of resynchronization after an
error, by having each frame start and end with special bytes. Often the same byte, called a flag byte, is
used as both the starting and ending delimiter.

This byte is shown in following figure a as FLAG. Two consecutive flag bytes indicate the end of one
frame and the start of the next. Thus, if the receiver ever loses synchronization it can just search for
two flag bytes to find the end of the current frame and the start of the next frame.
However, there is a still a problem we have to solve. It may happen that the flag byte occurs in the
data, especially when binary data such as photographs or songs are being transmitted. This situation
would interfere with the framing.

One way to solve this problem is to have the sender’s data link layer insert a special escape byte (ESC)
just before each ‘‘accidental’’ flag byte in the data. Thus, a framing flag byte can be distinguished
from one in the data by the absence or presence of an escape byte before it. The data link layer on the
receiving end removes the escape bytes before giving the data to the network layer. This technique is
called byte stuffing.

Of course, the next question is: what happens if an escape byte occurs in the middle of the data? The
answer is that it, too, is stuffed with an escape byte. At the receiver, the first escape byte is removed,
leaving the data byte that follows it (which might be another escape byte or the flag byte). Some
examples are shown in above figure b.
In all cases, the byte sequence delivered after de-stuffing is exactly the same as the original byte
sequence. We can still search for a frame boundary by looking for two flag bytes in a row, without
bothering to undo escapes.

Flag bits with bit stuffing, this method of delimiting the bit stream removes the disadvantage of byte
stuffing, which uses 8-bit bytes. Framing can also be done at the bit level, so frames can contain an
arbitrary number of bits made up of units of any size.

Each frame begins and ends with a special bit pattern, 01111110. This pattern is a flag byte. Whenever
the sender’s data link layer encounters five consecutive 1s in the data, it automatically stuffs a 0 bit
into the outgoing bit stream. This bit stuffing is similar to byte stuffing, in which an escape byte is
stuffed into the outgoing character stream before a flag byte in the data.

It also ensures a minimum density of transitions that help the physical layer maintain synchronization.
USB (Universal Serial Bus) uses bit stuffing for this reason.

When the receiver sees five consecutive incoming 1 bits, followed by a 0 bit, it automatically de-stuffs
(i.e., deletes) the 0 bit.

Just as byte stuffing is completely transparent to the network layer in both computers, so is bit stuffing.
If the user data contain the flag pattern, 01111110, this flag is transmitted as 011111010 but stored in
the receiver’s memory as 01111110. Following figure a, b, c gives an example of bit stuffing.

(a) The original data. (b) The data as they appear on the line.
(c) The data as they are stored in the receiver’s memory after de-stuffing.
With both bit and byte stuffing, a side effect is that the length of a frame now depends on the contents of the
data it carries.

Physical layer coding violations, this framing method is to use a shortcut from the physical layer. We
can use some reserved signals to indicate the start and end of frames. In effect, we are using ‘‘coding
violations’’ to delimit frames. The beauty of this scheme is that, because they are reserved signals, it is
easy to find the start and end of frames and there is no need to stuff the data.

For example, in the 4B/5B line code 4 data bits are mapped to 5 signal bits to ensure sufficient bit
transitions.

Error Control

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy