Card 01/ 10
The Network Layer: Addresses That Cross Networks
Layer 3 gives every host an address that means something beyond its own link.
The network layer, layer 3, gives every machine an address that is meaningful across many networks, and lets routers move packets from one network to the next until they reach that address. On the internet the network layer is IP, the Internet Protocol, and its address is the IP address.
A MAC address cannot do this job. It names a network card, and only the devices on the same link can reach it. Nothing in a MAC address says where in the world the card is, so a router a thousand kilometres away would have no way to know which direction to send a frame. An IP address carries that information: its first part names a network, and routers need to know only which way each network lies, not where every machine is.
| Layer | Holds | Lives for |
|---|---|---|
| 4 Transport | Segments addressed to ports | Reaching the right program on a machine |
| 3 Network | Packets addressed by IP address | Reaching the right machine, across any number of networks |
| 2 Data Link | Frames addressed by MAC address | Reaching the next device on one link |
A network, in this sense, is a group of addresses that share their first part, reachable from each other without passing through a router. A subnet is one such group carved out of a larger range, such as the addresses of one office floor or one cloud network. A router is the device that joins networks: it has an address on each, and moves packets between them.
The postal system is a fair comparison. A full address names a city, a street and a house, and a sorting office far away reads only the city to decide which lorry the letter goes on. Routers read only the network part of an IP address in the same way.
The network layer promises very little. It sends each packet on its own and does its best, but a packet may be lost, duplicated or arrive out of order, and IP does nothing about it. Reliability, when a program needs it, is added by TCP one layer up.
So when a packet reaches the right building but never the right machine across the street, the question is a layer 3 one: which network the address belongs to, and whether a router knows the way to it.
← → move through sections and cards