Class A
Class A comprises networks 1.0.0.0 through 127.0.0.0 . The network number is contained in the first octet. This class provides for a 24-bit host part, allowing roughly 1.6 million hosts per network.
Class B
Class B contains networks 128.0.0.0 through 191.255.0.0 ;
the network number is in the first two octets. This class allows for 16,320 nets with 65,024 hosts each.
Class C
Class C networks range from 192.0.0.0 through 223.255.255.0 , with the network number contained in the first three octets. This class allows for nearly 2 million networks with up to 254 hosts.
Classes D, E, and F
Addresses falling into the range of 224.0.0.0 through 254.0.0.0 are either experimental or are reserved for special purpose use and don't specify any network. IP Multicast, which is a service that allows material to be transmitted to many points on an internet at one time, has been assigned addresses from within this range.
If we go back to the example in Chapter 1, we find that 149.76.12.4 , the address of quark , refers to host 12.4 on the class B network 149.76.0.0 .
You may have noticed that not all possible values in the previous list were allowed for each octet in the host part. This is because octets 0 and 255 are reserved for special purposes. An address where all host part bits are 0 refers to the network, and an address where all bits of the host part are 1 is called a broadcast address . This refers to all hosts on the specified network simultaneously. Thus, 149.76.255.255 is not a valid host address, but refers to all hosts on network 149.76.0.0 .
A number of network addresses are reserved for special purposes. 0.0.0.0 and 127.0.0.0 are two such addresses. The first is called the default route , and the latter is the loopback address . The default route has to do with the way the IP routes datagrams.
Network 127.0.0.0 is reserved for IP traffic local to your host. Usually, address 127.0.0.1 will be assigned to a special interface on your host, the loopback interface , which acts like a closed circuit. Any IP packet handed to this interface from TCP or UDP will be returned to them as if it had just arrived from some network. This allows you to develop and test networking software without ever using a "real" network. The loopback network also allows you to use networking software on a standalone host. This may not be as uncommon as it sounds; for instance, many UUCP sites don't have IP connectivity at all, but still want to run the INN news system. For proper operation on Linux, INN requires the loopback interface.
Some address ranges from each of the network classes have been set aside and designated "reserved" or "private" address ranges. These addresses are reserved for use by private networks and are not routed on the Internet. They are commonly used by organizations building their own intranet, but even small networks often find them useful. The reserved network addresses appear in Table 2.1.
Table 2.1: IP Address Ranges Reserved for Private Use
| Class | Networks |
|---|---|
| A | 10.0.0.0 through 10.255.255.255 |
| B | 172.16.0.0 through 172.31.0.0 |
| C | 192.168.0.0 through 192.168.255.0 |
Address Resolution
A mechanism
is needed to map IP addresses onto the addresses of the underlying network. The mechanism used is the Address Resolution Protocol (ARP). In fact, ARP is not confined to Ethernet or Token Ring, but is used on other types of networks, such as the amateur radio AX.25 protocol. The idea underlying ARP is exactly what most people do when they have to find Mr. X in a throng of 150 people: the person who wants him calls out loudly enough that everyone in the room can hear them, expecting him to respond if he is there. When he responds, we know which person he is.
When ARP wants to find the Ethernet address corresponding to a given IP address, it uses an Ethernet feature called broadcasting , in which a datagram is addressed to all stations on the network simultaneously. The broadcast datagram sent by ARP contains a query for the IP address. Each receiving host compares this query to its own IP address and if it matches, returns an ARP reply to the inquiring host. The inquiring host can now extract the sender's Ethernet address from the reply.
You may wonder how a host can reach an Internet address that may be on a different network halfway around the world. The answer to this question involves routing , namely finding the physical location of a host in a network. We will discuss this issue further in the next section.