IP addressing
Every device on a network needs an IP address so data can reach it. An IPv4 address is 32 bits, written as four numbers (octets) from 0 to 255, separated by dots:
19211000000
.16810101000
.1000001010
.7701001101
/24Network part (24 bits)Host part (8 bits)
An address has two parts: the network part (like the neighbourhood) and the host part (like the house number). The subnet mask marks where the network part ends. /24 means the first 24 bits are the network, the same as 255.255.255.0.
| Type | Range | Note |
|---|---|---|
| Private | 10.0.0.0/8 | Large internal company networks. |
| Private | 172.16.0.0/12 | Only 172.16 to 172.31. |
| Private | 192.168.0.0/16 | The most common at home and in small offices. |
| Loopback | 127.0.0.1 | Means “this machine”. Handy for testing. |
| No DHCP | 169.254.x.x | If you see it, the device probably failed to get an address. |
Private addresses can't be used on the internet directly and repeat across millions of homes. A public address is unique on the whole internet, and your provider assigns it.
| DHCP | Hands out IP addresses automatically when devices join. Without it, you'd type an address into every device! |
| DNS | The internet's phone book: turns a name like `mymispal.com` into an IP address the device can use. |
| NAT | The router translates private addresses into one public address, so the whole office reaches the internet through it. |
Watch outIPv4 has only about 4.3 billion addresses, and they have essentially run out. The long-term fix is IPv6: 128 bits written in hex, like
2001:db8::1. NAT is what kept IPv4 alive all these years.