Target Audience: Oracle Database Professionals.
Information about IPV6 is all over the internet. There is wealth of articles published by different Network infrastructure companies and Linux/unix forums discussing and explaining IPV6 in depth.
It is not long ago when Oracle announced IPV6 support for its software for Database Technology(Starting version 11.2). This post covers basic introduction to IPV6 along with its impact on Oracle Database Technology.
Why IPV6 ?
Major contributing factor for evolution of IPV6 is: Address space Exhaustion in IPV4. Less address space in IPV4 forced users to use Network Address Translation (NAT).
What does an IPV6 Address look like ?
- Is 128 bit. IPV4 address is 32bit.
- Uses Hexadecimal Notation.
- Separated by colons (:) rather than dots (.)
- 128 bit address has two parts : Network prefix (64-bit) and Host part (64-bit).
Example of a IPV6 address is : 2001:db8::1234:1235:abcd:abef
IPV6 addresses can be shrunk by removing any consecutive occurrence of zeroes in the Address. For example: In IPV4, loopback address looks like 127.0.0.1, an IPV6 equivalent is 0000:0000:0000:0000:0000:0000:0000:0001 , which can be re-written as ::1. On same lines, a non-specified address in IPV4 is 0.0.0.0, its equivalent in IPV6 is ::
A quick method for checking and configuring your kernel for IPV6 readiness is:
a.) Check if your kernel IPV6 module is loaded for use:
b.) If above statement doesn’t give any output or errors out, load the IPV6 module as root user:
[root@ora-smanroy~]# modprobe ipv6
If this also errors out, modify /etc/modprobe.conf and hash-out the following entries:
#alias net-pf-10 off
#alias ipv6 off
#options ipv6 disable=1
After this, retry the modprobe command and it should execute succesfully.
c.) Take a server host restart. Just restarting Network services didn’t prove useful in my case (OEL 5.6).
After this, adding IPV6 interface is easy and can be done by following command:
/sbin/ifconfig <interface> inet6 add <ipv6address>/<prefixlength>
….Can I use ping ?
Some network (IP Address related) utilities that were available in IPV4 were rewritten for IPV6. For example, PING can’t be used to ping an IPV6 address. Rather we need to use PING6 utility. This is available on all platforms starting from linux kernel 2.4.X , though recommended linux kernel for IPV6 use is 2.6.x. PING6 is also available on Windows starting windows XP SP1. An example from OEL 5.6 (2.6.x kernel) is posted here:
[oracle@ora-smanroy admin]$ ping6 2001:db8::1234:1235:abcd:abef
PING 2001:db8::1234:1235:abcd:abef(2001:db8::1234:1235:abcd:abef) 56 data bytes
64 bytes from 2001:db8::1234:1235:abcd:abef: icmp_seq=0 ttl=64 time=0.030 ms
64 bytes from 2001:db8::1234:1235:abcd:abef: icmp_seq=1 ttl=64 time=0.042 ms
64 bytes from 2001:db8::1234:1235:abcd:abef: icmp_seq=2 ttl=64 time=0.036 ms
--- 2001:db8::1234:1235:abcd:abef ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1999ms
rtt min/avg/max/mdev = 0.030/0.036/0.042/0.005 ms, pipe 2
Here is output of ‘ifconfig’ command on a machine configured with IPV4 and IPV6 interface:
[root@ora-smanroy ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 10:78:D2:CA:7D:EC
inet addr:192.168.66.160 Bcast:192.168.66.255 Mask:255.255.255.0
inet6 addr: 2001:db8::1234:1235:abcd:abef/64 Scope:Global
inet6 addr: fe80::1278:d2ff:feca:7dec/64 Scope:Link
From the output, IPV6 address is represented by a colon separated hexadecimal number. “/64″ which is appended after the IPV6 address is similar to IPV4 netmask notation, specifying how many bits are used for network prefix. “Scope: Global” specifies that it doesn’t belong to any other ‘reserved’ category like (loopback, link, multicast) and it should be ping-able if interface is up. Next line specifies the ‘Link’ address (Scope: Link) which specifies that it is a special address which is valid only on this interface. Using this address as destination, packet would never pass through the router. IPV6 requires the link-local address to be assigned to each interface on IPV6. Due to this, IPv6 hosts usually have more than one IPV6 address assigned to each of their IPv6-enabled network interfaces. Table below specifies the network prefix for IPV6 that helps us quickly identify if the interface is link-local or site-local or Global.
More details on Address Types and IPV6 packet Header can be found by a quick google search.
Two IPV6 addresses in same subnet ?
As mentioned earlier, IPV6 address has a network prefix (64 MSB) that helps in identification of hosts in a subnet. Consider following IPs:
These IPs are in same subnet, because the network prefix (2001:db8::) is same for all hosts and number of bits allotted for network prefix is also the same (64). Note that /48 and /32 are also some of the possible and valid notations for network prefix.
Oracle Listener and IPV6
As we know, if we configure hostname in listener.ora, it listens on all interfaces. So, no change would be needed for listener.ora if hostname is used and IPV6 is configured. However, if you only want IPv6 clients to connect to database server, you can specify IP=V6_ONLY in the listener.ora file. Other valid value for IP parameter is V4_ONLY. Support for IP=FIRST still exists. Consider that underlying OS kernel supports IPV6 and it is installed on the DB server. To listen to requests from a mixture of IPv4 and IPv6 clients, Listener.ora can have following entries (if not using hostname) and would be good to listen to connections from either IPV4 or IPV6 clients.
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.66.160)(PORT = 1535))
(ADDRESS = (PROTOCOL = TCP)(HOST = 2001:db8::1234:1235:abcd:abef)(PORT = 1535))
Let’s start services and then check at OS level:
[oracle@ora-smanroy admin]$ netstat -an | grep 1535 | grep LISTEN
tcp 0 0 192.168.66.160:1535 0.0.0.0:* LISTEN
tcp 0 0 2001:db8::1234:1235:ab:1535 :::* LISTEN
There is no change in the way /etc/hosts files hold IP addresses :
# IPV6 Entries
There is no change as such in the way clients connect to database. I have covered a simple example anyways: Consider Oracle Database server host which is listening for requests from both IPV4 and IPV6 clients. Such a host is referred to as a Dual Stack host (supporting both IPV4 and v6). Suppose, an IPV4 Oracle client software tries to connect to the server. Client would try to connect to every IP returned by DNS/DB server until connection is successful or all addresses have been tried. This can be seen by setting TNSPING trace. Following is the trace from an IPV4 host trying to connect directly (without DNS) to DB server listening on both IPV4 and IPV6 interfaces
-- only relevant section shown
snlinGetAddrInfo: getaddrinfo() failed with error 11001 --- fails to connect to IPV6
nttbnd2addr: looking up IP addr for host: ora-smanroy --- Performs further lookup
nsmal: 996 bytes at 0x1e9a268
nsmal: 2096 bytes at 0x1e9a658
nsmal: 84 bytes at 0x1e9a078
nsopen: opening transport...
nttcon: toc = 1
nttcni: Tcp conn timeout = 0 (ms)
nttcni: trying to connect to socket 1760.
nttcni: connected on ipaddr 192.168.66.121 --- Resolves to IPV4
If client is dual stack and IPV6 enabled, it prefers IPV6 address for connection as per RFC 3484. Also, EasyConnect method is still supported to connect to IPV6 hosts. However, we need to use square brackets “” around the IPV6 address in the connection string. There is no ‘tnsping6′, ‘tnsping’ still works happily for IPV6 ;)
IPV6, Oracle and Future
- Grid Infrastructure Support
Oracle is yet to announce IPV6 support for Grid Infrastructure / RAC stack. I believe among other things, underlying code for the Grid Naming Service would undergo some change.
- Support for IPV6 JumboGrams
Like support for Jumbo Frames in IPV4, it would be interesting to see if Oracle would support JUMBOGRAMS in IPV6 for interconnect traffic, which can theoretically have a payload size of 4GB -1 (2^32 -1). This is because, IPV6 uses separate extension header for jumbogram, making full use of 32 bit available for payload. IPV4 has theoretical payload size limit of (2^16 – 1).