IPv4 address structure: network and host portions

Every device on an IP network needs a unique address: endpoints (PCs, printers, servers, phones) and intermediary devices (routers, switches). Street addresses locate houses for mail; IP addresses locate devices for data.

Two parts of a 32-bit address

The street analogy: network = the street, host = the house number. Live at 16 Shell Drive? Shell is your network, 16 is your host. Each street is its own network, and “network” here lines up with the terms broadcast domain and VLAN. A router traditionally holds a different network range on each interface, separating them.

Key point the address alone can’t tell you: looking at 172.16.12.22, there is no way to know where network ends and host begins. That’s the subnet mask’s job (covered soon). A /8 mask would make the first 8 bits network and the last 24 host.

Per-octet conversion example

192.168.4.6 in binary, one octet at a time:

IPv4 header fields

The header is the format all IP devices agree on: a container of values needed for host-to-host delivery. Some fields are static (version); others change in transit (TTL).

The four to know first:

The rest:

Classful addressing

History first: the original standard fixed the split at 8 network bits and 24 host bits, giving every network 16,777,214 hosts. Wasteful, since most orgs want several smaller networks, not one giant one.

RFC 790 (1981) introduced classes A, B, and C, assigned by IANA. Classes D and E came later via RFC 3330 (2002) for special use; hosts only use A, B, and C for unicast.

The class is encoded in the leading bits of the first octet, which is what produces each class’s first-octet range:

The class fixes the network portion; the host portion is what you get to pick.

Using the default mask for the class is classful. Pairing an address with a non-default mask (a 10.x address with /16 or /24) is classless, aka subnetting. Classless is what’s actually used today; classful is the foundation you need to understand it.

IPv6 note: designed for IPv4 address exhaustion, adoption started slow but keeps widening. IPv4 still dominates.