Lessons › Networking fundamentals
Addresses: streets and house numbers
▶ Start the interactive lesson
Ticket #102: "New printer in the warehouse office: nobody can print." Your laptop is 192.168.1.50 /24. The printer label says 192.168.2.50 /24. They're plugged into the same switch. Maya raises an eyebrow: "Same switch, different street."
Why do devices need addresses?
For a message to arrive, every device needs a unique address on its network, just like every house needs a postal address. On networks that's the IP address.
Under the hood it's binary
Computers only see 1s and 0s. Each octet is 8 bits, so an IP address is 32 bits. 8 bits can make 256 different values, which is why each number goes from 0 to 255.
Network part and host part
An IP address has two parts. The network part is like the street name, shared by everyone on that network. The host part is the house number, unique to each device.
Same network, or not?
Before sending, a device compares the network part of the destination with its own. Same street → it delivers directly through the switch. Different street → it sends the packet to its default gateway (router).
Addresses with special jobs
In every network: the first address is the network address (names the street, e.g. .0) and the last is the broadcast (reaches everyone, e.g. .255). Neither can be given to a device. The gateway is often .1.
Key points
- An IPv4 address is 32 bits, written as 4 numbers (octets). It has two parts: the network (the street) and the host (the house number).
- The subnet mask or prefix says where the street name ends. /24 means the first 24 bits (three octets) are the street: 192.168.1.50 lives on street 192.168.1.
- Hosts on the same street talk directly. To reach a different street, you go through the default gateway, the router at the end of your road.
- Private ranges (not routed on the Internet): 10.0.0.0/8, 172.16.0.0/12 (172.16–172.31) and 192.168.0.0/16.