TCP/IP includes an Internet addressing scheme that allows users and applications to identify a specific network or host with which to communicate. An Internet address works like a postal address, allowing data to be routed to the chosen destination. TCP/IP provides standards for assigning addresses to networks, subnetworks, hosts, and sockets, and for using special addresses for broadcasts and local loopback.
Internet addresses are made up of a network address and a host (or local) address. This two-part address allows a sender to specify the network as well as a specific host on the network. A unique, official network address is assigned to each network when it connects to other Internet networks. However, if a local network is not going to connect to other Internet networks, it can be assigned any network address that is convenient for local use.
The Internet addressing scheme consists of Internet Protocol (IP) addresses and two special cases of IP addresses: broadcast addresses and loopback addresses.
The Internet Protocol (IP) uses a 32-bit, two-part address field. The 32 bits are divided into four octets as in the following:
01111101 00001101 01001001 00001111
These binary numbers translate into:
125 13 73 15
The two parts of an Internet address are the network address portion and the host address portion. This allows a remote host to specify both the remote network and the host on the remote network when sending information. By convention, a host number of 0 is used to refer to the network itself.
TCP/IP supports three classes of Internet addresses: Class A, Class B, and Class C. The different classes of Internet addresses are designated by how the 32 bits of the address are allocated. The particular address class a network is assigned depends on the size of the network.
A Class A address consists of an 8-bit network address and a 24-bit local or host address. The first bit in the network address is dedicated to indicating the network class, leaving 7 bits for the actual network address. Because the highest number that 7 bits can represent in binary is 128, there are 128 possible Class A network addresses. Of the 128 possible network addresses, two are reserved for special cases: the network address 127 is reserved for local loopback addresses, and a network address of all ones indicates a broadcast address.
There are 126 possible Class A network addresses and 16,777,216 possible local host addresses. In a Class A address, the highest order bit is set to 0.
Figure 3-14. Class A Address. This illustration shows a typical class A address structure. The first 8 bits contain the network address (always beginning with a zero). The remaining 24 bits contain the local host address.
The first octet of a Class A address is in the range 1 to 126.
A Class B address consists of a 16-bit network address and a 16-bit local or host address. The first two bits in the network address are dedicated to indicating the network class, leaving 14 bits for the actual network address. There are 16,384 possible network addresses and 65,536 local host addresses. In a Class B address, the highest order bits are set to 1 and 0.
Figure 3-15. Class B Address. This illustration shows a typical class B address structure. The first 16 bits contain the network address. The two highest order bits will always be a one and a zero. The remaining 16 bits contain the local host address.
The first octet of a Class B address is in the range 128 to 191.
A Class C address consists of a 24-bit network address and an 8-bit local host address. The first two bits in the network address are dedicated to indicating the network class, leaving 22 bits for the actual network address. Therefore, there are 2,097,152 possible network addresses and 256 possible local host addresses. In a Class C address, the highest order bits are set to 1 and 1.
Figure 3-16. Class C Address. This illustration shows a typical class C address structure. The first 24 bits contain the network address (the two highest order bits will always be a one and a one). The remaining 8 bits contain the local host address.
In other words, the first octet of a Class C address is in the range 192 to 223.
When deciding which network address class to use, you must consider how many local hosts there will be on the network and how many subnetworks will be in the organization. If the organization is small and the network will have fewer than 256 hosts, a Class C address is probably sufficient. If the organization is large, then a Class B or Class A address might be more appropriate.
Note: Class D (1-1-1-0 in the highest order bits) addresses provide for multicast addresses and are supported by UDP/IP under this operating system.
Machines read addresses in binary code. The conventional notation for Internet host addresses is the dotted decimal, which divides the 32-bit address into four 8-bit fields. The following binary value:
0001010 00000010 00000000 00110100
can be expressed as:
010.002.000.052 or 10.2.0.52
where the value of each field is specified as a decimal number and the fields are separated by periods.
Note: The hostent command does recognize the following addresses: .08, .008, .09, and .009. Addresses with leading zeros are interpreted as octal, and numerals in octal cannot contain 8s or 9s.
TCP/IP requires a unique Internet address for each network interface (adapter) on a network. These addresses are determined by entries in the configuration database, which must agree with entries in the /etc/hosts file or the named database if the network is using a name server.
When a C class Internet address contains a 0 as the host address portion, (for example, 188.8.131.52), TCP/IP sends a wildcard address on the network. All machines with a Class C address of 192.9.200.X (where X represents a value between 0 and 254) should respond to the request. This results in a network flooded with requests to nonexistent machines.
Similarly, problems occur for Class B addresses such as 184.108.40.206. All machines with a Class B address of 129.5.X.X. (where X represents a value between 0 and 254) are obliged to respond to the request. In this case, because Class B addresses account for bigger networks than Class C addresses, the network is flooded with significantly more requests to nonexistent machines than for a Class C network.
Subnet addressing allows an autonomous system made up of multiple networks to share the same Internet address. The subnetwork capability of TCP/IP also makes it possible to divide a single network into multiple logical networks (subnets). For example, an organization can have a single Internet network address that is known to users outside the organization, yet it can configure its network internally into departmental subnets. In either case, fewer Internet network addresses are required while local routing capabilities are enhanced.
A standard Internet Protocol address field has two parts: a network address and a local address. To make subnets possible, the local address part of an Internet address is divided into a subnet number and a host number. The subnet is identified so that the local autonomous system can route messages reliably.
In the basic Class A Internet address, which consists of an 8-bit network address and 24-bit local address, the local address identifies the specific host machine on the network.
Figure 3-17. Class A Address. This illustration shows a typical class A address structure. The first 8 bits contain the network address (always beginning with a zero). The remaining 24 bits contain the local host address.
To create a subnet address for this Class A Internet address, the local address can be divided into a number identifying the physical network (or subnet) and a number identifying the host on the subnet. Senders route messages to the advertised network address, and the local system takes responsibility for routing messages to its subnets and their hosts. When deciding how to partition the local address into subnet address and host address, you should consider the number of subnets and the number of hosts on those subnets.
In the following figure, the local address is partitioned into a 12-bit subnet address and a 12-bit host address.
Figure 3-18. Class A Address with Corresponding Subnet Address. This illustration shows a typical class A address structure. The first 8 bits contain the network address (always beginning with a zero). The remaining 24 bits contain the local host address with the subnet address occupying the first 8 bits and the host address occupying the last 8 bits.
You have flexibility when assigning subnet addresses and host addresses. The bits of the local address can be divided according to the needs and potential growth of the organization and its network structure. The only restrictions are:
If the width of the subnet_address field is 0, the network is not organized into subnets, and addressing to the network is performed using the Internet network address.
The bits that identify the subnet are specified by a bit mask and, therefore, are not required to be adjacent in the address. However, it is generally desirable for the subnet bits to be contiguous and located as the most significant bits of the local address.
When a host sends a message to a destination, the system must determine whether the destination is on the same network as the source or if the destination can be reached directly through one of the local interfaces. The system compares the destination address to the host address using the subnet mask. If the destination is not local, the system sends the message on to a gateway. The gateway performs the same comparison to see if the destination address is on a network it can reach locally.
The subnet mask tells the system what the subnet partitioning scheme is. This bit mask consists of the network address portion and subnet address portion of the Internet address.
Figure 3-19. Class A Address with Corresponding Subnet Address. This illustration shows a typical class A address structure. The first 8 bits contain the network address (always beginning with a zero). The remaining 24 bits contain the local host address with the subnet address occupying the first 8 bits and the host address occupying the last 8 bits.
For example, the subnet mask of the Class A address with the partitioning scheme defined above is shown in this figure.
The subnet mask is a set of 4 bytes, just like the Internetwork address. The subnet mask consists of high bits (1's) corresponding to the bit positions of the network and subnetwork address, and low bits (0's) corresponding to the bit positions of the host address. A subnet mask for the previous address looks like the following figure.
Figure 3-20. Example Subnet Mask. This illustration shows a an example of a subnet mask structure. The first 8 bits contain the network address. The remaining 24 bits contain the local host address with the subnet address occupying the first 8 bits and the host address occupying the last 8 bits.
The destination address and the local network address are compared by performing the logical AND and exclusive OR on the subnet mask of the source host.
The comparison process is outlined below:
If the result is all 0's, the destination is assumed to be reachable directly through one of the local interfaces.
For example, assume that there are two local interfaces defined for a host network, T125. Their Internet addresses and the binary representations of those addresses are shown in the following example:
CLASS A 220.127.116.11 = 01001001 00000001 00000101 00000010 CLASS B 18.104.22.168 = 10010001 00010101 00000110 00000011
The corresponding subnet masks for the local network interfaces are shown in the following example:
CLASS A 22.214.171.124 = 11111111 11111111 11100000 00000000 CLASS B 126.96.36.199 = 11111111 11111111 11111111 11000000
If the source network, T125, is requested to send a message to a destination network with the host address 188.8.131.52 (represented in binary as: 01110010 00010000 00010111 00001000), the system checks whether the destination can be reached through a local interface.
Note: The subnetmask keyword must be set in the configuration database of each host that is to support subnets. Before the subnetwork capability can be used, all hosts on the network must support it. Set the subnet mask permanently in the configuration database using the Web-based System Manager Network application or the Network Interface Selection menu in SMIT. The subnet mask can also be set in the running system using the ifconfig command. Using the ifconfig command to set the subnet mask is not a permanent change.
The TCP/IP can send data to all hosts on a local network or to all hosts on all directly connected networks. Such transmissions are called broadcast messages. For example, the routed routing daemon uses broadcast messages to query and respond to routing queries.
For data to be broadcast to all hosts on all directly connected networks, User Datagram Protocol (UDP) and Internet Protocol (IP) are used to send the data, and the host destination address in the IP header has all bits set to 1. For data to be broadcast to all hosts on a specific network, all the bits in the local address part of the IP address are set to 0. There are no user commands that use the broadcast capability, although such commands, or programs, can be developed.
The broadcast address can be changed temporarily by changing the broadcast parameter in the ifconfig command. Change the broadcast address permanently by using the Web-based System Manager, wsm, or the SMIT fast path smit chinet. Changing the broadcast address may be useful if you need to be compatible with older versions of software that use a different broadcast address; for example, the host IDs are all set to 0.
The Internet Protocol defines the special network address, 127.0.0.1, as a local loopback address. Hosts use local loopback addresses to send messages to themselves. The local loopback address is set by the configuration manager during the system startup process. Local loopback is implemented in the kernel and can also be set with the ifconfig command. Loopback is invoked when the system is started.