0% found this document useful (0 votes)
51 views

The Data Link Layer: Dr. Ajay Singh Raghuvanshi

The document discusses the Data Link Layer, which is the second layer in the OSI model. It sits above the Physical Layer and below the Network Layer. The Data Link Layer ensures error-free data transfer between adjacent network nodes. It breaks data into frames for transmission and provides two main functions: reliable data transfer between peer layers and error/flow control to regulate frame flow. The Data Link Layer must provide framing to encapsulate bits from the Physical Layer into frames, add headers/trailers, and implement error control and flow control. It can offer unacknowledged connectionless service, acknowledged connectionless service, or acknowledged connection-oriented service.

Uploaded by

ashwin
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views

The Data Link Layer: Dr. Ajay Singh Raghuvanshi

The document discusses the Data Link Layer, which is the second layer in the OSI model. It sits above the Physical Layer and below the Network Layer. The Data Link Layer ensures error-free data transfer between adjacent network nodes. It breaks data into frames for transmission and provides two main functions: reliable data transfer between peer layers and error/flow control to regulate frame flow. The Data Link Layer must provide framing to encapsulate bits from the Physical Layer into frames, add headers/trailers, and implement error control and flow control. It can offer unacknowledged connectionless service, acknowledged connectionless service, or acknowledged connection-oriented service.

Uploaded by

ashwin
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 29

The Data Link Layer

Dr. Ajay Singh Raghuvanshi


Electronics & Telecommunication
Engineering, NIT, Raipur
The Data Link Layer
The Data Link Layer is the second layer in the transport
OSI model, above the Physical Layer, which
ensures that the error free data is transferred network
between the adjacent nodes in the network. It
breaks the datagrams passed down by above Data link
layers and convert them into frames ready for
transfer. This is called Framing. physical
It provides two main functionalities
 Reliable data transfer service between two peer network layers
 Error Control and Flow Control mechanism which regulates the
flow of frames such that data congestion is not there at slow
receivers due to fast senders

05/03/2020 Dr.Ajay Singh Raghuvanshi 2


Data Link Layer responsibility
 Algorithms for achieving:
 Reliable, Efficient, communication of a whole units – frames (as
opposed to bits – Physical Layer) between two machines.
 Two machines are connected by a communication channel that
acts conceptually like a wire (e.g., telephone line, coaxial cable, or
wireless channel).
 Essential property of a channel that makes it “wire-like” connection
is that the bits are delivered in exactly the same order in which
they are sent.
 For ideal channel (no distortion, unlimited bandwidth and no
delay) the job of data link layer would be trivial.
 However, limited bandwidth, distortions and delay makes this job
very difficult.
Function of Data Link Layer
Get packets from network layer, and encapsulate to frames

Takes the bits from Physical layer, and recover the frames

05/03/2020 Dr.Ajay Singh Raghuvanshi 4


Data Link Layer Functional Issues
 Physical layer delivers bits of information to and from data link
layer. The functions of Data Link Layer are:
1. Providing a well-defined service interface to the network
layer.
2. Dealing with transmission errors, Error Control.
3. Regulating the flow of data so that slow receivers are not
swamped by fast senders Flow Control.
 Data Link layer
 Takes the bits from Physical layer, and Encapsulates
them into frames
 Each frame has a frame header – a field for holding the
packet, and frame trailer. Frame Management is what Data
Link Layer does.
Data Link Layer Design Issues
•Network layer services
•Framing
•Error control
•Flow control and Flow
Management

05/03/2020 Dr.Ajay Singh Raghuvanshi 6


Network Layer Services

(a) Virtual communication. (b) Actual


communication.
Services Provided to the Network Layer
 Principal Service Function of the data link layer is to
transfer the data from the network layer on the
source machine to the network layer on the
destination machine.
 Process in the network layer that hands some bits
to the data link layer for transmission.
 Job of data link layer is to transmit the bits to the
destination machine so they can be handed over
to the network layer there.
Possible Services Offered
1. Unacknowledged connectionless service.
2. Acknowledged connectionless service.
3. Acknowledged connection-oriented service.

Unacknowledged Connectionless Service


It consists of having the source machine send independent
frames to the destination machine without having the destination
machine acknowledge them.
Example: Ethernet, Voice over IP, etc. in all the communication
channel were real time operation is more important that quality of
transmission.
Unacknowledged connectionless service
 The source machine send frames to the destination
machine without having the destination machine
acknowledged them.
 No logical connection is established before hand 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 DLL.
 This class of service is appropriate when the error rate
is very low so that recovery task is left for solution to
higher layers.
 It is also appropriate for real-time traffic, such as
voice, in which late data are worse than bad data.
 Most Wired LANs use unacknowledged
connectionless service in the DLL
05/03/2020 Dr.Ajay Singh Raghuvanshi 10
Acknowledged Connectionless Service
 Each frame send by the Data Link layer is acknowledged and
the sender knows if a specific frame has been received or
lost.
 Typically the protocol uses a specific time period that if has
passed without getting acknowledgment it will re-send the
frame.
 This service is useful for commutation when an unreliable
channel is being utilized (e.g., 802.11 WiFi).
 Network layer does not know frame size of the packets and
other restriction of the data link layer. Hence it becomes
necessary for data link layer to have some mechanism to
optimize the transmission.
Acknowledged connectionless service
 Is more reliable.
 Still no logical connections used, but each frame sent
is individually acknowledged.
 The sender knows whether a frame has arrived
correctly.
 If it has not arrived within a specific time interval, it can
be sent again.
 This service is useful over unreliable channels, such
as wireless system.
 If the large packet is broken up into frames, If individual
frames are acknowledged or retransmitted, entire
packets get through much faster than unbroken frame
that is lost, it may take a very long time for the packet to
get through..
05/03/2020 Dr.Ajay Singh Raghuvanshi 12
Acknowledged Connection Oriented Service
 Source and Destination establish a connection first.
 Each frame sent is numbered
 Data link layer guarantees that each frame sent is
indeed received.
 It guarantees that each frame is received only
once and that all frames are received in the
correct order.
 Examples:
 Satellite channel communication,
 Long-distance telephone communication, etc.
ACK- ed connection-oriented service
 The service requires established connection between
source/destination machines before data are transferred.
 Any frame sent over the connection is numbered, and the DLL
guarantees that each frame sent, is received, and are received
in the same order.
 With connectionless service, in contrast, it is possible that a lost
acknowledgement causes a packet to be sent several times and
thus received several times.
 When connection-oriented service is used, transfers go
through 3 distinct phases:
1. The connection is established, counters needed to keep track
of which frames have been received and which ones have not.
2. One or more frames are transmitted and acknowledged.
3. Connection is released, freeing up the variables - buffers and
other resources used to maintain the connection .

05/03/2020 Dr.Ajay Singh Raghuvanshi 14


Why Framing
 To provide service to the network layer the data link
layer must use the service provided to it by physical
layer.
 Stream of data bits provided to data link layer is not
guaranteed to be without errors.
 Errors could be:
 Number of received bits does not match number
of transmitted bits (deletion or insertion)
 Bit Value
 It is up to data link layer to correct the errors if
necessary.
Framing
 Transmission of the data link layer starts with
breaking up the bit stream
 into discrete frames
 Computation of a checksum for each frame, and
 Include the checksum into the frame before it is
transmitted.
 Receiver computes its checksum error for a
receiving frame and if it is different from the
checksum that is being transmitted will have to deal
with the error.
Framing Methods
1. Byte count.
2. Flag bytes with byte stuffing.
3. Flag bits with bit stuffing.
4. Physical layer coding violations, or
Error control.
Byte Count Framing Method
 It uses a field in the header to specify the number of
bytes in the frame.
 Once the header information is being received it will be
used to determine end of the frame.
 See figure in the next slide:
 Trouble with this algorithm is that when the count is
incorrectly received the destination will get out of synch
with transmission.
 Destination may be able to detect that the frame is in
error but it does not have a means (in this algorithm)
how to correct it.
Byte Count Framing

A byte stream. (a) Without errors. (b) With one


error.
Flag Bytes with Byte Stuffing Framing Method
 This methods gets around the boundary detection of the
frame by having each appended by the frame start and
frame end special bytes.
 If they are the same (beginning and ending byte in the frame)
they are called flag byte.
 In the next slide figure this byte is shown as FLAG.
 If the actual data contains a byte that is identical to the FLAG
byte (e.g., picture, data stream, etc.) the convention that can
be used is to have escape character inserted just before the
“FLAG” character.
Flag Bytes Framing

 A frame delimited by flag bytes.


 Four examples of byte sequences before and after byte stuffing.
Flag Byte with Bit Stuffing Framing Method
 This methods achieves the same thing as Byte Stuffing
method by using Bits (1) instead of Bytes (8 Bits).
 It was developed for High-level Data Link Control (HDLC)
protocol.
 Each frames begins and ends with a special bit patter:
 01111110 or 0x7E <- 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.
 USB uses bit stuffing.
Framing with Bit Stuffing

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.
Framing Summary
 Many data link protocols use a combination of
presented methods for safety. For example in
Ethernet or 802.3 and WiFi or 802.11 each
frame begin with a well-defined pattern called
a preamble.
 Preamble is typically 56-72 bits long with sync
field and start frame limiter.
 It is then followed by a length field specifing
length of frame.
Error Control Why
 After solving the marking of the frame with start and
end the data link layer has to handle eventual errors
in transmission or detection.
 Ensuring that all frames are delivered to the
network layer at the destination and in proper
order.
 Unacknowledged connectionless service: it is OK for
the sender to output frames regardless of its
reception.
 Reliable connection-oriented service: it is NOT OK.
Error Control
 Reliable connection-oriented service usually will
provide a sender with some feedback about what is
happening at the other end of the line.
 Receiver Sends Back Special Control Frames.
 If the Sender Receives positive Acknowledgment it
will know that the frame has arrived safely.
 Timer and Frame Sequence Number for the Sender is
Necessary to handle the case when there is no
response (positive or negative) from the Receiver .
Flow Control
 Important Design issue for the cases when the
sender is running on a fast powerful computer and
receiver is running on a slow low-end machine.
 Two approaches:
1. Feedback-based flow control
 Receiver sends back information to the sender giving it
permission to send more data, or Telling sender how
receiver is doing
2. Rate-based flow control
 Built in mechanism that limits the rate at which sender
may transmit data, without the need for feedback from the
receiver.
Error Detection and Correction
 Two basic strategies to deal with errors:
1. Include enough redundant information to enable
the receiver to deduce what the transmitted data
must have been.
Error correcting codes.
2. Include only enough redundancy to allow the
receiver to deduce that an error has occurred
(but not which error).
Error detecting codes.
Error Detection & Correction Code

1. Hamming codes (Block Code).


2. Binary convolutional codes.
3. Reed-Solomon codes.
4. Low-Density Parity Check codes.

05/03/2020 Dr.Ajay Singh Raghuvanshi 29

You might also like