IPv4 Fundamentals and Addressing
Every IPv4 address is a 32-bit value used to identify an interface on an IP network. This lesson connects dotted-decimal notation to prefixes, local delivery, and the default gateway.
1. Read an IPv4 address
Section titled “1. Read an IPv4 address”An address has 32 bits, conventionally written as four 8-bit octets. Each octet ranges from 0 to 255; for example, 192.168.1.50 is four decimal representations of those bit groups.
An address alone does not tell you which bits identify the network. The prefix length does. In 192.168.1.50/24, the first 24 bits are the network prefix and the remaining 8 bits identify an interface within that subnet. The equivalent dotted-decimal subnet mask is 255.255.255.0.
A prefix belongs with an address: 192.168.1.50/24 is in 192.168.1.0/24, while the same address with /25 belongs to 192.168.1.0/25. Prefix length controls the boundary; old class A/B/C rules do not determine modern subnet boundaries.
2. Private and special-use ranges
Section titled “2. Private and special-use ranges”RFC 1918 reserves these IPv4 blocks for private internets:
| Private block | Prefix | Common context |
|---|---|---|
10.0.0.0–10.255.255.255 |
10.0.0.0/8 |
Large private networks |
172.16.0.0–172.31.255.255 |
172.16.0.0/12 |
Private networks |
192.168.0.0–192.168.255.255 |
192.168.0.0/16 |
Home and small-office networks |
These are CIDR ranges, not address classes. Private addresses are not globally reachable through the public Internet by default, but private does not mean trusted or secure. Networks commonly use NAT for Internet access, but NAT itself is not an access-control policy; firewalls and endpoint controls still matter.
Other special-purpose ranges have different meanings. 127.0.0.0/8 is loopback, 169.254.0.0/16 is link-local, and 100.64.0.0/10 is shared address space often used by service providers. The IANA IPv4 Special-Purpose Address Registry documents additional reserved blocks. Do not assume every non-RFC-1918 address is a reachable public host.
3. Network, host, and broadcast addresses
Section titled “3. Network, host, and broadcast addresses”For a conventional IPv4 subnet shorter than /31, the all-zero host portion identifies the subnet (the network address) and the all-one host portion is its directed broadcast address. In 192.168.1.0/24, these are .0 and .255; ordinary hosts commonly use .1 through .254.
That familiar rule has exceptions: /31 is used for point-to-point links without traditional network/broadcast reservations, and /32 identifies one address as a host route. These details matter when planning links or reading routing tables.
255.255.255.255 is the limited IPv4 broadcast address on the local network. A broadcast is not a way to reach every device across the Internet; routers do not forward this limited broadcast.
4. Decide whether to use the gateway
Section titled “4. Decide whether to use the gateway”A host compares a destination with its own address and prefix. If the destination is in the same subnet, it sends directly over the local link. Otherwise, it sends the packet to a configured default gateway, which can route traffic onward. For IPv4 on Ethernet, ARP discovers the next-hop MAC address; IPv6 uses Neighbor Discovery instead.
Example: a host at 192.168.1.50/24 treats 192.168.1.80 as local, but sends traffic for 192.168.2.80 to its gateway. The destination IP remains the remote host; the local frame is addressed to the gateway’s MAC address.
5. Quick checks and common mistakes
Section titled “5. Quick checks and common mistakes”On Windows, ipconfig shows addresses, masks, and gateways. In PowerShell, Get-NetIPConfiguration shows interface and DNS configuration. On Linux, use ip address and ip route.
If a host cannot reach a destination, check that its address and prefix are correct, then check its route and gateway before changing DNS or NAT. A duplicate address can cause intermittent failures. A host with 169.254.x.x may have self-assigned a link-local address because it did not obtain normal configuration; that address does not identify the precise cause by itself.
Common mistakes:
- Treating
172.x.x.xas private: only172.16.0.0/12is RFC 1918 space. - Thinking a private address provides security or that NAT replaces a firewall.
- Reading an IP address without its prefix length.
- Treating
0.0.0.0as a normal host address. Its meaning depends on context; for example, it can mean an unspecified address or a default route.
What you should be able to do now
Section titled “What you should be able to do now”You should be able to explain an IPv4 prefix, identify the three RFC 1918 blocks, distinguish network and broadcast addresses in an ordinary subnet, and decide when a host sends traffic through its gateway.