Global IPv6 Address Format

Posted: June 10, 2010 in Uncategorized

One of the big challenges with converting from IP version 4 to IP version 6 is understanding the format of the IPv6 address. Even today, many people have a difficult time working with IPv4 addressing (ex. 172.17.33.14 255.255.240.0, or 172.16.33.14/20) without the use of a computer program so when presented with an IPv6 address (ex. 2001:0db8:30cd:a120:023c:4bff:fe36:2482/64) the job of managing the network can seem much more difficult.

Although IPv6 has many types of addresses such as global unicast, multicast, link-local, and unique-local addresses to name a few, the purpose of this posting will focus on the allocation, and format, of global unicast address assignments. The other address types will be covered in other posts.

In IPv6 the host address is 128 bits in length with the bits representing two different parts of the address. The first of these two parts is the prefix, also know as the network or sub-network, and the second part is the host id. The basic division is 64 bits for the prefix and 64 bits for the host. The reasoning behind this is that IPv6 was designed to support a feature called stateless auto-configuration that allows hosts to automatically determine and configure their address when they connect to the network. The benefit to stateless auto-configuration is that you do not have to manage individual host addresses for every device connecting to the network. The basis behind the “stateless” is that the host will automatically create it’s own host id (also know as the interface id) typically as a derivative of it’s 48-bit mac address. A common method for this is to create a 64-bit extended unique identifier (EUI-64) by expanding the 48-bit mac address to 64-bits by placing a 16-bit value label of 0xFFFE between the 24-bit company-id and the 24-bit extension identifier. Since proper layer 2 operation on a network requires that each host have a unique layer 2 identifier this helps to ensure that each host creating a EUI-64 identifier will be unique. To ensure there is no conflict with an existing host id, the host performing the auto-configuration will conduct a Duplicate Address Detection process before fully configuring its own address. With the ever growing number of devices that are connecting to the IP network, such as PC’s, VOIP phones, mobile phones, iPads, and eventually even appliances, the stateless auto-configuration capability will be a necessity.

To make the management of IPv6 addresses much easier, several conventions have been adopted.

  • The 128 bits are divided into 8 equal segments of 16 bits each with each segment separated by a colon.
  • The value for each of the 16-bit segments is represented in hexadecimal (ex. 2001:0db8:30cd:a120:023c:4bff:fe36:2482/64).
  • The prefix (network or sub-network) is identified by the prefix length represented as a forward slash followed by the number of bits that identify the prefix (ex. /64).
  • Since the address is read from least significant bit (right) to most significant bit (left) leading zeros may be omitted.  (ex. 2001:0db8:0001:0001:0000:0000:0000:0001/64 can be represented as 2001:db8:1:1:0:0:0:1/64).
  • Concurrent groups of zeros can be consolidated within two colons (::).  This can only be done once within an address since the system has to be able to determine how many bits are represented between the double colon by knowing how many bits are represented before and after the double colon. (ex 2001:db8:1:1:0:0:0:1 can be represented as 2001:db8:1:1::1/64)

To be able to fully understand the address, you must understand how addresses are allocated.  The controlling authority for address assignments is the Internet Assigned Numbers Authority (IANA).  IANA has assigned the prefix 2000::/3 as the top level prefix for Global Unicast addresses.  This means that the most significant three bits (/3) must be equal to 2 in hexadecimal so if the most significant digit of an IPv6 address is 2 or 3 (0010 or 0011) the address is in the Global Unicast category.

Under the current guidelines IANA assigns /12 prefixes to each of the five Regional Internet Registries (RIRs).  The five RIRs are the Asia-Pacific Network Information Centre (APNIC – 2400::/12), the African Network Information Center (AfriNIC – 2C00::/12), the American Registry for Internet Numbers (ARIN – 2600::/12), the Latin American and Caribbean Internet Addresses Registry (LACNIC – 2800::/12), and the Reseaux IP Europeens Network Coordination Centre (RIPE NCC – 2A00::/12).  All of these RIRs, with the exception of AfriNIC, have been assigned prefixes up to /23  but for the purpose of this document I have only identified the /12 assignments.

Each RIR is responsible for allocating address space from their prefix to entities in their respective region.  Typically this allocation only goes to Local Internet Registries (LIR, also know as Service Providers) but in special cases the RIR may allocate address space directly to the End User (EU) but this is not currently very common.  The current guideline is to assign a /32 prefix to each LIR.

The LIRs assign address prefix space to the EUs with a minimum value of /64 and a maximum value of /48 based on need.  As stated above, the common usage of the address is up to 64 bits for the prefix and 64 bits for the interface id.  Following this usage, if an EU is assigned a /48 prefix they will have 16 bits that they can use to identify individual network segments (subnets) so they would be able to assign individual prefixes for up to 65,536 network segments.  This would be the same as assigning an IPv4 class A address to an organization that subnets to the 24 bit boundary except that with IPv4 addresses you would only have 8 bits left for hosts which would only allow you 254 hosts per subnet, with IPv6 /64 prefixes you still have 64 host bits which allow you to theoretically have 18,446,744,073,709,551,614 hosts per subnet.  A current guideline for this is to assign a /64 prefix when only one subnet is needed, assign a /56 for small sites that only need “a few” (up to 256) subnets over the next 5 years, and assign a /48 to large organizations.

Assuming an organization is assigned a /48 prefix, they can use the next 16 bits to subnet the prefix for their organization to the /64 boundary.  The remaining 64 bits can be used for the host id utilizing the auto-configuration capabilities.  Addresses may also be assigned to the host level if desired, this is common to maintain some of the currently used conventions like the gateway having the first address on a subnet (ex. 2001:db8:1:1::1/64).

When reading the address of  a host in IPv6 you simply take this hierarchy of the address allocation from IANA.  A “2” or “3” as the most significant digit identifies the address as a Global Unicast Address.  The most significant 3 digits (12-bits) identify the RIR for the region of the world the address applies to (again the RIR prefix could be up to 23 bits but for the purpose of this article and the current guidelines we are focusing on the first 12 bits).  The most significant 32 bits, the first two address segments, represent the Service Provider (LIR).  The following 16 to 32 bits identify the organization  and possibly the specific subnet within the organization.  The remaining bits identify the specific host on the network segment.  An example of this breakdown is shown below.

As an additional note, the prefix show in the examples (2001:db8::/32) is a special purpose address for documentation purposes so the addresses shown are not meant to represent anyone’s personal address.

What is IPv6?

Posted: June 8, 2010 in Uncategorized

Simply stated, Internet Protocol (IP) version 6 (v6) is an extension of the addressing scheme to allow for a far greater number of addresses to be assigned over the currently used IP version 4.  To clarify this, you must first understand a few basic principles of the address allocation.

Just as if you were going to send a letter to someone, you have to put an address on the envelope that can be used by the intermediate handlers (postal service, etc.) that will identify the location of the recipient of the letter.  This address has several parts including the region of the world or country, the street that the recipient is on, and the individual building or unit on that street.  For computers to talk to each other they have to create a packet of information that will be sent and this packet also has to be properly addressed for delivery. For one host to speak to another host, an address has to be used to identify the segment of the internet that the packet will be routed to and the individual host has to be identified as well.

In IPv4, the address space for this identification is 32 bits in length and is subdivided so that part of the address will identify the network segment and the rest of the address will identify the individual host on that network segment.  When computers speak to each other, information is passed as a series of 0’s and 1’s that are encoded by the transmission mechanism (light, voltage, etc.).  The receiving computer will interpret the (binary) 0’s and 1’s to read and handle the message that is received.  This gives us a deterministic range of values based upon the number of bits used, each bit being a single 0 or 1.  To calculate the number of this range you can simple use a formula of 2 (number of values a single bit can have) to the power of the number of bits.  For example, if you have 3 bits you can get a total of 8 combinations (2 to the power of 3, or 2 x 2 x 2 = 8 ) as displayed below.

In IPv4 there are 32 bits assigned for each address (source and destination).  Doing the simple math means this will give you a total possibility of 4,294,967,296 combinations from the 32 bits.  According to Internet World Stats the 2009 population of the top 10 countries alone was 3,988,712,105, with a world population of 6,767,805,208.  Based on the fact that many people have more than one computer and other devices, such as mobile phones, are also requiring addresses, it is not too difficult to see how we can easily run out of addresses for devices to use.

Compound this with the fact that not all of the approximately 4.3 billion address are available for use.  In IPv4 addresses are classified as A, B, C, D, etc. for usage allocation.  Class A designates that the first 8 bits of the address identify the network and the remaining 24 bits can be used to identify subnetworks and hosts, class B designates the first 16 bit for the network identification leaving 16 bit for assignment, class C designates the first 24 bits for the network leaving 8 bits for subnets and hosts, class D is for multicast addressing, etc.  There are special purpose addresses like class A address 127.0.0.0 (for loopback) and private addresses (10.0.0.0, 172.16-31.0.0, and 192.168.0-255-0).  These are addresses that cannot be assigned for public use.  The loopback network (127.0.0.0) is based of a fixed value for the first 8 bits identifying this as a special purpose addresses and therefore the remaining combinations of the following 24 bits cannot be used for public identification, this address alone excludes 16,777,217 (2 to the power of 24 plus the value of 127 for the first eight bits) from public assignment.

IPv6 expands the addressing possibilities by extending the number of bits used for host addressing from 32 bits to 128 bits.  This quadruples the number of bits allocated for addressing and gives us an exponential growth of binary possibilities to a value of 340,282,366,920,938,463,463,374,607,431,768,211,456.  With this number of possible combinations, it seems like we will never have a problem with addressing again.  Don’t get overly excited yet, it my article on the format of IPv6 addressing I explain a lot about what is and what is not usable out of this space.

Because the number of bits for addressing was expanded, the information header (Internet Protocol) had to be redesigned to support the new address space.  Because we have had over twenty years of experience working with IPv4, this hindsight was used to make improvements to the overall operation of IP to include streamlining the header to make processing more efficient, auto-configuration capability of the addressing assignments, improvements for mobility support, and improvements to IPSec security to name a few.  All of these are beyond the scope of this posting but will be discussed in other postings.