15.6 Subnetting

     

Let's start by looking at an example of HP's Class A address of 15. If HP network administrators had no other option, this would mean that HP had only one internal network that could accommodate 16,777,216 hosts . This is impractical , so we need to look to subnetting as a means of providing different network addresses and hence the ability to set up different networks. The traditional mechanism for doing this is to establish a subnet mask that will steal a number of bits from the host ID to form the overall network ID. Let's take a Class C network address as an example: 192.168.0.1. By default, our subnet mask is 255.255.255.0. We need to modify the default subnet mask so that, when we perform the logical AND operation, with the IP address, it will produce a different network ID. The big question we need to ask, regardless of whether we have a Class A, B, or C address is, " How many networks do I need? " In an organization that has a Class A (or possibly even a Class B) address, you may ask, " How many geographic regions do I have? " because each region could further refine the subnet mask for its own individual requirements. In our example, we have five networks to set up: IT, Research, Marketing, Finance, and Sales. We need to determine how many bits of the host ID to steal in order to achieve the necessary number of networks. If we take a power of two, which achieves at least the number of networks we require: 2 2 = 4, it's not enough; 2 3 = 8, that's enough. Be careful with this because if we needed only four networks, we may have chosen to steal only two bits of the host ID. The problem here is that when we are subnetting we need to remember the conventions of "all 1's" representing "all hosts" in the network and "all 0's" representing the entire network. Although these conventions still apply, we will see that we have various network and broadcast addresses for a single Class C IP address range. Although the IP software will work with the "all 0's" and "all 1's" scenarios, it's advisable to avoid the "all 0's" and "all 1's" in the last octet because such a situation is normally reserved for a non- subnetted network. The formula we should use is this:

2 n >= number of networks required + 2

n = number of bits to steal from the host ID

In our example, we need the following:

2 n >= 5 + 2

n = 3

In our case, we will steal the top 3 bits of the host ID. These top 3 bits represent 128 + 64 + 32 = 224 from the binary to decimal conversion. This means that our new subnet mask will be 255.255.255.224. This has an immediate impact on which IP addresses I use for particular hosts. Previously, any IP address in my Class C network would provide a network address of 192.168.0.0. Now, different IP addresses will provide different network addresses (we will represent the last octet of the IP address and Subnet Mask in binary to make the logical AND operation easier to follow). Table 15-6 shows the effect the choice of a subnet mask has on the resulting network address.

Table 15-6. The Effect of a Subnet Mask

IP

192

168

40

=

192

168

00101000

SM

255

255

255

224

=

255

255

255

11100000

Network Address

=

192

168

32


There are other consequences of subnetting; as you can see, we can no longer use particular IP addresses (e.g., 192.168.0.32) because they represent specific entities within our network (a network address in this instance). The outcome of this should be a planning document (see Table 15-7) that details the different network addresses now in use, the ranges of IP addresses within each network that are allowed, and the resulting broadcast address expected, i.e., the broadcast address is the IP address with all 1's in the host ID component.

Table 15-7. Planning Document for a Subnetted Network

High Order 3-bit Sequence of 4th Octet

Network Address

Range of IP Addresses

Broadcast Address

000

Not allowed; all 0's should represent the entire network

001

192.168.0.32

192.168.0.33 62

192.168.0.63

010

192.168.0.64

192.168.0.65 94

192.168.0.95

011

192.168.0.96

192.168.0.97 126

192.168.0.127

100

192.168.0.128

192.168.0.129 158

192.168.0.159

101

192.168.0.160

192.168.0.161 190

192.168.0.191

110

192.168.0.192

192.168.0.193 222

192.168.0.223

111

Not allowed; all 1's should represent a broadcast address


You should notice a few things right away:

  1. We have a significantly reduced the number of IP addresses available to use.

  2. Changing this configuration will affect every machine in our network.

  3. Every machine in our network uses the subnet mask of 255.255.255.224.

  4. Every machine that is now in a different network will need to know the IP address of its local router in order to communicate with other machines in the organization.

  5. All the subnets have the ability to accommodate the same number of hosts: in this case, 30.

An alternative to using the traditional mechanism for establishing a subnet mask is to think about the problem in a slightly different way. The question we asked previously was, " How many networks do I need? " This did not take into account the requirement for having more or less than 30 nodes per subnet. If we were to adopt a different strategy, the question we might ask ourselves is, " How many nodes do I need per subnet? " This leads to different subnets having different subnet masks, or variable length subnet masks . If I wanted a subnet to support 50 clients , I would allocate a subnet mask of 192: 192 steals 2 bits from the host ID, leaving 2 6 = 64 bits to specify individual hosts. This would allow for my 50 clients as well as for expansion up to 62 clients (one address for the network address and one for the broadcast address). If I wanted to permit only six hosts, I would apply a subnet mask of 248, and so on. Another important part of variable length subnet masks is to ensure that each subnet has a unique subnet address. We do this by carefully selecting the range of IP addresses that each subnet will use. Table 15-8 shows the impact of using a differing size of subnet mask on our Class C address 192.168.0:

Table 15-8. Variable Length Subnet Mask

Subnet Mask 255.255.255.

IP address range

# of clients per subnet

Subnet address

Broadcast Address

248

129 134

6

128

135

240

33 46

14

32

47

224

193 222

30

192

223

192

65 126

62

64

127

128

1 126

129 254

126

126

1

127

255

With variable length subnet masks, we are utilizing our Class C address more efficiently because it is based on current and projected usage of individual subnets.

We can now use the relevant ranges of IP addresses for our individual networks. In our case, we will have a range of IP addresses not used because we only have five networks currently. Once we have designed and planned our IP configuration, we can proceed with the next part of our network design: routing table entries.



HP-UX CSE(c) Official Study Guide and Desk Reference
HP-UX CSE(c) Official Study Guide and Desk Reference
ISBN: N/A
EAN: N/A
Year: 2006
Pages: 434

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