Subnetting Shortcuts- Part 1

Many CCNA candidates have trouble with subnet masking (and some CCNP candidates, as well!). Over the next few weeks, we’ll learn some shortcuts that make subnet masking calculations easier. But first, a review …

Recall that the IPv4 address space is subdivided into five regions, referred to as Class A, B, C, D and E:

  • Class A: The first octet is in the range of 1 to 126 (networks 0 and 127 are reserved). By default, the first octet is network information, and the last three octets are host information.
  • Class B: The first octet is in the range of 128 to 191. By default, the first two octets are network information, and the last two octets are host information.
  • Class C: The first octet is in the range of 192 to 223. By default, the first three octets are network information, and the last octet is host information.
  • Class D: The first octet is in the range from 224 through 239. These are reserved for Multicast, and never assigned to hosts (and thus have no subnet masks).
  • Class E: The first octet is in the range from 240 through 255. These are reserved for Research (effectively unused).

Also recall the rules for subnet masks:

  • Like IPv4 addresses, subnet masks for IPv4 are always 32 bits in length.
  • A “1” in a bit position of a mask indicates that the corresponding address bit is network-type (network or subnet) information.
  • A “0” in a bit position of a mask indicates that the corresponding address bit is host information.
  • Subnet masks must be contiguous, meaning that the1’s must form an unbroken string starting from the left, with the zeros to the right.

Putting together the A, B and C ranges with the rules for subnet masks:

  • Class A: The default subnet mask is 255.0.0.0 (all 1’s in the first octet, zeros thereafter). Since there are eight 1’s in the subnet mask, this mask can also be represented as “/8”.
  • Class B: The default subnet mask is 255.255.0.0 (all 1’s in the first two octets, zeros thereafter). Since there are sixteen 1’s in the subnet mask, this mask can also be represented as “/16”.
  • Class C: The default subnet mask is 255.255.255.0 (all 1’s in the first three octets, zeros in the fourth octet). Since there are twenty-four 1’s in the subnet mask, this mask can also be represented as “/24”.
  • The “slash” notation (such as “/8”) is commonly referred to as “CIDR” (“Classless Inter Domain Routing”) or “bit-count” notation.

Finally, recall that subnet masks allow hosts and routers to calculate the subnets on which particular addresses reside. For example, if a host has an address of 192.168.1.99 and a mask of 255.255.255.0, the host knows that its own subnet is 192.168.1.0/24. How does it know? It does a “bitwise-AND” calculation using the address and mask (multiply the bits in each column):

11000000.10101000.00000001.01100011 (address of 192.168.1.99)
11111111.11111111.11111111.00000000 (mask of 255.255.255.0)
———————————————————
11000000.10101000.00000001.00000000 (subnet is 192.168.1.0)

Likewise, if a router’s FastEthernet 0/0 interface has an address of 172.16.100.200 with a mask of “/24”, the router places a connected (“C”) route for 172.16.100.0/24 into its routing table, associated with that interface.

Next time, we’ll take a look at the calculations in more detail, and begin the shortcuts.

Author: Al Friebe

In this article

Join the Conversation

1 comment

  1. Beth Reply

    Thank you for the subnetting tips

    Beth