Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Apr 1998 11:58:07 +0100
From:      Chrisy Luke <chrisy@flix.net>
To:        freebsd-hackers@FreeBSD.ORG
Subject:   Beta 2 Release of Multipath Routing Code.
Message-ID:  <19980422115807.39446@flix.net>

next in thread | raw e-mail | index | archive | help
ftp://ftp.flirble.org/pub/unix/hacks/FreeBSD/mpath/

Multipath routing means you can have more than one gateway per
destination in the routing table. I dropped the project for a bit
since the Beta 1 release in January. This release supports multiple
interfaces and has some installation destructions.

Comments, bugs etc always welcome.

Regards,
Chris Luke.


README.MPATH:
Multipath Routing for FreeBSD
-----------------------------

Beta 2 release. 22 April 1998.

Patches for FreeBSD-2.2.6-STABLE (last cvsup'ed on 21 April 1998).

Installation
------------

Please follow these in order...

NOTE: This is *NOT* production code! Do not use it on a backbone yet.
      I won't have sympathy for you if you do and it fries...

In the tar file are a number of diffs all relative to /usr/src.
One is for the sys/ tree (the kernel source) and the others
for ifconfig(8), netstat(8) and route(8). I recommend you make copies
of these binary sources into directories called "name.mpath" firstly
for backup, secondly because cvsup overwrties files with changes with
their current versions! Patch everything up as usual. If you don't know
how, you shouldn't be playing with this code...

You will need to copy the patched sys/net/route.h to
/usr/include/net/route.h, taking a copy of the original first, of course.

There is an example kernel config file in sys/i386/conf/QBert-MPath.
The important lines in this file are:

options         EA_MULTIPATH
options         "EA_N_MULTIPATH=4"
options         "MSIZE=256"

The first two enable the patched code to be compiled in (all the code
in the kernel is delimited with #ifdef EA_MULTIPATH - I hope) and the
number of multipath gateways to support for each destination. This has
to be hardcoded, I'm afraid, without a major rewrite of nearly everything.

MSIZE is the size of an mbuf. The extra data made routing socket messages
too big for a single mbuf. This shouldn't be too terrible an overheard,
many people have been considering making this the default for a long time.

Compile the kernel, compile the patches binaries. You will also need to
recompile arp(8) (no patches necessary) and anything else that makes
use of the routing socket (or #include's route.h) to make them understand
the new message structure. Particularly braindead code may need hacking
to get it right (see below).

Install it all, reboot, and hope for the best...

...with this code, I can type...

bash-2.01# route add default -gateway 193.131.248.183 -gateway 195.40.1.1

...and get a routing table that looks like...

bash-2.01# netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags     Refs     Use     Netif Expire
default                               UGSc        2      989 
                    193.131.248.183                      494      fxp2
                   *195.40.1.1                           495      fxp0
127.0.0.1          *127.0.0.1         UH          1       14       lo0
193.131.248        *link#3            UC          0        0 
193.131.248.20     *0:0:c0:a0:b1:e3   UHLW        0      357      fxp2    997
[etc]

...(note the gateways and their interfaces, also note the "Use" column)
   and thus get traceroutes like...

bash-2.01# traceroute -n 195.40.6.30
traceroute to 195.40.6.30 (195.40.6.30), 30 hops max, 40 byte packets
 1  195.40.1.1  0.629 ms 193.131.248.183  0.551 ms 195.40.1.1  0.491 ms
 2  193.131.248.1  0.620 ms 195.40.1.13  0.676 ms 193.131.248.1  0.636 ms
 3  195.40.6.30  0.975 ms  0.886 ms  0.915 ms

Note the alternating IP's on *every* response. This is what it's all about.
If the remote machine (195.40.6.30) has multipath code, then all data
between these two hosts would use both available paths.

Fixing things (programs) that don't work
----------------------------------------

Also in the tar is share/man/man4/route.mpath.4 which you may want
to install. It has a brief descriprion of the changed routing socket
messages. The notable difference is that the RTA_GATEWAY data is at the
*end* of the message now instead of the middle, and that it's formed from
a bit pattern that specifies how many gateways are in the message (which
follow each other, at the end of said message). Code that doesn't follow
the values of the RTA masks, even for single-gateway destinations, will
have unpredictable results!

Other things
------------

I've updated most man pages. I've probably missed a few, but route(8)
is the most important in my mind. Route(8) has relatively good visual
support for multipath routes. I've not yet defined a mechanism in the
routing socket for passing multiple interface information, so it won't
display that there. It works for netstat(8) because it accesses the kernel
memory directly.

I'm working on GateD. I've got GateD3_6Alpha_2 doing something half
sensible, but not quite. When I've done GateD4 I'll submit those changes
back to the Consortium.

I'm not going to touch routed. Someone else can do that, if they want. I'll
include diffs here should I recieve them.

Bugs, comments, flames to chris@easynet.net or chrisy@flix.net.
-- 
== chris@easynet.net, chrisy@flix.net, chrisy@flirble.org.
== Head of Systems for Easynet Group PLC.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980422115807.39446>