March 21th, 2005
Gilles Quillard
Aurélien Charbon
Introduction:
This page provides patches and packages allowing the support of NFS (v2, v3 and v4) over IPv6. This includes :
- kernel patches to provide the support of IPv6 in the sunrpc code and in the NFS client and server code,
- a new TI-RPC (Transport Independent RPC) library and a rpcbind portmapper to allow the support of protocols other than the INET udp/tcp protocols by the user RPC implementation,
- user patches over the nfs-utils and util-linux packages to provide the support of IPv6 in the NFS user commands and daemons.
The current kernel patches are over a linux-2.6.11 kernel release on which the CITI's patches and the Chuck Lever's transport switch patches have been applied (see below).
The TI-RPC library and the rpcbind command have been ported from FreeBSD, and are currently provided as standalone packaging. The question of knowing how these new libraries and command could be delivered is open (standalone packaging, included in other packagings,...).
Note Well:
- The following patches and packages have not been fully tested. Please report problems to Gilles Quillard or Aurelien Charbon.
- A first implementation had been done as recommended in the books, i.e. NFS code is now full IPv6 and IPv6 structures are used to carry both IPv4 and IPv6 addresses (the IPv4 adresses are "mapped" into IPv6 addresses). But this method required a kernel built with IPv6. This was unacceptable for the community people. This implementation is still available here.
- The following implementation is based on the IPv6 support in NFS specifications.
Available patches and packages:
Kernel part:
The current kernel patch set allows the support of IPv6 in the client side. These patches are available either in separate patches or in a cumulative patch.
Please report problems to Gilles Quillard or Aurelien Charbon.
These patches have to be applied over a linux-2.6.11 on which the CITI's patches and the Chuck Lever's patches, providing the support of advanced transport technologies, have been applied respectively.
Refer to the Chuck Lever's Release Notes for more information about these patches.
User part:
libtirpc-0.1.6.tar.bz2
rpcbind-0.1.4.tar.bz2
util-linux-2.12-3-01.patch applied over util-linux-2.12 on which the CITI's patch have been applied.
The libtirpc and rpcbind packages provide respectively the TI-RPC library and the rpcbind/rpcinfo commands.
To install them, unpack the tar files, and follow the instructions in the INSTALL file.
Tests done:
- Functional tests have be run including :
- export of filesystem using IPv4 and IPv6 addresses
- mount, ls, read/write data, umount of filesystems using IPv4 and IPv6 addresses
- Robustness tests Not yet done.
- Performances tests Not yet done.
- Interoperability tests have been done with an AIX 5 and a Solaris 5.10 (i386, pre-release)
(connectathon 2004 tests have been run)
- modified linux client / AIX server :
- mounting NFSv2/v3 filesystems with IPv4 : OK
- mounting NFSv4 filesystems with IPv4 and IPv6 : OK
- modified linux client / Solaris server :
Not yet done.
- AIX client / modified Linux server :
Not yet done.
- Solaris client / modified Linux server :
Not yet done.
More complete tests have to be run including fsstress and iozone tests.
File linux-2.6.11-01.patch
Move some tests depending on the transport from inode.c to xprtsock.c.
File linux-2.6.11-02.patch
Change the server address in the 'struct server' to be transport independent.
The type of the 'addr' field is changed from sockaddr_in to sockaddr *.
A 'addrlen' field is added to contain the length of the address.
With this solution, the space needed to store the address is allocated according to the family of the address. This avoids to use a sockaddr_storage structure with a large unused space.
File linux-2.6.11-03.patch
Change the client address in the 'struct nfs4_client' to be transport independent.
The type of the 'cl_addr' field is changed from sockaddr_in to sockaddr *.
A 'addrlen' field is added to contain the length of the address.
With this solution, the space needed to store the address is allocated according to the family of the address. This avoids to use a sockaddr_storage structure with a large unused space.
Adapt the prototypage of the nfs4_find_client() and nfs4_get_client().
File linux-2.6.11-04.patch
Complete the transport dependent functions used to print the addresses: add a raw mode (print only the value without any comment) and add a new display for universal addresses.
Use rpc_print_peeraddr() to display the address information in NFS.
File linux-2.6.11-05.patch
Change the interface with the mount command for NFSv2 and v3 in order
to allow the use of non-IPv4 addresses.
The 'nfs_mount_data' structure is extended with the fields host_addrlen (int) and host_addr (sockaddr *) to carry addresses which may be other than IPv4 addresses. The mount version number is incremented to 7 to assume the compatibility with previous versions.
So according to the mount version, the server address will be retrieved from the addr or host_addr field.
File linux-2.6.11-06.patch
Currently the kernel RPC implements only the portmap (v2) to register/unregister a program and to get the port of a program. Some implementations don't support the portmap (replaced by the rpcbind) with new transports such as IPv6. So at least the getaddr function of the rpcbind has to be supported.
Since there is no mean to know which version of the portmapper is available on the remote machine, we have to try one and, if this fails with an mismatch version error, retry the other one.
To limit the duplication of code, and to increase the maintainability, pmap_getport6() has been suppressed. pmap_getport() is called for both IPv4 and IPv6 protocols but pmap_create() or pmap_create6() is called according to the address family.
File linux-2.6.11-07.patch
Change the callback address in the nfs4_client, nfs_server and nfs4_setclientid structures to be usable by any transport. Adapt the constants for the XDR encoding/decoding.
File linux-2.6.11-ALL.patch
The complete set of patches combined into one patch.