Home > Articles > Network Technology > General Networking > Internet Addressing and Routing First Step

Internet Addressing and Routing First Step

Chapter Description

This chapter explains how internet routing works, and how internet addresses are assigned and utilized by network structures.

From the Book

Routing First-Step

Routing First-Step

$32.79 (Save 20%)

IP Version 4 and IP Version 6

IP version 4 (IPv4) has not changed much since it was defined in 1981. For the last two decades, IPv4 has proven to be a robust and scalable protocol for Internet routing. Unfortunately, the designers of IPv4 did not anticipate the explosive growth of the Internet, or the need for more IP addresses than version 4 could supply.

IPv4 uses 32-bit IP address, and with 32 bits the maximum number of IP addresses is 232—or 4,294,967,296. This provides a little more than four billion IPv4 addresses (in theory). The number of IPv4 available addresses is actually less than the theoretical maximum number. The reason the actual number of usable IP addresses is less than the maximum is because the broadcast and "this" network addresses cannot be assigned to hosts. A usable IPv4 address is one that can be assigned to a host, implying a unicast IP address. The only unicast IP addresses available are Class A, B, and C addresses. How many unicast IPv4 addresses are there? There are 27 – 3, or 126, possible Class A networks with numbers ranging from 1 to 126. (0 and 127 are not used, and 10 is the Class A private address space.) Each Class A network can have 224 – 2, or 16,777,216 hosts. (A host address of all 0s signifies the network address, and a host address of all 1s signifies the broadcast address.) The number of Class A hosts is 126 * 16,777,216 or 2,113,929,216. There are 214 – 1, or 16,383 Class B networks. (172.16.0.0 is the private Class B address space.) Each Class B network can have 216 – 2, or 65,534 hosts. The number of Class B hosts is 16,383 * 65,534, or 1,073,643,522. There are 221 – 1, or 2,097,151 possible Class C networks. (192.168.0.0 is the private Class C address space.) Each Class C network can have 28 – 2, or 254, hosts. The number of Class C hosts is 2,097,151 * 254 or 532,676,354. The total number of IPv4 unicast addresses is 3,720,249,092. A Class A, B, or C address identifies one specific host, and these addresses are called unicast addresses. The private addresses can be used in a network, but cannot be advertised on the Internet. This allows many networks to use the same private address as long as the hosts using these addresses do not need to be connected to the Internet.

The actual number of usable IPv4 unicast addresses is less than four billion. But there are usable addresses that will never be used. When IPv4 addresses were first allocated to government agencies, universities, and businesses, the addresses were allocated as classful addresses. If a university received a Class A address, the university had 16,777,216 host addresses that could be used. I cannot imagine any university, business, or government agency using every possible address assigned to them. It is difficult to determine how many IPv4 unicast addresses will never be used, but I'm sure it is more than 1. So the actual number of usable IPv4 addresses is less than 3.7 billion.

At first glance, even 3.7 billion addresses seems like enough. One reason it is not enough is the majority of the IPv4 address space has been allocated to countries that were early implementers of the Internet. The United States and Europe own the majority of the IP address space. Emerging countries like China need more IP addresses than what is available, driving the need for a larger address space.

Also, in the twenty-first century, devices other than computers need an Internet address. Cell phones, PDAs, vehicles, and appliances are all becoming part of the Internet. There simply are not enough IPv4 addresses to go around. So the big question is, how much is enough?

The current world population is more than six billion people, so there are more people than there are IPv4 addresses. If you assume everyone will eventually need at least one IP address, it is easy to see IPv4 does not have enough addresses. For every bit added to an IP address, the size of the address space doubles. A 33-bit IP address has around 8.5 billion addresses. A 34-bit IP address has about 17 billion possible addresses, and so on. IP version 6 (IPv6) uses 128 bits and it is interesting to investigate if 128 bits satisfies the need for more IP addresses.

Using 128 bits gives a theoretical address space of 3.4 * 1038 addresses. This is 3.4 followed by 38 zeros, or 3,400,000,000,000,000,000,000,000,000,000,000,000,000. Wow! That looks like a BIG number. But how big is it? To put this number in perspective, we need something to compare it to.

There are approximately 100 billion nerve cells in your brain or 1 * 1011. If you divide the number of possible IPv6 addresses by the number of nerve cells in your brain you get

3.4 * 1038 / 1.0 * 1011 = 3.4 * 1027 IPv6 address for every nerve cell in your brain.

There are approximately 7 * 1027 atoms in your body. 3.4 * 1038 / 7.0 * 1027 = 4.86 * 1010 IPv6 address for every atom in your body. This is more than 48 billion! Of course, you have to share these addresses with 6 billion plus people, so every atom in your body can only have 8 billion IPv6 addresses. By now you should be convinced that the number of possible addresses using 128 bits should last us for quite awhile.

IPv6 Address Format

IPv4 addresses are typically represented using the dotted decimal notation. For example, the 32-bit IPv4 address 100111000001101000100000000000012 can be represented as the dotted decimal number 156.26.21.1.

IPv6 uses eight 16-bit hexadecimal numbers (8 * 16 = 128 bits) separated by a colon to represent a 128-bit IPv6 address using the following rules:

  • Leading zeros in each 16-bit field are optional.

  • Example: The IPv6 address

    1A23:120B:0000:0000:0000:7634:AD01:004D can be represented by

    1A23:120B:0:0:0:7634:AD01:004D

  • Successive fields with the value 0 can be represented by a pair of colons (::).

  • Example: The IPv6 address

    1A23:120B:0000:0000:0000:7634:AD01:004D can be represented by

    1A23:120B::7634:AD01:4D

    The double colon :: represents the number of 0s needed to produce eight 16-bit hexadecimal numbers.

  • The double colon :: can be used only once to represent an IPv6 address.

  • Example: The IPv6 address

    1A23:120B:0000:0000:1234:0000:0000:4D can be represented by

    1A23:120B::1234:0:0:004D or

    1A23:120B:0:0:124::4D, but not by

    1A23:120B::1234::4D because there is no way to determine how many zeros each :: represents.

IPv6 Address Types

IPv4 uses two types of addresses: unicast and multicast. Unicast addresses are the Class A, B, and C addresses and are used to identify a single host on the Internet. Multicast addresses are used to identify multiple hosts for the delivery of multicast traffic (discussed in more detail in Chapter 9, "Multicast—What the Post Office Can't Do"). IPv6 has three major address types: unicast, multicast, and anycast.

IPv6 unicast addresses are divided into five groups:

  • Global unicast addresses—Equivalent in function to an IPv4 unicast address using 64 bits for the network ID and 64 bits for the host ID.

  • Site-local unicast addresses—Equivalent to the IPv4 private addresses such as 10.0.0.0 and 172.16.0.0.

  • Link-local unicast addresses—An IPv6 address that is automatically configured on an interface allowing hosts on the same subnet to communicate with each other without the need for a router.

  • IPv4-compatible IPv6 addresses—Used to transport IPv6 messages over an IPv4 network. An IPv4 address is placed in the low-order 32 bits of an IPv6 address. For example, the IPv4-compatible IPv6 address for the IPv4 address 156.26.32.1 is

  • 0:0:0:0:0:0:156.26.32.1 = ::156.26.32.1 = ::9C1A2001
  • IPv4-mapped IPv6 addresses—Similar to an IPv4-compatible address, and used to represent an IPv4 interface as an IPv6 interface using 16 ones before the IPv4 address. For example, the IPv4-mapped IPv6 address for the IPv4 address 156.26.32.1 is

  • 0:0:0:0:0:FF:156.26.32.1 = ::FFFF:9C1A:2001

IPv6 multicast addresses serve the same function as IPv4 mulitcast addresses (again, more on this in Chapter 9). The anycast address type is a unicast address assigned to a set of interfaces, and a packet is sent to the nearest interface.

IPv6 provides enough addresses to last for a very long time. Eventually, the Internet will move to the use of IPv6; and, for a time, IPv4 and IPv6 will both be used. Routing protocols must be able to handle both address formats. For an in-depth discussion of IPv6, refer to the references at the end of the chapter.