Classless Inter-Domain Routing (CIDR) aka Supernetting

Supernetting is best illustrated with an example. Let’s say that we wanted to aggregate the 8 network addresses between 131.0.0.0 and 131.7.0.0. In order to do this, we need to find a subnet mask value that makes all 8 network addresses appear to be on the same single network. Remember the ANDing process? By the time we’re done, we should be able to AND together any two addresses in that range of 8 networks, and come up with the exact same value.

Recall that when subnetting, we stole bits from the host portion of an address, moving from left to right. When we’re supernetting, we’re going to do the opposite – instead of stealing bits from the host portion, we’re going to steal low-order bits from the network portion. So this time, we’re going to steal bits from right to left.

How many bits do we need to supernet 8 networks? Unlike with subnetting, we don’t subtract 2 this time. In this case we need 3 bits, since 23 is 8.

Recall also that by default, a Class B address has a subnet mask of 255.255.0.0 (or /16). If we steal 3 bits from the network portion of the subnet mask, we end up with the mask shown below.

Figure: Network and host portions after using CIDR to create a /13 mask.

Supernetting really is no more difficult than that. Instead of stealing host bits, we steal network bits. If you look at Figure 5-28, notice that each of my 8 network IDs appear to be on the exact same network when I use a mask of 255.248.0.0, or /13. As such, the range can now be designated as 131.0.0.0/13. This value aggregates all addresses between 131.0.0.1 and 131.7.255.254.

Figure: Network portion of addresses after supernetting.

Think about why CIDR is so important. Small ISPs are the customers of larger ISPs, who may in turn be the customer of a Tier 1 network provider like WorldCom or AT&T. In cases like this, where a major ISP may have many smaller ISPs as customers, supernetting allows many networks to be reached through a single or smaller number of routing table entries. Just keep in mind that a large ISP is likely aggregating many Class B or C blocks of addresses together.

If you want a supernetting shortcut, just go back to the subnetting shortcut table that we looked at previously. Imagine that you wanted to supernet together 4 Class B addresses. You would simply look in the Range Multiples row, find the value of 4, and then look up. Supernetting 4 Class B addresses together is accomplished using a mask of /14, or 255.252.0.0. Just remember which way you’re stealing bits!

Tip: Remember that if you are asked to summarize routing table entries on an exam, what you are really being asked to do is supernet the networks into a single routing table entry.

It’s really important to remember that only certain contiguous ranges will work together when supernetting. For example, if you had the network address 165.43.0.0 and wanted to supernet it with 8 other ranges, you would need to determine the correct 8 ranges that the 165.43.0.0 network can be aggregated with. The easiest way to do this is to AND the 165.43.0.0 network address with the 255.248.0.0 subnet mask (since we already know that supernetting 8 class B addresses uses this mask). The answer from the ANDing process will show you the beginning of the range.

Figure: Calculating the network ID based on a custom subnet mask using ANDing.

Since the network ID becomes 165.40.0.0 after the ANDing process, we now know that the 165.43.0.0 network ID must be aggregated with the 8 network IDs that span from 165.40.0.0 up to 165.47.0.0.

CIDR use is not limited to the public Internet. It can also be used on internal company networks to aggregate routes behind a smaller number of routing table entries. For example, imagine that the subnets 131.107.8.0/24 through 131.107.15.0/24 all exist behind one router. Instead of adding entries for all eight networks in the routing table, a single entry could be added for network 131.107.8.0/21 instead. In effect, the address 131.107.8.0/21 “summarizes” all eight networks into one network routing table entry. This technique, known as route summarization, is also used by some routing protocols to reduce the number of networks that they need to advertise to other routers. Route summarization is looked at in more detail in Chapter 8. Ultimately, techniques like route summarization make routing faster and more efficient, and are especially useful within large organizations.

Tip: For more information on Classless Interdomain Routing, see RFC 1519.

Author: Dan DiNicolo

Dan DiNicolo is a freelance author, consultant, trainer, and the managing editor of 2000Trainers.com. He is the author of the CCNA Study Guide found on this site, as well as many books including the PC Magazine titles Windows XP Security Solutions and Windows Vista Security Solutions. Click here to contact Dan.