How to Determine Network Prefixes

By Jedadiah Casey

Network prefixes are determined directly from the subnet mask of the network. Internet Protocol networking is used to define three usable classes of addresses exclusively, Class A through C, each of which has its own default IP subnet mask. This is called "classful addressing." Classless Inter-Domain Routing was invented as a way to use variable-length subnet masks, or VLSM, to create more concise IP networks. Subnets based on VLSM include a prefix, such as /24, instead of an IP address, such as 255.255.255.0. You can determine network prefixes by converting the IP address of the subnet.

Step 1

Determine the full subnet mask IP address, such as 255.255.255.192. On a computer system, this can be obtained from the command-line by typing "ipconfig" for Windows systems, and "ifconfig" for UNIX-like systems.

Step 2

Convert each octet of the subnet mask to a binary value. Using the previous example, the result is 11111111.11111111.11111111.11000000.

Step 3

Count the consecutive ones to determine the prefix. In the previous example, the network prefix is /26.

Tips & Warnings

  • The Class A subnet mask is 255.0.0.0 and includes IP addresses from 0.0.0.0 through 127.255.255.255.
  • The Class B subnet mask is 255.255.0.0 and includes IP addresses from 128.0.0.0 through 191.255.255.255.
  • The Class C subnet mask is 255.255.255.0 and includes IP addresses from 192.0.0.0 through 223.255.255.255.
  • Class D addresses are not public and are used for multicast purposes.
  • Class E addresses are also not public and are used for experimental purposes.
  • Neither Class D or E have a default subnet mask.