May 26th, 2005
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:
Last release of TI-RPC
libtirpc-0.1.7.tar.bz2
rpcbind-0.1.4.tar.bz2
Util-linux package (contains NFS client commands)
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.
- Connectathon 04 full test completed.
- Robustness tests Not yet done.
- Performances tests Tests result (with iozone tool) are available here
- Client: 2.6.11 kernel with IPv6 patches applied - Server: 2.6.9 + old patches of IPv6 implementation - IPv4 mount - here
- Client: 2.6.11 kernel with IPv6 patches applied - Server: 2.6.9 + old patches of IPv6 implementation - IPv6 mount - here
- Client: 2.6.11 kernel with last CITI patch release - Server: 2.6.9 + old patches of IPv6 implementation - IPv4 mount - here
- Interoperability tests have been done with an AIX 5
(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
- AIX client / modified Linux server :our priority is to have a usable IPv6 compliant client
Not yet done.
More complete tests have be run including fsstress and iozone tests.
File linux-2.6.11-01.patch
Change structures and tests depending on the transport in inode.c
Change transport-dependant field (sockaddr_in) of structure nfs_server
(sockaddr* + length)
File linux-2.6.11-02.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.
Adapt the prototypage of the nfs4_find_client() and nfs4_get_client().
File linux-2.6.11-03.patch
Complete the transport dependent functions used to print the addresses
Use rpc_print_peeraddr() to display the address information in NFS.
File linux-2.6.11-04.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. The bind_idx is an index on the binding function to
use is an array of available binding function.
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-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
Change the address format from sockaddr_in to sockaddr_storage to be
transport independant. Can be divided into smaller patches:
Patch
linux-2.6.11-06a.patch: Introducing two function: svc_getaddlen and svc_get_port to obtain address length and port of a given sockaddr
Patch
linux-2.6.11-06d.patch: Introduce constant MAX_ADDR_BUF which is the max length for an adress buffer. Add addrbuf: address buffer to store all type of addresses
Patch
linux-2.6.11-06e.patch: Changing the rq_addr field of svc_rqst structure to become transport-independant
Patch
linux-2.6.11-06f.patch: Changing the rq_daddr field of svc_rqst structure to become transport-independant
Patch
linux-2.6.11-06g.patch: Changing the addr field from of svc_deferred_req structure to become transport-independant
File linux-2.6.11-07.patch
Adding macros used to manipulate IPv6 addreses (IPv6 mapping, loopback etc.)
File linux-2.6.11-08.patch
Change the callback address in the nfs4_client and nfs4_setclientid
structures to be usable by any transport. Adapt the constants for the XDR
encoding/decodind
File linux-2.6.11-09.patch
Adding SOCK_PMAP_REG and SOCK_PERM flags
SOCK_PERM flag has been introduced to avoid callback connections to be registered in rpcbind
SOCK_PMAP_REG replaces the pmap_register flag.
File linux-2.6.11-ALL.patch