Network+ (N10-009) · ELI Explains Networking Layers (book)

Layer 2 — Data Link

4 min read
Want it in plain words first? Jump to Eli explains — the same idea, no jargon.
On this page 3 sections
  1. The college version
  2. Eli explains
  3. Study tools

The college version

What This Layer Does

Layer 1 can move bits, but it cannot tell one device from another. If four computers and a printer share a network, something has to make sure a job sent to the printer reaches the printer and not the computer next to it. That is the Data Link layer's job: delivering data to a specific device on the , meaning the group of devices connected together in one place, such as a home, an office floor, or a single Wi-Fi network.

To do this, the Data Link layer wraps the data in a . A frame is the data plus a small amount of extra information attached to the front and back of it. The front carries the address of the device the frame is for and the address of the device that sent it. The back carries a check value used to detect damage.

The addresses used here are MAC addresses. Every network interface is given one when it is manufactured, and it is normally written as twelve hexadecimal digits, such as 00:1B:44:11:3A:B7. A identifies a piece of network hardware. It does not describe where that hardware is, which is why it only works for local delivery — a subject Chapter 4 picks up.

The Data Link layer also checks its own work. The check value at the end of the frame lets the receiving device tell whether the frame arrived intact. A damaged frame is discarded. Note the limit of this: Layer 2 detects damage, it does not repair it. Deciding whether to ask for the data again is somebody else's job.

Common Examples

  • Ethernet, the standard for wired local networks
  • Wi-Fi, the standard for wireless local networks
  • Switches
  • Wireless access points
  • Network interface cards, which hold the MAC address

You may also hear about VLANs, which let one physical carry several separate logical networks, and spanning tree, which stops frames from looping forever between switches. Both are Layer 2 features. Both are subjects for a later book.

Simple Real-World Example

A desktop computer sends a document to a printer on the same home network. The computer builds a frame containing the print data, addressed from its own MAC address to the printer's MAC address, and sends it to the switch built into the home router.

The switch reads the destination MAC address, checks its internal table of which device is on which port, and forwards the frame out that one port only. The other devices on the network never see it.

        ┌──────────┐
        │  Laptop  │  (not the destination — receives nothing)
        └────┬─────┘
             │
   ┌─────────┴──────────┐
   │       Switch       │  reads destination MAC, forwards to one port
   └────┬──────────┬────┘
        │          │
  ┌─────┴────┐  ┌──┴──────┐
  │ Computer │  │ Printer │  <── frame delivered here
  └──────────┘  └─────────┘

What Can Go Wrong?

  • Two devices are given the same MAC address. Rare, but it makes local delivery ambiguous and produces intermittent failures.
  • The frame is damaged. The check value fails and the frame is discarded. A faulty cable or a noisy wireless environment can cause this repeatedly.
  • The device is on the wrong Wi-Fi network or the wrong VLAN. It has a working connection and still cannot reach the devices it expects, because it is in a different classroom.
  • A switch port is disabled or misconfigured. The cable is fine, the lights may even be on, and frames still go nowhere.

Remember This

Layer 2 delivers frames to devices on the local network using MAC addresses.

Eli, the EliExplains learning guide

Eli explains

The same idea, in plain words

Explain it like I’m 10

Imagine a classroom.

Every student in the room has a name tag. You want to pass a note to one particular student, so you write their name on the outside and hand it to a helper. The helper looks at the name, walks over to that exact student, and gives them the note. Nobody else in the room reads it.

That is Layer 2.

The classroom is the local network — the computers and printers connected together in one place. The name tag is the MAC address, a code built into every piece of network hardware so each device can be told apart. The helper is a switch, a device whose whole job is to read the name and deliver the note to the right desk.

Why do we need it? Because the layer below just pushes signals into a cable or into the air. Signals alone cannot say who a message is for. Without names and a helper, every message would go to everybody.

The note also gets a quick check for damage. If it arrives torn and unreadable, the helper throws it away rather than delivering nonsense.

Here is a real example. When you print at home, your computer wraps the document with the printer's name tag and hands it to the switch inside your router. The switch delivers it to the printer and to nothing else.

One important limit: this only works inside one classroom. Getting a note to a student in a different school is the next chapter's problem.

Keep learning

Ready to build on this? Continue to the next lesson.

Practice Network+ (N10-009)

This lesson has no separate scored set. Practice draws from the subject’s question bank.

Study tools & related lessonsKey vocabulary · Related

Key vocabulary

Frame
data wrapped with a Layer 2 header and trailer, ready for local
MAC address
the hardware address that identifies a network interface on
Local network
the devices that can reach each other without a router in
Switch
a device that reads MAC addresses and forwards each frame only to
Error detection
checking whether a frame was damaged in transit, using

Educational content only. It is not medical, legal or professional advice. Found an error? Tell us.