From owner-freebsd-hackers Wed Apr 22 03:58:21 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id DAA13809 for freebsd-hackers-outgoing; Wed, 22 Apr 1998 03:58:21 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from vorbis.noc.easynet.net (qmailr@vorbis.noc.easynet.net [195.40.1.254]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id KAA13794 for ; Wed, 22 Apr 1998 10:58:17 GMT (envelope-from chrisy@vorbis.noc.easynet.net) Received: (qmail 9562 invoked by uid 1943); 22 Apr 1998 10:58:07 -0000 Message-ID: <19980422115807.39446@flix.net> Date: Wed, 22 Apr 1998 11:58:07 +0100 From: Chrisy Luke To: freebsd-hackers@FreeBSD.ORG Subject: Beta 2 Release of Multipath Routing Code. Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.88 Organization: The Flirble Internet Exchange X-URL: http://www.flix.net/ X-FTP: ftp://ftp.flirble.org/ Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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