NOTATION

Using the last subnet mask in the above example, we have 1022 host addresses. What if our computer actually had host address 768 on subnet 4? What would be our actual IP address? We cannot say it is 165.10.4.768 since with decimal notation no byte can be more than 255. The actual IP address would be 165.10.7.0 so you do need to know the subnet mask before determining the actual subnet address and host address.

There is a simpler way of representing the actual IP address and that is by using the Classless InterDomain Routing (CIDR) scheme. With this scheme the concept of A, B and C classes is eliminated, but the concept of subnetting is retained. In the above example, we use a total of 22 bits of contiguous 1s in our mask so we would display our IP address as 165.10.7.0/22. Although it is still not obvious that we are host 768 on subnet 4 of network 165.10, we can figure it out using this single notation which tells us exactly where the subnet mask separates the network and host addresses.

For example, in a previous lesson we mentioned that there were one A, 32 B and 256 C addresses that were strictly private and cannot be accessed through the Internet. These are as follows:

10.0.0.0 to 10.255.255.255

172.16.0.0 to 172.31.255.255

192.168.0.0 to 192.168.255.255

Notice that the first range is a single A address with 24 bits of host addressing, the second are B addresses with 16 bits of host addressing and the third are C addresses with 8 bits of host addressing. Using CIDR notation these same address ranges can be displayed as follows:

10.0.0.0/8

172.16.0.0/12

192.168.0.0/16

The natural mask for a Class A address is 255.0.0.0 which means eight contiguous 1s from the left so 10.0.0.0/8 represents the natural mask for a Class A address. This is what we would expect. A single Class A network address with provisions for 24 bits of host addressing. The natural mask for a Class B address is 255.255.0.0 which, with CIDR notation, would be /16 but the above class B addresses have only 12 mask bits of contiguous 1s. This seems to violate our rule for subnetting and it does. With subnetting you move the bits to the right of the natural mask, thereby, consuming host bits. Instead, we are moving the mask to the left of the natural mask (changing 1 bits to 0s) consuming network bits. This is called supernetting which requires contiguous network addresses and will be discussed shortly. By moving the mask to the left by four bits from the natural mask, we can gain more host addresses at the expense of 16 contiguous network addresses. Therefore, the notation 172.16.0.0/12 is short for indicating a range of contiguous network addresses from 172.16.0.0 to 172.31.0.0. The same is true for the last example which are C class addresses. The natural mask for a C address is /24. Instead the CIDR notation is a /16 meaning eight less mask bits, thereby, yielding a range of network addresses from 192.168.0.0 to 192.168.255.0.

SUPERNETTING

The inverse of subnetting is supernetting. Instead of moving mask bits to the right of the natural mask for subnetting, we move mask bits to the left for supernetting. With subnetting we create more network addresses at the expense of host addresses. With supernetting we create more host addresses at the expense of network addresses. Supernetting is not for users since it would be difficult for users to be granted a range of contiguous network addresses. Supernetting is for Internet Service Providers (ISPs) who are attempting to obtain the most efficient allocation of IP addresses using the A, B, C class scheme.

Subnetting a Class C Address
Subnet Mask
CIDR
# Subnets
# Host
11111111.11111111.11111111.00000000
/24
0
254
11111111.11111111.11111111.11000000
/26
2
62
11111111.11111111.11111111.11100000
/27
6
30
11111111.11111111.11111111.11110000
/28
14
14
11111111.11111111.11111111.11111000
/29
30
6
11111111.11111111.11111111.11111100
/30
62
2
The natural mask for a Class C address is 255.255.255.000 which provides for up to 254 host addresses. By moving the mask bits to the right (replacing 0s for 1s), subnets are created at the expense of host bits. Not shown are masks /25 and /31 since they are not allowed. Similar charts can be made for Class A and Class B addressing. Class A subnetting begins at /10 and class B at /18. Both end at /30.

Table 2 — Subnetting a Class C Address

SUMMARY

Although a 32-bit IP address offers an extremely large number of addresses, the A, B, C, class structure does not make efficient use of <netid, hostid> assignments. Subnetting improves the situation by allowing a finer split between network and host assignments while improving the performance and maintainability of large networks.

References

Illustrated TCP/IP, Matthew Naugle, 1998, Wiley Computer Publishing

Practical Networking With Ethernet, Charles E. Spurgeon, 1997, International Thomson Computer Press

International Standard ISO/IEC 8802-3 ANSI/IEEE Std 802.3, 1996, The Institute of Electrical and Electronic Engineers, Inc.

TCP/IP Clearly Explained, Pete Loshin, 1997, Academic Press

TCP/IP Illustrated Volume I, The Protocols, W. Richard Stevens, 1994, Addison-Wesley Publishing Company