• No results found

Consult the Tables

If you’ve been given a “classfull” block of addresses to use—that is, an entire class A, B, or C network address—then you can refer to the corresponding subnet tables at the end of the chapter. Those tables can guide you to the proper mask to choose and how to allocate address ranges.

Let’s look at our sample network shown in Figure 3.1. After our analysis, Table 3.2 showed that we need to support seven subnets, and the maximum number of addresses needed in any subnet is 25. Let’s assume we’ve been given class C network 192.168.153.0 to use in our organization.

Table 3.3 is a traditional (RFC 950) Class C subnetting table. Consulting this table, we can try to find an appropriate mask.

Table 3.3 Class C Subnet Table

Can you locate a mask that will support seven subnets with 25 hosts each? No; a mask of

# Subnet Bits # Subnets # Host Bits # Hosts Mask 2 2 6 62 255.255.255.192 3 6 5 30 255.255.255.224 4 14 4 14 255.255.255.240 5 30 3 6 255.255.255.248 6 62 2 2 255.255.255.252

255.255.255.224 gives us enough host addresses, but not enough subnets, and 255.255.255.240 supports enough subnets, but not enough host addresses. Now what? In this situation, you have four options:

1. Use unnumbered interfaces.

2. Ask for a bigger block of addresses. 3. Play some tricks with your router. 4. Use “subnet zero.”

Use Unnumbered Interfaces

Many popular routers today provide a feature known as unnumbered interfaces or IP unnumbered. This feature can be used when the interface connects to a point-to-point network, such as a leased 56k or T1 line. When you use this feature, the point-to-point network does not need IP addresses and can be

omitted from the total number of subnets. If we took advantage of this feature in our sample network, we would need to provide addresses only for the LAN segments. This can lead to substantial savings in the number of IP addresses needed. We’ll look at some examples in the next section.

One disadvantage of using unnumbered interfaces is that you cannot directly access those interfaces for testing or management purposes. So you will have to make a choice for manageability or for address conservation. In most networks, the choice will be clear, based on the needs of the

organization. In other networks, you may just have to make a judgement call.

Using unnumbered interfaces in our example eliminates the need for three subnets—the three WAN connections. Now we need only four subnets, and a mask of 255.255.255.224 would be appropriate.

Ask for a Bigger Block of Addresses

If you had two class C addresses, you could use one for the Headquarters LAN, and subnet the other for the branch LANs and WAN links. For example, if you were allocated two class C addresses

(192.168.8.0 and 192.168.9.0), you could use 192.168.8.0 with the mask 255.255.255.0 for the

Headquarters LAN. For the remaining LANs and WAN links we can subnet 192.168.9.0 with the mask 255.255.255.224. This gives us six subnets with 30 host addresses each—plenty to cover our needs.

Router Tricks

Most routers allow you to assign more than one IP address to an interface. This feature is called

multinetting or secondary interfaces. Thus, you can actually support more than one subnet on a single

router interface. In our sample network, you could use the mask 255.255.255.240 (which gives you 14 subnets and 14 host addresses), then assign two addresses on the Headquarters LAN interface of the router.

Caution

The choice of the two addresses is important. The first address must be a valid address on one subnet, the second address must be a valid address on another subnet.

Now we have 28 addresses available on the Headquarters LAN. Pretty handy, right? Yes, but at a price.

address. If your workstation is communicating with a host on another subnet (as determined by your mask and the target IP address), the datagrams will be delivered to your default gateway (router). Take a look at Figure 3.2.

Figure 3.2 Multiple subnets on a LAN segment.

WS1 is on one IP network, and WS2 and the server are on another. They (and the router) are all on a single LAN segment (i.e., they are all connected to the same Ethernet hub).

When WS2 wants to communicate with the server, the IP software in WS2 determines that, based on the mask of 255.255.255.0, the server is on the same IP network/subnet. So, WS2 will send a packet directly to the server.

What happens when WS1 wants to talk to the server? Are they on the same IP network? They aren’t, so WS1 will send the packets to its default gateway (Router1). Router1 will then forward the packets to the proper network for the server. Thus, each packet transmitted between WS1 and the server will appear on the Ethernet segment twice—once from WS1 to the router and again from the router to the server (and vice-versa).

Tip

If you choose to use this trick, you need to be careful about which devices you place in which network/subnet. Try to keep devices that talk to each other on the same subnet.

Use Subnet Zero Note

In the original subnetting standard (RFC 950), the subnets whose binary subnet ID is all zeros or all ones could not be used (thus the –2 in the subnetting formula 2n–2). In RFC 1812, this restriction has been lifted. Here is a quote from RFC 1812:

“Previous versions of this document also noted that subnet numbers must be neither 0 nor –1, and must be at least two bits in length. In a CIDR world, the subnet number is clearly an extension of the network prefix and cannot be interpreted without the remainder of the prefix. This restriction of subnet numbers is therefore meaningless in view of CIDR and may be safely ignored.”

To help avoid potential interoperability problems, conservative network managers still follow the original specification and choose not to use the all zeros and all ones subnets. If this is the path you choose to follow, then you must subtract two from the number of subnets shown in each row of the tables at the end of the chapter. In some cases, such as the example we’re working on, it may be necessary to go ahead and use the additional subnets.

In our example, you could choose to use 255.255.255.224 as your mask, which gives you enough host addresses. By using subnet zero, you would have enough subnets to cover your needs.

For more practice choosing the correct mask for your network, please refer to the exercises at the end of the chapter.