Back to 1.0 Network Fundamentals

1.5 IPv4 Addressing & Subnetting

The mathematical core of routing. Master Classless Inter-Domain Routing (CIDR), Variable Length Subnet Masks (VLSM), and the rapid mental math required to design scalable networks.

RFC 1918 (Private IP Spaces)

These IP addresses are non-routable on the public internet. You can use them freely inside your client environments, but a NAT router must translate them to a public IP before traffic crosses the ISP boundary.

ClassAddress RangeDefault CIDRTypical MSP Deployment
Class A10.0.0.0 – 10.255.255.255/8Massive enterprise networks and SD-WAN overlays.
Class B172.16.0.0 – 172.31.255.255/12Medium-to-large campus networks and datacenter fabrics.
Class C192.168.0.0 – 192.168.255.255/16Small Office/Home Office (SOHO) and small MSP clients.

The Master CIDR Reference Chart

The Universal Formula

To calculate usable hosts: Usable Hosts = (2 ^ Host Bits) - 2

  • -1Network Address (The very first IP in the block, used to identify the network itself).
  • -1Broadcast Address (The very last IP in the block, used to send packets to every host).
CIDRSubnet MaskBlock SizeWildcard MaskUsable Hosts
/00.0.0.0256255.255.255.2554,294,967,294
/1128.0.0.0128127.255.255.2552,147,483,646
/2192.0.0.06463.255.255.2551,073,741,822
/3224.0.0.03231.255.255.255536,870,910
/4240.0.0.01615.255.255.255268,435,454
/5248.0.0.087.255.255.255134,217,726
/6252.0.0.043.255.255.25567,108,862
/7254.0.0.021.255.255.25533,554,430
/8255.0.0.02560.255.255.25516,777,214
/9255.128.0.01280.127.255.2558,388,606
/10255.192.0.0640.63.255.2554,194,302
/11255.224.0.0320.31.255.2552,097,150
/12255.240.0.0160.15.255.2551,048,574
/13255.248.0.080.7.255.255524,286
/14255.252.0.040.3.255.255262,142
/15255.254.0.020.1.255.255131,070
/16255.255.0.02560.0.255.25565,534
/17255.255.128.01280.0.127.25532,766
/18255.255.192.0640.0.63.25516,382
/19255.255.224.0320.0.31.2558,190
/20255.255.240.0160.0.15.2554,094
/21255.255.248.080.0.7.2552,046
/22255.255.252.040.0.3.2551,022
/23255.255.254.020.0.1.255510
/24255.255.255.02560.0.0.255254
/25255.255.255.1281280.0.0.127126
/26255.255.255.192640.0.0.6362
/27255.255.255.224320.0.0.3130
/28255.255.255.240160.0.0.1514
/29255.255.255.24880.0.0.76
/30255.255.255.25240.0.0.32
/31255.255.255.25420.0.0.12
/32255.255.255.25510.0.0.01

Mental Math & The Subnet Cheat Code

Making the mental leap from seeing a CIDR (like /26) to instantly knowing the Subnet Mask and Block Size is the biggest "aha!" moment in networking. The CIDR number literally just tells you how many "1s" to write down from left to right across the 32-bit IP address.

Example: Decoding a /26

Write down twenty-six 1s, grouped into four 8-bit octets:

11111111 . 11111111 . 11111111 . 11000000

The first three octets are completely full (8 bits each), which equals 255. The 4th octet is our Interesting Octet (where the 1s stop). It has two 1s turned on. If you memorize the sequence below, you instantly know that two bits equals 192.

Subnet Mask: 255.255.255.192
Block Size: 256 - 192 = 64

The 8-Bit Memorization Grid

There are only 8 possible values you will ever see in a subnet mask. Memorize this sequence to calculate block sizes instantly on the exam whiteboard.

1 Bit On128Block Size: 128
2 Bits On192Block Size: 64
3 Bits On224Block Size: 32
4 Bits On240Block Size: 16
5 Bits On248Block Size: 8
6 Bits On252Block Size: 4
7 Bits On254Block Size: 2
8 Bits On255Block Size: 1

Special Addressing Rules

APIPA (Link-Local)

169.254.x.x /16

If a PC is configured for DHCP but cannot reach the server, it assigns itself this address. It cannot route to the internet.

Loopback

127.0.0.0 /8

Used to test the local TCP/IP stack. Pinging 127.0.0.1 never leaves the physical Network Interface Card (NIC).

Default Route

0.0.0.0 /0

The Gateway of Last Resort. Matches all IP addresses. Used to route traffic to the ISP.

Local Broadcast

255.255.255.255

Targeted at all hosts on the local physical network. Routers will drop this packet to prevent broadcast storms.