June 30, 2026
I Finally Understood the Data Link Layer — Here’s the Simplest Explanation
Why packets need frames, why bandwidth isn’t Internet speed, and how networks decide who gets to transmit first.

By Asad Sayyad
10 min read
Before We Begin
Networking is often considered one of the most confusing topics in computer science. In this blog, we'll simplify the Data Link Layer, understand why packets and frames both exist, uncover one of the biggest myths about Internet speed, and answer the two most important questions behind every transmission: How is data sent? and When is data sent?
Let's get started…
Section 1: The Journey Begins
The Data You Send Never Actually Travels the Way You Think
Imagine you're sitting in your room, connected to your home Wi-Fi.
You open your browser, type google.com, and press Enter.
Within a fraction of a second, your request begins a journey that may pass through:
Eventually, Google's server receives your request, processes it, and sends a response back to you.
Seems simple, right?
Not quite.
In fact, as your request travels from one router to another, the outer structure carrying your data is destroyed and rebuilt multiple times.
🤔 Question
If the outer wrapper keeps changing…
What exactly remains constant during the entire journey?
To answer this let's first understand the difference between packets and frames, because these two terms are often confused — even by people who have studied networking.
📦Packets vs Frames — Why Do We Need Both?
Imagine you're opening google.com from your laptop.
The browser creates an HTTP request and sends it down the networking stack.
Before this request can travel across the Internet, it is first converted into a packet.
📦Packet
A packet is the data unit of the Network Layer (Layer 3). It carries logical addressing information that allows data to travel from a source network to a destination network across the Internet.
IP Header: Contains the source and destination IP addresses
TCP/UDP Header: Contains port numbers and communication information used by applications
Payload: The actual data being sent, such as an HTTP request, image, video, or file.
A packet knows where it wants to go, but not how it will physically get there.
📬 Frames
A frame is the Protocol Data Unit (PDU) of the Data Link Layer (Layer 2). It encapsulates a packet with physical addressing and error-detection information, allowing it to travel between two directly connected devices over a specific network medium.
Destination MAC : MAC address of the next device that should receive the frame.
Source MAC: MAC address of the device sending the frame.
Type/Length: Identifies the protocol inside the payload (usually IPv4, IPv6, etc.).
Payload: The complete IP packet created earlier.
FCS (Frame check sequence): Used to detect transmission errors before forwarding the frame.
_The _entire packet becomes the payload of the frame.
The frame doesn't replace the packet. It simply wraps around it so that it can travel across a physical network
🧠 Quick Thought
If the frame already contains the packet…
Why don't routers simply forward the same frame from one network to another?
The Mac addresses are unique number given to each device using Network Interface Card (NIC). So each router has their own unique MAC which is needed for a router to hop from one to another router.
The router opens the IP packet and sees the DEST IP address and then check its own subnet whether it belongs to it or its subnet using LPM method. If to its subnet then its ARP broadcasts to get MAC address of that device and we replace previous dest and src MAC with new ones being its own source and the receiver router destination MAC
📖 Want to know what actually happens inside a router?
check out my blog on
👉 Inside a Router: How Packets Find Their Way Across the Internet
A Simple Analogy
Think of a toffee wrapped inside a wrapper
Toffee — → IP packets
Wrapper — → Frames
Hence,
A packet is UNIVERSAL while frames are LOCAL
💡 Did You Know?
A typical home router changes millions of frames every minute, but the IP packet continues toward the same destination.
🧩 Section 2. The Data Link Layer —The Layer That Answers "How?" and "When?"
Have you ever wondered how a router decides which data to send first, especially when data can be lost or corrupted during transmission?
Or how does a router handle requests coming from multiple devices at the same time without creating complete chaos?
The Data Link Layer (Layer 2) is responsible for solving these challenges. It answers two of the most important questions in networking:
1. How should a frame be sent?
This focuses on reliable communication. The Data Link Layer detects transmission errors and ensures that lost or corrupted frames can be sent again using error control mechanisms.
2. When should a frame be sent?
This focuses on network access. When multiple devices want to transmit simultaneously, the Data Link Layer follows a set of rules to decide which device gets to use the communication medium first.
Simply sending a frame doesn't guarantee that it will reach the next device correctly. Frames may be corrupted due to electrical noise, wireless interference, or other transmission errors.
To overcome this, the Data Link Layer uses Error Control.
Error Control_ is a mechanism used by the Data Link Layer to detect lost or corrupted frames and ensure they are retransmitted until they are received correctly._
🛡 Error Control Techniques
1. Stop-and-Wait ARQ
The sender transmits one frame and waits for an ACK (Acknowledgement) before sending the next frame.
- Problem: Very slow because only one frame can be in transit at a time.
- Advantage: Simple and reliable.
2. Go-Back-N ARQ
The sender uses a sliding window to send multiple frames without waiting for individual ACKs. If one frame is lost or corrupted, the receiver discards that frame and all subsequent frames, forcing the sender to retransmit the lost frame and every frame sent after it.
- Problem: Retransmits many frames that may have already reached the receiver, wasting bandwidth.
- Advantage: Higher throughput than Stop-and-Wait ARQ.
3. Selective Repeat ARQ
The sender also uses a sliding window to transmit multiple frames. Unlike Go-Back-N, the receiver stores correctly received out-of-order frames and requests only the missing frame to be retransmitted.
- Problem: More complex because both sender and receiver must maintain buffers and track individual frames.
- Advantage: Makes efficient use of bandwidth by retransmitting only the lost frames.
💡 Which One Is Used Today?
Modern reliable communication, particularly TCP, uses mechanisms that are conceptually similar to Selective Repeat ARQ (such as selective acknowledgements or SACK). Instead of retransmitting everything after a loss, TCP can retransmit only the missing segments, making communication much more efficient on modern networks.
⏳ When Should a Frame Be Sent?
Why Can't Every Device Send Data at the Same Time?
Imagine everyone in your house is streaming Netflix, downloading games, attending Zoom meetings, and scrolling through Instagram — all at the same time.
Why doesn't the router simply send everyone's data at the same time?
What prevents every device from sending data at once?
To answer that, we first need to understand one of the most misunderstood concepts in networking:
📶 Bandwidth
Let's see what it actually means.
The Biggest Myth About Internet Speed
Bandwidth_ is the maximum amount of data that a communication link can carry in one second. It is measured in _bits per second (bps).
You'll often see values like:
- 100 Mbps
- 1 Gbps
- 10 Gbps
These numbers tell us how much data the network can carry, not how fast an individual packet travels.
💡 Quick Fact
When buying a router, most people compare its advertised "speed."
In reality, what they're usually comparing is the router's bandwidth — its capacity to handle data — not the speed of a single packet.
Is Bandwidth the Speed of a Packet?
No.
Bandwidth tells us how much data can be transmitted at once, not how fast a packet moves from one device to another.
Example: A four-lane highway doesn't make cars drive faster; it simply allows more cars to travel side by side.
Why Does Bandwidth Matter?
Every communication medium has a maximum capacity. Once that capacity is reached, it simply cannot carry more data at the same time.
If devices generate more data than the available bandwidth can handle, not every frame can be transmitted immediately. Some frames have to wait for their turn. This naturally leads to the next question:
Who decides which device gets to transmit first?
This is exactly where Medium Access Control (MAC) comes into the picture.
⚠️ Common Misconception
More bandwidths does not make a packet travel faster.
It simply allows more packets to be transmitted at the same time.
🚦 Medium Access Control (MAC)
Who Gets to Send Data First?
We now know that bandwidth is limited, meaning every device cannot transmit its frame at the same time.
So how is this problem solved?
The answer is Medium Access Control (MAC).
Medium Access Control (MAC) is a sublayer of the Data Link Layer that defines the rules for when and how devices can access a shared communication medium to transmit their frames.
Over the years, different MAC protocols were developed to solve this problem. These protocols can be divided into three categories:
Medium Access Control
│
┌─────────────────┼─────────────────┐
│ │ │
Random Access Controlled Access Channelization Medium Access Control
│
┌─────────────────┼─────────────────┐
│ │ │
Random Access Controlled Access Channelization🎲 1. Random Access Protocols
What Happens When Everyone Tries to Talk Together?
There is no central controller deciding who goes first.
If two devices transmit at the same time, a collision may occur, and the protocol handles it accordingly.
Protocols in this category include:
- ALOHA
- Slotted ALOHA
- CSMA/CD
- CSMA/CA
ALOHA
A device sends its frame whenever it has data.
If a collision occurs, it waits for a random amount of time before trying again.
- Problem: Very high number of collisions.
- Advantage: Extremely simple to implement.
Slotted ALOHA
Time is divided into fixed slots, and devices are allowed to transmit only at the beginning of a slot.
- Problem: Collisions can still occur if two devices choose the same slot.
- Advantage: Reduces collisions compared to pure ALOHA.
CSMA/CD (Carrier Sense Multiple Access with Collision Detection)
Before transmitting, a device first listens to the communication medium.
If the medium is free, it transmits.
If a collision occurs, the device detects it, stops transmitting, waits for a random time, and tries again.
- Problem: Doesn't work efficiently in wireless networks because collisions cannot be reliably detected.
- Advantage: Greatly reduces unnecessary collisions compared to ALOHA.
Used in: Traditional shared Ethernet networks.
CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance)
Instead of detecting collisions, devices try to avoid them by waiting for the medium to become idle and using additional techniques like random backoff before transmitting.
- Problem: Adds a small delay before transmission.
- Advantage: Minimizes collisions in wireless communication.
💡 Quick Fact
Why does Wi-Fi use Collision Avoidance while Ethernet used Collision Detection?
The answer is simple.
A computer connected by a cable can listen while transmitting, making collision detection possible.
We've learned that bandwidth is limited, so not every device can transmit its frame at the same time.
This creates a new challenge:
If multiple devices want to use the same communication medium simultaneously, who gets to transmit first?
Without any rules, devices would continuously interfere with each other's transmissions, resulting in frequent collisions, retransmissions, and poor network performance.
This is exactly the problem that Medium Access Control (MAC) solves.
MAC ensures that multiple devices can share the same network efficiently without creating unnecessary collisions or communication conflicts.
Over the years, different MAC protocols were developed to solve this problem. They are broadly divided into three categories:
Medium Access Control
│
┌─────────────────┼─────────────────┐
│ │ │
Random Access Controlled Access Channelization Medium Access Control
│
┌─────────────────┼─────────────────┐
│ │ │
Random Access Controlled Access Channelization🎫 2. Controlled Access Protocols
Giving Every Device a Fair Turn
Instead of allowing every device to compete for the medium, Controlled Access protocols decide which device gets permission to transmit, almost eliminating collisions.
These protocols include:
Reservation
Each device reserves a time slot before transmitting, ensuring collision-free communication.
- Problem: Reservation introduces overhead.
- Advantage: No collisions during data transmission.
Polling
A central controller asks each device one by one whether it has data to send.
- Problem: If the controller fails, communication stops.
- Advantage: Simple and collision-free.
Token Passing
A special token circulates among devices, and only the device holding the token can transmit.
- Problem: Token loss or corruption affects communication.
- Advantage: Completely avoids collisions.
📡 3. Channelization Protocols
Dividing the Medium Instead of Competing for It
Instead of making devices wait for their turn, the communication medium itself is divided so that multiple devices can transmit simultaneously without interfering with one another.
These protocols include:
FDMA (Frequency Division Multiple Access)
Each device is assigned a separate frequency band for communication.
- Problem: Wastes bandwidth when a channel is idle.
- Advantage: Multiple users can communicate simultaneously.
TDMA (Time Division Multiple Access)
Each device is assigned a specific time slot to transmit.
- Problem: Time synchronization is required.
- Advantage: Efficient sharing of the communication medium.
CDMA (Code Division Multiple Access)
All devices transmit at the same time but use unique codes to separate their signals.
- Problem: Complex implementation.
- Advantage: High capacity and good resistance to interference.
OFDMA (Orthogonal Frequency Division Multiple Access)
The available bandwidth is divided into multiple orthogonal subcarriers, which are dynamically allocated to different users.
- Problem: More complex hardware and signal processing.
- Advantage: High efficiency and excellent bandwidth utilization.
Used in: Wi-Fi 6, 4G LTE, and 5G networks.
Putting It All Together
Let's follow a simple example.
Suppose you open your browser and type:
google.com
- Your browser creates an HTTP request.
- The Network Layer converts this request into an IP packet, containing the source and destination IP addresses.
- Before the packet can leave your computer, the Data Link Layer encapsulates it inside a frame by adding the source and destination MAC addresses along with error detection information.
- If multiple devices are trying to transmit at the same time, the Medium Access Control (MAC) mechanism decides when your frame is allowed to use the communication medium.
- During transmission, if the frame is lost or corrupted, Error Control mechanisms ensure that it is retransmitted.
- When the frame reaches the router, the frame is removed, the packet is examined to determine the next hop, and a new frame with new MAC addresses is created for the next network.
- This process repeats at every router until your request finally reaches Google's server.
Although the frame changes at every hop, the packet continues its journey toward the same destination, carrying your request across the Internet.
🎉 What You Know Now
If you've made it this far, you've learned concepts that many networking students struggle to connect.
✅ Why packets and frames both exist.
✅ Why frames change at every router, while packets continue their journey.
✅ Why Internet speed isn't just about buying a faster router.
✅ Why your Internet slows down when multiple devices share the same connection.
✅ How the Data Link Layer answers two fundamental questions:
- How should data be sent?
- When should data be sent?
✅ How the Data Link Layer makes reliable communication possible using Error Control and Medium Access Control.
Final Thought
The next time you open Google, stream a YouTube video, or send a WhatsApp message, remember that your data isn't simply "sent over the Internet."
Behind every request, the Data Link Layer is quietly ensuring that your data is wrapped into frames, transmitted at the right time, checked for errors, and forwarded one hop at a time until it reaches its destination.
❤️ Thank You for Reading and Being Patient!