Полезная информация

TCP/IP Network Administration

TCP/IP Network AdministrationSearch this book
Previous: 2.2 The IP AddressChapter 2
Delivering the Data
Next: 2.4 Internet Routing Architecture
 

2.3 Subnets

The structure of an IP address can be locally modified by using host address bits as additional network address bits. Essentially, the "dividing line" between network address bits and host address bits is moved, creating additional networks, but reducing the maximum number of hosts that can belong to each network. These newly designated network bits define a network within the larger network, called a subnet.

Organizations usually decide to subnet in order to overcome topological or organizational problems. Subnetting allows decentralized management of host addressing. With the standard addressing scheme, a central administrator is responsible for managing host addresses for the entire network. By subnetting, the administrator can delegate address assignment to smaller organizations within the overall organization - which may be a political expedient, if not a technical requirement. If you don't want to deal with the data processing department, assign them their own subnet and let them manage it themselves.

Subnetting can also be used to overcome hardware differences and distance limitations. IP routers can link dissimilar physical networks together, but only if each physical network has its own unique network address. Subnetting divides a single network address into many unique subnet addresses, so that each physical network can have its own unique address.

A subnet is defined by changing the bit mask of the IP address. A subnet mask functions in the same way as a normal address mask: an "on" bit is interpreted as a network bit; an "off" bit belongs to the host part of the address. The difference is that a subnet mask is only used locally. In the outside world the address is still interpreted as a standard IP address.

Assume we have been assigned network address 172.16.0.0/16. The subnet mask associated with that address is 255.255.0.0. The most commonly used subnet mask, and the one we use in most of our examples, extends the network portion of the address by an additional byte, e.g., 172.16.0.0/24. The subnet mask that does this is 255.255.255.0; all bits on in the first three bytes, and all bits off in the last byte. The first two bytes define the original network; the third byte defines the the subnet address; the fourth byte defines the host on that subnet.

Many network administrators prefer byte-oriented masks because they are easy to read and understand when addresses are written in dotted decimal notation. However, limiting subnet masks to byte boundaries does not take advantage of their true power. The subnet mask is bit-oriented. We could subdivide 172.16.0.0/16 into 16 subnets with the mask 255.255.240.0, i.e. 172.16.0.0/20. Applying this mask defines the four high-order bits of the third byte as the subnet part of the address, and the remaining 12 bits - four bits of the third byte and all of the fourth byte - as the host portion of the address. This creates 16 subnets that each contain more than four thousand host addresses, which may well be better suited to our network and organization. For example, we may have a small number of large subdivisions. Table 2.1 shows the subnets and host addresses produced by applying this subnet masks to network address 172.16.0.0/16.

Table 2.1: Effect of a Subnet Mask
Network NumberFirst AddressLast Address
172.16.0.0172.16.0.1172.16.15.254
172.16.16.0172.16.16.1172.16.31.254
172.16.32.0172.16.32.1172.16.47.254
172.16.48.0172.16.48.1172.16.63.254
172.16.64.0172.16.64.1172.16.79.254
172.16.80.0172.16.80.1172.16.95.254
172.16.96.0172.16.96.1172.16.111.254
172.16.112.0172.16.112.1172.16.127.254
172.16.128.0172.16.128.1172.16.143.254
172.16.144.0172.16.144.1172.16.159.254
172.16.160.0172.16.160.1172.16.175.254
172.16.176.0172.16.176.1172.16.191.254
172.16.192.0172.16.192.1172.16.207.254
172.16.208.0172.16.208.1172.16.223.254
172.16.224.0172.16.224.1172.16.239.254
172.16.240.0172.16.240.1172.16.254.254

You don't have to manually calculate a table like Table 2.1 to know what subnets and host addresses are produced by a subnet mask. The calculations have already been done for you. RFC 1878 lists all possible subnet masks and the valid addresses they produce.

Organizations have been discouraged from subnetting class C addresses because of the fear that subnetting reduces the number of host addresses to increase the number of network addresses. A class C network is limited to fewer than 255 host addresses. Further limiting the number of hosts would reduce the utility of a class C address. The mask 255.255.255.192 divides a class C address into four subnets of 64 host addresses. The fear is that the subnet address of all 0s and the subnet address of all 1s will not be usable. This leaves only two subnets; and because host addresses of all 1s and all 0s are also unusable, the remaining two subnets can only address 62 hosts. Therefore the address space of this class C network number is reduced from 254 hosts to 124 hosts. The fear of subnetting class C addresses is no longer justified.

Originally, the RFCs implied that you should not used subnet numbers of all 0s or all 1s. However, RFC 1812, Requirements for IP Version 4 Routers, makes it clear that subnets of all 0s and all 1s are legal and should be supported by all routers. Some older routers do not allow the use of these addresses despite the newer RFCs. Updating router software or hardware should make it possible for you to reliably subnet class C addresses.

Class C subnets are used when very small networks are needed for specialized network equipment, such as terminal servers, cluster controllers or routers. In some configurations an entire subnet may be consumed for the link between two routers. In this case only two host addresses are need, one for the router at each end of the link. A subnet mask of 255.255.255.252 applied to a class C address creates 64 subnets each containing four host addresses. In a special case this might be just what is needed.


Previous: 2.2 The IP AddressTCP/IP Network AdministrationNext: 2.4 Internet Routing Architecture
2.2 The IP AddressBook Index2.4 Internet Routing Architecture