TCP/IP
Chapter 3. Internetworking protocols
3.1 Internet Protocol (IP)
3.1.7 Classless Inter-Domain Routing (CIDR)
The current rules are to be found in RFC 2050 – Internet Registry IP
Allocation Guidelines, which updates RFC 1466. The reasons for the rules for the allocation of Class C network numbers will become apparent in the following sections. The use of Class C network numbers in this way has averted the exhaustion of the Class B address space, but it is not a permanent solution to the overall address space constraints that are fundamental to IP. A long-term solution is discussed in Chapter 17, “IP Version 6” on page 559.
Chapter 3. Internetworking protocols 87 are related. The result of this is termed the routing table explosion problem: A Class B network of 3000 hosts requires one routing table entry at each backbone router. The same environment, if addressed as a range of Class C networks, requires 16 entries.
The solution to this problem is called Classless Inter-Domain Routing (CIDR).
CIDR is described in RFCs 1518 to 1520. CIDR does not route according to the class of the network number (hence the term classless). It is based solely on the high order bits of the IP address. These bits are termed the IP prefix.
Each CIDR routing table entry contains a 32-bit IP address and a 32-bit network mask, which together give the length and value of the IP prefix. This is represented as the tuple <IP_address network_mask>. For example, to address a block of eight Class C addresses with one single routing table entry, the following representation suffices: <192.32.136.0 255.255.248.0>.
This would, from a backbone point of view, refer to the Class C network range from 192.32.136.0 to 192.32.143.0 as one single network. This is illustrated in Figure 25:
11000000 00100000 10001000 00000000 = 192.32.136.0 (class C address)
11111111 11111111 11111--- --- 255.255.248.0 (network mask) ===================================== logical_AND
11000000 00100000 10001--- --- = 192.32.136 (IP prefix)
11000000 00100000 10001111 00000000 = 192.32.143.0 (class C address)
11111111 11111111 11111--- --- 255.255.248.0 (network mask) ===================================== logical_AND
11000000 00100000 10001--- --- = 192.32.136 (same IP prefix)
Figure 25. Classless Inter-Domain Routing - IP supernetting example
This process of combining multiple networks into a single entry is referred to as supernetting. Routing is based on network masks that are shorter than the natural network mask of an IP address. This contrasts subnetting (see 3.1.2,
“IP subnets” on page 69) where the subnet masks are longer than the natural network mask.
The current Internet address allocation policies and the assumptions on which those policies were based, are described in RFC 1518 – An
Architecture for IP Address Allocation with CIDR. They can be summarized as follows:
• IP address assignment reflects the physical topology of the network and not the organizational topology. Wherever organizational and
administrative boundaries do not match the network topology, they should not be used for the assignment of IP addresses.
• In general, network topology will closely follow continental and national boundaries. Therefore IP addresses should be assigned on this basis.
• There will be a relatively small set of networks that carry a large amount of traffic between routing domains. These networks will be interconnected in a non-hierarchical way that crosses national boundaries. These networks are referred to as transit routing domains (TRDs). Each TRD will have a unique IP prefix. TRDs will not be organized in a hierarchical way when there is no appropriate hierarchy. However, whenever a TRD is wholly within a continental boundary, its IP prefix should be an extension of the continental IP prefix.
• There will be many organizations that have attachments to other
organizations that are for the private use of those two organizations. The attachments do not carry traffic intended for other domains (transit traffic).
Such private connections do not have a significant effect on the routing topology and can be ignored.
• The great majority of routing domains will be single-homed. That is, they will be attached to a single TRD. They should be assigned addresses that begin with that TRD's IP prefix. All of the addresses for all single-homed domains attached to a TRD can therefore be aggregated into a single routing table entry for all domains outside that TRD.
This implies that if an organization changes its Internet service provider, it should change all of its IP addresses. This is not the current practice, but the widespread implementation of CIDR is likely to make it much more common.
Note:
• There are a number of address assignment schemes that can be used for multi-homed domains. These include:
- The use of a single IP prefix for the domain. External routers must have an entry for the organization that lies partly or wholly outside the normal hierarchy. Where a domain is multi-homed, but all of the attached TRDs themselves are topologically nearby, it would be appropriate for the domain's IP prefix to include those bits common to
Chapter 3. Internetworking protocols 89 all of the attached TRDs. For example, if all of the TRDs were wholly within the United States, an IP prefix implying an exclusively North American domain would be appropriate.
- The use of one IP prefix for each attached TRD with hosts in the domain having IP addresses containing the IP prefix of the most appropriate TRD. The organization appears to be a set of routing domains.
- Assigning an IP prefix from one of the attached TRDs. This TRD becomes a default TRD for the domain but other domains can explicitly route by one of the alternative TRDs.
- The use of IP prefixes to refer to sets of multi-homed domains having the TRD attachments. For example, there may be an IP prefix to refer to single-homed domains attached to network A, one to refer to single-homed domains attached to network B, and one to refer to dual-homed domains attached to networks A and B.
Each of these has various advantages, disadvantages and side effects.
For example, the first approach tends to result in inbound traffic entering the target domain closer to the sending host than the second approach.
Therefore, a larger proportion of the network costs are incurred by the receiving organization.
Because multi-homed domains vary greatly in character. None of the above schemes is suitable for every domain. There is no single policy that is best. RFC 1518 does not specify any rules for choosing between them.
3.1.7.1 CIDR implementation
The implementation of CIDR in the Internet is primarily based on Border Gateway Protocol Version 4 (see 4.9, “Border Gateway Protocol (BGP)” on page 180). The implementation strategy, described in RFC 1520 –
Exchanging Routing Information Across Provider Boundaries in the CIDR Environment, involves a staged process through the routing hierarchy beginning with backbone routers. Network service providers are divided into four types:
• Type 1: Those providers that cannot employ any default inter-domain routing.
• Type 2: Those providers that use default inter-domain routing but require explicit routes for a substantial proportion of the assigned IP network numbers.
• Type 3: Those providers that use default inter-domain routing and supplement it with a small number of explicit routes.
• Type 4: Those providers that perform inter-domain routing using only default routes.
The CIDR implementation began with the Type 1 network providers, then the Type 2, and finally the Type 3 providers.