Subnet Mask and CIDR Subnet Table

Subnet Mask Definition

Every device has an IP address with two pieces: the client or host address (0) and the server or network address (1). IP addresses are either configured by a DHCP server or manually configured (static IP addresses). The subnet mask splits the IP address into the host and network addresses, thereby defining which part of the IP address belongs to the device and which part belongs to the network.

The device called a gateway or default gateway connects local devices to other networks. This means that when a local device wants to send information to a device at an IP address on another network, it first sends its packets to the gateway, which then forwards the data to its destination outside of the local network.

CIDR Subnet Table:


Subnet Mask

CIDR Prefix

Available client IP's

255.255.255.255

/32

1

255.255.255.254

/31

2

255.255.255.252

/30

4

255.255.255.248

/29

8

255.255.255.240

/28

16

255.255.255.224

/27

32

255.255.255.192

/26

64

255.255.255.128

/25

128

255.255.255.0

/24

256

255.255.254.0

/23

512

255.255.252.0

/22

1024

255.255.248.0

/21

2048

255.255.240.0

/20

4096

255.255.224.0

/19

8192

255.255.192.0

/18

16,384

255.255.128.0

/17

32,768

255.255.0.0

/16

65,536

255.254.0.0

/15

131,072

255.252.0.0

/14

262,144

255.248.0.0

/13

524,288

255.240.0.0

/12

1,048,576

255.224.0 0

/11

2,097,152

255.192.0.0

/10

4,194,304

255.128.0.0

/9

8,388,608

255.0.0.0

/8

16,777,216

254.0.0.0

/7

33,554,432

252.0.0.0

/6

67,108,864

248.0.0.0

/5

134,217,728

240.0.0.0

/4

268,435,456

224.0.0.0

/3

536,870,912

192.0.0.0

/2

1,073,741,824

128.0.0.0

/1

2,147,483,648

0.0.0.0

/0

4,294,967,296


Where do CIDR numbers come from?

The CIDR number comes from the number of ones in the subnet mask when converted to binary.

The typical subnet mask 255.255.255.0 is 11111111.11111111.11111111.00000000 in binary. This adds up to 24 ones, or /24 (pronounced ‘slash twenty-four’).

A subnet mask of 255.255.255.192 is 11111111.11111111.11111111.11000000 in binary or 26 ones, hence /26.

Class address ranges:

  • Class A = 1.0.0.0 to 126.0.0.0
  • Class B = 128.0.0.0 to 191.255.0.0
  • Class C = 192.0.1.0 to 223.255.255.0

Reserved address ranges for private (non-routed) use:

  • 10.0.0.0 -> 10.255.255.255
  • 172.16.0.0 -> 172.31.255.255
  • 192.168.0.0 -> 192.168.255.255

Other reserved addresses:

  • 127.0.0.0 is reserved for loopback and IPC on the localhost
  • 224.0.0.0 -> 239.255.255.255 is reserved for multicast addresses

Note: The use of /31 networks is a particular case defined by RFC 3021 where the two IP addresses in the subnet are usable for point-to-point links to conserve IPv4 address space. 

References:

Add comment

reload, if the code cannot be seen