Let’s look at a VLSM IP address assignment example involving the Class B network 130.20.0.0/16. Using a /20 mask produces 16 subnetworks, as shown in Table 1-19. With the /20 subnet mask, the first 4 bits of the third byte determine the subnets.
Table 1-19 Subnets with the /20 Mask
Third Byte | Subnetwork |
00000000 | 130.20.0.0/20 |
00010000 | 130.20.16.0/20 |
00100000 | 130.20.32.0/20 |
00110000 | 130.20.48.0/20 |
01000000 | 130.20.64.0/20 |
01010000 | 130.20.80.0/20 |
01100000 | 130.20.96.0/20 |
01110000 | 130.20.112.0/20 |
10000000 | 130.20.128.0/20 |
10010000 | 130.20.144.0/20 |
10100000 | 130.20.160.0/20 |
10110000 | 130.20.176.0/20 |
11000000 | 130.20.192.0/20 |
11010000 | 130.20.208.0/20 |
11100000 | 130.20.224.0/20 |
11110000 | 130.20.240.0/20 |
With fixed-length subnet masks, the network supports only 16 networks. Any LAN or WAN link has to use a /20 subnet. In this scenario, if the sites involved vary in size, this “one network size fits all” solution might be a waste of address space and therefore be inefficient. With VLSM, you can further subnet the /20 subnets.
For example, say that you want to subdivide 130.20.64.0/20 to support LANs with about 500 hosts. A /23 mask has 9 bits for hosts, producing 29 − 2 = 510 IP addresses for hosts. Table 1-20 shows the subnetworks for LANs within a specified subnet.
Table 1-20 Subnetworks for 130.20.64.0/20
Third Byte | Subnetwork |
01000000 | 130.20.64.0/23 |
01000010 | 130.20.66.0/23 |
01000100 | 130.20.68.0/23 |
01000110 | 130.20.70.0/23 |
01001000 | 130.20.72.0/23 |
01001010 | 130.20.74.0/23 |
01001100 | 130.20.76.0/23 |
01001110 | 130.20.78.0/23 |
With VLSM, you can further subdivide these subnetworks of subnetworks. Say that you want to use subnetwork 130.20.76.0/23 for two LANs that have fewer than 250 hosts. This subdivision produces subnetworks 130.20.76.0/24 and 130.20.77.0/24. You can also subdivide 130.20.78.0/23 for serial links. Because each point-to-point serial link needs only two IP addresses, you can use a /30 mask. Table 1-21 shows the subnetworks produced.
Table 1-21 Serial-Link Subnetworks
Third Byte | Fourth Byte | Subnetwork |
01001110 | 00000000 | 130.20.78.0/30 |
01001110 | 00000100 | 130.20.78.4/30 |
01001110 | 00001000 | 130.20.78.8/30 |
01001110 | 00001100 | 130.20.78.12/30 |
… | … | … |
01001111 | 11110100 | 130.20.79.244/30 |
01001111 | 11111000 | 130.20.79.248/30 |
01001111 | 11111100 | 130.20.79.252/30 |
Each /30 subnetwork includes the subnetwork number, two IP addresses, and a broadcast address. Table 1-22 shows the bits for 130.20.78.8/30.
Table 1-22 Addresses Within Subnetwork 110.20.78.8/30
Binary Address | IP Address | Function |
10000010 00010100 01001110 00001000 | 130.20.78.8 | Subnetwork |
10000010 00010100 01001110 00001001 | 130.20.78.9 | IP address 1 |
10000010 00010100 01001110 00001010 | 130.20.78.10 | IP address 2 |
10000010 00010100 01001110 00001011 | 130.20.78.11 | Broadcast address |
Loopback Addresses
You can reserve a subnet for router loopback addresses. There are several reasons to use loopback addresses:
- A loopback address provides an always-up interface to use for router-management connectivity.
- A loopback address can serve as the router ID for some routing protocols.
- A loopback address is reachable even if a single interface goes down on a device that has multiple interfaces.
- They are used for IP telephony (for example, in the configuration of dial peers).
- A loopback address is used as the source IP address for network management and monitoring.
The loopback address is a single IP address with a 32-bit mask. In the previous example, network 130.20.75.0/24 could provide 256 loopback addresses for network devices, starting with 130.20.75.0/32 and ending with 130.20.75.255/32.