Extending IP Addresses


In the past, when the Network Information Center (NIC) assigned a network number to an organization, it assigned either the first octet (a Class A network), the first two octets (a Class B network), or the first three octets (a Class C network). The organization could take this one network number and further subdivide it into smaller networks through a process called subnetting.

To illustrate, let’s say that your organization has been assigned the Class B network 172.16.0.0. You have several different network segments, each of which needs a unique network number. So you decide to subnet your network. You use a subnet mask of 255.255.255.0. The subnet mask determines which portion of your IP address belongs to the network portion and which part belongs to the host portion. If you write your subnet mask out in binary, as illustrated in Table 7.1, the 1s correspond to the network portion of the address, and the 0s correspond to the node portion of the address.

Table 7.1: IP Address Example

Decimal

172

16

0

0

Binary

10101100

00010000

00000000

00000000

Decimal

255

255

255

0

Binary

11111111

11111111

11111111

00000000

So in your case, instead of having one network (172.16.0.0) with 65,534 available hosts numbers, you have 254 networks (172.16.1.0–172.16.254.0) with 254 available host numbers in each subnet.

You can calculate the number of hosts available on a subnet by using the formula 2n – 2 = number of available host IPs, where n is the number of hosts bits (in your example, 8). The minus 2 (–2) represents all host bits on and all hosts bits off, which are reserved for the subnet address and the broadcast address and cannot be used for addressing of hosts.

Similarly, the number of networks (or subnets) can be calculated with nearly the same formula: 2n – 2 = number of available networks, where n is the number of subnet bits (in your example, 8). So with subnetting, you have balanced your need for available network and host numbers. However, there may be instances where you need fewer host numbers on a particular subnet and more host numbers on another. The –2 represents all subnet bits on and all subnet bits off.

Let’s extend this example to include a serial link between two routers, as shown in Figure 7.1.

click to expand
Figure 7.1: IP address example

Because these are routers and not switches, each interface belongs to a different network. However, the serial interfaces need to share the same network to talk. How many IP numbers do you really need on the network interconnecting the two routers? You only need two IP numbers, one for each serial interface, as shown in Figure 7.1. Unfortunately, you have an 8-bit subnet mask (i.e., 255.255.255.0), so you’re wasting 252 of the 254 available numbers on the subnet.

One possible solution to this dilemma is to use variable-length subnet masks (VLSMs).

Variable-Length Subnet Masks (VLSMs)

IP version 4 addresses are composed of a network portion and a host portion that can be thought of like a two-part zip code with its five-digit prefix and four-digit suffix. The prefix directs the post office to a general destination— the city and state—and the suffix resolves to a street address or a P.O. box. An IP address, with its network and node portions, works much the same way, as you can see in Figure 7.2.

click to expand
Figure 7.2: The makeup of an IP version 4 address

The network portion works just like the five-digit prefix of a zip code, and the node or host portion is the unique identifier, similar to the four- digit suffix of a zip code. An IP version 4 address consists of 32 bits broken down into four 8-bit segments known as octets. As shown in Figure 7.2, the first three octets define the network portion, and the last octet defines the host. We’ll discuss how the network and host portions may be changed by providing certain information later in this chapter.

For a router to route data, it obviously needs to know where to send it. Routers don’t maintain information for every unique address in their tables because doing so would make their tables so huge that they would require enormous amounts of memory and processing time. It’s much more practical and efficient for them to maintain a table that contains only the network information. If a unique host or address isn’t directly connected to a router, it looks in its table to find the appropriate path on which to send the data for them to reach their particular destination. So a router doesn’t need to know a specific host’s address; its only concern is to accurately identify the network on which it’s located.

The specification of the host and network portions within an IP address establishes an inherent hierarchy consisting of different network lengths being advertised throughout a network or over the Internet. Using a hierarchy when implementing IP addressing provides two main benefits:

  • Since IP addresses can be broken down into smaller subnets to accommodate addressing requirements, address space is conserved.

  • Route information can be summarized, greatly reducing the size of route tables and the need for the router to know a route to every network.

Figure 7.3 shows what is meant by varying network portion length.

click to expand
Figure 7.3: Hierarchical IP address structure

Longer network prefixes reside near the bottom of the network tree. The network length is depicted by a /24 or /26 suffixed to an IP address, which specifies the number of bits (beginning from the left) that define the network portion. The first 24 binary bits are equal to the first three octets in the dotted decimal format of an IP address.

As you move up through the network diagram, you can see that the network prefix gets smaller—decreasing from /24 and /26 down to /16. This hierarchy enables routers to determine where to send data when the packet’s destination isn’t directly connected to the local router. A good example of this can be seen in Figure 7.4, which portrays three different WANs connected to the Internet.

click to expand
Figure 7.4: Hierarchical routing decisions

Each WAN has a specific network that it advertises to the Internet, but it doesn’t reveal every host that resides within the network. It advertises information to the Internet only in the most general manner possible.

WAN A advertises the network 172.16.0.0/16 (equivalent to advertising the 172.16.0.0 network as a Class B IP address). Many different host addresses exist within WAN A that fall within the IP address range specified by the /16 subnet. However, to preserve the hierarchy, only a general address is advertised.

So if a host that’s on WAN C wants to reach a host on WAN B (192.68.10.2), it sends the packet to the default gateway router. At this point, the router is interested only in the network portion of the IP address in the packet’s header. After determining which network the packet is destined for, the router forwards the packet to the next hop. In this example, the packet is forwarded to Router A within WAN C and then to Internet Router C. Then Internet Router C learns about network 192.68.0.0/16 from Internet Router B. So as you can see, no information has been advertised about where 192.68.10.0 is located. Since WAN B advertised general information (that it knows about all 192.68.0.0/16 addresses), it doesn’t need to advertise that it has routes to 192.68.10.0/24, 192.68.1.0/26, and 192.68.40.0/24.

All of this can be made clear by working back down the hierarchical tree. Once the packet is forwarded to the border router in WAN B, that device is the one that needs to know the more specific information. At the border router’s level, each subnet is advertised. Therefore, a proper routing decision can be made, and the packet reaches its correct destination on network 192.68.10.0.

How is the length of the network prefix determined? To answer that, let’s review IP version 4 addressing. In the beginning (see RFC 760), IP version 4 addresses weren’t assigned classes. Instead, the network portion of the address was assigned to the first octet. This allowed for only 254 IP networks. To resolve this dilemma, RFC 791 was defined and written. This RFC converted a previously classless IP address structure into specific classes—five to be exact. The three most common ones are Classes A, B, and C, and prefix lengths were defined as 8 bits, 16 bits, and 24 bits, corresponding to Classes A, B, and C respectively. The first three bits in the first octet were used to determine the IP address class.

Table 7.2 shows how classes were defined by RFC 791.

Table 7.2: RFC 791 IP Class Assignments

Address Class

Bit Specification

A

0

B

10

C

110

These bit specifications not only defined the IP class, but they also predefined the shortest subnet mask for the address.

The assigned masks are depicted in Table 7.3, wherein the prefix for each class varies from 8 bits to 24 bits. You can see a prefix of 8 bits, with the first bit set to 0 (27), which allows for 126 Class A networks. The Class B prefix of 16 bits, with the first bit set to 1 and the second bit set to 0 (214), allows for 16,384 Class B networks. Finally, the Class C prefix of 24 bits, with three bits being used for class definition (221), allows for 2,097,152 Class C networks. So as you can see, the available network numbers, using the classfull scheme, are finite. Although 2,097,152 networks seems like a very large number of networks, when you look at it within a global frame of reference, you can see that they can eventually run out.

Table 7.3: Classfull IP Subnet Mask Assignments

Address Class

Subnet Mask

A

255.0.0.0

B

255.255.0.0

C

255.255.255.0

To deal with (and work around) these inherent limits, new methods of subnetting needed to be developed and implemented—the variable-length subnet mask (VLSM) is one of those methods. Because the VLSM provides much greater flexibility when deploying IP version 4 addresses, it’s much more efficient than just using standard classfull subnets. Instead of being forced to use predefined masks, a network designer can be more specific with regard to the number of hosts that can be assigned to a given network segment.

We have discussed the importance of an addressing hierarchy and the information routers need to route data, as well as the differences between classic IP subnets and the VLSM approach. Now we’ll move on to discuss in detail the important design considerations when planning a network.

VLSM Design Considerations

If you look at the 32-bit IP address again—understanding that the address is divided into the network and host (node) portions—using VLSM, you can create the division between the two at any point desired. To understand what is meant by dividing the network and host portions, refer to Figure 7.5.

click to expand
Figure 7.5: VLSM subnet adjustment

Figure 7.5 depicts a generic 32-bit IP address. The dark line signifies the division between the network and host portions of the address. As discussed previously, in classfull IP subnets, the division could take place only after 8, 16, and 24 bits. It was those divisions that created the subnet masks shown in Table 7.3.

However, by using VLSM, the division can be slid to the left or right to adjust the subnet mask. Why is this important? Because as the division between network and host identifying bits is moved, the number of hosts on the defined network changes respectively.

For reference, take the classfull Class C address. A Class C address contains 254 host nodes—254 because 0 and 255 are reserved for network and broadcast addresses. As depicted in Figure 7.5, when the mask is between the 24th and 25th bit, it is a Class C address with 254 hosts. On the second example in Figure 7.5—the first example of a VLSM-manipulated IP address—you can see that the division lies between the 25th and 26th bits. This allows seven bits for host identification and is the equivalent of one-half of a Class C address. The numerical definition would be 0 to 127, and because 0 and 127 are reserved for network and broad-cast addresses, one-half of the remaining Class C addresses gives you 126 host addresses.

Two more examples follow in Figure 7.5, with the VLSMs’ equivalency to a Class C address shown at the right. In the third example, the network portion is 20 bits long, leaving 12 bits for host addresses. So referencing these numbers, you can see that the range is from 0 to 4,095. If you subtract 2, you’re left with 4,094 possible hosts for this network. The fourth example is a network that reserves only two bits for host addresses, permitting two hosts per network.

Because greater flexibility can be achieved through VLSM IP address assignment within a network, it’s an efficient method to choose if you need to accommodate a large number of hosts. This increase in availability is made possible simply by moving the division between the network and host addresses to the left. Conversely, if you need more networks, all you have to do is move the division to the right.

VLSM goes much further than just increasing subnet mask tractability for the network. Traditionally, only one subnet could be assigned to a network. However, VLSM allows for more than one subnet to be assigned to a network—but there’s a catch.

Discontinuous IP addresses should be avoided. To implement VLSM properly, the networks you’re working with should be physically connected to the same router. Why is this important? Take a core router, for example. Core routers usually have many connections from other routers and switches— even from other LAN segments linked into them. For a picture of this architecture, look at Figure 7.6.

Figure 7.6 shows a core router with several connections. Instead of using a separate Class C address for each link, VLSM can be implemented to more efficiently utilize a classfull Class B network.

click to expand
Figure 7.6: VLSM implementation example

The Class B network has been broken down into six different networks, with each one providing only for the number of hosts necessary. When connecting two routers, only two IP host addresses are needed, and setting the subnet mask to /30 (or 255.255.255.252) defines two host IP addresses for the network. The network numbers in Figure 7.6 designate that the links connecting the core router to either a distribution or an access router use a subnet of /30. This specifies one address for the core router interface and one IP address for the opposite end of the link.

Look at the network diagram again—do you see subnets /26 and /29? Subnet /26 is used to connect to a switch, and using the /26 mask allocates 64 IP addresses to the switch’s segment. However, remember that two of those addresses are reserved, so in reality, 62 machines (including the switch and router) can possibly be configured on this segment. The last mask of /29 allows for even fewer hosts. There are only three routers connected to the FDDI ring, and six host addresses can be used within the 172.16.1.20 network. If more routers were added to the FDDI ring, the subnet mask could be modified to allow for more hosts.

The beauty of VLSM is that it allows you to take a Class B address and break it down into a Class C equivalent CIDR (classless interdomain routing) block (172.16.1.0) and then create six subnets from that. Why is this useful? Because not only does it conserve IP addresses, it also creates a hierarchy within the core router. This gives the router different networks for each active interface and allows it to just route instead of relying on the ARP table. Can you imagine wasting an entire Class B network on one router? If the Class B network were used without subnetting, the network would be flat, with no hierarchy.

Note

We’ve used three different masks—/26, /29, and /30—and it’s recommended that you don’t use more than two or three different masks for each network.

So far it looks pretty easy, doesn’t it? But don’t forget, a great number of networks were designed when VLSM wasn’t yet available, and routing protocols like RIP and IGRP don’t carry subnet mask information along with the IP address. So networks designed and implemented before routing protocols like Enhanced IGRP (EIGRP), OSPF, and RIP2 were available could have IP addresses allocated in a way that just doesn’t facilitate grouping them into blocks for VLSM implementation. With cases like these, you would have to renumber IP addresses—a rather deplorable task that many network administrators don’t want anything to do with—to implement VLSM.

However, VLSM can greatly enhance potential IP address allocation and simultaneously create a hierarchical architecture within the network. So if renumbering the network is necessary to implement VLSM, it’s well worth it in the long run. If you do, you’ll be able to utilize IP address space more efficiently, plus (believe it or not) network management will be much easier. For instance, just imagine how much easier it is to write access lists on a router that uses a block of addresses instead of separate networks.

VLSM Structure

As the name suggests, VLSMs can have different subnet masks for different subnets. So, if you have a serial point-to-point link between two routers, you could have a subnet mask of 255.255.255.252. If you do the math and look at your subnet in binary, you see that you have only two host bits, as shown in Table 7.4.

Table 7.4: A VLSM Example

Decimal

255

255

255

252

Binary

11111111

11111111

11111111

11111100

Therefore, this subnet mask will give you only two host IPs (22 – 2 = 2), which is exactly what you need for your serial link. Now, remember that to get this working on an internetwork, you need a classless routing protocol like EIGRP, OSPF, or even RIPv2.

start sidebar
Real World Scenario—Should You Really Use a /30 on Your Internetwork?

Probably. What a great solution this mask is if you have many WAN point- to-point links. There are a few issues you need to keep in mind:

  • You must be running a routing protocol that supports VLSM. OSPF, RIPv2, and EIGRP are the typical routing protocols used in these types of networks.

  • It is possible that your CSU/DSU needs an IP address. Yes, it’s true. Some ISPs have been putting IP addresses on their CSU/DSUs to help mange them. If this is true with your network, then a /30 network won’t work. You’d have to use a /29. Just keep this in mind and ask your ISP before you configure your network.

end sidebar

As an example, take a look at Figure 7.7, which shows a router with 14 interfaces, all using the same subnet mask.

click to expand
Figure 7.7: Fourteen subnets with no VLSM applied

Notice that you have 14 subnets, each with 14 hosts on each interface. The only option is to use the 255.255.255.240 mask, because this gives you 14 subnets. However, you get only 14 hosts on each LAN and WAN because of the bits reserved for subnetting. The WAN links, though, are point-to-point and use only two IP addresses. Each WAN link is assigned 14 host IDs, which can be inefficient. Now take a look at Figure 7.8.

click to expand
Figure 7.8: Fourteen subnets with VLSM applied

Because you can use different size masks on each interface, you now get 2 hosts per WAN interface and 64 hosts per LAN interface! What a difference. Not only can you get more hosts on a LAN, you still have room to add more WANs and LANs on the same network. Very efficient.

To create VLSMs quickly and efficiently, you need to understand how block sizes and charts work together to create the VLSM masks. Table 7.5 shows you the block sizes used when creating VLSMs with Class C networks. For example, if you need 25 hosts, you’ll need a block size of 32. If you need 11 hosts, you’ll use a block size of 16. Memorize the block sizes in this table.

Table 7.5: Block Sizes

Prefix

Mask

Hosts

Block Size

/26

192

62

64

/27

224

30

32

/28

240

14

16

/29

248

6

8

/30

252

2

4

The next thing to do is to create a VLSM table. Figure 7.9 shows you the three steps used in creating a VLSM table.

click to expand
Figure 7.9: The three steps in creating a VLSM table

You can be even more thorough and create a fourth and fifth step, which build the table in groups of 8 and 4, which is necessary for your WAN links.

Let’s take your block size and VLSM table and create a VLSM using a Class C network address for the network in Figure 7.10. Then fill out the VLSM table as shown in Figure 7.11.

click to expand
Figure 7.10: VLSM network example one

click to expand
Figure 7.11: VLSM table example one

Notice that you used the network address of 192.168.1.0 and added the prefix of each block size used. Now, take those addresses and masks and apply them to the router interfaces. You still have plenty of room for growth. You could never accomplish this with one subnet mask.

Let’s do another one together. Figure 7.12 shows a network with six interfaces, each needing a different number of hosts.

click to expand
Figure 7.12: VLSM network example two

First, create your VLSM table and use your block size chart to fill in the table with the subnets you need. Figure 7.13 shows a possible solution.

click to expand
Figure 7.13: VLSM table example two

Notice that you used almost the entire range of address space. Not too much room for network growth in this example.

Let’s do another example. Figure 7.14 shows a network with four routers and eight networks, four of which are WANs. Create a VLSM network using the VLSM chart.

click to expand
Figure 7.14: VLSM network example three

Figure 7.15 shows a possible solution. You still have room for growth in this one.

click to expand
Figure 7.15: VLSM table example three

Let’s do one more, just to make sure you have this down pat. Figure 7.16 shows the network on which you want to run a VLSM network. Create a VLSM table and reserve your block sizes.

click to expand
Figure 7.16: VLSM network example four

Notice that you have three routers and seven networks. Okay, get to work. Figure 7.17 shows a possible solution for network example four. You have plenty of room for growth.

click to expand
Figure 7.17: VLSM table example four

Now that you have seen how valuable VLSMs can be in preserving those precious IP addresses, be aware that there is a catch. Specifically, if you use a classfull routing protocol (a protocol that advertises routes at the Class A, Class B, and Class C boundaries) such as RIPv1 or IGRP, then VLSMs are not going to work.

RIPv1 and IGRP routing protocols do not have a field for subnet information. Therefore, the subnet information gets dropped. This means that if a router running RIP has a subnet mask of a certain value, it assumes that all interfaces within the classfull address space have the same subnet mask. Classless routing protocols, however, do support the advertisement of subnet information. So you can use VLSM with routing protocols such as RIPv2, EIGRP, or OSPF.




CCDA. Cisco Certified Design Associate Study Guide
CCDA: Cisco Certified Design Associate Study Guide, 2nd Edition (640-861)
ISBN: 0782142001
EAN: 2147483647
Year: 2002
Pages: 201

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net