IPv4 IP Subnet – What Are the Component Names of CIDR Prefix Notation?

ipip addressipv4rfcsubnet

What are the components of the IETF's CIDR Prefix Notation called?

172.16.0.0/16 contains two parts:

  • 172.16.0.0
  • /16

In the RFC the entire term 172.16.0.0/16 is defined as the "Prefix Notation" for the network 172.16.0.0 with the subnet mask of 255.255.0.0

  • My (potentially incorrect) understanding is:
  • 172.16.0.0 would be considered the Network Name or Network ID
  • /16 is the CIDR Notation for that network name.

Unfortunately, that definition does not exist within the RFC!

Hoping to get clarification! Writing a paper for my degree and I want to be sure that I define my terms correctly.

Best Answer

For your example of 172.16.0.0/16, the 172.16.0.0 is both the IPv4 network address and a host address, but not a usable host address. It could be the network address, and it may be a usable host address with a different mask length (for example, it is a usable host address with a /11 or shorter mask length). It could even be both a network address and a usable host address if the mask length is /31. The /16 tells you the length of the mask (number of consecutive 1 bits), and I call it the mask length (can be called the prefix length, depending on the context).

An IPv4 address is a 32-bit unsigned integer (a binary cardinal number from 00000000000000000000000000000000 to 11111111111111111111111111111111, or 0 to 4294967295 in decimal). Don't read anything into the fact that it is expressed as four decimal octets; that is simply to make it easier for humans to read; network devices deal with the binary number, not the text representation.

A network mask for IPv4 is also a 32-bit unsigned integer, but it consists of consecutive bits set to 1, followed by any other bits set to 0. The mask determines which part of the IP address is the network, and which part is the host number in the network.

If you do a bitwise AND of the IP address and the mask, you will get the network address. You need to do IP math in binary; trying to use decimal will lead to stupid errors.

IPv4 address 172.16.0.0 -> 10101100000100000000000000000000
Mask length 16          -> 11111111111111110000000000000000
Bitwise AND             -> ================================
IPv4 network address    -> 10101100000100000000000000000000

If you have an address and mask, you have everything you need to calculate everything about the IPv4 address. See the question, How do you calculate the prefix, network, subnet, and host numbers? for how to do IP math.


IPv6 addressing works the same way, except that IPv6 addresses are 128 bits instead of the IPv4 32 bits, and all IPv6 addresses in a network are usable host addresses because IPv6 does not have broadcast.