Data Link Layer · GATE CSE 2026

Data Link Layer (OSI Layer 2)

Complete GATE CSE Revision Notes · 2026

The Data Link Layer (DLL) is one of the most important topics in Computer Networks for GATE CSE. Questions related to framing, error detection, ARQ protocols, MAC protocols, Ethernet, and switching are frequently asked in the examination.

This guide provides concise yet comprehensive revision notes that help you revise the entire Data Link Layer in less than three hours.


What is the Data Link Layer?

The Data Link Layer is Layer 2 of the OSI (Open Systems Interconnection) Model. It provides reliable communication between two directly connected devices by converting a stream of bits into frames and ensuring error‑free transmission.

Protocol Data Unit (PDU)

OSI LayerPDU
Physical LayerBits
Data Link LayerFrames
Network LayerPackets

Functions of the Data Link Layer

The major responsibilities of the Data Link Layer are:

  • Framing
  • Physical Addressing (MAC Address)
  • Error Detection
  • Error Control
  • Flow Control
  • Medium Access Control (MAC)

These functions ensure that data is delivered efficiently and accurately across a physical network.


Framing

Framing is the process of dividing a continuous stream of bits into manageable units called frames.

Types of Framing

Fixed‑Size Framing

  • Every frame has the same size.
  • Simple implementation.
  • Used in technologies like ATM.

Variable‑Size Framing

Frame sizes may vary depending on the data. Common techniques include:

  • Character Count
  • Byte Stuffing
  • Bit Stuffing

Byte Stuffing

Byte stuffing is used in character‑oriented protocols.

A special byte known as the Flag marks the beginning and end of a frame. If the same flag appears inside the data, an Escape Character (ESC) is inserted before it. The receiver removes the ESC during processing to restore the original data.


Bit Stuffing

Bit stuffing is used in bit‑oriented protocols such as HDLC.

Flag Pattern

01111110

Rule

Whenever the sender encounters five consecutive 1s, it inserts a 0 immediately afterward. The receiver removes this extra 0 during decoding.

Example

Original Data

011111101

After Bit Stuffing

0111110101
💡 GATE Tip: Bit stuffing is one of the most frequently tested concepts in Computer Networks.

Error Detection Techniques

The Data Link Layer detects transmission errors using various techniques.

1. Parity Check

  • Even Parity: The total number of 1s should be even.
  • Odd Parity: The total number of 1s should be odd.

Limitation: It cannot reliably detect multiple‑bit errors.

2. Checksum

The sender:

  • Divides data into blocks
  • Adds all blocks
  • Computes the one's complement

The receiver performs the same calculation. If the final result is all 1s, the data is considered error‑free.

3. Cyclic Redundancy Check (CRC)

CRC is the most reliable error detection technique used in modern communication systems. It works using polynomial division.

  • Sender: Computes CRC bits and appends them to the frame.
  • Receiver: Performs polynomial division. If the remainder is zero, the frame is accepted.
Important: CRC is a favorite topic in GATE examinations.

Error Control

Error control ensures lost or corrupted frames are retransmitted.

Stop‑and‑Wait ARQ

The sender transmits one frame and waits for an acknowledgment (ACK). If no ACK is received before timeout, the frame is retransmitted.

  • Advantages: Simple implementation
  • Disadvantages: Low efficiency, poor bandwidth utilization

Go‑Back‑N ARQ

Multiple frames can be transmitted without waiting. If one frame is lost, all subsequent frames are discarded by the receiver. The sender retransmits from the lost frame onward.

Selective Repeat ARQ

The receiver accepts correctly received frames even if one frame is missing. Only the erroneous frame is retransmitted. This protocol provides the highest efficiency but is more complex to implement.

Comparison of ARQ Protocols

ProtocolWindow SizeRetransmission
Stop‑and‑Wait1One frame
Go‑Back‑NMultipleLost frame and all following frames
Selective RepeatMultipleOnly erroneous frame

Flow Control

Flow control prevents a fast sender from overwhelming a slow receiver. The two primary techniques are:

  • Stop‑and‑Wait
  • Sliding Window Protocol

Sliding Window Protocol

Sliding Window allows multiple frames to remain unacknowledged simultaneously.

  • Better bandwidth utilization
  • Higher throughput
  • Increased network efficiency

MAC Address

A MAC (Media Access Control) Address uniquely identifies a network interface.

00:1A:2B:3C:4D:5E
  • 48‑bit address (6 Bytes)
  • Globally unique
  • Stored in the Network Interface Card (NIC)

LLC and MAC Sublayers

The Data Link Layer is divided into two sublayers.

Logical Link Control (LLC)

  • Error Control · Flow Control

Media Access Control (MAC)

  • Physical Addressing · Medium Access

Multiple Access Protocols

Pure ALOHA

Efficiency: 18.4%

Slotted ALOHA

Efficiency: 36.8% – approximately twice as efficient as Pure ALOHA.

CSMA (Carrier Sense Multiple Access)

Before transmitting, a station first listens to the communication channel. Variants include:

  • 1‑Persistent
  • Non‑Persistent
  • p‑Persistent

CSMA/CD

Carrier Sense Multiple Access with Collision Detection. Used in Traditional Ethernet.

  1. Listen
  2. Transmit
  3. Detect Collision
  4. Stop Transmission
  5. Wait Random Backoff
  6. Retransmit

CSMA/CA

Carrier Sense Multiple Access with Collision Avoidance. Used in Wi‑Fi Networks. Since wireless devices cannot detect collisions effectively, they avoid collisions using RTS · CTS · ACK.


Ethernet

Ethernet follows the IEEE standard: IEEE 802.3

  • Wired LAN Technology
  • Uses MAC Addressing
  • Originally Based on CSMA/CD
  • High‑Speed Communication

Switch

A Switch operates at OSI Layer 2. It forwards frames using MAC addresses.

  • Full Duplex Communication
  • High Speed
  • One Collision Domain per Port
  • Reduced Network Congestion

Bridge

A Bridge also works at the Data Link Layer. Its primary function is connecting multiple LAN segments while filtering traffic using MAC addresses.


Hub vs Bridge vs Switch

FeatureHubBridgeSwitch
OSI Layer122
Address UsedNoneMACMAC
Collision DomainOneSeparateOne per Port
PerformanceLowMediumHigh

Virtual LAN (VLAN)

A VLAN logically divides a physical LAN into multiple virtual networks.

  • Improved Security
  • Better Network Management
  • Reduced Broadcast Traffic
  • Easier Administration

Broadcast Domain

  • A Switch normally creates one broadcast domain.
  • VLANs divide broadcast domains.
  • Routers separate broadcast domains.

Important GATE Formulas

Go‑Back‑N

Sender Window ≤ 2ⁿ − 1
Receiver Window = 1

Selective Repeat

Sender Window ≤ 2ⁿ⁻¹
Receiver Window ≤ 2ⁿ⁻¹

Frequently Asked GATE Facts

TopicImportant Fact
Data Link LayerLayer 2
PDUFrame
AddressMAC Address
MAC Address Length48 Bits
EthernetIEEE 802.3
Wi‑FiIEEE 802.11
Bit StuffingInsert 0 after five consecutive 1s
CRCPolynomial Division
Pure ALOHA18.4% Efficiency
Slotted ALOHA36.8% Efficiency
CSMA/CDEthernet
CSMA/CAWi‑Fi
SwitchLayer 2
BridgeLayer 2
HubLayer 1

Last‑Minute Revision

If you have only two minutes before the exam, remember these key points:

  • Data Link Layer = OSI Layer 2
  • PDU = Frame
  • Address = 48‑bit MAC Address
  • Main Functions = Framing, Error Detection, Error Control, Flow Control, MAC
  • Bit Stuffing inserts a 0 after every five consecutive 1s
  • CRC is the most reliable error detection technique
  • Stop‑and‑Wait sends one frame at a time
  • Go‑Back‑N retransmits from the lost frame onward
  • Selective Repeat retransmits only the erroneous frame
  • Pure ALOHA Efficiency = 18.4%
  • Slotted ALOHA Efficiency = 36.8%
  • Ethernet uses IEEE 802.3
  • Wi‑Fi uses IEEE 802.11
  • CSMA/CD is used in Ethernet
  • CSMA/CA is used in Wi‑Fi
  • Switch operates at Layer 2
  • Router separates broadcast domains

Conclusion

The Data Link Layer forms the foundation of reliable communication in computer networks. For GATE CSE, mastering framing, error detection techniques, ARQ protocols, Ethernet, switching, MAC addressing, and multiple access protocols is essential. Regular practice of previous‑year questions along with these revision notes will strengthen your conceptual understanding and improve your exam performance.

Data Link Layer · GATE CSE 2026 · Revision ready