Data Link Layer
Data Link Layer
Special
Flag byte (01111110) Flag bit pattern (01111110)
byte/bit
6. ARQ
Definition:
Key Features:
Types of ARQ:
1. Stop-and-Wait ARQ – Sender sends one frame and waits for an ACK
before sending the next.
2. Go-Back-N ARQ – Sender can send multiple frames before needing an
ACK, but must retransmit from the error onward if a problem occurs.
3. Selective Repeat ARQ – Only the specific erroneous frames are
retransmitted, improving efficiency.
Purpose:
Definition:
Framing is the technique used at the Data Link Layer (Layer 2) of the OSI model to divide
a data stream into manageable pieces (frames) for reliable transmission and
synchronization between sender and receiver.
In Go-Back-N In Selective
In Stop and Wait protocol, Efficiency Repeat protocol,
protocol, Efficiency formular is Efficiency formular
formular is N/(1+2*a) where is N/(1+2*a)
1/(1+2*a) where a is ratio of where a is ratio of
Efficiency
a is ratio of propagation delay propagation delay
propagation delay vs transmission vs transmission
vs transmission delay and N is delay and N is
delay. number of packets number of packets
sent. sent.
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.
• Control − It is 1 or 2 bytes containing flow and error control information.
• Payload − This carries the data from the network layer. Its length may vary from one
network to another.
• FCS − It is a 2 byte or 4 bytes frame check sequence for error detection. The standard
code used is CRC (cyclic redundancy code)
In the diagram, starts sending the first bit of its frame at t1 and since C
sees the channel idle at t2, starts sending its frame at t2. C detects A’s
frame at t3 and aborts transmission. A detects C’s frame at t4 and aborts
its transmission. Transmission time for C’s frame is, therefore, t3-t2 and
for A’s frame is t4-t1
So, the frame transmission time (Tfr) should be at least twice the
maximum propagation time (Tp). This can be deduced when the two
stations involved in a collision are a maximum distance apart.
Process: The entire process of collision detection can be explained as
follows:
Low-traffic
Pure Sends frames No collision
Low networks
ALOHA immediately detection
Monitors
Wired
CSMA/CD medium after Collision High networks
sending a detection by
with
frame,
Collision
Transmission detection
Protocol behavior method Efficiency Use cases
Monitors Wireless
medium while Collision networks
transmitting, avoidance with
CSMA/CA adjusts through random High moderate to
behavior to backoff time high traffic
avoid intervals and high
collisions error rates
CSMA / CA will first transmit the CSMA / CD resends the data frame
intent to send for data transmission. whenever a conflict occurs.
11.ALOHA Protocol
1. Introduction
ALOHA was developed at the University of Hawaii in the 1970s to enable communication
between different islands via radio. It is one of the earliest random access protocols, and
forms the basis of modern protocols like Ethernet and Wi-Fi.
2. Types of ALOHA
Efficiency:
Max Efficiency=18.4% (12e)\text{Max Efficiency} = 18.4\% \
(\frac{1}{2e})Max Efficiency=18.4% (2e1)
3. Working Mechanism
4. Advantages
5. Disadvantages
6. Applications
• Satellite communication
• Initial design of Ethernet
• Basis for wireless protocols
Conclusion
ALOHA laid the foundation for modern random access protocols. While it's not efficient in
high-traffic networks, its simplicity made it valuable for early wireless systems and for
understanding network access principles.
Maximum
Maximum efficiency = 18.4%. Maximum efficiency = 36.8%.
efficiency
Working of Piggybacking
As we can see in the figure, we can see with piggybacking, a single
message (ACK + DATA) over the wire in place of two separate messages.
Piggybacking improves the efficiency of the bidirectional protocols.
• If Host A has both acknowledgment and data, which it wants to
send, then the data frame will be sent with the ack field which
contains the sequence number of the frame.
• If Host A contains only one acknowledgment, then it will wait
for some time, then in the case, if it finds any data frame, it
piggybacks the acknowledgment, otherwise, it will send the
ACK frame.
• If Host A left with only a data frame, then it will add the last
acknowledgment to it. Host A can send a data frame with an ack
field containing no acknowledgment bit.
Advantages of Piggybacking
1. The major advantage of piggybacking is the better use of
available channel bandwidth. This happens because an
acknowledgment frame does not need to be sent separately.
2. Usage cost reduction.
3. Improves latency of data transfer.
4. To avoid the delay and rebroadcast of frame transmission,
piggybacking uses a very short-duration timer.
Disadvantages of Piggybacking
1. The disadvantage of piggybacking is the additional complexity.
2. If the data link layer waits long before transmitting the
acknowledgment (blocks the ACK for some time), the frame will
rebroadcast.