Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX LAN Administrator's Guide: HP-UX 11i v2 > Chapter 6  Network Addressing

Variable-Length Subnet Addressing

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

For the most efficient use of address space and maximum flexibility in increasing/decreasing the size of your subnets, Hewlett-Packard recommends variable-length subnet addressing. To maximize the possibilities offered with this new approach, you should utilize mirror image counting, as described in this section, to select subnet numbers.

In the past, a network administrator typically assigned values to the subnet number and host address fields in numerical order. For example, within a given subnet, hosts were numbers 1, 2, 3, etc. and within a given network, the subnets were numbered 1, 2, 3, etc. The result was that some bits on the right side of the subnet field and host field were “ones and zeros” and some bits on the left side of the subnet and host fields were “all zeros” for all subnets and hosts. As shown below, the “all zeros” bits represented room for growth, and the “ones and zeros” bits represented bits already consumed by growth.

Figure 6-9 Traditional Subnet and Host Field Allocation

Traditional Subnet and Host Field Allocation

In the next example. the entire host field has been allocated. As a result, only the subnet field can grow.

Figure 6-10 Entire Host Field Allocated

Entire Host Field Allocated

To alleviate this restrictive situation, when you use the variable-length subnetting approach, you can, alternatively, assign subnet numbers from the left of the subnet field and work right. This is implemented using mirror-image counting. In the mirror image approach, the bits for subnet numbers are assigned left to right instead of right to left (normal situation). This would result in the following format:

Table 6-7 Mirror Image Counting

Traditional Approach

Mirror Image Approach

01

10

10

01

011

110

100

001

101

101

 

This will allow for more growth bits between the subnet field and the host fields as shown below.

Figure 6-11 Mirror Image Subnet and Host Field Allocation

Mirror Image Subnet and Host Field Allocation

In this case, both the host field and subnet field have considerably more growing space than before, although the combined growing space is the same. As it is difficult to predict how many hosts might end up in a subnet, or how many subnets there might eventually be, this arrangement allows for maximum flexibility in growth.

Assigning Variable-Length Subnet Masks

In Figure 6-11 “Mirror Image Subnet and Host Field Allocation”, the boundary between the host and subnet fields is shown in the middle of the growth area. The boundary, however, could exist anywhere within the growth area. The subnet mask determines where the boundary is located. “Ones” in the subnet mask indicate subnet bits, and “zeros” indicate host bits. To minimize the amount of rework after the initial planning of your network, you should choose a subnet mask for a given subnet based on the projected growth of that subnet. As shown in Figure 6-12 “Example of Variable-Length Subnet Mask”, the subnet is projected to have a maximum size of 14 hosts. Therefore, the subnet mask should be 255.255.255.240. There are two remaining growth bits for this subnet. If the subnet grows beyond 14 hosts, you may choose to change one of the two remaining growth bits to a host bit. The new subnet mask will be 255.255.255.224.

Variable-length subnet masks are assigned using the netmask parameter of the ifconfig command, SUBNET_MASK in netconf with a 32-bit subnet mask indicated in dot notation, or SAM. In the example below with a Class C IP address, the host portion has three types of assigned bits: subnet number bits, growth bits, and host bits, with a chosen subnet mask that allows for growth in both the host field and subnet field without a mask change.

Figure 6-12 Example of Variable-Length Subnet Mask

Example of Variable-Length Subnet Mask

The example below shows how the bits might look in the host address portion of a Class C address in a network with four subnets using variable-length subnetting. In this example “g” stands for growth bits and “h” stands for host bits. The 0’s and 1’s in the host address are assigned subnet numbers.

Table 6-8 Subnets with Variable-Length Subnet Mask

Subnet

Host Address (Bits)

Subnet Mask (Bits)

A

10gg gghh

1111 1100

B

01gg ghhh

1111 1000

C

110g ghhh

1111 1000

D

001g ghhh

1111 1000

 

If hosts are added to subnet B above, so that all of its remaining “g” bits become “h” bits, the mask in subnet B also must change. Table 6-9 “Subnets with Subnet Mask (B) Modified” shows the results of these changes. Also, two additional subnets have been added, subnet E and subnet F.

Table 6-9 Subnets with Subnet Mask (B) Modified

Subnet

Host Address (Bits)

Subnet Mask (Bits)

A

100g gghh

1111 1000

B

01hh hhhh

1100 0000

C

110g ghhh

1111 1000

D

001g ghhh

1111 1000

E

101g ghhh

1111 1000

F

1110 ghhh

1111 1000

 

Notice that these additions caused A to change its leftmost g-bit into a subnet-bit  (“s” bit). With the addition of subnet address 101 for subnet E, the old subnet address 10 of subnet A must be changed to 100 so that the proper number of bits are used to make the subnet numbers unique.

Table 6-10 “Subnets with Subnet E Removed” shows the results of removing subnet E.

Table 6-10 Subnets with Subnet E Removed

Subnet

Host Address (Bits)

Subnet Mask (Bits)

A

10gg gghh

1111 1100

B

01hh hhhh

1100 0000

C

110g ghhh

1111 1000

D

001g ghhh

1111 1000

F

1110 ghhh

1111 1000

 

Notice that with this change, subnet A gains back one growth bit (“g” bit) as its old subnet address of 10 is now unique again.

Example of Subnets with Variable-Length Subnet Masks

The following example shows four subnetworks within the 192.6.12 network along with the netconf entries necessary to configure these subnetworks with variable-length subnet masks. Note that there are four different subnet masks used in this network. Also note that the subnet numbers in the network map correspond to the mirror image subnet numbers listed in Table 6-7 “Mirror Image Counting”.

Figure 6-13 Network Map with Variable-Length Subnets

Network Map with Variable-Length Subnets

The subnet numbers shown below correspond to the subnets show in the network map in Figure 6-13 “Network Map with Variable-Length Subnets”.

In this example of mirror image counting, the first subnet has 6 hosts (with space allocated for a maximum of 6 hosts), the second subnet has 60 hosts (with space allocated for a maximum of 62 hosts), the third subnet has 30 hosts (with space allocated for a maximum of 30 hosts), and the fourth subnet has 14 hosts (with space allocated for a maximum of 16 hosts). Notice how the range of numbers (129-135, 65-127,193-223, and 33-47) is spread out to allow room for additional growth in each case.

Table 6-11 Variable-Length Subnet Addressing in a Class C Network

Subnet Mask 255.255.255

Subnet Number

Mirror Image Subnet Number

Subnet Address

Internet Address Range

248

16

(10000)

1

(00001)

n.n.n.128

n.n.n.129 - n.n.n.134

192

1

(01)

2

(10)

n.n.n.64

n.n.n.65-n.n.n.126

128

1

(01)

2

(10)

n.n.n.0

n.n.n.1-n.n.n.126
n.n.n.129-n.n.n.254

224

6

(110)

3

(011)

n.n.n.192

n.n.n.193-n.n.n.222

240

2

(0010)

4

(0100)

n.n.n.32

n.n.n.33-n.n.n.46

 

NOTE: In a Class C network, no two subnets can have more than 125 hosts.

Summary network information:

Company division network = 192.6.12
Facility LAN subnet
    Subnet mask: 255.255.255.248
    Subnet number: 16
    Mirror image subnet number: 1
    Subnet address: 192.6.12.128
    Host address range: 129 to 134
    Host A internet address: 192.6.12.129 for network interface lan0
    Host B internet address: 192.6.12.131 for network interface lan0
    Host C internet address: 192.6.12.130 for network interface lan0
    Host D internet address: 192.6.12.132 for network interface lan0
Marketing Department Subnet   
    Subnet mask: 255.255.255.192
    Subnet number: 1 
    Mirror image subnet number: 2
    Subnet address: 192.6.12.64
    Host address range: 65 to 126
    Host A internet address: 192.6.12.65 for network interface lan1
Networking LAN subnet
    Subnet mask: 255.255.255.128
    Subnet number: 17
    Mirror image subnet number: 2
    Subnet address: 192.6.12.0
    Host address range: 1 to 126 and 129 to 254
    Host A internet address: 192.6.12.1 for network interface lan0
    Host B internet address: 192.6.12.120 for network interface lan0
    Host C internet address: 192.6.12.130 for network interface lan1
    Host D internet address: 192.6.12.182 for network interface lan1
R & D Department Subnet
    Subnet mask: 255.255.255.224
    Subnet number: 6
    Mirror image subnet number: 3
    Subnet address: 192.6.12.192
    Host address range: 193 to 222
    Host C internet address: 192.6.12.193 for network interface lan1
Manufacturing Department Subnet
    Subnet mask: 255.255.255.240
    Subnet number: 2
    Mirror image subnet number: 4
    Subnet address: 192.6.12.32
    Host address range: 33 to 46
    Host B internet address: 192.6.12.33 for network interface lan1

Example of Network Map with Variable-Length Subnets

This sample network combines networks, subnets with variable-length subnet masks, and clusters previously described and illustrated in this chapter. Note that the subnet masks for each IP address are shown on the accompanying worksheet.

Figure 6-14 Network Map II

Network Map II

Table 6-12 Network Map II Worksheet

Host

Interface Alias

Internet Address

Subnet Mask

Cnode Type

A

mkt_32
mkt_64

192.6.12.129 192.6.12.65

255.255.255.248 255.255.255.192

Server

A1

mkt_a1

192.6.12.67

255.255.255.192

Client 1

A2

mkt_a2

192.6.12.66

255.255.255.192

Client 2

B

mfg_32
mfg_128

192.6.12.131 192.6.12.33

255.255.255.248 255.255.255.240

N/A

B1

mfg__b1
b1_ship

192.6.12.34 192.1.1.2

255.255.255.240 N/A

N/A

B2

mfg_b2

192.6.12.35

255.255.255.240

N/A

C

rd_32
rd_96

192.6.12.130 192.6.12.193

255.255.255.248 255.255.255.224

Server

C1

rd_c1

192.6.12.195

255.255.255.224

Client 1

C2

rd_c2

192.6.12.194

255.255.255.224

Client 2

D

div1_32
div_gw

192.6.12.132 192.6.20.1

255.255.255.248 255.255.255.0

N/A

Div2

div2_128
div2_gw

192.6.14.129 192.6.20.2

255.255.255.0 255.255.255.0

N/A

Div3

div3_128
div3_gw

192.6.13.130 192.6.20.3

255.255.255.0 255.255.255.0

N/A

E (SLIP)

e_slip

192.1.1.1

N/A

N/A

 

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2003 Hewlett-Packard Development Company, L.P.