| United States-English |
|
|
|
![]() |
HP-UX LAN Administrator's Guide: HP-UX 11i v2 > Chapter 6 Network
AddressingSubnet Addresses |
|
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. 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). 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:
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. The following rules apply when choosing a subnet addressing scheme and an internet address:
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. 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. 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. 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)
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”. Summary network information:
There are two ways to configure a subnet mask:
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:
Host B:
Host C:
Host D:
In addition, every other host on each subnetwork would require the subnet mask 255.255.255.224 in their netconf file entries. 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. Table 6-6 Network Map I Worksheet
Subnet mask = 255.255.255.224 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||