Data Link Layer·Lesson 1 of 11

Data Link Layer

01

The Short Answer

The data link layer is the part of a network whose job is to move data safely from one device to the very next device it is directly connected to. That "next device" might be your laptop handing data to your Wi-Fi router, or one switch passing data to another switch beside it. It does not worry about the entire journey across the internet — it only cares about getting data across a single , correctly, to the device on the other end.

It is called "Layer 2" because it is the second layer in the , a standard seven-layer map of networking jobs. It sits just above the physical layer (the raw wires and radio signals) and just below the network layer (which plans the route across the whole internet). Each device it deals with is called a node — any machine that can send, receive, or forward data.

The one-line version

The data link layer handles node-to-node delivery: getting data across one hop, from a device to the device directly next to it. It bundles data into frames and labels them with hardware (MAC) addresses so the correct neighbour picks them up.

🏃

Think of a relay race

In a relay race, the overall race plan — who runs, in what order, to reach the finish line — is decided in advance. But the actual work happens one handoff at a time: each runner just needs to pass the baton cleanly to the next runner. The data link layer is that single, careful handoff between two neighbours. Planning the full route from start to finish is a higher layer's job.

02

Where It Sits

The seven OSI layers stack on top of each other, each doing one job and handing its work to the layer below. The data link layer is the second from the bottom. Below it, the physical layer turns bits into signals on the wire; above it, the network layer figures out how to reach a device on a faraway network. Here are the bottom three layers and how they relate:

The bottom of the OSI model

3

Network Layer

Finds a route across many networks using IP addresses

Layer 3
2

Data Link Layer

Delivers data to the next device on the same link using MAC addresses

Layer 2
1

Physical Layer

Sends raw bits as electrical, light, or radio signals

Layer 1
03

Frames, Not Packets

Each layer has its own name for the chunk of data it handles. The network layer above works with a . When that packet arrives at the data link layer, this layer wraps it in a little envelope — adding a header at the front and a trailer at the end — and the result is called a . The header carries the addresses of the sender and the next receiver; the trailer carries a check value used to spot damage.

Quick memory hook

Layer names for data, bottom to top: bits (physical) → frames (data link) → packets (network) → segments (transport). If a question mentions frames or MAC addresses, you are at Layer 2.

04

Two Halves: LLC and MAC

The data link layer is usually split into two smaller sublayers, each handling part of the work. Splitting it this way keeps the software that talks to the network layer separate from the software that deals with the specific type of cable or wireless in use.

The two sublayers

  • LLC (Logical Link Control) — the upper half. It talks to the network layer above and manages error checking and pacing, hiding the messy hardware details.
  • MAC (Media Access Control) — the lower half. It adds hardware addresses to frames and decides when a device is allowed to transmit if the medium is shared.
05

What Runs Here

The devices that live at the data link layer are the ones that move frames around a local network. A and a network card (NIC) both operate here, reading and writing MAC addresses. This is a different job from a router, which works one layer up and forwards data between separate networks using IP addresses.

🚫

"The data link layer delivers my data all the way to the website's server."

It only ever delivers across one hop — to the next device on the same link. A message crossing the internet is handed off many times, and the data link layer does one handoff at a time. Planning the full end-to-end path is the network layer's job (Layer 3).

Q:What is the difference between a packet and a frame?

A: A packet is the network layer's unit (Layer 3) and carries IP addresses for the whole journey. A frame is the data link layer's unit (Layer 2): it wraps a packet with a header holding MAC addresses and a trailer holding an error check, for delivery across a single link. As data moves down one device and up the next, the frame is rebuilt on every hop while the packet inside stays the same.

Quick Revision Cheat Sheet

Layer: Layer 2 of the OSI model, between Physical (L1) and Network (L3)

Job: Node-to-node delivery across a single link

Data unit: Frame (a packet wrapped with a header and trailer)

Addressing: MAC (hardware) addresses, not IP addresses

Sublayers: LLC (talks to network layer) and MAC (addressing + medium access)

Devices: Switches, bridges, and network cards (NICs)