From owner-freebsd-hackers Tue Jan 6 02:50:40 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.7/8.8.7) id CAA27655 for hackers-outgoing; Tue, 6 Jan 1998 02:50:40 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from omega.noc.easynet.net (omega.noc.easynet.net [193.131.248.227]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id CAA27317 for ; Tue, 6 Jan 1998 02:45:22 -0800 (PST) (envelope-from chrisy@omega.noc.easynet.net) Received: (qmail 16061 invoked by uid 1001); 6 Jan 1998 10:45:20 -0000 Message-ID: <19980106104520.25045@flix.net> Date: Tue, 6 Jan 1998 10:45:20 +0000 From: Chrisy Luke To: freebsd-hackers@FreeBSD.ORG Subject: Multipath Routing. 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 This is a scouting survey to see if anyone else is interested in what I've been playing with... I'm just finishing off a pretty neat kernel hack I started last week to implement multipath routing in the BSD kernel, using FreeBSD as my development base. Not much has changed across the BSD's or time to the code I've changed so it should be portable to other BSD's quite easily. What it changes is the rule that an entry in the routing table can only have one next-hop gateway. Unlike Sun's implementation of the same. this load balances across the installed gateways for a route. Sun's method merely allowed two nodes in the patricia tree to have the same network and netmask. On route lookup, it finds the first one and disregards any others. You end up with a routing table that looks something like: chrisy@om[~]> netstat -rn Routing tables Internet: Destination Gateway Flags Refs Use Netif Expire default UGSc 3 138832 193.131.248.183 46278 fxp0 *193.131.248.254 46277 fxp0 193.131.248.186 46277 fxp0 127.0.0.1 *127.0.0.1 UH 0 2 lo0 193.131.248 *link#1 UC 0 0 193.131.248.2 *0:0:f8:30:2:4b UHLW 0 13785 fxp0 1198 193.131.248.24 *0:0:c0:53:22:e4 UHLW 0 1 fxp0 697 193.131.248.97 *8:0:3:22:47:ae UHLW 0 0 fxp0 572 193.131.248.173 *0:0:c0:3a:22:e4 UHLW 0 772 fxp0 782 193.131.248.179 *0:0:c0:b0:3b:e7 UHLW 0 0 fxp0 1081 193.131.248.180 *8:0:3:23:15:e5 UHLW 0 0 fxp0 571 193.131.248.183 *0:0:c0:78:22:e4 UHLW 4 0 fxp0 682 193.131.248.185 *0:0:c0:6e:22:e4 UHLW 0 0 fxp0 1194 193.131.248.186 *0:0:c0:9c:b1:e3 UHLW 2 0 fxp0 1170 193.131.248.187 *0:0:c0:5c:10:dc UHLW 0 0 fxp0 1198 193.131.248.254 *0:0:f8:30:98:a8 UHLW 4 6076 fxp0 1184 195.40.1 UGSc 0 0 *193.131.248.183 0 fxp0 193.131.248.186 0 fxp0 Note the subtle changes. The '*' that preceeds some of the Gateway fields shows the target of the next packet to hit ip_output() and is destined for that network. Note also that each gateway has it's own Use and netif field. Unfortunately it required quite a bastardisation of the PF_ROUTE protocol, so all routing tools needed to be modified. I'm presently convincing gated that it wants to talk multipath too, where the largest benefits lie. My prime intention for this feature is in a core-of-the-network scenario where an IP network has a number of unix nodes and a unix-based set of BGP speakers, with multiple core routers. These core routers are the default routes for your regular unix nodes. Using Router discovery, you can identify all of thse core routers, but it only ever uses the one with the lowest IP address. That router sees all of the load and the others remain idle. This will remove that imbalance. If anyone is interested, I'll put my patches up (they are in beta form at present - there don't appear to be any leaks but I won't know for sure until gated loads a full routing table onto it... :-) Cheers, Chris. -- == chris@easynet.net, chrisy@flix.net, chrisy@flirble.org. == Head of Systems for Easynet Group PLC.