The link layer - delivery within one network
How do two devices on the same network find each other? MAC addresses and switches, and ARP, which turns an IP address into a MAC address.
Recap
Part one came down to two things. The internet is a packet-switched network that breaks data into packets, and the communication problem is divided into layers so each layer answers only for its own job.
This part’s question starts at the very bottom. Within one network, how does a frame reach exactly the right counterpart?
MAC addresses: a device’s unique identifier
The link layer’s address is the MAC address (Media Access Control address). It is a 48-bit value like a4:5e:60:e2:1b:8f, assigned to each network interface (NIC) at manufacturing time. The leading 24 bits are the manufacturer identifier (OUI) and the trailing 24 bits are a serial number assigned by that manufacturer, so in principle it is globally unique.
The important characteristic is that a MAC address is a flat address. The address alone tells you nothing about whether the device is in Seoul or New York. It is like a national ID number: it identifies a person uniquely, but you cannot use it to find their house.
Ethernet frames
Ethernet, the de facto standard for wired LANs, transmits data in units called frames.
[ destination MAC | source MAC | type | payload (IP packet) | FCS ]
It consists of the destination and source MAC addresses, a type field indicating which protocol the payload belongs to, and a checksum (FCS) that detects damage in transit. It is the outermost shell of the encapsulation we saw in part one.
From hubs to switches
The hub, an early LAN device, was simple: it copies the signal arriving on one port out to every other port. Every device receives every frame, so collisions and waste explode as devices are added.
The switch fixes this. It watches the source MAC of each frame to learn a MAC address table — “this MAC is on this port” — and from then on forwards a frame only to the port matching the destination MAC. It floods every port only for unknown destinations or the broadcast address (ff:ff:ff:ff:ff:ff).
ARP: from IP address to MAC address
A packet handed down from the layer above carries a destination IP address. But building a frame requires a destination MAC address. ARP (Address Resolution Protocol) bridges that gap.
The mechanism is a simple question and answer.
A -> everyone (broadcast): "Who has 192.168.0.5? Tell 192.168.0.2"
B -> A (unicast): "That's me. My MAC is a4:5e:60:e2:1b:8f"
The mapping learned from the reply is stored in the ARP cache for a while, so a broadcast is not repeated for every frame. You can inspect the current host’s ARP cache directly with arp -a.
The limits of the link layer
Could we build a worldwide network out of switches and MAC addresses alone? No. A MAC address is flat and carries no location information, so every switch would have to learn the MACs of billions of devices worldwide. ARP broadcasts would also have to spread across the whole world. Neither is possible.
So the link layer’s responsibility is limited to one hop — delivery within the same network. Crossing a network boundary requires a hierarchical address that carries location information, and a separate layer that chooses routes using it.
Summary
| Link layer | |
|---|---|
| Unit of delivery | frame |
| Address | MAC address (48-bit, flat) |
| Key device | switch (MAC learning table) |
| Address resolution | ARP (IP → MAC) |
| Scope | within one network, a single hop |
The core point is this.
The link layer is responsible for one hop of delivery only. Crossing network boundaries is the next layer’s job.
Coming up next
The next part covers the internet layer: IP addresses, the hierarchical addresses that carry location information, and the routing that picks a path across many networks to the destination host.