Keith Sinclair

← Networking

IP Subnetting

These are tables to help in the understanding and generation of VLSM (Variable Length Subnet Masks) networks and CIDR (Classless Inter Domain Routing) which is what the Internet currently uses to route packets on the Internet Backbone. It makes it possible to represent the millions of networks which form the Internet to be represented by less than 100,000 routes.

Although years ago we couldn't use the "Zero Subnet" now we can, current IP stacks support using this address space. Some devices may have to be configured — Cisco routers for example need the command ip subnet-zero put in and while you are at it do ip classless.

Network Address Ranges by Class

ClassRangeDefault Mask
Class A1–127255.0.0.0
Class B128–191255.255.0.0
Class C192–223255.255.255.0

Maximum Number of Hosts by Class

ClassFormulaAddresses
Class A2^2416,777,216
Class B2^1665,536
Class C2^8256

Binary Calculations

2^0100000001
2^1200000010
2^2400000100
2^3800001000
2^41600010000
2^53200100000
2^66401000000
2^712810000000

Subnet Masks — Binary Representations

DecimalBinaryBits
.192110000002 bits
.224111000003 bits
.240111100004 bits
.248111110005 bits
.252111111006 bits
.254111111107 bits
.255111111118 bits

CIDR (Classless Inter Domain Routing) Bits to Mask

This table helps with notation like 192.168.4.4/30

# BitsSubnet Mask
8255.0.0.0
16255.255.0.0
17255.255.128.0
18255.255.192.0
19255.255.224.0
20255.255.240.0
21255.255.248.0
22255.255.252.0
23255.255.254.0
24255.255.255.0
25255.255.255.128
26255.255.255.192
27255.255.255.224
28255.255.255.240
29255.255.255.248
30255.255.255.252
31255.255.255.254
32255.255.255.255

Classful Subnetting Tables

Class B

# BitsSubnet Mask# Subnets# Hosts
2255.255.192.0216,382
3255.255.224.068,190
4255.255.240.0144,094
5255.255.248.0302,046
6255.255.252.0621,022
7255.255.254.0126510
8255.255.255.0254254
9255.255.255.128510126
10255.255.255.1921,02262
11255.255.255.2242,04630
12255.255.255.2404,09414
13255.255.255.2488,1906
14255.255.255.25216,3822

Class C

# BitsSubnet Mask# Subnets# Hosts
24255.255.255.01254
25255.255.255.1282126
26255.255.255.192462
27255.255.255.224830
28255.255.255.2401614
29255.255.255.248326
30255.255.255.252642
31255.255.255.254UNUSEDN/A
32255.255.255.2552551