Topic 4.1
Local Delivery: MAC Addresses, ARP & Switches
In one line
Inside one local network, frames are delivered by MAC address; ARP maps a neighbour's IP to its MAC, and switches learn which port each MAC lives on.
Think of it like this
Inside one office floor, people deliver notes by desk number (MAC address) rather than postal address. If you know someone's name (IP) but not their desk, you shout across the floor 'who is Priya?' (ARP request) and Priya answers with her desk number (ARP reply).
Key ideas
- 01
A MAC address is a 48-bit hardware address (
02:42:ac:11:00:02) that only matters on the local link (layer 2). IP addresses (layer 3) are what routers care about. - 02
ARP (Address Resolution Protocol): before sending to an IP on the same subnet, a host broadcasts 'who has 10.0.0.5?'; the owner replies with its MAC, and the answer is cached in the ARP (neighbour) table. For destinations OUTSIDE the subnet, the host ARPs for its DEFAULT GATEWAY instead and sends the frame there.
- 03
A SWITCH learns which MAC addresses are behind which port by watching source addresses, and forwards frames only to the right port. A BRIDGE is the software version, and it's exactly what
docker0and Kubernetes node bridges are (Phase 6). - 04
VLANs split one physical switch into several isolated layer-2 networks, the on-premise ancestor of VPC subnets.
Code & diagrams
ip neigh show # ARP / neighbour table: IP → MAC, and state (REACHABLE, STALE)
ip link show # interfaces and their MAC addresses
bridge link show # which interfaces are attached to software bridges (e.g. docker0)Explain it without notes
When your laptop sends a packet to a server on the internet, whose MAC address is in the destination field of the frame it sends?
Practice
Run ip neigh before and after pinging another device on your network. What changed?
Trade-offs
- ↔
Large flat layer-2 networks are simple but broadcasts (like ARP) grow with every host and failures spread widely; routing between smaller subnets scales better, which is why clouds give you routed subnets rather than one giant LAN.
Done when you can
I know the difference between MAC and IP addresses.
I can explain ARP and the neighbour table.
I know that software bridges are what containers attach to.