Lasso Soft Inc. > Home

  • Articles

IPv6 - The New Internet Protocol

This article includes background information on IPv6, the new version of the Internet Protocol. The network infrastructure necessary to support IPv6 is being rolled out now. Recent OS releases including Windows Vista and Mac OS X Leopard improve support for IPv6 addresses.

Introduction

IPv6 is an abbreviation for Internet Protocol version 6. The Internet Protocol defines how packets are transmitted between machines using IP addresses. IPv6 is an upgrade to the IPv4 standard. Packets in IPv4 are addressed using familiar IP addresses such as 127.0.0.1.

The Internet (or any network) is often described in terms of five layers. The lowest layer is physical wiring such as Ethernet cables or Airport antennas. The second layer defines the data link which is used for communication over the physical layer. The details of this layer are essentially handled by your Ethernet card or Airport card. The third layer is the network or Internet layer. This layer controls how machines on the network are addressed. This layer is defined by the Internet Protocol.

The fourth layer is called the transport layer. On the Internet there are two popular transports. TCP is the Transmission Control Protocol and is used for common protocols including Email (SMTP/POP/IMAP), the Web (HTTP), FTP, and others. To an application like Lasso a TCP connection looks like a wire connected directly to a remote server. Messages can be sent and received over the connection. UDP is the User Datagram Protocol. It allows packets to be sent to remote machines without the overhead of maintaining a connection. UDP is often used for simple protocols like DNS and for time sensitive protocols.

The fifth layer is the application layer. All of the familiar Internet protocols like HTTP, SMTP, POP, IMAP, FTP, SSH, DNS, etc. are examples of this layer. As users we almost always deal with applications that implement these protocols. Lasso is usually accessed through HTTP. Lasso has tags which allow SMTP, POP, IMAP, FTP, and DNS to be used. Lasso's low-level tags allow access to the fourth layer so additional fifth layer protocols can be implemented.

Why Make Changes?

Many people reading this tip make their living using the Internet. We all surf the Web and read email and instant messages for more than we ought. The Internet works very well. So why do any changes need to be made?

IPv4 addresses are actually 32-bit numbers. For readability the numbers are split into four bytes (or octets) each of which is rendered as a number from 0 to 255. The IP address 127.0.0.1 can be written in hexadecimal as 0x7f000001 or in decimal as 2130706433.

The 32-bit address space of IPv4 contains about 4 billion addresses. This sounds like a lot, but when you consider that the original design of the Internet called for every device (computers, routers, game systems, iPhones) hooked up to it to have a unique address the supply of available addresses is being depleted.

There are many different ways that the limited number of IPv6 addresses have been stretched. Dial-up users are familiar with being assigned an IP address out of a pool. DNS and cable users are typically assigned one IP address and a Network Address Translator (NAT) is used to route traffic to different ports on that IP address to machines assigned local IP addresses. However, these can make it difficult to recognize the full potential of the Internet. If you've ever had a hard time getting your IM client to work through a router then you've seen first hand the difficulties that NAT can introduce.

Beyond the simple limitations of the IPv4 address space, there have been a lot of changes to network infrastructure in the 25 or so years since IPv4 was introduced. Remember how different your computer experience was in the early eighties. IPv4 predates both the Macintosh and Windows!

IPv6 represents an opportunity to integrate new technologies right into the Internet Protocol, to expand the address space to accommodate new kinds of Internet-enabled devices and applications, and to restore some of the original ideas of IPv4 including the uniqueness of IP addresses and the embedding of routing information in the IP addresses.

What's New?

The most visible change in the transition to IPv6 is the new format for IP addresses. IPv6 addresses are 128-bit rather than only 32-bit for IPv4 addresses. IPv6 addresses are written as a collection of eight 4-digit hexadecimal numbers separated by colons. For example, an IPv6 address might appear as follows.

  2001:0db8:0000:0000:0000:0000:1428:57ab

If an address contains one or more sections which consist entirely of zeroes (0000) then the address can be abbreviated. Any section with four zeroes can be shortened to a single 0. The address above can be abbreviated as follows.

  2001:0db8:0:0:0:0:1428:57ab

In addition, a single run of zero sections can be shortened to simply ::. The reader of the address is expected to count the number of specified sections and expand :: into enough zero sections to fill out the address. The address above can be abbreviated as follows.

  2001:0db8::1428:57ab

The :: abbreviation can only be used once in any address. If an address has two non-contiguous runs of zero sections then the longer of the two can be shortened. Also, it is technically valid to write an address with 0000 in one section and simply 0 in another. This address is technically equivalent to the addresses above even though it contains a mix of abbreviations.

  2001:0db8:0000::0:1428:57ab

When an IPv6 address is specified in a URL it must be enclosed in square brackets. The following URL is equivalent to http://localhost/ or http://127.0.0.1/.

  http://[::1]/

Note: in Lasso you should write this address as http://[NoProcess][::1][/NoProcess]/ so Lasso doesn't process the contents of the square brackets into an array.

Each IPv6 address breaks down into two parts. The first part is a prefix which specifies which service provider owns a block of IP addresses. The second part is a suffix which identifies a specific machine in the service provider's block of IP addresses. In the example address we've been using 2001:0db8 might represent the service provider and 1428:571b represents a specific machine.

  2001:0db8::1428:57ab

The length of the prefix will depend on how many addresses are assigned to the service provider. A service provider with a six segment prefix has roughly as many internal addresses as are currently available in all of the IPv4 address space! The suffix can either be provider dependent or may use a universal identifier such as the 48-bit MAC address which uniquely identifies every Ethernet port and Airport card which has been deployed. Although there is some controversy about the privacy implications of using MAC addresses for this purpose.

IPv4 Compatibility

A special prefix is used for backward compatibility with existing IPv4 addressed servers. ::ffff followed by the IPv4 address using the usual notation represents an existing server. For example: ::ffff:209.173.53.180 represents the address for the www.ietf.org server in an IPv6 compatible manner. A more formal method is to use the ::ffff prefix, but express the IPv4 address in two segments as a hexadecimal value. For example, the IP address of the www.ietf.org server could also be written as ::ffff:d1ad:35b4.

We can translate an existing IPv4 address to its IPv6 equivalent using the following Lasso tag.

  Define_Tag('IPv4to6', -Namespace='client_', -Required='ip');

    Local('hex') = Client_IPToInteger(#ip);

    #hex->SetFormat(-Hexadecimal=True);

    Local('ipv6') = '::ffff:' + String(#hex) - '0x';

    #ipv6->Merge(12,':');

    Return(@#ipv6);

  /Define_Tag;

 

   Client_IPv4to6('209.173.53.180');

   ::ffff:d1ad:35b4

The localhost address 127.0.0.1 has the special abbreviation ::1 although the lengthier http://[::ffff:7f00:0001]/ also works.

DNS Support

The DNS system has been expanded to return information about IPv6 addresses using a new AAAA selector. IPv4 addresses are returned using the traditional A selector. However, very few service providers have transitioned to IPv6 addresses so there aren't many DNS servers currently serving IPv6 addresses. Dig can be used to get information about IPv6 addresses as follows.

  dig -t AAAA www.ietf.org

   2610:a0:c779:b::d1ad:35b4

The DNS tags in Lasso have not yet been expanded to return IPv6 addresses.

Apache Support

By default Apache on compatible systems like Mac OS X 10.5 Leopard accepts either IPv4 or IPv6 connections. You can change the binding using the Listen directive. Apache starts with a default "Listen 80" directive which accepts either IPv6 or IPv4 connections. If you change this directive to "Listen 0.0.0.0:80" then Apache will only accept IPv4 connections. If you change it to "Listen [::]:80" then Apache will only accept IPv6 connections.

The [Client_IP] tag in Lasso is one of the first tags where the effects of the IPv6 transition are being seen. On Leopard systems the network defaults to IPv6 when possible. In particular localhost communications with Apache use IPv6. The IP reported to Lasso by Apache and returned by the [Client_IP] tag will be ::1 on Leopard machines.

The [Client_IP] tag will be fixed before Lasso 8.5.5 is released to support IPv6 address comparisons. It will automatically translate addresses when possible and it will recognize the equivalence of 127.0.0.1 and ::1.

However, if you want to disable IPv6 on your installation of Apache then you can go into your /etc/apache2/httpd.conf file and change the line with "Listen 80" to "Listen 0.0.0.0:80". Use "sudo apachectl restart" in the Terminal to restart Apache. I have confirmed on Leopard that this restores the [Client_IP] tag to return 127.0.0.1.

The following page has details about how to configure Apache's binding.

http://httpd.apache.org/docs/2.0/bind.html

You can use "sudo apachectl -V" to list the configuration options for Apache. On Leopard (IPv4-mapped addresses enabled) is included by default.

What Else?

The IPv6 changes described above will have the most ramifications to Web browsers, Web developers, and Lasso users. There are many low-level changes to IPv6 which are of interest if you want to know more about how the Internet works. The Wikipedia entry and the RFC linked below contain a lot more information about changes in IPv6.

This article relies on the information found in the Wikipedia article about IPv6 and many linked articles in addition to the RFC for IPv6 and related RFCs .

Author: Fletcher Sandbeck
Created: 7 Dec 2007
Last Modified: 16 Mar 2011

Comments

No comments found
You must be logged in to comment.

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft