IP Addressing and How Routers Choose a Path
How an address splits into a network part and a host part, and how a router uses its forwarding table to pick the next hop without knowing the whole route. No single machine holds a map of the internet.
What a learner can do afterwards
- Split an address with a subnet mask into its network and host parts
- Decide from a small forwarding table which link a packet leaves on
- Explain why two packets of one message can take different routes and still arrive
1 · Read
Every device on a network needs an address. IPv4 writes each one as four numbers, like 192.168.1.20. A subnet mask marks which part of the address names the network and which part names the device itself. Think of the network part as the street and the host part as the house number.
Take 210.1.1.100 with the mask 255.255.255.224. The lowest address in its subnet is the network address, 210.1.1.96. The highest address is the broadcast address, 210.1.1.127. The addresses you can hand to devices sit between those two.
Routers keep small forwarding tables that match address prefixes to outgoing links. For each packet they cover every row's prefix against the destination and take the longest match. Suppose a table sends 192.168.1.0/24 out on link A, 192.168.0.0/16 out on link B, and everything else out on link C. A packet for 192.168.1.20 matches the first two rows, and the longer /24 wins, so it leaves on link A. Packets headed outside your own network go to the default gateway, the usual door out, and the wrong gateway strands them with nowhere to go.
Each packet carries its full source and destination addresses, so routers judge every packet afresh. That is why two packets of one message can take different routes when a link clogs or fails. No single machine holds a map of the whole internet, and none needs to, because each router only picks the next hop. The receiver at the far end reassembles the packets and hides the whole adventure from your apps.
Split each address with its mask, forward every packet by its longest match, and let the receiver reassemble the pieces.
2 · Watch
Take it off screen
Where it sits
8 questions wait behind this lesson, each with its answer explained. Every answer feeds the sky: stars light as they are learned, and dim when it is time to come back.