Classful IP Addressing
 |
| |
For
a protocol to be routable, its address structure must be hierarchical, meaning
that the address must contain at least two parts. For IP addresses, these parts
are the network portion and the host portion. A host is an end station such as a
computer workstation, router interface, or printer, while a network consists of
one or more hosts. Figure 2-1 is a simple network consisting of two networks
connected by a two-port router. The address of each host on this network,
including the router interfaces, is given by its network and host
numbers. |
| |
 |
| |
Figure 2-1: Hierarchical addressing |
|
 | |
 |
| |
When
the IP address scheme was designed, the decision was made to create five classes
of IP addresses simply named Class A, B, C, D, and E. The logic behind the first
three network classes was that the IP addressing scheme would be used for a few
networks with a large number of hosts (Class A), a moderate number of networks
with a moderate number of hosts (Class B), and a large number of networks with a
small number of hosts (Class C). Class D addresses would be used for
multicasting and Class E addresses would be reserved for experimental
use. |
| |
 |
| |
Having three classes of IP addresses to handle different size
networks requires that the network part and the host part for each address class
have unequal sizes. The breakdown for the allocation of bits for the network and
host portion for the first four IP address classes is shown in Figure
2-2. |
| |
 |
| |
Figure 2-2: Classful IP address structure |
|
 | |
 |
| |
Class A addresses use 8 bits to identify the network and 24 bits to
identify the host with the most significant bit of the first octet set to zero.
Class B addresses use 16 bits to identify the network and 16 bits to identify
the host with the first two bits of the first octet set to 1 0. Class C
addresses use 24 bits to identify the network and 8 bits to identify the host
with the first 3 bits of the first octet set to 1 1 0. |
| |
 |
| |
Class D or multicast addresses differ from unicast addresses in their
interpretation. |
| |
 |
| |
A
Class A, B, or C address is used to identify a network and a host on that
network. A Class D multicast address is used to identify a group of receivers
and senders of multicast traffic. Additionally, multicast senders and receivers
can be present on any network. |
| |
 |
| |
If
we examine the first octet of each class, we can see that the range of values
for the four classes is |
| |
 |
| |
00000001 (1)—01111110 (126) for Class A |
| |
| |
10000000 (128)—10111111 (191) for Class B |
| |
| |
11000000 (192)—11011111 (223) for Class C |
| |
| |
11100000 (224)—11101111 (239) for Class D |
| |
 |
| |
Looking at the first octet of the IP address can easily identify the
network class. For example, the address used previously, 156.26.30.60, is a
Class B address because the first octet is between 128 and 191. Another (and
more tedious) way to identify the class is to represent the first octet of the
address in binary and see what the first couple of bits are set to. For example,
156 equals 10011100 in binary. The first two bits are 1 0, so according to
Figure 2-1, this is a Class B address. |
| |
 |
| |
How
many Class A, B, and C networks are there? Class A networks use 7 bits for the
network ID, so 128 Class A networks are possible. Class B addresses use 6 bits
from the first octet and all 8 bits of the second octet, so there are 16,384
networks (64 x 256), 64 from the first octet and 256 from the second octet.
Class C addresses use 5 bits from the first octet, 8 bits from the second octet,
and 8 bits from the third octet, so there are 2,097,152 possible Class C
networks (32 x 256 x 256). Class D addresses are not associated with networks
but with multicast groups. |
| |
 |
| |
Class A, B, and C addresses are unicast addresses. Each IP address in
the first three classes is used to identify a particular and unique Internet
host, while a Class D address is used to identify a group of hosts belonging to
a particular IP multicast group. The multicast addresses are in the range
224.0.0.0 through 239.255.255.255 (currently assigned multicast addresses are
listed in Appendix B). The range of addresses between 224.0.0.0 and 224.0.0.255,
inclusive, is reserved for the use of routing protocols and other low-level
topology discovery or maintenance protocols, such as gateway discovery and group
membership reporting. Multicast routers should not for ward any multicast
datagram with destination addresses in this range, regardless of the
TTL. |
| |
 |
| |
How
many hosts can each network have? Class A networks have 24 bits to identify a
host; this equals 1,677,216 possible hosts per network! Class B networks have 16
bits to identify a host, which equals 65,536 hosts, and Class C networks have 8
bits to identify a host, which equals 256 possible hosts. Table 2-2 lists the
capabilities for Class A, B, and C addresses. |
| |
 |
| |
Table 2-2: IP Classful Address Capabilities |
| |
 |
| |
You
may have noticed that the number of hosts listed in Table 2-1 is always two less
than the number calculated. The reason for this discrepancy is that two special
addresses can’t be assigned to a host. A host address of all ones is the
broadcast address for a particular network, and a host address of all zeros is
used by a host to temporarily identify itself (“this host”) until it has been
assigned an IP address. Only 126 Class A networks exist because network 0 cannot
be used, and network 127 is reserved for the loopback address that is used for
testing interprocess communication. When a host sends a packet to 127.0.0.1, the
data is not sent on the network but is returned immediately to the sending
host. |
| |
 |
| |
The
IP address blocks listed below have been reserved for private
Internets. |
| |
 |
| |
11110.0.0.0 — 10.255.255.2550 |
| |
| |
1172.16.0.0 — 172.31.255.2550 |
| |
| |
192.168.0.0 — 192.168.255.255 |
| |
 |
| |
These private IP addresses should never be advertised on the Internet
because they can be used by any private Internet. If these addresses are used,
then a technique such as network address translation would need to be used in
the private Internet to be connected to the public Internet. |
| |
 |
| |
Classful IP address assignments can be extremely inefficient as the
following design problem demonstrates. Assume we are designing a network for a
campus that has approximately 1500 nodes or end-stations. Also assume that the
predicted future growth of the network over the next five years will be no more
than 5000 nodes. At first glance, it would seem that a Class B network would
suffice for the current network requirements and also leave plenty of room for
future growth. Having 1500-plus nodes (5000-plus in the future) would be a very
large ethernet collision domain. If we want to limit the number of nodes on an
ethernet segment to no more than 100, then we need 50 networks to accomplish our
design. Regardless of which class of IP network addresses we decide to use
(assuming we could choose any addresses we want), there will be an enormous
waste of IP addresses as shown in Table 2-3. |
| |
 |
| |
Table 2-3: IP Address Design Inefficiencies |
| |
 |
| |
Network Class |
| |
 |
| Addresses Required |
| |
|
 |
| Addresses Available |
| |
|
 |
| Addresses Wasted |
| |
|
 |
| |
A |
| |
 |
| 100 |
| |
|
 |
| 16,777,214 |
| |
|
 |
| 16,777,114 |
| |
|
 |
| |
B |
| |
 |
| 100 |
| |
|
 |
| 00,065,534 |
| |
|
 |
| 00,065,434 |
| |
|
 |
| |
C |
| |
 |
| 100 |
| |
|
 |
| 00,000,254 |
| |
|
 |
| 00,000,154 |
| |
|
 |
| |
Now
multiply each entry in Table 2-3 by the 50 networks that are required and you
can easily see that regardless of which address class we choose, an enormous
number of IP addresses will be wasted. Also, if we are to have connectivity to
the Internet, then the network will have to advertise 50 networks to the
Internet routers. Multiply that by the number of campuses in the world and you
have a situation where the size of the Internet routing tables becomes
unmanageable. How do we overcome these problems? In a word, subnetting. | |
345 times read
|