[FUGSPBR] new multipath routing patches for FreeBSD 4.8

Jean Milanez Melo jmelo em FreeBSDBrasil.COM.BR
Qua Jul 2 10:30:20 BRT 2003


Pessoal,

Essa eu acho que isso interessa a muita gente:

--------------------------------------------------------------------

WHAT IT DOES

It allow entries in the route table to have more than one gateway.
As the stack forwards packets, it round-robins the available gateways
for the route. Each gateway has a "metric" which is decremented for
each packet. When it reaches zero, the nex gateway in the list is
selected.

You can see this like so:

ossory# netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags/   Refs/     Use     Netif Expire
                                      metric   left
default            194.72.46.62       UGSc        0        0      an0
127.0.0.1          127.0.0.1          UH          0        0      lo0
194.72.46/26       link#10            UC          0        0      an0 =>
194.72.46.32/29    link#11            UC          0        0   vmnet1 =>
195.40.1                              UGSc        1        0      an0
                   194.72.46.6            10               0      an0
                  *194.72.46.62           10      0        0      an0

was the result of:

ossory# route add 195.40.1.0 -netmask 255.255.255.0
        -gateway 194.72.46.6 -gateway 194.72.46.62

You can also specify metric, like:

ossory# route add 195.40.0.0
        -pathmetric 20 -gateway 194.72.46.6

You can see this like so:

ossory# netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags/   Refs/     Use     Netif
Expire
default            194.72.46.62       UGSc        0        0      an0
127.0.0.1          127.0.0.1          UH          0        0      lo0
194.72.46/26       link#10            UC          0        0      an0 =>
194.72.46.32/29    link#11            UC          0        0   vmnet1 =>
195.40.1                              UGSc        1        0      an0
                   194.72.46.6            10               0      an0
                  *194.72.46.62           10      0        0      an0

was the result of:

ossory# route add 195.40.1.0 -netmask 255.255.255.0
        -gateway 194.72.46.6 -gateway 194.72.46.62

You can also specify metric, like:

ossory# route add 195.40.0.0
        -pathmetric 20 -gateway 194.72.46.6
        -pathmetric 5 -gateway 194.72.46.62

ossory# route -n get 195.40.0.0

   route to: 195.40.0.0
destination: 195.40.0.0
       mask: 255.255.0.0
cur gateway: 194.72.46.6
 multipaths: 194.72.46.6  metric: 20
             194.72.46.62  metric: 5
  interface: an0
      flags:
 recvpipe  sendpipe  ssthresh  rtt,msec    rttvar  hopcount      mtu     expire
       0         0         0         0         0         0      1500         0
sockaddrs:

By default, routes that are cloned automatically (suc as by TCP sessions)
multipath also, but you can override this by

ossory# syscwl -w debug.clonemultipath=0

if you do this, individual routes can still be set to clone multipath
data by settgin flag MPRT_CLONEMULTIPATH, or with route(8) with
option -clonemultipath. If you stop it clong multipath data, the cloned
route uses the current gateway of the route it was cloned from - however,

if no non-TCP traffic goes via the route, don't expect it to change much.
(This could perhaps be fixed)

WHAT IT DOES NOT DO

It doesn't detect when remote hosts are down. This is not the job of the
kernel. It's not a routing protocol, it's not an automatic failover
system.

KNOWN BUGS

"route get" sometimes hangs, which is mostly because RTM_GET sometimes
produces duff data.
Needs better load testing. I've sent a billion packets from a ping -f
of varying sizes whilst having some route table changes happen in an
endless loop without problems, but this was just my laptop. YMMV.

....from the README.43S file by the author.


Multipath route table. <chrisy em flirble.org>

Ported to FreeBSD 4.8 by Ed Tanzer <tanzer em dsm.fordham.edu>.

Version 5, released agains FreeBSD 4.8-STABLE 2003/06/27

http://www.dsm.fordham.edu/~tanzer/multipath/

-------------------------------------------------------------------------

Atenciosamente
Jean Milanez Melo
FreeBSD Brasil LTDA.
http://www.freebsdbrasil.com.br


-------------- Próxima Parte ----------
_______________________________________________________________
Sair da Lista: http://www2.fugspbr.org/mailman/listinfo/fugspbr
Historico: http://www4.fugspbr.org/lista/html/FUG-BR/


Mais detalhes sobre a lista de discussão freebsd