The Internet Protocol: IPV4 Address Allocation

We ended the last lesson with a discussion on variable-length subnets. Let's discuss how blocks of addresses are allocated to organizations, in this lesson.

Allocating Blocks of Addresses to Organizations

A second issue concerning the addresses of the network layer is how to allocate blocks of addresses to organizations.

  • The first allocation scheme was to allocate class address blocks on a first come, first served basis.

  • Large organizations such as IBM, BBN, as well as Stanford or MIT were able to obtain one class A address block each.

  • However, most organizations requested class B address blocks consisting of 65,53665,536 addresses, which was suitable for their size. Unfortunately, there were only 16,384 different class B address blocks. This address space was being consumed quickly. Since a disproportionate number of class B address blocks were being used, the number of entries for class B blocks increased. So the routing tables maintained by the routers were also growing quickly, and some routers had difficulties maintaining all these routes in their limited memory. Hence, the purpose of address space classes was being defeated.

Press + to interact
Evolution of the size of the routing tables on the Internet (Jul 1988-Dec 1992)
Evolution of the size of the routing tables on the Internet (Jul 1988-Dec 1992)

Classless Interdomain Routing #

Faced with these two problems, the Internet Engineering Task Force decided to develop the Classless Interdomain Routing (CIDR) architecture RFC 1518. This architecture allows IP routing to scale better than class-based architecture. CIDR contains three important modifications over class-based architecture:

  1. IP address classes are deprecated. All IP equipment must use and support variable-length subnets.

  2. IP address blocks are no longer allocated on a first come, first served basis. Instead, CIDR introduces a hierarchical address allocation scheme. The main draw-back of the first come, first served address block allocation scheme was that neighboring address blocks were allocated to very different organizations and conversely, very different address blocks were allocated to similar organizations.

  3. IP routers must use longest-prefix match when they look up a destination address in their forwarding table.

Who Allocates What? #

With CIDR, address blocks are allocated by Regional IP Registries (RIR) in an aggregatable manner. A RIR is responsible for a large block of addresses and a region. For example, RIPE is the RIR that is responsible for Europe. A RIR allocates smaller address blocks from its large block to Internet Service Providers (ISPs). ISPs then allocate smaller address blocks to their customers.

Press + to interact

Why CIDR? #

The main advantage of this hierarchical address block allocation scheme is that it allows the routers to maintain fewer routes. For example, consider the address blocks that were allocated to some Belgian universities as shown in the table below:

Address block Organization
130.104.0.0/16 Universite catholique de Louvain
134.58.0.0/16 Katholiek Universiteit Leuven
138.48.0.0/16 Facultes universitaires Notre-Dame de la Paix
139.165.0.0/16 Universite de Liege
164.15.0.0/16 Universite Libre de Bruxelles

Suppose that these universities are all connected to the Internet exclusively via ISP A. As each university has been allocated a different address block, the routers of ISP A must announce one route for each university, and all routers on the Internet must maintain a route towards each university.

In contrast, suppose all the high schools and the government institutions that are connected to the Internet via ISP A are assigned one block: 193.190.0.0/15 after the introduction of CIDR. Thanks to this, ISP A has one route for all high schools and government institutions.

Longest Prefix Match #

However, there is one difficulty with the aggregatable variable length subnets used by CIDR. Consider, for example, a government institution X that uses the 193.191.244.0/23 address block. Assume that in addition to being connected to the Internet via ISP A, X wants to be connected to another ISP. X’s network is then said to be multihomed. This is shown in the figure below.

Press + to interact
 Multihoming and CIDR
Multihoming and CIDR

With such a multihomed network, routers in the general Internet would have two routes towards an address in X such as 193.191.245.88:

  • One route via ISP A (193.190.0.0/15)
  • One route via ISP B (193.191.244.0/23).

Both routes match IPv4 address 193.192.145.88. Since RFC 1519 when a router knows several routes towards the same destination address, it must forward packets along the route with the longest prefix length. In our example:

  • Our target IP address, 193.191.245.88 in binary is 11000001.10111111.11110101.01011000
  • 193.190.0.0 in binary is 11000001.10111110.00000000.00000000
  • 193.191.244.0 in binary is 11000001.10111111.11110100.00000000
  • Hence, 193.191.245.88 and 193.190.0.0 have a 15-bit matching prefix.
  • Whereas 193.191.245.88 and 193.191.244.0 have a 23-bit matching prefix.
  • In the case of 193.191.245.88, the route that will be taken will be via ISP B.

This forwarding rule is called the longest prefix match or the more specific match. All IPv4 routers implement this forwarding rule.

Classless Interdomain Routing Vs. Variable-length Subnets #

Variable-length subnets steal bits from the host portion of the IP address. Classless interdomain routing also allows aggregation of smaller subnets into larger ones by making less specific subnet masks. For example, 190.10.1.0/24, 190.10.2.0/24, 190.10.3.0/24 and 190.10.4.0/24 can be summarized into 190.10.0.0/21. This reduces the number of entries that a router advertises, thereby controlling the size of the routing tables in the core of the Internet.

Furthermore, in Variable-length subnets the default subnet mask of the classes is strictly extended, whereas in CIDR, classes do not exist at all. So the ‘default’ length can be extended or reduced. Therefore, variable-length subnets are used if someone needs fewer addresses generally, whereas CIDR is for reducing routing table entries.

Special IPv4 addresses #

Most unicast IPv4 addresses can appear as source and destination addresses in packets on the global Internet. It’s worth noting though, that some blocks of IPv4 addresses have a special usage, as described in RFC 5735. These include:

  • 0.0.0.0/8: reserved for self-identification. A common address in this block is 0.0.0.0, that we saw being used in the previous chapter!

  • 127.0.0.0/8, reserved for loopback addresses. Each IPV4 host has a loopback interface (that’s not attached to a data link layer). By convention, IPv4 address 127.0.0.1 is assigned to this interface as we saw in the previous chapter. This allows processes running on a host to use TCP/IP to contact other processes running on the same host. This is very useful for testing purposes. Furthermore, loopback interfaces can not be down. If the device is up, so are its loopback interfaces. Yes, the plural is intentional too. You can configure as many loopback interfaces as you want. In such a case, the loopback interfaces can be assigned different IP addresses. Anyway, a loopback interface address is used as a router identifier when configuring some of the routing protocols. We want the routing process to keep running even if some of the physical interfaces go down. The loopback interface(s) provide the desired stability.

  • 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 are reserved for private networks that are not directly attached to the Internet. These addresses are often called private addresses.

  • 169.254.0.0/16 is used for link-local addresses. Some hosts use an address in this block when they’re connected to a network that does not allocate addresses as expected.

Quick Quiz! #

1

What would the next hop for the IP address 205.135.3.2205.135.3.2 be based on the following routing table?

Destination Next-hop
205.135.0.0/16205.135.0.0/16 R3
205.135.3.0/24205.135.3.0/24 R1
205.0.0.0/8205.0.0.0/8 R2
Any other R4

If entries for a certain IP address are not available (no prefix bits match), then they get forwarded to a certain default router.

A)

R1

B)

R2

C)

R3

D)

R4

Question 1 of 20 attempted

In the next lesson, we’ll look at IPV4 packets!

Get hands-on with 1400+ tech skills courses.