Reference notes.
IP addresses uniquely identify devices on a network. Understanding addressing and subnetting is fundamental to network design and troubleshooting.
IPv4 Addressing
32-bit addresses written in dotted decimal notation: 192.168.1.1
Private Address Ranges (RFC 1918)
CIDR replaced classful addressing in 1993, though RFC 1918 originally carved these private ranges from legacy classful blocks:
| Legacy Classful Scope | Range | CIDR | Usable Hosts |
|---|---|---|---|
| 1 Class A block | 10.0.0.0 - 10.255.255.255 | 10.0.0.0/8 | 16,777,214 |
| 16 contiguous Class B blocks | 172.16.0.0 - 172.31.255.255 | 172.16.0.0/12 | 1,048,574 |
| 256 contiguous Class C blocks | 192.168.0.0 - 192.168.255.255 | 192.168.0.0/16 | 65,534 |
Special Addresses
100.64.0.0/10- Carrier-Grade NAT / Shared Address Space (RFC 6598; used by ISPs and overlay VPNs such as Tailscale)127.0.0.0/8- Loopback (localhost)169.254.0.0/16- Link-local (APIPA, when DHCP fails)192.0.2.0/24,198.51.100.0/24,203.0.113.0/24- Documentation and examples (RFC 5737)224.0.0.0/4- Multicast0.0.0.0- Default route / “any address”255.255.255.255- Limited broadcast
CIDR Notation
Classless Inter-Domain Routing (introduced in 1993) replaced classful addressing. The /n suffix indicates the number of network bits.
| CIDR | Subnet Mask | Usable Hosts |
|---|---|---|
/32 | 255.255.255.255 | 1 (host route) |
/31 | 255.255.255.254 | 2 (point-to-point, RFC 3021) |
/24 | 255.255.255.0 | 254 |
/16 | 255.255.0.0 | 65,534 |
/8 | 255.0.0.0 | 16,777,214 |
Quick mental maths: (subtracting the network and broadcast addresses), with two exceptions: /31 provides 2 usable hosts for point-to-point links (RFC 3021, no network/broadcast address), and /32 represents 1 host route.
Subnetting
Dividing a network into smaller segments for:
- Security isolation
- Reduced broadcast domains
- Efficient IP allocation
Subnetting Example
Given 192.168.1.0/24, create 4 subnets:
- Need 2 additional bits ( subnets)
- New prefix:
/26(24 + 2) - Each subnet: 64 addresses (62 usable)
| Subnet | Network | Usable Range | Broadcast |
|---|---|---|---|
| 1 | 192.168.1.0/26 | .1 - .62 | .63 |
| 2 | 192.168.1.64/26 | .65 - .126 | .127 |
| 3 | 192.168.1.128/26 | .129 - .190 | .191 |
| 4 | 192.168.1.192/26 | .193 - .254 | .255 |
IPv6 Addressing
128-bit addresses written in hexadecimal: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
Shorthand rules:
- Leading zeros can be omitted:
2001:db8:85a3:0:0:8a2e:370:7334 - One group of consecutive zeros can be replaced with
:::2001:db8:85a3::8a2e:370:7334
Common IPv6 Ranges
::/128- Unspecified address (analogous to0.0.0.0)::1/128- Loopbackfe80::/10- Link-localfc00::/7- Unique Local Addresses (ULA, like private IPv4);fd00::/8is used for locally generated ULAs whilefc00::/8remains reserved2001:db8::/32- Documentation and examples (RFC 3849)2000::/3- Global unicast (public)ff00::/8- Multicast (IPv6 has no broadcast)
NAT (Network Address Translation)
Translates private IPs to public IPs at the network boundary.
- SNAT (Source NAT) - Rewrites the source IP on outbound traffic (can be 1:1, many-to-many, or many-to-one)
- DNAT (Destination NAT) - Rewrites the destination IP/port on inbound traffic (port forwarding)
- PAT / NAPT (Port Address Translation / Network Address Port Translation) - Specifically many-to-one SNAT where multiple hosts share one public IP by translating source ports (also called masquerading)
NAT breaks end-to-end connectivity but conserves IPv4 addresses. IPv6 was designed to eliminate the need for NAT.
See Also
References
- CIDR Report - Global routing table statistics
- ipcalc - Online subnet calculator
- RFC 1918 - Private Addresses
- RFC 4291 - IPv6 Addressing