APPLIES TO:

GOAL

During the conversion to IPv6 there is a specific address range that has been allocated for use during specific migration conditions. This address range is for IPv4 Mapping. This IPv6 address allows an application that only knows IPv6 to be able to communicate with an application that only understands IPv4. This address range has the form of “::FFFF:{IPv4 address}”.

SOLUTION

Background

The designers of IPv6 have allocated specific address ranges for certain purposes. This article covers how to configured the Oracle database and client to use the IPv4 Mapping Address. The IPv4 Mapping Address is not an IPv6 tunnel, but is a configuration of the Operating System to allow an IPv6 application to use the IPv4 protocol.

These IPv6 addresses have a specific format. According to RFC 4191, the IPv4-Mapped IPv6 Address has the first eighty bits are zeros. The next 16 bits (2 octets) are all ones. The last 32 bits are the IPv4 address in either the IPv4 dot notation or the Hexadecimal equivalent. In the example below, each address is equivalent:

The leading zeros, coupled with the 16 bits of ones, flag this to be an IPv4 Mapped address.

The translation of the IPv4 packets into an IPv6 compatible format is performed by the Operating System. Because of this, the Operating System should be run in a dual-stack configuration. Configuring a system to use nothing but IPv6, in essence, removes all the code needed for it to understand the IPv4 protocol format. The existing implementations that Operating Systems are using require both protocol stacks installed and functioning.

The purpose for the IPv6 address range is to handle the condition where an application has been written to use only IPv6. The Oracle database and client have been written to only use both IPv4 and IPv6. Because of this multiple protocol support, there may be no reason to use the IPv4 Mapping feature for Oracle. However, if this is feature is needed, this paper covers how to configure it.

Configuring a Linux Database and Client for the IPv4 Mapped Address

The first step is to make sure the Operating System has IPv6 configured. There are many other documents that cover this step, so it does not need to be covered here.

Configure Linux

To configure Linux with this specific IPv6 address, you modify the /etc/sysconfig/network-scripts/ifcfg-{device name} file. In my case I modified the ifcfg-eth0 file. I had previously added an IPv6 address and will add a secondary IPv6 address for the IPv4 Mapped Address.

Once these files have been configured, run the command “service network reload” to have the OS reinitialize the network with the changes made. To validate these changes, issue the command “/sbin/ifconfig eth0”. The results of the ifconfig command should look similar to:

In this example, I’ve only used the IPv6 address. If you decide to have the IPv4 address also, the two addresses will have to have different port numbers. At this time, Linux requires different port numbers to be used even though these are separate IP addresses.

Configuring the Client

The client should use the IPv4 address. Since the purpose behind this special IPv6 address is to allow an application that can only use IPv6 to be able to converse with an application that can only use IPv4, we will configure the client to use IPv4. TNSNAMES.ORA file uses an IPv4 address:

Test the Connection

The first test is to use the utility TNSPING. Here we test from a Windows OS based client that is running Oracle version 11.1.0.7. Since this is a client that only uses IPv4, it is OK to use an earlier version of Oracle.

C:\>tnsping V11R21-FFFF

TNS Ping Utility for 32-bit Windows: Version 11.1.0.7.0 - Production on 22-MAY-2009 11:30:14

Copyright (c) 1997, 2008, Oracle. All rights reserved.

Used parameter files:D:\Oracle\Product\11.1.0\db_1\network\admin\sqlnet.ora

Other methods to validate that IPv6 is being used

Other utilities can be used to validate that IPv6 is being used. The most common for Unix are lsof and strace (strace is similar to truss on other Operating Systems).

lsof

The Unix utility lsof (LiSt Of Files) will show which IP sockets are being used. In this example both IPv4 and IPv6 sockets are being used. The IPv4 socket being used is the loopback address, while the IPv6 seems to have the IPv4 address listed but with the IPv6 protocol family.

The following strace output was generated when a Windows client used TNSPING to connect to the Listener. The first number in the file output below is the line number shown when using the utility vi to examine the file.

Line 1641 is when the Listener was woken up from its poll on the file descriptor 11 (fd=11), which is the socket it is listening on.Line 1643 is getting the socket name for file descriptor 11, we see that it is an IPv6 socket as the AF_INET6 protocol family and the IPv6 address are listed.Line 1645 is where the connection gets accepted, and the next line shows that it too is an IPv6 file (the file descriptor created is now 14).Line 1656 is the Listener reading an inbound packet on file descriptor 14, which is a connect packet containing the TNSPING commandLine 1660 is a write to file descriptor 14, which is the Listener’s response, all on the IPv6 socket.