Think of a network as a building full of rooms, doors, and room numbers. A packet starts to make sense when you can picture where it is trying to go.
License: CC BY-NC-ND 4.0
Part One: Buildings as Networks
Chapter 1: The Room, the Door, and the Room Number

The building
Imagine a building full of rooms, each with a purpose. Some are for sleeping, some for storing utilities, some for parties. In a network each one of those rooms is a device, a laptop, a printer, a phone.
Every room needs a door. In networking terms, that door is an interface. An Ethernet port is a door. The Wi-Fi is a door. A server with four network cards has four doors.
Each door has two labels:
- A door label stamped into the hardware itself. This is the MAC address. It looks like
AA:BB:CC:11:22:33. - A room number assigned by whoever runs the floor plan. This is the IP address. Something like
192.168.1.101.
The MAC address is for local delivery on the same floor. It is baked into the interface, more or less. These days you can spoof it, virtualize it, randomize it for privacy. But conceptually it stays: this is the label on this specific door.
The IP address describes where your device sits in the network’s logical layout. Carry your laptop to a coffee shop and the door label is still the same door label. But the room number changes because you are now in a different building.
When two devices are on the same local network, they do not need a city map. They need local labels and a local path.
Getting your room number
When you carry your laptop into a new building, you don’t guess your room number. If you did, you’d probably pick a number someone else is already using. The building manager would have to throw both of you out.
Instead, you walk up to the front desk.
The clerk checks a clipboard, finds a vacant room number, and hands you a temporary keycard. That card has your assigned room number, your floor plan (subnet mask), and the location of the elevator lobby (default gateway).
This front desk clerk is DHCP (Dynamic Host Configuration Protocol).
When your device plugs in or connects to Wi-Fi, it has a door label (MAC address) but no room number. So it shouts to the whole floor: “Hey, I’m new here! Who is the clerk at the front desk?”
The DHCP server hears the shout, checks its pool of available room numbers, and leases one to you. It’s a lease because you don’t own the room number. If you leave the building and come back later, the clerk might give you a completely different room number.
A late-night support call taught me this the hard way. I assumed a server’s IP would stay the same forever. But the lease expired, the DHCP clerk handed the IP to a printer, and our database traffic went to a printer instead. Printers, as we established, love to ruin your afternoon.
A few commands
You can look at your own door and room number right now:
# Linux: room number, floor plan, and door label in one shot
ip addr show
# macOS: room number, then the door label
ipconfig getifaddr en0
ifconfig en0 | grep ether
# Windows: everything, including the DHCP clerk who gave you the lease
ipconfig /all
Find the MAC address and the IP address for your active interface. One of them will follow you to the coffee shop. The other one won’t.
Where the analogy bends
A device is not literally a room with one fixed door. It may have multiple interfaces, virtual interfaces, tunnels, VPN adapters. The analogy still holds if you treat each interface as a separate door attached to the same room.
What to remember:
- MAC address answers: “Which local door?”
- IP address answers: “Which logical location?”
That is the foundation. Everything else builds on it.
This is the first chapter of my book, Understanding Computer Networks by Analogy. The full book continues the same map through subnets, routing, DNS, NAT, cloud networks, containers, and troubleshooting.