IP subnets

This article explains how IP Prefix Size, amount of IP addresses in IP subnets, IP netmask and IP Classes are interrelated and correlate with each other. All arranged in one simple table.

Prefix table
Prefix size Amount of IP addresses Usable IP addresses Amount of Class C address space Netmask Class
/32 1 0 1/256 255.255.255.255 Class D
/31 2 0 1/128 255.255.255.254 Class D
/30 4 2 1/64 255.255.255.252 Class D
/29 8 6 1/32 255.255.255.248 Class D
/28 16 14 1/16 255.255.255.240 Class D
/27 32 30 1/8 255.255.255.224 Class D
/26 64 62 1/4 255.255.255.192 Class D
/25 128 126 1/2 255.255.255.128 Class D
/24 256 254 1 255.255.255.0 Class C
/23 512 510 2 255.255.254.0 Class C
/22 1024 1022 4 255.255.252.0 Class C
/21 2048 2046 8 255.255.248.0 Class C
/20 4096 4094 16 255.255.240.0 Class C
/19 8192 8190 32 255.255.224.0 Class C
/18 16384 16382 64 255.255.192.0 Class C
/17 32768 32766 128 255.255.128.0 Class C
/16 65536 65534 256 255.255.0.0 Class C
/15 131072 131070 512 255.254.0.0 Class B
/14 262144 262142 1024 255.252.0.0 Class B
/13 524288 524286 2048 255.248.0.0 Class B
/12 1048576 1048574 4096 255.240.0.0 Class B
/11 2097152 2097150 8192 255.224.0.0 Class B
/10 4194304 4194302 16384 255.192.0.0 Class B
/9 8388608 8388606 32768 255.128.0.0 Class B
/8 16777216 16777214 65536 255.0.0.0 Class B
/7 33554432 33554430 131072 254.0.0.0 Class A
/6 67108864 67108862 262144 252.0.0.0 Class A
/5 134217728 134217726 524288 248.0.0.0 Class A
/4 268435456 268435454 1048576 240.0.0.0 Class A
/3 536870912 536870910 2097152 224.0.0.0 Class A
/2 1073741824 1073741822 4194304 192.0.0.0 Class A
/1 2147483648 2147483648 8388608 128.0.0.0 Class A

NOTE: Keep in mind that in real life use cases, subnets need to have at least 4 IP addresses. This is because the first and the last IP address in a proper subnet is reserved for the gateway and broadcast respectively.

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.