0% found this document useful (0 votes)
28 views36 pages

Data Link Layer: Framing & Flow Control

The document provides an in-depth overview of the Data Link Layer, detailing its design issues, functions, and protocols such as framing, flow control, and error control. It discusses the two sub-layers of the Data Link Layer: Logical Link Control (LLC) and Media Access Control (MAC), along with various techniques for framing, flow control, and error detection and correction. Additionally, it covers the importance of addressing and link management in ensuring effective data communication between connected devices.

Uploaded by

pkaarthikeyani
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)
28 views36 pages

Data Link Layer: Framing & Flow Control

The document provides an in-depth overview of the Data Link Layer, detailing its design issues, functions, and protocols such as framing, flow control, and error control. It discusses the two sub-layers of the Data Link Layer: Logical Link Control (LLC) and Media Access Control (MAC), along with various techniques for framing, flow control, and error detection and correction. Additionally, it covers the importance of addressing and link management in ensuring effective data communication between connected devices.

Uploaded by

pkaarthikeyani
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

UNIT II:

Data link layer: Design issues, Framing: fixed size framing, variable size framing, flow control,
error control, error detection and correction codes, CRC, Checksum: idea, one’s complement
internet checksum, services provided to Network Layer, Elementary Data Link Layer protocols:
simplex protocol, Simplex stop and wait, Simplex protocol for Noisy Channel.
Sliding window protocol: One bit, Go back N, Selective repeat-Stop and wait protocol, Data link
layer in HDLC: configuration and transfer modes, frames, control field, point to point protocol
(PPP): framing transition phase, multiplexing, multi link PPP.

Data-link layer is the second layer after the physical layer. The data link layer is responsible for
maintaining the data link between two hosts or nodes.
The data link layer is divided into two sub-layers :
1. Logical Link Control Sub-layer (LLC) –
Provides the logic for the data link, Thus it controls the synchronization, flow control, and error
checking functions of the data link layer. Functions are –
• (i) Error Recovery.
• (ii) It performs the flow control operations.
• (iii) User addressin
2. Media Access Control Sub-layer (MAC) –
It is the second sub-layer of data-link layer. It controls the flow and multiplexing for transmission
medium. Transmission of data packets is controlled by this layer. This layer is responsible for
sending the data over the network interface card.
Functions are –
• (i) To perform the control of access to media.
• (ii) It performs the unique addressing to stations directly connected to LAN.
• (iii) Detection of errors.

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 less 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 recognition, 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.

There are two types of techniques that are used for flow control as follows.

• Rate based flow control


• Feedback based flow control.
Error Control

The errors made in bits during transmission from source to destination machines must be
detected and corrected. The data link layer ensures error -free data transmission. For this,
two types of error control techniques are used in the data link layer are as follows.

• Error detection techniques


• Error correction techniques
Addressing

Addressing is also one of the design issues of data link layer. On a multipoint line, the
identity of the individual machines must be specified while transmitting the data frames.
Each frame comprises a header in which the source and destination addresses are placed.

Link Management

The initiation, maintenance and termination of the link between the source and destination is
required for the effective exchange of data. The data link layer of the OSI Model handles
proper link management of connected devices.

Framing

In the physical layer, data transmission involves synchronized transmission of bits from the source to the
destination. The data link layer packs these bits into frames.
Data-link layer takes the packets from the Network Layer and encapsulates them into frames. If the frame
size becomes too large, then the packet may be divided into small sized frames. Smaller sized frames makes
flow control and error control more efficient.
Then, it sends each frame bit-by-bit on the hardware. At receiver’s end, data link layer picks up signals from
hardware and assembles them into frames.

Parts of a Frame
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

Framing can be of two types, fixed sized framing and variable sized framing.
Fixed-sized Framing
Here the size of the frame is fixed and so the frame length acts as delimiter of the frame. Consequently, it
does not require additional boundary bits to identify the start and end of the frame.
Example − ATM cells.
• Drawback: It suffers from internal fragmentation if the data size is less than the frame size
• Solution: Padding
Variable – Sized Framing
In this, there is a need to define the end of the frame as well as the beginning of the next frame to
distinguish. This can be done in two ways:

1. Length field – We can introduce a length field in the frame to indicate the length of the frame. Used
in Ethernet(802.3). The problem with this is that sometimes the length field might get corrupted.
2. End Delimiter (ED) – We can introduce an ED(pattern) to indicate the end of the frame. Used
in Token Ring. The problem with this is that ED can occur in the data. This can be solved by:
1. Character/Byte Stuffing: Used when frames consist of characters. If data contains ED then, a byte
is stuffed into data to differentiate it from ED.
Let ED = “$” –> if data contains ‘$’ anywhere, it can be escaped using ‘\O’ character.
–> if data contains ‘\O$’ then, use ‘\O\O\O$'($ is escaped using \O and \O is escaped using \O).

Disadvantage – It is very costly and obsolete method.

[Link] Stuffing: Let ED = 01111 and if data = 01111


–> Sender stuffs a bit to break the pattern i.e. here appends a 0 in data = 011101.
–> Receiver receives the frame.
–> If data contains 011101, receiver removes the 0 and reads the data.
Flow control in Data Link Layer

Flow control is a technique that allows two stations working at different speeds to
communicate with each other. It is a set of measures taken to regulate the amount of data
that a sender sends so that a fast sender does not overwhelm a slow receiver. In data link
layer, flow control restricts the number of frames the sender can send before it waits for an
acknowledgment from the receiver.

Approaches of Flow Control


Flow control can be broadly classified into two categories −

Feedback based Flow Control: In these protocols, the sender sends frames after it has
received acknowledgments from the user. This is used in the data link layer.

Rate based Flow Control :These protocols have built in mechanisms to restrict the rate of
transmission of data without requiring acknowledgment from the receiver. This is used in
the network layer and the transport layer.
Flow Control Techniques in Data Link Layer

Data link layer uses feedback based flow control mechanisms. There are two main techniques −

Sliding Window

This protocol improves the efficiency of stop and wait protocol by allowing multiple frames to be
transmitted before receiving an acknowledgment.
The working principle of this protocol can be described as follows −
• Both the sender and the receiver has finite sized buffers called windows. The sender and the receiver
agrees upon the number of frames to be sent based upon the buffer size.
• The sender sends multiple frames in a sequence, without waiting for acknowledgment. When its
sending window is filled, it waits for acknowledgment. On receiving acknowledgment, it advances
the window and transmits the next frames, according to the number of acknowledgments received.

Stop and Wait Flow control:


• The sender has to wait for an acknowledgment of every frame that it sends.
• Only when a acknowledgment has been received is the next frame sent. This process continues until the
sender transmits an End of Transmission (EOT) frame.
• In Stop-and-Wait flow control, the receiver indicates its readiness to receive data for each frame.

• For every frame that is sent, there needs to be an acknowledgment, which takes a similar amount of
propagation time to get back to the sender.
• Only one frame can be in transmission at a time. This leads to inefficiency if propagation delay is much
longer than the transmission delay
• Advantages of Stop and Wait:
• It’s simple and each frame is checked and acknowledged well.
• Disadvantages of Stop and Wait:
• Only one frame can be in transmission at a time.
• It is inefficient, if the distance between devices is long. Reason is propagation delay is much longer
than the transmission delay.
• The time spent for waiting acknowledgements between each frame can add significant amount to the
total transmission time

Sliding Window Flow Control:


• It works by having the sender and receiver have a “window” of frames.
• Each frame has to be numbered in relation to the sliding window. For a window of size n, frames get a
number from 0 to n – 1. Subsequent frames get a number mod n.
• The sender can send as many frames as would fit into a window.
• The receiver, upon receiving enough frames, will respond with an acknowledgment of all frames up to a
certain point in the window. It is called slide.
• This window can hold frames at either end and provides the upper limit on the number of frames that can
be transmitted before requiring an acknowledgement.
• For example, if n = 8, the frames are numbered 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1…so on. The
size of the window is (n -1) = 7.
• When the receiver sends an ACK, it includes the number of the next frame it expects to receive. When the
receiver sends an ACK containing the number 5, it means all frames upto number 4 have been received.

Error Control Techniques in Data Link Layer

Error Control: Error control in the data link layer is based on ARQ (automatic repeat request), which is the
retransmission of data.
• The term error control refers to methods of error detection and retransmission.
• Anytime an error is detected in an exchange, specified frames are retransmitted. This process is called
ARQ Automatic Repeat Request).
To ensure reliable communication, there needs to exist flow control (managing the amount of data the sender
sends), and error control (that data arrives at the destination error free).

• Flow and error control needs to be done at several layers.


• For node-to-node links, flow and error control is carried out in the data-link layer.
• For end-point to end-point, flow and error control is carried out in the transport layer.

Error Detection
When bits are transmitted over the computer network, they are subject to get corrupted due to interference
and network problems. The corrupted bits leads to spurious data being received by the receiver and are
called errors.
Error detection techniques are responsible for checking whether an error has occurred or not in the frame
that has been transmitted via the network. It does not take into account the number of error bits and the type
of error.
For error detection, the sender needs to send some additional bits along with the data bits. The receiver
performs necessary checks based upon the additional redundant bits. If it finds that the data is free from
errors, it removes the redundant bits before passing the message to the upper layers.
There are three main techniques for detecting errors in data frames: Parity Check, Checksum and Cyclic
Redundancy Check (CRC).

Parity Bits
The parity check is done by adding an extra bit, called parity bit, to the data to make the number of 1s either
even or odd depending upon the type of parity. The parity check is suitable for single bit error detection
only.
The two types of parity checking are
• Even Parity − Here the total number of bits in the message is made even.
• Odd Parity − Here the total number of bits in the message is made odd.

Error Detection by Parity Check


Sender’s End − While creating a frame, the sender counts the number of 1s in it and adds the parity bit the
value of which is determined as follows -
• In the case of even parity: If a number of 1s is even, the parity bit value is 0. If a number of 1s is odd,
the parity bit value is 1.
• In case of odd parity: If a number of 1s is odd, the parity bit value is 0. If a number of 1s is even, the
parity bit value is 1.

Receiver’s End − On receiving a frame, the receiver counts the number of 1s in it. In case of even parity
check, if the count of 1s is even, the frame is accepted, otherwise, it is rejected. In case of odd parity check,
if the count of 1s is odd, the frame is accepted, otherwise, it is rejected.
Example
Suppose that a sender wants to send the data 1001101 using even parity check method. It will add the parity
bit as shown below.

The receiver will decide whether an error has occurred by counting whether the total number
of 1s is even.
Cyclic Redundancy Check (CRC):
• CRC is based on binary division.
• A sequence of redundant bits called CRC or the CRC remainder is appended to the end of a data unit, so
that the resulting data unit becomes exactly divisible by a second, predetermined binary number.
• At its destination, the incoming data unit is divided by the same number. If at this step there is no
remainder, the data unit is assumed to be intact and therefore is accepted.
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.

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.

Checksum
• There are two algorithms involved in this process, checksum generator at sender end and checksum
checker at receiver end.
Error Detection by Checksums
For error detection by checksums, data is divided into fixed sized frames or segments.
• Sender’s End − The sender adds the segments using 1’s complement arithmetic to get the sum. It
then complements the sum to get the checksum and sends it along with the data frames.
• Receiver’s End − The receiver adds the incoming segments along with the checksum using 1’s
complement arithmetic to get the sum and then complements it.
If the result is zero, the received frames are accepted; otherwise they are discarded.
Example
Suppose that the sender wants to send 4 frames each of 8 bits, where the frames are 11001100, 10101010,
11110000 and 11000011.

The sender adds the bits using 1s complement arithmetic. While adding two numbers using 1s complement
arithmetic, if there is a carry over, it is added to the sum.
After adding all the 4 frames, the sender complements the sum to get the checksum, 11010011, and sends it
along with the data frames.
The receiver performs 1s complement arithmetic sum of all the frames including the checksum. The result is
complemented and found to be 0. Hence, the receiver assumes that no error has occurred.

Error Correction:
• Error correction in data link layer is implemented simply anytime.
• An error is detected in an exchange, a negative acknowledgement NAK is returned and the specified
frames are retransmitted. This process is called Automatic Repeat Request (ARQ).
• Retransmission of data happens in three Cases: Damaged frame, Lost frame and Lost acknowledgement.
1. Stop-and-Wait ARQ : Stop-and-Wait ARQ is also known as alternating bit protocol. It is
one of simplest flow and error control techniques or mechanisms. This mechanism is
generally required in telecommunications to transmit data or information among two
connected devices. Receiver simply indicates its readiness to receive data for each frame. In
these, sender sends information or data packet to receiver. Sender then stops and waits for
ACK (Acknowledgment) from receiver. Further, if ACK does not arrive within given time
period i.e., time-out, sender then again resends frame and waits for ACK. But, if sender
receives ACK, then it will transmit the next data packet to receiver and then again wait for
ACK from receiver. This process to stop and wait continues until sender has no data frame
or packet to send.

2. Sliding Window ARQ : This technique is generally used for continuous transmission error
control. It is further categorized into two categories as given below :
• Go-Back-N ARQ : Go-Back-N ARQ is form of ARQ protocol in which transmission process
continues to send or transmit total number of frames that are specified by window size even without
receiving an ACK (Acknowledgement) packet from the receiver. It uses sliding window flow control
protocol. If no errors occur, then operation is identical to sliding window.

Piggybacking Protocol
In some protocols data frames flow in only one direction although control information such as ACK and
NAK frames can travel in the other direction. In real life, data frames are normally flowing in both
directions, from node A to node B and from node B to node A. This means that the control information also
needs to flow in both directions.
A technique called piggybacking is used to improve the efficiency of the bidirectional protocols.
When a frame is carrying data from A to B, it can also carry control information about arrived (or lost)
frames from B; when a frame is carrying data from B to A, it can also carry control information about the
arrived (or lost) frames from A.
The design for a Go-Back-N ARQ using piggybacking is in the following figure.
• Selective Repeat ARQ : Selective Repeat ARQ is also form of ARQ protocol in which only
suspected or damaged or lost data frames are only retransmitted. This technique is similar to Go -
Back-N ARQ though much more efficient than the Go-Back-N ARQ technique due to reason that it
reduces number of retransmission. In this, the sender only retransmits frames for which NAK is
received. But this technique is used less because of more complexity at sender and receiver and each
frame must be needed to acknowledged individually.

Error Detection & Correction Codes

We know that the bits 0 and 1 corresponding to two different range of analog voltages. So, during
transmission of binary data from one system to the other, the noise may also be added. Due to this, there may
be errors in the received data at other system.
That means a bit 0 may change to 1 or a bit 1 may change to 0. We can’t avoid the interference of noise. But,
we can get back the original data first by detecting whether any errors s present and then correcting those
errors. For this purpose, we can use the following codes.
• Error detection codes
• Error correction codes

• Error detection codes − are used to detect the errors s present in the received data bitstream. These
codes contain some bits s, which are included appended appended to the original bit stream. These
codes detect the error, if it is occurred during transmission of the original data bitstream
Example − Parity code, Hamming code.
• Error correction codes − are used to correct the errors s present in the received data bitstream so
that, we will get the original data. Error correction codes also use the similar strategy of error
detection codes. Example − Hamming code.
• Therefore, to detect and correct the errors, additional bits s are appended to the data bits at the time of
transmission.

Parity Code
It is easy to include append one parity bit either to the left of MSB or to the right of LSB of original bit
stream. There are two types of parity codes, namely even parity code and odd parity code based on the type
of parity being chosen.

Even Parity Code


The value of even parity bit should be zero, if even number of ones present in the binary code. Otherwise, it
should be one. So that, even number of ones present in even parity code. Even parity code contains the data
bits and even parity bit.
The following table shows the even parity codes corresponding to each 3-bit binary code. Here, the even
parity bit is included to the right of LSB of binary code.

Binary Even Even


Code Parity bit Parity
Code

000 0 0000

001 1 0011

010 1 0101

011 0 0110

100 1 1001

101 0 1010

110 0 1100

111 1 1111

Here, the number of bits present in the even parity codes is 4. So, the possible even number of ones in these
even parity codes are 0, 2 & 4.
• If the other system receives one of these even parity codes, then there is no error in the received data.
The bits other than even parity bit are same as that of binary code.
• If the other system receives other than even parity codes, then there will be an errorss in the received
data. In this case, we can’t predict the original binary code because we don’t know the bit
positionss of error.
Therefore, even parity bit is useful only for detection of error in the received parity code. But, it is not
sufficient to correct the error.
Odd Parity Code
The value of odd parity bit should be zero, if odd number of ones present in the binary code. Otherwise, it
should be one. So that, odd number of ones present in odd parity code. Odd parity code contains the data
bits and odd parity bit.
The following table shows the odd parity codes corresponding to each 3-bit binary code. Here, the odd
parity bit is included to the right of LSB of binary code.
Binary Odd Odd
Code Parity bit Parity
Code

000 1 0001

001 0 0010

010 0 0100

011 1 0111

100 0 1000

101 1 1011

110 1 1101

111 0 1110

Here, the number of bits present in the odd parity codes is 4. So, the possible odd number of ones in these
odd parity codes are 1 & 3.
• If the other system receives one of these odd parity codes, then there is no error in the received data.
The bits other than odd parity bit are same as that of binary code.
• If the other system receives other than odd parity codes, then there is an errors s in the received data.
In this case, we can’t predict the original binary code because we don’t know the bit positions s of
error.
Therefore, odd parity bit is useful only for detection of error in the received parity code. But, it is not
sufficient to correct the error.
Hamming code

Hamming code is a set of error-correction codes that can be used to detect and correct the errors that
can occur when the data is moved or stored from the sender to the receiver. It is a technique developed by
R.W. Hamming for error correction. Redundant bits – Redundant bits are extra binary bits that are
generated and added to the information-carrying bits of data transfer to ensure that no bits were lost during
the data transfer. The number of redundant bits can be calculated using the following formula:
2^r ≥ m + r + 1
where, r = redundant bit, m = data bit
Suppose the number of data bits is 7, then the number of redundant bits can be calculated using: = 2^4 ≥ 7
+ 4 + 1 Thus, the number of redundant bits= 4 Parity bits. A parity bit is a bit appended to a data of
binary bits to ensure that the total number of 1’s in the data is even or odd. Parity bits are used for error
detection. There are two types of parity bits:
1. Even parity bit: In the case of even parity, for a given set of bits, the number of 1’s are counted. If
that count is odd, the parity bit value is set to 1, making the total count of occurrences of 1’s an even
number. If the total number of 1’s in a given set of bits is already even, the parity bit’s value is 0.
2. Odd Parity bit – In the case of odd parity, for a given set of bits, the number of 1’s are counted. If that
count is even, the parity bit value is set to 1, making the total count of occurrences of 1’s an odd
number. If the total number of 1’s in a given set of bits is already odd, the parity bit’s value is 0.
General Algorithm of Hamming code: Hamming Code is simply the use of extra parity bits to allow the
identification of an error.
1. Write the bit positions starting from 1 in binary form (1, 10, 11, 100, etc).
2. All the bit positions that are a power of 2 are marked as parity bits (1, 2, 4, 8, etc).
3. All the other bit positions are marked as data bits.
4. Each data bit is included in a unique set of parity bits, as determined its bit position in binary
form. a. Parity bit 1 covers all the bits positions whose binary representation includes a 1 in the least
significant position (1, 3, 5, 7, 9, 11, etc). b. Parity bit 2 covers all the bits positions whose binary
representation includes a 1 in the second position from the least significant bit (2, 3, 6, 7, 10, 11,
etc). c. Parity bit 4 covers all the bits positions whose binary representation includes a 1 in the third
position from the least significant bit (4–7, 12–15, 20–23, etc). d. Parity bit 8 covers all the bits
positions whose binary representation includes a 1 in the fourth position from the least significant bit
bits (8–15, 24–31, 40–47, etc). e. In general, each parity bit covers all bits where the bitwise AND of
the parity position and the bit position is non-zero.
5. Since we check for even parity set a parity bit to 1 if the total number of ones in the positions it checks
is odd.
6. Set a parity bit to 0 if the total number of ones in the positions it checks is even.

Determining the position of redundant bits – These redundancy bits are placed at positions that
correspond to the power of 2.
As in the above example:
• The number of data bits = 7
• The number of redundant bits = 4
• The total number of bits = 11
• The redundant bits are placed at positions corresponding to power of 2- 1, 2, 4, and 8

• Suppose the data to be transmitted is 1011001, the bits will be placed as follows:

Determining the Parity bits:


• R1 bit is calculated using parity check at all the bits positions whose binary representation includes a 1
in the least significant position. R1: bits 1, 3, 5, 7, 9, 11

• To find the redundant bit R1, we check for even parity. Since the total number of 1’s in all the bit
positions corresponding to R1 is an even number the value of R1 (parity bit’s value) = 0
• R2 bit is calculated using parity check at all the bits positions whose binary representation includes a 1
in the second position from the least significant bit. R2: bits 2,3,6,7,10,11
• To find the redundant bit R2, we check for even parity. Since the total number of 1’s in all the bit
positions corresponding to R2 is odd the value of R2(parity bit’s value)=1
• R4 bit is calculated using parity check at all the bits positions whose binary representation includes a 1
in the third position from the least significant bit. R4: bits 4, 5, 6, 7

1. To find the redundant bit R4, we check for even parity. Since the total number of 1’s in all the bit
positions corresponding to R4 is odd the value of R4(parity bit’s value) = 1
2. R8 bit is calculated using parity check at all the bits positions whose binary representation includes a 1
in the fourth position from the least significant bit. R8: bit

8,9,10,11
• To find the redundant bit R8, we check for even parity. Since the total number of 1’s in all the bit
positions corresponding to R8 is an even number the value of R8(parity bit’s value)=0. Thus, the data
transferred is:

Error detection and correction: Suppose in the above example the 6th bit is changed from 0 to 1 during
data transmission, then it gives new parity values in the binary number:
The bits give the binary number 0110 whose decimal representation is 6. Thus, bit 6 contains an error. To
correct the error the 6th bit is changed from 1 to 0.

services provided to Network Layer


What are the Data Link Layer services provided to the Network Layer?
In the OSI (Open System Interconnections) Model, each layer uses the services of the layer
below it and provides services to the layer above it. The primary function of the data link layer is to
provide a well-defined service interface to the network layer above it.
Virtual Communication versus Actual Communication
The main service provided is to transfer data packets from the network layer on the sending machine to the
network layer on the receiving machine. Data link layer of the sending machine transmits accepts data from
the network layer and sends them to the data link layer of the destination machine which hands them to the
network layer there.
In actual communication, the data link layer transmits bits via the physical layers and physical medium.
However virtually, this can be visualized as the two data link layers communicating with each other using a
data link protocol.
The processes are depicted in the following diagram –
Types of Services
The data link layer offers three types of services.
• Unacknowledged connectionless service − Here, the data link layer of the sending machine sends
independent frames to the data link layer of the receiving machine. The receiving machine does not
acknowledge receiving the frame. No logical connection is set up between the host machines. Error
and data loss is not handled in this service. This is applicable in Ethernet services and voice
communications.
• Acknowledged connectionless service − Here, no logical connection is set up between the host
machines, but each frame sent by the source machine is acknowledged by the destination machine on
receiving. If the source does not receive the acknowledgment within a stipulated time, then it resends
the frame. This is used in Wifi (IEEE 802.11) services.
• Acknowledged connection-oriented service − This is the best service that the data link layer can
offer to the network layer. A logical connection is set up between the two machines and the data is
transmitted along this logical path. The frames are numbered, that keeps track of loss of frames and
also ensures that frames are received in correct order. The service has three distinct phases −
o Set up of connection – A logical path is set up between the source and the destination
machines. Buffers and counters are initialised to keep track of frames.
o Sending frames – The frames are transmitted.
o Release connection – The connection is released, buffers and other resources are released.
It is appropriate for satellite communications and long-distance telephone circuits.

Elementary Data Link protocols


Elementary Data Link protocols are classified into three categories, as given below −
• Protocol 1 − Unrestricted simplex protocol
• Protocol 2 − Simplex stop and wait protocol
• Protocol 3 − Simplex protocol for noisy channels.
Let us discuss each protocol one by one.
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 −
Simplex Protocol for Noisy Channel

Data transfer is only in one direction, consider separate sender and receiver, finite processing capacity and
speed at the receiver, since it is a noisy channel, errors in data frames or acknowledgement frames are
expected. Every frame has a unique sequence number.
After a frame has been transmitted, the timer is started for a finite time. Before the timer expires, if the
acknowledgement is not received , the frame gets retransmitted, when the acknowledgement gets corrupted
or sent data frames gets damaged, how long the sender should wait to transmit the next frame is infinite.
The Simplex Protocol for Noisy Channel is diagrammatically represented as follows −
Data link layer in HDLC

High-Level Data Link Control (HDLC) is a protocol that is generally developed by


the International Organization of Standardization (ISO). HDLC is basically a group of data link
layer protocols of the Open System Interconnection (OSI) Model that is required to transmit
synchronous data packets or frames among point-to-point nodes. It also provides both connection-
oriented service and connectionless service.

HDLC (High-Level Data Link Control) is a bit-oriented protocol that is used for communication over

the point-to-point and multipoint links. This protocol implements the mechanism of ARQ(Automatic
Repeat Request). With the help of the HDLC protocol,full-duplex communication is possible.

HDLC is the most widely used protocol and offers reliability, efficiency, and a high level of Flexibility.

In order to make the HDLC protocol applicable for various network configurations, there are three types of
stations and these are as follows:

• Primary Station This station mainly looks after data like management. In the case of the
communication between the primary and secondary station; it is the responsibility of the primary
station to connect and disconnect the data link. The frames issued by the primary station are
commonly known as commands.
• Secondary Station The secondary station operates under the control of the primary station. The
Frames issued by the secondary stations are commonly known as responses.
• Combined Station The combined station acts as both Primary stations as well as Secondary stations.
The combined station issues both commands as well as responses.

Types of Configurations :
HDLC generally explains different types of configurations for different types of stations
i.e., Primary station, Secondary station, and Combined station. Configuration simply means
relationship among various hardware devices on a link. These different configurations are
given below :

1. Unbalanced Configuration :
Unbalanced Configuration is generally required for Primary stations. In this configuration, one station
is primary and all stations are secondary. This configuration mainly arises due to reason that Primary
Stations are basically used as controlling stations that control secondary station on data link. It also
consists of two or more secondary stations. It supports the following operations :
• Both mode of transmission i.e., Full duplex and Half-duplex
• Both mode of networks i.e., Point-to-Point and Multi-Point networks

Example –

2. Balanced Configuration:
Balanced Configuration is generally required for Combined stations. This configuration consists of two
combined stations that have equal and complementary responsibilities to enhance and emphasize the
working and qualities of each other as shown below in the diagram. It supports only specific operations as
given below :
• Both mode of transmission i.e. Full duplex and half-duplex, or
• One mode of network i.e. Point-to-Point
Example –

[Link]:
Symmetrical Configuration is generally required for Secondary stations that are usually combined with
Primary stations. This configuration consists of exactly two nodes i.e. two independent point-to-point
unbalanced station configurations.
Sometimes, it is also a combination of balanced and unbalanced configurations. This configuration is
rarely used in present technologies. Each of stations in network has basically two different kinds of status
out of which one is Primary status and other one is Secondary status. Even each of station is generally
considered as two stations logically.

Example –

Transfer Modes in HDLC

The HDLC protocol offers two modes of transfer that mainly can be used in different configurations. These
are as follows:

• Normal Response Mode(NRM)


• Asynchronous Balance Mode(ABM)

1. Normal Response Mode(NRM)

In this mode, the configuration of the station is unbalanced. There are one primary station and multiple
secondary stations. Where the primary station can send the commands and the secondary station can only
respond.

This mode is used for both point-to-point as well as multiple-point links.

2. Asynchronous Balance Mode(ABM)

In this mode, the configuration of the station is balanced. In this mode, the link is point-to-point, and each
station can function as a primary and as secondary.

Asynchronous Balance mode(ABM) is a commonly used mode today.


HDLC Frames

In order to provide the flexibility that is necessary to support all the options possible in the modes and
Configurations that are just described above. There are three types of frames defined in the HDLC:

• Information Frames(I-frames) These frames are used to transport the user data and the control
information that is related to the user data. If the first bit of the control field is 0 then it is identified
as I-frame.
• Supervisory Frames(S-frames) These frames are only used to transport the control information. If
the first two bits of the control field are 1 and 0 then the frame is identified as S-frame
• Unnumbered Frames(U-Frames) These frames are mainly reserved for system [Link]
frames are used for exchanging control information between the communicating devices.

1. Flag Field

This field of the HDLC frame is mainly a sequence of 8-bit having the bit pattern 01111110 and it is used to
identify the beginning and end of the frame. The flag field mainly serves as a synchronization pattern for the
receiver.

2. Address Field

It is the second field of the HDLC frame and it mainly contains the address of the secondary station. This
field can be 1 byte or several bytes long which mainly depends upon the need of the network. In case if the
frame is sent by the primary station, then this field contains the address(es) of the secondary stations. If the
frame is sent by the secondary station, then this field contains the address of the primary station.

3. Control Field

This is the third field of the HDLC frame and it is a 1 or 2-byte segment of the frame and is mainly used for
flow control and error control. Bits interpretation in this field mainly depends upon the type of the frame.
4. Information Field

This field of the HDLC frame contains the user's data from the network layer or the management
information. The length of this field varies from one network to another.

5. FCS Field

FCS means Frame check sequence and it is the error detection field in the HDLC protocol. There is a 16 bit
CRC code for error detection.

Point-to-Point Protocol

PPP(Point-To-Point) protocol is a protocol used in the data link layer. The PPP protocol is mainly used to
establish a direct connection between two nodes.

The Point-To-Point protocol mainly provides connections over multiple links.

• This protocol defines how two devices can authenticate with each other.
• PPP protocol also defines the format of the frames that are to be exchanged between the devices.
• This protocol also defines how the data of the network layer are encapsulated in the data link frame.
• The PPP protocol defines how the two devices can negotiate the establishment of the link and then
can exchange the data.
• This protocol provides multiple services of the network layer and also supports various network-layer
protocols.
• This protocol also provides connection over multiple links.

Some services that are not offered by the PPP protocol are as follows:

1. This protocol does not provide a flow control mechanism. Because when using this protocol the
sender can send any number of frames to the receiver one after the other without even thinking about
overwhelming the receiver.
2. This protocol does not provide any mechanism for addressing in order to handle the frames in the
multipoint configuration.
3. The PPP protocol provides a very simple mechanism for error control. There is a CRC field that
detects the errors. In case if there is a corrupted frame then it is discarded silently.

In the PPP protocol, the framing is done using the byte-oriented technique.

PPP Frame Format

Given below figure shows the format of the PPP Frame:


1. Flag

The PPP frame mainly starts and ends with a 1-byte flag field that has the bit pattern: 01111110. It is
important to note that this pattern is the same as the flag pattern used in HDLC. But there is a difference too
and that is PPP is a byte-oriented protocol whereas the HDLC is a bit-oriented protocol.

2. Address

The value of this field in PPP protocol is constant and it is set to 11111111 which is a broadcast address. The
two parties can negotiate and can omit this byte.

3. Control

The value of this field is also a constant value of 11000000. We have already told you that PPP does not
provide any flow control and also error control is limited to error detection. The two parties can negotiate
and can omit this byte.

4. Protocol

This field defines what is being carried in the data field. It can either be user information or other
information. By default, this field is 2 bytes long.

5. Payload field

This field carries the data from the network layer. The maximum length of this field is 1500 bytes. This can
also be negotiated between the endpoints of communication.

6. FCS

It is simply a 2-byte or 4-byte standard CRC(Cyclic redundancy check).

Byte Stuffing in PPP

As we have told you that the major difference between PPP and HDLC is that PPP is a byte-oriented
protocol. It means that the flag in the PPP is a byte and it is needed to be escaped wherever it appears in the
data section of the frame.

The escape byte is 011111101 which means whenever the flag-like pattern appears in the data then the extra
byte is stuffed that mainly tells the receiver that the next byte is not a flag.

Transition Phases in the PPP Protocol

The PPP protocol has to go through various phases and these are shown in the diagram given below;
Dead

In this phase, the link is not being [Link] active carrier is there at the physical layer and the line is simply
quiet.

Establish

If one of the nodes starts the communication then the connection goes into the established phase. In this
phase, options are negotiated between the two parties. In case if the negotiation is done successfully then the
system goes into the Authenticate phase (in case if there is the requirement of authentication otherwise goes
into the network phase.)

Several packets are exchanged here.

Authenticate

This is an optional phase. During the establishment phase, the two nodes may decide not to skip this phase.
If the two nodes decide to proceed with the authentication then they send several authentication packets.

If the result of this is successful then the connection goes into the networking phase otherwise goes into the
termination phase.

Network

In this phase, the negotiation of the protocols of the network layer takes place. The PPP protocol specifies
that the two nodes establish an agreement of the network layer before the data at the network layer can be
exchanged. The reason behind this is PPP supports multiple protocols at the network layer.

In case if any node is running multiple protocols at the network layer simultaneously then the receiving node
needs to know that which protocol will receive the data.
Open

In this phase the transfer of the data takes place. Whenever a connection reaches this phase, then the
exchange of data packets can be started. The Connection remains in this phase until one of the endpoints in
the communication terminates the connection.

Terminate

In this phase, the connection is terminated. There is an exchange of several packets between two ends for
house cleaning and then closing the link.

Multiplexing
Multiplexing is a technique by which different analog and digital streams of transmission can be
simultaneously processed over a shared link. Multiplexing divides the high capacity medium into low
capacity logical medium which is then shared by different streams.
Communication is possible over the air (radio frequency), using a physical media (cable), and light (optical
fiber). All mediums are capable of multiplexing.
When multiple senders try to send over a single medium, a device called Multiplexer divides the physical
channel and allocates one to each. On the other end of communication, a De-multiplexer receives data from
a single medium, identifies each, and sends to different receivers.
Frequency Division Multiplexing
When the carrier is frequency, FDM is used. FDM is an analog technology. FDM divides the spectrum or
carrier bandwidth in logical channels and allocates one user to each channel. Each user can use the channel
frequency independently and has exclusive access of it. All channels are divided in such a way that they do
not overlap with each other. Channels are separated by guard bands. Guard band is a frequency which is not
used by either channel.

Time Division Multiplexing


TDM is applied primarily on digital signals but can be applied on analog signals as well. In TDM the shared
channel is divided among its user by means of time slot. Each user can transmit data within the provided
time slot only. Digital signals are divided in frames, equivalent to time slot i.e. frame of an optimal size
which can be transmitted in given time slot.
TDM works in synchronized mode. Both ends, i.e. Multiplexer and De-multiplexer are timely synchronized
and both switch to next channel simultaneously.
When channel A transmits its frame at one end,the De-multiplexer provides media to channel A on the other
[Link] soon as the channel A’s time slot expires, this side switches to channel B. On the other end, the De-
multiplexer works in a synchronized manner and provides media to channel B. Signals from different
channels travel the path in interleaved manner.
Wavelength Division Multiplexing
Light has different wavelength (colors). In fiber optic mode, multiple optical carrier signals are multiplexed
into an optical fiber by using different wavelengths. This is an analog multiplexing technique and is done
conceptually in the same manner as FDM but uses light as signals.

Further, on each wavelength time division multiplexing can be incorporated to accommodate more data
signals.
Code Division Multiplexing
Multiple data signals can be transmitted over a single frequency by using Code Division Multiplexing. FDM
divides the frequency in smaller channels but CDM allows its users to full bandwidth and transmit signals all
the time using a unique code. CDM uses orthogonal codes to spread signals.
Each station is assigned with a unique code, called chip. Signals travel with these codes independently,
inside the whole [Link] receiver knows in advance the chip code signal it has to receive.

Multi Link PPP

What is MLPPP?
MLPPP (Multilink Point-to-Point Protocol) is the protocol that bundles multiple serial wan links into a

one Logical Bundle. As a name, PPP Multilink, MLP and MP are also used for MLPPP (Multilink Point-

to-Point Protocol).

There can be multiple PPP serial links between two nodes. With MLPPP, these links are
bundled and become a single logical link.

PPP Multilink Load Balancing

In PPP Multilink, Load Balancing is used between the member links of the Logical Link. The traffic is
shared between each link of these links. Load Balancing is used with fragmentation in MLPPP.

PPP Multilink Fault Tolerance

MLPPP provide Fault Tolerance with multiple links to the same destination. If one of the links between the
nodes fails, the link stays up and the communication continues. With this mechanism, MLPPP also
provide redundacy between links.
Easiness in Layer 3

The Layer 3 configuration, IP configurations and Routing Protocol configurations are done on the Logical
interface of PPP Multilink. So, MLPPP provides also a Layer 3 configuration easiness.

MLPPP Fragmentation

In MLPPP (PPP Multilink) , packet fragmentation is also supported beside load balancing. With packet
fragmentation, the packets that are fragmented are sent at the same time in different members of the Logical
Bundle.

Here, if the coming packet has MLPPP Header, it is fragmented and sequenced and at the
other end it is reassembled. If it is not, the packet is not sequenced and send only as first
come first sent.

MLPPP in TCP/IP Model

In TCP/IP Model, PPP Multilink works in the Network Interface Layer like PPP. But it is above the PPP
in the hierarchy.

You might also like