The Network Layer: Forwarding & IP

an IPv4 address

An IPv4 address is a 32-bit number that names one network interface so the network layer can deliver packets to it — like a street address for a house, except it tags a location on the network rather than a person. Because 32 raw bits are unreadable to humans, we write the address in dotted-decimal notation: the 32 bits are split into four 8-bit bytes, each written as a number from 0 to 255, joined by dots, as in 192.168.1.20.

Crucially, an IP address has two parts: a network part (a prefix shared by every host on the same network) and a host part (which identifies the specific interface within that network). A router only needs the network part to forward toward the right network; the host part matters at the final hop. The line between the two parts is set by the prefix length — modern addressing (CIDR) makes that line adjustable, so 10.0.0.0/8 means the first 8 bits are the network part. There are exactly 2^32, about 4.3 billion, possible IPv4 addresses, which sounds huge but ran out, driving the move to NAT and IPv6.

An honest caveat: an IP address identifies an interface and a location, not a permanent device and certainly not a person. The same laptop gets a different address on your home Wi-Fi than on a café network (DHCP hands out addresses), many homes share one public address (NAT), and addresses move with you. So an IP address is a routing label, not an identity card.

192.168.1.20 in binary is 11000000.10101000.00000001.00010100. Under the prefix 192.168.1.0/24 the first 24 bits (192.168.1) are the network part and the last 8 bits (.20) are the host part — one of 254 usable hosts on that network.

32 bits, shown as four bytes; split into a network part and a host part.

Each byte runs 0–255 (that's the range of 8 bits), so 192.168.1.300 is invalid. And the address is per-interface: a router with several interfaces has several IP addresses, one per attached network.

Also called
IP addressdotted-decimal addressIPv4 位址IP 位址