As the Internet has grown, it has become more difficult for organizations to obtain Class A or Class B addresses for their networks. Most Class A or B network addresses have already been assigned. The problem is compounded by the fact that Class C networks are limited to a maximum of 254 hosts.
One solution to this problem is supernetting. To create a supernetwork, or supernet, an organization uses a block of IP addresses assigned to several Class C networks to create one large network. In this article, I will cover the procedures involved in creating a supernetwork.
Let's take a look at a typical networking problem for a medium-size organization. In this example, TechRepublic needs IP addresses for 1,000 hosts. There are no Class A or Class B addresses available, so TechRepublic applies for and receives a block of four Class C addresses. TechRepublic can now employ these addresses using one of the following three options:
- The address block may be used to create four separate Class C networks.
- The addresses may be subnetted to create more than four subnetworks.
- The addresses may be combined to create one supernetwork.
Figure A shows how four separate Class C networks may be combined to create one large supernetwork.
|With supernetting you can combine small networks into one larger network.|
Figure A shows IP addresses within the following Class C subnetworks:
These four smaller networks have been combined to create the 192.168.64.0 supernetwork. Class C supernetworks will usually assume the address of the subnetwork with the lowest IP address, in this case, 192.168.64.0.
Creating the supernetwork mask
Before I discuss creating a supernetwork mask, I should cover some points about the regular Class C subnet mask. The default subnet mask for Class C networks is 255.255.255.0. In binary format, this is written as:
The 1s in the mask represent the network ID (Netid) section of the address, and the 0s represent the host ID (Hostid) section. When a subnetwork is created, we first create the subnet mask by changing some of the 0s in the Hostid section to 1s.
For example, to create four separate subnetworks from one Class C network, we would simply add two bits (22 = 4) to the default subnet mask. Example A shows how this is done.
|11111111 11111111 11111111.||11000000|
With this new subnet mask, the network has been transformed from one Class C network with up to 254 hosts to four separate subnetworks, each with 64 (26 = 64) hosts. However, because the IP with all host bits set to 0 and the IP address with all bits set to 1 are both reserved, there is actually a limit of 62 hosts for each subnetwork.
To create a supernetwork, we reverse the procedure. Remember, what we are trying to do here is make room to combine networks by creating space for a larger number of hosts. To accomplish this, we start with the default subnet mask of 255.255.255.0 and use some of the bits reserved for the Netid to identify the Hostid. Example B shows we would create a new supernetwork by combining four separate subnetworks.
|New supernet mask|
|Original subnet mask|
This new supernetwork can now accommodate 210, or 1024 hosts. If the first Netid is 192.168.64.0, the next three Netids will be 192.168.65.0, 192.168.66.0, and 192.168.67.0.
Now, when the router for the new supernet receives an incoming packet, the new supernet mask is applied to the destination IP address, and a bitwise AND operation is performed. If the result of this bitwise AND operation and the lowest network IP address are the same, the router knows that the packet must be routed to a host on the supernet. A bitwise AND operation compares an IP address to a subnet mask to discover which network an IP packet will be routed to.
Bitwise AND operations
The principle behind bitwise AND operations is simple: If the first operator has a value of 1 (true) and the second operator has a value of 1 (true), then the value returned is true. In all other cases, the value returned is false (0).
Let's look at an example of this procedure. If a packet arrives at the router with the destination address 192.168.64.48, the supernet mask 255.255.252.0 is applied to the destination address.
11000000.10101000.01000000.00110000 (destination IP address)
11111111.11111111.11111100.00000000 (supernet mask)
In this example, the value returned by the bitwise AND operation is 192.168.64.0. This is the lowest available IP address on the supernet. This router then uses this information to forward the incoming packet to a host on the newly created supernetwork.
Classless interdomain routing
When a supernetwork is created, the result is a Class C network capable of hosting more than 254 IP addresses (hosts). One potential problem with supernetting occurs with routing tables. Normally, each of these 254 IP addresses and the applicable subnet mask would have to be entered into the routing table. To eliminate the need to enter each IP address into the routing table, we use classless interdomain routing (CIDR). With this form of routing, the only entries in the routing table are the supernetwork mask and the lowest IP address available on the supernetwork. Example C shows an example of a routing table using the default Class C subnet mask, and a routing table with the supernetwork mask.
|Default Mask||Network Address||Next Hop|
|Default Mask||Network Address||Next Hop|
No Next Hop
The new routing table is able to determine that the packet is being sent to a host on the new 192.168.64.0 supernetwork, and the packet is sent directly to the destination IP address without being forwarded to another router. For this reason, there is no entry in the Next Hop column in the routing table.
When CIDR is employed, a bitwise AND operation is performed on the destination IP addresses on incoming packets. In Example C, when a packet is addressed to a host on any of the following networks:
192.168.64.0, 192.168.65.0, 192.168.66.0, 192.168.67.0
the new routing table is able to determine that the packet is being sent to a host on the new 192.168.64.0 supernetwork, and the packet is sent directly to the destination IP address.