IP Addressing Concepts


IP addressing is central to the operation of the IP protocol. The TCP/IP stack shown in Figure 1-1 features a network interface to the underlying physical and data-link layers, which allow the IP protocol to be media independent. Media independence is probably one of the critical advantages of the IP protocol that has promoted its wide acceptance and ubiquity. IP uses a native addressing scheme, in line with its media-independent architecture, that has no bearing on the underlying localarea network (LAN) or wide-area network (WAN) media interconnect IP devices. Therefore, IP successfully operates over heterogeneous network infrastructures consisting of several kinds of different media technology. This flexibility, together with a simple protocol stack, is the most critical instigator of its popularity.

IP addressing assigns addresses to individual network interfaces of a device (link-based approach) instead of using a single address for the whole device (host-based approach). The various interfaces of a device are connected to network links that are designated as subnetworks (or subnets) and are assigned subnet addresses. An interface's IP address is assigned from the subnet address space of the connecting link. The advantage of this link-based addressing approach is that it allows routers to summarize routing information by keeping track of only IP subnets in the routing tables instead of every host on the network. This is advantageous especially for broadcast links such as Ethernet that might have many devices connected at the same time. The Address Resolution Protocol (ARP) is used in IP networking for resolving the IP addresses of directly connected hosts to the corresponding datalink addresses.

Currently, two types of IP addresses exist: IP Version 4 addresses (IPv4) and IP Version 6 addresses (IPv6). IPv4 addressing, which was in place before IPv6 was adopted, uses 32 bits to represent each IP address. This 32-bit addressing scheme provides up to 232 (4,294,967,295) unique host addresses, mathematically speaking. With the ever increasing size of the global Internet, the 32-bit IPv4 addressing scheme has turned out to be insufficient for the foreseeable future, prompting the introduction of the 128-bit IPv6 addressing scheme. This book covers practical troubleshooting of IP routing protocols deployed in IPv4 environments. Therefore, the ensuing text discusses only the IPv4 addressing structure and related concepts, most of which are applicable to IPv6. The following IPv4 addressing topics are covered in the subsequent sections:

IPv4 Address Classes


As explained in the previous section, the 32-bit IPv4 addressing scheme allows a large number of host addresses to be defined. However, the link-based addressing scheme adopted by IP requires network links to be associated with groups of addresses from which the connected hosts are assigned specific addresses. These address groups, described also as address prefixes, are referred to in classical IP terminology as IP network numbers.

Originally, IP network numbers were defined with rigid boundaries and grouped into ad-dress classes. The idea behind IP address classes was to enable efficient assignment of the IP address space by creating address groups that would support a varying number of hosts. Network links with fewer hosts then would be assigned an address from a class that sup-ports an appropriate number of attached hosts. Another benefit of address classes

Five address classes—A, B, C, D, and E—were defined and distinguished by the setting of the most significant bits of the most significant byte in the IP address. Each address class embraced a set of IPv4 address subnets, each of which supported a certain number of hosts. Table 1-1 shows the five IPv4 classes.

Table 1-1. IP Address Classes and Representation
IP Address Classes and Representation

As Table 1-1 shows, a specific bit pattern in the first byte of an IP address corresponds to a range of addresses and maps to a specific address class.

Of the five address classes, three—Class A, B, and C—were designated for unicast single source–to–single destination communication. Addresses in Class D were reserved for IP Multicast applications, which allows one-to-many communication. Class E addresses were reserved for experimental purposes.

To make the addresses in each of the unicast address classes (A, B, and C) support a specific maximum number of hosts, the 32-bit address field was delineated into network identifier (network ID) bits and host identifier bits (host ID) as follows: Figure 1-2 shows the assignment of the 32 bits in a Class A address. The highest-order bit has a fixed value of 0, and the whole of the first byte is the network ID. The last 3 bytes are designated as host bits.

Figre 1-2. Assignment of Class A Address Bits

Assignment of Class A Address Bits

This notion of categorizing IP addresses into classes with rigid boundaries is also known as classful addressing. IP addresses use masks to delineate host bits from the network number bits. IP address structuring has evolved through various innovations, all geared toward mak-ing address allocation and actual assignment in real networks more efficient. You find out more about this in the section "Subnetting and Variable-Length Subnet Masks."

To make it easier for humans to work with IP addresses, these addresses are represented in a format known as dotted-decimal notation. In the dotted-decimal representation, the bits are grouped into octets and are separated by dots. Each octet of binary bits then is converted into the decimal equivalent. The last column of Table 1-1 shows the dotted-decimal notations for the range of addresses in each of the address classes.

Even though classful addressing was introduced to facilitate efficient use of the IPv4 address space, the rigid classful boundaries left a lot more to be desired. Because of its rigidity and inefficiency, classful addressing has been abandoned for the more efficient and flexible notion of classless addressing.

In classless addressing, any IP network number is interpreted as a prefix of a certain length. This interpretation provides more flexibility and results in a more efficient use of the IPv4 address space. A large classful block of addresses such as a Class A address can be split into multiple smaller blocks for allocation to multiple organizations instead of being allocated to a single organization under the classful notions. Conversely, classless addressing allows multiple Class C addresses to be aggregated and advertised as a single larger block instead of being treated as separate addresses. Aggregating addresses in this manner for the purposes of conserving resource in routers connected to the Internet is referred to as classless interdomain routing (CIDR), which is further discussed in a later section, "Classless Interdomain Routing (CIDR)."

IPv4 Private Address Space


Some address blocks in the unicast space were set aside and designated as private addresses. The private address space was intended for networks that are not connected to the public Internet. The following addresses are specific in RFC 1918 as part of the IPv4 private address space: RFC 1700 provides general information on reserved or allocated parameters, including reserved addresses. Private internets that have deployed addresses from the private IPv4 space still can connect to the public Internet by using address Network Address Translation (NAT).

Subnetting and Variable-Length Subnet Masks


Before CIDR, each classful network number could be allocated for use in only a single organization. However, within an organization, it was possible to use subnetting to break up a classful address into multiple smaller address groups that could be applied to different segments of the same network domain.

IP subnetting introduces another level of hierarchy into the structure of IP address classes by moving some of the host bits in a classful network number into the network ID field. The extended network ID is referred to as a subnetwork number or simply as an IP subnet. For example, one octet of the 2 octet host bits of a Class B address can be used to create 255 subnets, each with only an octet of host bits. This is illustrated in Figure 1-3.

Figure 1-3. Class B Subnet Example
Class B Subnet Example

When an IP address is subnetted, the address mask is adjusted to reflect the new demarcation between the network and host bits. Figure 1-4 shows the new mask and the corresponding subnets that are created from a Class B address. A string of ones in the mask represent the network bits, and the zeros represent the host bits. A common way of representing an IP address is to indicate its prefix length, which is the number of 1 bits in the mask. This also represents the number of network bits in the address. For example, 172.16.1.0 255.255.255.0 can be represented as 172.16.1.0/24.

Figure 1-4. Subnet Mask Example

Subnet Mask Example

Even though classful addressing allows subnetting for more efficient assignment of addresses from a block, in a classful network environment only a consistent mask is allowed. VLSM extends the notion of subnetting to allow different masks to be applied to one network number, providing more flexibility in carving up an address into different block sizes for application to different segments in a network domain. This allows more efficient use of an allocated address block. For example, by using VLSM, the Class B address, 172.16.0.0/16, can be carved into smaller subnets with 24-bit subnet masks by using 8 host bits as subnet bits. You then can further subnet one of the first genera-tion subnets—for example, 172.16.1.0/24—by using another 4 of the remaining host bits. This will result in much smaller blocks such as 172.16.1.0/28, 172.16.1.16/28, 172.16.1.32/28, and so on. VLSM can be used only in classless network environments in which the routing protocols and related routing software support classless addressing. Figure 1-5 illustrates subnetting with VLSMs.

Figure 1-5. VLSM Example

VLSM Example