[OpenAFS-devel] Announcement: Significant changes to Rx internals

Ken Hornstein kenh@cmf.nrl.navy.mil
Tue, 09 May 2006 13:59:54 -0400


Some background:

Many of you know that I have been working on adding a TCP transport for Rx.
That work has been progressing (not as fast as I would like, but forward
progress is being made).

I have reached a point where limitations in the internals of Rx had
become too limiting in my TCP work.  Specifically, hosts were
respresented internally as pairs of unsigned 32-bit integers (one for
the host, one for the remote port number).  This left no room for
specifying a socket type (such as a TCP socket, forcing me to implement
a number of hacks to work around that), or a larger address such as
IPv6 addresses.

After discussions with Derrick Brashear, I have committed code to the
HEAD of the OpenAFS CVS tree to address these deficiencies.  These include
the following changes:

- The rx_peer structure "host" and "port" elements have been replaced by
  the following members:

  struct sockaddr_storage saddr;
  int saddrlen;
  int socktype;

- All of the internal Rx functions (there is no good definition of what
  constitutes "internal" Rx functions - I took my best guess) have been
  changed to pass a pointer to struct sockaddr_storage and the address
  length instead of host & port.

- Additional APIs have been added to allow a programmer to specify different
  addresses/socket types.  The original APIs have been retained for
  compatibility.  The complete functionality of these new APIs has not
  yet been implemented, but that should come in the future.  I was
  planning on giving a more complete presentation on these changes
  at the AFS Best Practices Workshop.

I have tested a fileserver and client with these changes; they both
work.  There is additional work to be done.  Specifically, the
interfaces inside of the os-specific kernel network routines need to be
changed to support the new arguments for osi_NetSend() and
osi_NetReceive() (I couldn't do them all since I didn't have access to
them).  These changes should be relatively straightforward; if you are
interested in working on the code for a platform that has not yet been
fixed, let me know if you need help.  Look at src/rx/DARWIN/rx_knet.c
for an example of an already-fixed platform.

We have not yet put in compatbility for operating systems that lack the
sockaddr_storage structure.  I don't know how many hosts we still care
about that lack this structure.  The ways for dealing with this are
fairly well understood; I just wanted a test system that we could
utilize before I started guessing at a fix.

Code that depends on accessing peer->host will obviously fail.  If code
uses rx_HostOf(), it will do the right thing.

During this work I tried to be careful about supporting IPv6.  I
believe that Rx is now 70-80% IPv6 "ready".  HOWEVER ... this comes
with a significant caveat, and people should READ THIS CAREFULLY.
While I think there is only a small amount of work that is required to
make Rx work with IPv6, this does not hold true for AFS in general.  A
LOT of work would be necessary to make AFS support IPv6 properly; there
are a large number of IPv4 assumptions in AFS right now.  This is an
important first step, but it's only a _first_ step.

Comments are welcome,

--Ken