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

Subnet Addresses

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

Subnetting is an optional addressing scheme that allows you to partition the host address portion of an internet address into discrete subnetworks. This allows you to have multiple physical networks without requiring you to obtain multiple network addresses. The physical networks are connected via gateways.

For example, if you have a large installation with many interconnected nodes, you could run into hardware configuration restrictions or performance degradation if you tried to place all nodes on the same physical network. With subnetting you can install several smaller physical networks but have them all share the same network address. When messages with subnet addresses are routed across the network, the internet address is ANDed with the subnet mask to determine the subnetwork address. (0 values in the subnet mask convert corresponding bits in the IP address to 0.)

Figure 6-4 “Internet Address 192.6.12.33 ANDed with Subnet Mask 255.255.255.224” shows how a Class C Internet address and a subnet mask combine to form a subnet address.

Figure 6-4 Internet Address 192.6.12.33 ANDed with Subnet Mask 255.255.255.224

Internet Address 192.6.12.33 ANDed with Subnet Mask 255.255.255.224

When the internet address is ANDed with the subnet mask, the zero values in the host portion of the subnet mask will “overwrite” the corresponding bits of the host portion of the internet address and the resultant subnet address will be 192.6.12.32 as shown in Figure 6-4 “Internet Address 192.6.12.33 ANDed with Subnet Mask 255.255.255.224” above. Non-zero values in the subnet mask indicate that the corresponding bits in the internet address do not change. The subnet mask may be fixed-length or variable-length.

IP Subnet Mask

The subnet field (the portion of an IP address that identifies the subnet beyond the network portion of the address) can be all 0’s or all 1’s, as described in RFC 1878.To disallow subnet fields with all ones or all zeroes (conform to RFC 1122 behavior), set the ndd parameter ip_check_subnet_addr to 1 in the nddconf file (/etc/rc.config.d/nddconf).

Selecting a Subnet Addressing Scheme

In addition to fixed-length subnet addressing, HP-UX11i v2 systems support variable-length subnet addressing. The advantages of using variable-length subnet addressing over fixed-length subnet addressing include the following:

  • Allows the local administrator to easily increase/decrease the size of individual subnets when variable-length subnet addressing is used in conjunction with a non-contiguous numbering system (and/or ranges of numbers for each subnet that are non-contiguous).

    The mirror-image counting feature, which will be discussed in the following section, also allows for more possibilities in the numbers that can be assigned to individual subnets.

  • Reduces the amount of rework that network planners will have to do on network design after the initial plan has been completed.

    Fixed-length subnets were easy to implement, but growth restrictions often meant that it was necessary to invest more time whenever a change was made to a subnet after it had been originally designed.

This new feature also makes it possible to have more than one subnet mask on a network.

As described previously, an internet address can be represented as four fields separated by a period, each of which represents 8 bits of the overall address.

The subnet address is based on the host address portion of the internet address. The host address portion subdivides into subnet number and host number fields to accommodate a given number of subnetworks and a given number of nodes per subnetwork. The size of the subnet number field is determined by the subnet mask, which is explained later in this section. The subnet number field must contain a minimum of one bit.

In the example below, the IP address, 192.6.12.33, has a subnet number of 1.

Refer to Figure 6-5 “Subnet Address and Subnet Number of Class C Internet Address 192.6.12.33” earlier in this chapter for an illustration of how the subnet mask is ANDed with the IP address to form the subnet number.

Figure 6-5 Subnet Address and Subnet Number of Class C Internet Address 192.6.12.33

Subnet Address and Subnet Number of Class C Internet Address 192.6.12.33

The following rules apply when choosing a subnet addressing scheme and an internet address:

  • All subnets on the same network must have the same network address.

  • If your system is attached to more than one physical network, the subnet addresses of the interfaces on your system cannot be the same.

  • Do not assign a host address where all the bits of the host number are 0 or all the bits are 1.

You may choose a fixed-length subnet addressing scheme in which one subnet mask will be used in all subnets in your network. You may also choose a variable-length subnet addressing scheme in which the subnet masks may be varied depending on the size of the subnets you want.

If you wish to implement variable-length subnetting, first read the conceptual information, “Assigning Variable-Length Subnet Addresses” later in this chapter. Then refer to the specific task-oriented instructions in the “Manually Installing and Configuring HP-UX LAN” chapter earlier in this manual. For additional information, refer to the following online man pages: ifconfig(1M), netstat(1), ppl.remotes(4), routing(7), and route(1M). Detailed descriptions of fixed-length and variable-length subnet addressing follow.

Fixed-Length Subnet Addressing

This section shows you how to apply a fixed-length subnet addressing scheme on a class C network. The same steps may be applied on a Class A or Class B network.

Assigning a Fixed-Length Subnet Mask

Subnet addressing is implemented by specifying a 32-bit subnet mask in the ifconfig command or the netconf file when a LAN interface card is assigned an internet address. All nodes on a subnet must have the same subnet mask. Under the fixed-length subnet address scheme, all subnets on a network, must have the same subnet mask.

The subnet mask is ANDed with the address attached to a message coming across the network to determine if that message should be routed to a node on the local network or ignored.

Before a subnet mask is applied, the first three octets of a Class C IP address represent the network address. If the subnet mask 255.255.255.224 is applied, the first three octets of the address and the first three bits of the last octet indicate the subnet address while the last five bits of the last octet indicate the host address. This is shown in the following figure.

Figure 6-6 Fixed-Length Subnet Mask Example

Fixed-Length Subnet Mask Example

With this subnet mask, up to 8 subnets with 30 nodes per subnet are possible. Table 6-5 “Fixed-Length Subnet Addressing (Subnet Mask 255.255.255.224)” below lists the valid internet address ranges for nodes in a network with the subnet mask 255.255.255.224.

Table 6-5 Fixed-Length Subnet Addressing (Subnet Mask 255.255.255.224)

Subnet Address
(dot notation)

Internet Address Range (dot notation)

Subnet Broadcast Address

n.n.n.0

n.n.n.1 - n.n.n.30n.n.n.31

n.n.n.32

n.n.n.33 - n.n.n.62

n.n.n.63

n.n.n.64

n.n.n.65 - n.n.n.94

n.n.n.95

n.n.n.96

n.n.n.97 - n.n.n.126

n.n.n.127

n.n.n.128

n.n.n.129 - n.n.n.158

n.n.n.159

n.n.n.160

n.n.n.161 - n.n.n.190

n.n.n.191

n.n.n.192

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

n.n.n.223

n.n.n.224

n.n.n.225 - n.n.n.254n.n.n.255

 

Example of Subnets with a Fixed-Length Subnet Mask

The following example shows four subnetworks within the 192.6.12 network along with the netconf entries necessary to configure these subnetworks. The complete network map is shown in Figure 6-8 “Network Map I”.

Figure 6-7 Network Map for Subnetting

Network Map for Subnetting

Summary network information:

Company division network = 192.6.12
    Subnet mask: 255.255.255.224
Facility LAN subnet number = 1
    Host address range: 22 to 62
    Host A internet address: 192.6.12.33 for network interface lan0
    Host B internet address: 192.6.12.36 for network interface lan0
    Host C internet address: 192.6.12.34 for network interface lan0
    Host D internet address: 192.6.12.35 for network interface lan0
Marketing Department subnet number = 2
    Host address range: 65 to 94
    Host A internet address: 192.6.12.65 for network interface lan1
R & D Department subnet number = 3
    Host address range: 97 to 126
    Host A internet address: 192.6.12.97 for network interface lan1:0
    Host B internet address: 192.6.12.98 for network interface lan1:1
Manufacturing Department subnet number = 4
    Host address range: 129 to 158
    Host B internet address: 192.6.12.130 for network interface lan1

Configuring Hosts on Fixed-Length Subnets Using the netconf file

There are two ways to configure a subnet mask:

  • Use SAM to configure the subnet mask.

  • Use the ifconfig command. These changes will disappear, however, when the system reboots.

To set a subnet mask, you may either include it in the SUBNET_MASK variable in the netconf file or the ifconfig command. The netconf file contains information you entered in SAM and this information is used to start networking when the system reboots. If you configure your network interfaces using SAM, SAM will enter the proper information in the netconf file for you. The examples below are netconf examples for the hosts in the example above after you have configured them in SAM:

Host A:

INTERFACE_NAME[0]=”lan0”
IP_ADDRESS[0]=”192.6.12.33”
SUBNET_MASK[0]=”255.255.255.224”
INTERFACE_NAME[1]=”lan1”
IP_ADDRESS[1]=”192.6.12.65”
SUBNET_MASK[1]=”255.255.255.224”

Host B:

INTERFACE_NAME[0]=”lan0”
IP_ADDRESS[0]=”192.6.12.36”
SUBNET_MASK[0]=”255.255.255.224”
INTERFACE_NAME[1]=”lan1”
IP_ADDRESS[1]=”192.6.12.130”
SUBNET_MASK[1]=”255.255.255.224”

Host C:

INTERFACE_NAME[0]=”lan0”
IP_ADDRESS[0]=”192.6.12.34”
SUBNET_MASK[0]=”255.255.255.224”
INTERFACE_NAME[1]=”lan0:1”
IP_ADDRESS[1]=”192.6.12.37”
SUBNET_MASK[1]=”255.255.255.224”
INTERFACE_NAME[2]=”lan1”
IP_ADDRESS[2]=”192.6.12.97”
SUBNET_MASK[2]=”255.255.255.224”
INTERFACE_NAME[3]=”lan1:1”
IP_ADDRESS[3]=”192.6.12.98”
SUBNET_MASK[3]=”255.255.255.224”

Host D:

INTERFACE_NAME[0]=”lan0”
IP_ADDRESS[0]=”192.6.12.35”
SUBNET_MASK[0]=”255.255.255.224”
INTERFACE_NAME[1]=”lan1”
IP_ADDRESS[1]=”192.6.20.1”
SUBNET_MASK[1]= 255.255.255.0

In addition, every other host on each subnetwork would require the subnet mask 255.255.255.224 in their netconf file entries.

Example of Network Map with Fixed-Length Subnets

This sample network combines networks, subnets with a fixed-length mask, and clusters previously described and illustrated in this chapter along with a sample worksheet that provides configuration information necessary to attach these systems to the networks.

Figure 6-8 Network Map I

Network Map I

Table 6-6 Network Map I Worksheet

Host

Inter-
face
Alias

Internet Address

Station Address

Cnode Type

A

mkt_32
mkt_64

192.6.12.33 192.6.12.65

08000909030D 080009080102

Server

A1

mkt_a1

192.6.12.67

080009005201

Client 1

A2

mkt_a2

192.6.12.66

080009003001

Client 2

B

mfg_32
mfg_128

192.6.12.36 192.6.12.130

080009005201 080009000C24

N/A

B1

mfg__b1
b1_slip

192.6.12.131 192.1.1.2

080009001001 N/A

N/A

B2

mfg_b2

192.6.12.132

080009002125

N/A

C

rd_32
rd_36
rd_96
rd_99

192.6.12.34
192.6.12.37
192.6.12.97
192.6.12.98

080009267C14080009267C14 080009260C85
080009260C85

Server

C1

rd_c1

192.6.12.99

08000900079C

Client 1

C2

rd_c2

192.6.12.98

08000900601A

Client 2

D

div1_32
div_gw

192.6.12.35 192.6.20.1

080009000740 080009000B30

N/A

Div2

div2_128
div2_gw

192.6.14.129 192.6.20.2

080009006041 080009007104

N/A

Div3

div3_128
div3_gw

192.6.13.130 192.6.20.3

080009004020 080009010312

N/A

E
(SLIP)

e_slip

192.1.1.1

N/A

N/A

 

Subnet mask = 255.255.255.224

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