Re: [LARTC] Load balancing, routing docs

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chris,

 : So, I'm looking at doing this with the kernel's multipath routing option
 : (CONFIG_IP_ROUTE_MULTIPATH). So far I've been able to configure a route
 : with multiple nexthops as described in the "ip" tool documentation:
 :
 : ip route add default equalize \
 : 	nexthop via 10.0.0.2 \
 : 	nexthop via 10.0.0.2 dev eth3 \
 : 	nexthop via 192.168.3.254 dev eth1 \
 : 	nexthop via 192.168.3.254 dev eth4
 :
 : The reason for repeating the first nexthop is that the first route is
 : always marked as dead for some reason. None of the others get marked dead
 : for me, and I can't figure out why it's happening, but if I add a dummy
 : route before the real ones then it seems to work.

Hmm!  That sounds bad....might be worth a bug report....

 : Anyway, it does what I think it's supposed to, which is choose one route
 : at random _and cache it for that destination address_. However, this is
 : not an ideal property of a load balancer. Ideally each packet would be
 : routed out through a separate connection.

Have you looked at Patrick McHardy's equalize patch. [1] I believe it
addresses this very issue.  See the LARTC thread from January on this very
issue (link load sharing and equalize) [2].

 : So my questions to you all are:
 :
 : - Is there a simple way to do this with iproute2 as it stands, or with
 :   some other method (apart from TEQL) which I missed?

To my knowledge, no.  You appear to have located the relevant technologies
to perform link load sharing with linux (I'd be happy if somebody could
prove me wrong here...).

Link load sharing options:

  - teql
  - equalize

[ Your options for link load sharing include ethernet bonding if and
  only if you are using ethernet only AND both endpoints support
  bonding (sometimes called trunking or etherchannel, and even more
  unambiguously, 802.3ad).  But it sounds like this is not what you
  seek. ]

 : - If not, can anyone point me to an explanation of how the routing code
 :   caches and retrieves routes, so that I can disable the route caching?
 :   (I know this is probably not a good idea for performance)

I don't know of any sources better than ip-cref, the iproute2
documentation. [3]  There may be other more detailed sources.  If so, send
a link, and I'll add it to my collection of links.

There's a good book published by the Wiley & Sons press which discusses
the IP and TCP portions of the linux networking stack in glorious detail
[4]. The book is a bit out of date (printed matter always is), but it can
give you a good overview of the architecture of the system, and provide
context for further examination of newer 2.4 kernels.

Sadly, I think it may not answer any of the questions you asked, but if
you do need to vivisect the kernel to answer your own questions, you may
find this book helpful.

 : - Is there any documentation of the kernel routing code, e.g. the path
 :   taken by a packet through that code? (LARTC howto doesn't seem to cover
 :   it, nor Stef's docum.org, nor Google searches).

Another possible starting place is Mathieu Lafon's kernel 2.4 diagram [5].
This is another perspective on the same topic covered by the KPTD at
docum.org.

 : - If this documentation isn't available, would anyone be interested in me
 :   writing some, and would anyone mind if I send the requisite questions to
 :   this list?

Chris, this is one of the dark and musty corners of documentation
currently available on linux routing.  I do not yet understand the
peculiars of the behaviour of nexthop and equalize, so I have not
documented it yet.  If you were to write something, I'm sure I would
voraciously consume it, and possibly add content to my chapter on routing.

I doubt you missed it, but I have some documentation on the routing, route
selection, and the routing cache under linux [6].  For further research, I
would recommend Julian's explanatory texts, available at his website [7].
You will find many patches and explanation of some of these patches, but
careful study will provide some clues into the nether regions of the
kernel routing code.

Good luck, and share any success with the list!

-Martin

 [1]  http://trash.net/~kaber/
      http://trash.net/~kaber/equalize_2.4.18.patch
 [2]  http://mailman.ds9a.nl/pipermail/lartc/2003q1/006781.html
 [3]  http://linux-ip.net/gl/ip-cref/
 [4]  http://www.wiley.com/cda/product/0,,0471408824,00.html
 [5]  http://open-source.arkoon.net/kernel/kernel_net.png
 [6]  http://linux-ip.net/html/ch-routing.html
 [7]  http://www.ssi.bg/~ja/

-- 
Martin A. Brown --- SecurePipe, Inc. --- mabrown@xxxxxxxxxxxxxx



[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux