2 Unit-2
2 Unit-2
Design Issues, Services Provided to the Network Layer, Framing, Error Control, Flow
Control, Error Detection and Correction, Error Correcting Codes, Error Detecting Codes, A
Simplex Stop and Wait Protocol for an Error free channel, A Simplex Stop and Wait Protocol
for a Noisy Channel, Sliding Window Protocols (A One Bit Sliding Window Protocol-A
Protocol Using Go-Back-NA Protocol Using Selective Repeat), Data Link Layer in HDLC:
Configuration and transmission modes, frames, control fields.
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.
The data link layer receives the information in the form of packets from the
Network layer, it divides packets into frames and sends those frames bit-by-bit
to the underlying physical layer.
Design Issues of Data Link Layer
The data link layer is supposed to carry out many specified functions. It is
responsible for effective data communication between two directly connected
transmitting and receiving stations.
The data link layer has to carry out several specific functions and the following
are the main design issues of data link layer:
Data transfer
Frame synchronization
Flow control
Error control
Addressing
Link management.
Provide Services to the Network Layer
The data link layer provides a well-defined service interface to the network layer.
The principle of services is to transfer data from the network layer on the source
machine to the network layer on the destination machine.
The transfer is done through DDL(Dynamic-link layer). The data link layer takes
services from the physical layer and provides well-defined services to the
network layer.
Datalink layer provides three types of services as follows:
Unacknowledged connectionless service
Acknowledged connection service
Acknowledged connection-oriented service.
Frame Synchronization
Frame synchronization is one form the design issues of data link layer. The
source machine sends data in a block called frame to the destination machine.
The starting and ending of each frame must be recognized by the destination
machine.
For frame recognization, every frame comprises three parts, such as frame
header, payload field (contains data packet from the network layer) and trailer.
Flow Control
The source machine should not send a data frame at a fast data rate as compared
to the destination machine receiving data rate. When the sender sends the data at
a high speed, the slow receiver cannot able to handle it and the frame can lose in
such cases.
The physical layer doesn‟t know anything about the frames. It takes individual
bits and converts them into equivalent signals before sending them. Now, the
receiving device's physical layer has to convert these bits into frames, but
certain problems need to be discussed before that.
Challenges in Framing
1. For example, the sending device sends 100 bits of data, out of which 50
bits belong to frame one. The receiving device receives all the bits. How
will the receiver know that up to 50 bits belong to the frame?
Solution: Some protocols are defined between the devices before beginning
with the communication and data exchange. Let both the devices agree
that the frame's start and end will be 11011 (added with the header and
trailer). The frame received by the receiving device will look like this
1101101101101011011.
Bit-Oriented Approach
It views the frames as a collection of bits. The data is transmitted as a sequence
of bits that can be interpreted as text andmultimedia data in the upper layer.
Receiver Window
o At the beginning of transmission, the receiver window does not contain n
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. When acknowledgement is received, then only sender will send or transfer the
next frame. This process is continued until sender transmits EOT (End of
Transmission) frame. In this method, only one of frames can be in transmission at
a time. It leads to inefficiency i.e. less productivity if propagation delay is very
much longer than the transmission delay and Ultimately In this method sender
sent single frame and receiver take one frame at a time and sent
acknowledgement(which is next frame number only) for new frame.
At the other end, the receiver performs division operation on codewords using the
same CRC divisor. If the remainder contains all zeros the data bits are accepted,
otherwise it is considered as there some data corruption occurred in transit.
Error Correction
In the digital world, error correction can be done in two ways:
Backward Error Correction When the receiver detects an error in the
data received, it requests back the sender to retransmit the data unit.
Forward Error Correction When the receiver detects some error in the
data received, it executes error-correcting code, which helps it to auto-
recover and to correct some kinds of errors.
Basic approach used for error detection is the use of redundancy bits, where
additional bits are added to facilitate detection of errors.
Some popular techniques for error detection are:
1. Simple Parity check
2. Two-dimensional Parity check
3. Checksum
4. Cyclic redundancy check
Example :
Hamming Code
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.
Algorithm of Hamming code:
o An information of 'd' bits are added to the redundant bits 'r' to form d+r.
o The location of each of the (d+r) digits is assigned a decimal value.
o The 'r' bits are placed in the positions 1,2,......................2k-1.
Noiseless Channel :
An idealistic channel in which no frames are lost, corrupted or duplicated. The
protocol does not implement error control in this category. There are two
protocols for the noiseless channel as follows.
}
Flow Diagram :
This Flow Diagram shows an example of communication using the
simplest protocol. It is very straightforward. The sender sends a series of
frames without further consideration about the receiver. Let‟s take an
example, three frames will send from the sender, and three frames
received by receivers. Bear in mind the data frames are shown by tilted
boxes; the height of the box defines the transmission time difference
between the first bit and the last bit in the frame.
b. Then, the receiver sends the acknowledgment for the 0th frame
d. Accordingly, the receiver sends the acknowledgement for the 1st frame, and
upon receiving that, the sender slides the window again and sends the next
frame. This process keeps on happening until all the frames are sent
successfully.
2. Selective Repeat ARQ:
Selective Repeat ARQ (Selective Repeat Automatic Repeat Request) is
another name for Selective Repeat ARQ. A sliding window method is used in
this data link layer protocol. If the frame has fewer errors, Go-Back-N ARQ
works well. However, if the frame contains a lot of errors, sending the frames
again will result in a lot of bandwidth loss. As a result, we employ the
Selective Repeat ARQ method. The size of the sender window is always equal
to the size of the receiver window in this protocol. The sliding window‟s size
is always greater than 1.
Example of Selective Repeat ARQ:
HDLC Frame
HDLC is a bit - oriented protocol where each frame contains up to six fields.
The structure varies according to the type of frame. The fields of a HDLC
frame are −
Flag − It is an 8-bit sequence that marks the beginning and the end of
the frame. The bit pattern of the flag is 01111110.
Address − It contains the address of the receiver. If the frame is sent by
the primary station, it contains the address(es) of the secondary
station(s). If it is sent by the secondary station, it contains the address
of the primary station. The address field may be from 1 byte to
several bytes.