Unit 5 Data Link
Unit 5 Data Link
LAYERS
• Data link layer is responsible for converting
data stream to signals bit by bit and to send
that over the underlying hardware.
• At the receiving end, Data link layer picks up
data from hardware which are in the form of
electrical signals, assembles them in a
recognizable frame format, and hands over to
upper layer.
• Data link layer has two sub-layers:
• Logical Link Control: It deals with protocols,
flow-control, and error control
• Media Access Control: It deals with actual control of
media
services of Data Link Layer:
• Framing
• Addressing
• Error Control
• Flow Control
• Framing Framing is a point-to-point connection between two computers
or devices consisting of a wire in which data is transmitted as a stream of
bits.
• However, these bits must be framed into discernible blocks of
information.
• 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.
• Frames have headers that contain information such as error-checking
codes.
• At the data link layer, it extracts the message from the sender and
provides it to the receiver by providing the sender’s and receiver’s
addresses. The process of dividing the data into frames and reassembling
it is transparent to the user and is handled by the data link layer. Framing
is an important aspect of data link layer protocol design because it allows
the transmission of data to be organized and controlled
A frame has the following parts −
• Frame Header − It contains the source and the
destination addresses of the frame.
• Payload field − It contains the message to be delivered.
• Trailer − It contains the error detection and error
correction bits.
• Flag − It marks the beginning and end of the frame
Types of framing
• 1. Fixed-size: The frame is of fixed size and
there is no need to provide boundaries to the
frame, the length of the frame itself acts as a
delimiter.
• Drawback: It suffers from internal
fragmentation if the data size is less than the
frame size
• Solution: Padding
• Variable size: The size of the frame is variable
during this form of framing.
• In variable-size framing, we are in need of a
way to outline the tip of the frame and also
the starting of the succeeding frame.
• This can be utilized in local area networks
(LAN).
• 2.1 Length field–To confirm the length of the
field, a length field is used. It is utilized in
Ethernet (1EEE 802.3).
• 2.2 End Delimeter–To confirm the size of the
frame, a pattern is worn as a delimiter.
Bit Stuffing
• Bit-Oriented Framing Most protocols use a
special 8-bit pattern flag 01111110 as a result of
the delimiter to stipulate the beginning and so the
end of the frame.
• Bit stuffing is completed at the sender end and
bit removal at the receiver end.
• If we have a tendency to get a zero(0) after 5 1s.
we have a tendency to tend to still stuff a zero(0).
The receiver will remove the zero. Bit stuffing is in
addition said as bit stuffing.
Byte stuffing:
The receiver receives frames one by one. It keeps track of incoming frame’s
sequence number and sends the corresponding acknowledgment frames.
• After the sender has sent all the frames in window, it checks up to what
sequence number it has received positive acknowledgment.
• If the sender has received positive acknowledgment for all the frames, it
sends next set of frames.
• If sender receives NACK or has not receive any ACK for a particular frame, it
retransmits all the frames after which it does not receive any positive ACK
Selective Repeat ARQ
• • Both the sender and the receiver have buffers called
sending window and receiving window respectively
• . • The sender sends multiple frames based upon the
sending-window size, without receiving the
acknowledgment of the previous ones.
• • The receiver also receives multiple frames within the
receiving window size.
• • The receiver keeps track of incoming frame’s sequence
numbers, buffers the frames in memory.
• • It sends ACK for all successfully received frames and sends
NACK for only frames which are missing or damaged. • The
sender in this case, sends only packet for which NACK is
received.
Data link layer protocols
• Data link layer protocol is generally responsible to simply ensure
and confirm that the bits and bytes that are received are identical
to bits and bytes being transferred. SDLC, HDLC, SLIP, PPP, LCP,
LAP, and NCP are some of the data link layer protocols.
• SDLC: SDLC stands for synchronous data link control
protocol, is a communication protocol of a computer.
• It is usually used to carry system network architecture
traffic.
• Synchronous data link protocol connects all the remote
devices to the mainframe computer at the Central location.
• This connection is done in two formats, point to point
format i.e. one to one connection, and point to multipoint
format, i.e. one to many connections.
• SDLC support one to many connections even in case of error
detection or error recovery.
• SDLC ensures that all the received data units are correct and
flow is right from one network point to the next network
point.
• HDLC: HDLC stands for High-level data link control protocol, is a
bit-orientated code transparent synchronous protocol developed by ISO
(International organization for standardization) in1979.
• It provides both connection-orientated and connectionless services.
• HDLC protocol contains various wide-area protocols. It is based on the
SDLC protocol that supports both point-to-point and multipoint
communication.
• HDLC frames are transferred over synchronous or asynchronous serial
communication links. HDLC uses various modes such as normal response
mode, asynchronous response mode, asynchronous balanced mode.
• Normal response mode is used to share the secondary to primary link
without contention.
• asynchronous response mode is used for full-duplex links. asynchronous
balanced mode, support combined terminal which can act as both primary
and secondary
SLIP
• SLIP stands for Serial line interface protocol which is
used to add framing byte at the end of the IP Packet.
• SLIP is a data link layer protocol That transforms the IP
packets among ISP (Internet Service Providers) and
home user over dial-up links.
• SLIP is designed to work with ports and router
connections. SLIP does not provide error detection,
being reliant on upper-layer protocols for this.
Therefore, SLIP on its own is not satisfactory over an
error-prone dial-up connection.
LCP
• LCP stands for Link control protocol, is a part of
point-to-point control protocol. LCP packets
determine the standards of data transmission.
• LCP protocol is used to determine the identity of
the linked devices, if the device is correct it
accepts it otherwise it rejects the device.
• It also determines whether the size of the packet
is accepted or not.
• If requirements exceed the parameters, then the
link control protocol terminates that link
LAP
• LAP stands for Link access procedure is a data link
layer protocol that is used for framing and
transfer the data across point-to-point links.
• There are three types of Link access procedure –
LAPB ( Link Access procedure balanced),LAPF (
Link Access Procedure Frame-Mode Bearer
Services), and LAPD (Link Access Procedure
D-Channel.
• LAP was originally derived from HDLC (High-Level
Data Link Control), but was later updated and
renamed LAPB (LAP Balanced)
PPP