[Part 1 of this article begins with an overview of IP addressing. Part 2 reviews the network/host boundary and examines the IPv4 address in detail. Part 3 looks at the IPv6 header and address, as well as the basics of subnetting.]
CIDR and VLSM
Today, the standard methods for moving the network/host address boundary are variable-length subnet masking (VLSM) for host
addressing and routing inside a routing domain, and classless interdomain routing (CIDR) for routing between routing domains. (We'll talk more about routing domains later in this book. For now, think of a routing domain as an ISP's collection of routers.) And although treated separately here for introductory reasons, it is important to realize that VLSM is the fundamental mechanism of CIDR.
CIDR (defined in RFC 1519) and VLSM (defined in RFC 1860) address more general issues than simple subnetting. We've been looking at addresses from the host perspective in this chapter so far. Let's discuss CIDR from the router perspective.
CIDR was an immediate answer to two problems: first, the impending exhaustion of the Class A and Class B address space, and second, the rapid increase in Internet core routing table sizes to handle the many Class C addresses required to handle new users.
In CIDR, a block of contiguous IP addresses from the former classful address space are assigned in a group, such as groups of Class C addresses. This allows a service provider or large customer to configure IP networks from a few hosts up to 16,384 hosts. The number of contiguous addresses needed is determined by a simple count of the number of host addresses required.
The original CIDR plan, applied to Class C addresses, is shown in Table 4.4. Contiguous address numbers flow seamlessly between former class boundaries, allowing assignment of address "chunks" for larger networks.
Table 4.4 Address Grouping under CIDR*
The CIDR RFC does not "subtract" two host addresses for the network itself (final bits all 0s) and a broadcast address (final bits all 1s). CIDR applies mainly to router operation, and routers do not assume any structure of the IP addresses in the packets they route.The limitation on assigning the high and low IP addresses to a host interface is a function of the host TCP/IP implementation (and some, like routers, do not enforce any limitations at all).
CIDR changed the terminology that applied to IP addresses. Routes to IP networks are now represented by prefixes. A prefix consists of an IP network address, followed by a slash (/), and followed with an indication of how many of the leftmost contiguous bits in the address are part of the network mask applied for routing purposes.
For example, before CIDR, the Class C address 192.168.64.0 would ordinarily have a mask of 255.255.255.0. Subnetting could add bits to this major network mask, but only in the fixed patterns and values outlined in the previous section. CIDR enabled a "CIDR-ized" network address to be represented as 192.168.64.0/18, and that was all the information needed. Sometimes this is abbreviated even further to just 192.168.64/18, but the two forms are equivalent. The notation just means that a "subnet mask 18 bits long should be applied to 192.168.64.0." This is the same as writing "192.168.64.0 with mask 255.255.192.0" but in more compact form.