MyMisPal
← Networking & security lessons
Lesson 4 of 12

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
/24
Network 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.

TypeRangeNote
Private10.0.0.0/8Large internal company networks.
Private172.16.0.0/12Only 172.16 to 172.31.
Private192.168.0.0/16The most common at home and in small offices.
Loopback127.0.0.1Means “this machine”. Handy for testing.
No DHCP169.254.x.xIf 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.

Inside · private addresses192.168.1.10192.168.1.11192.168.1.12One public address203.0.113.25NATInternet
DHCPHands out IP addresses automatically when devices join. Without it, you'd type an address into every device!
DNSThe internet's phone book: turns a name like `mymispal.com` into an IP address the device can use.
NATThe 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.
Spotted a mistake on this page, or have an idea to improve the site?