Re: ip balance

Linux Advanced Routing and Traffic Control

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

 



On 4 Nov 2002, Esteban Ribicic wrote:

> root@debian:/wk/ESTADISTICAS/Trafico_en_kisero_hq# ip route list
> 172.0.0.0/24 dev eth0  proto kernel  scope link  src 172.0.0.82
> 172.0.0.0/24 dev eth1  proto kernel  scope link  src 172.0.0.81
> default
>         nexthop via 172.0.0.1  dev eth0 weight 1
>         nexthop via 172.0.0.1  dev eth1 weight 1
> root@debian:/wk/ESTADISTICAS/Trafico_en_kisero_hq#
>
> the result was that the %78 of traffic goes to eth0 and the rest from
> eth1..!!!.
>
> any idea? i still dont understand based on what dsecicion the kernel
> routes one paquet to eth0 or eth1...any idea?


Kernel get [randomly] one of "nexthop" gateway to achieve required IP
addres and make routing entry in own route cache. Next request to the same
IP will be routed due to previous cache entry [until entry expires]. Than
if all Your clients wants connect to considered IP all get the same
gateway [and interface]. It's also important to know that its not packet-by-packet
load balancing but "entry-by-entry" balancing - thats why
traffic isnt always distributed fair but looks balanced when considered
during large number of sessions.
To check if it works coorect You can count cache entries for your both
interfaces ie. ip r l ta cache |grep eth0 |wc -l and ip r l ta cache |grep
eth1 |wc -l and than You should see that numbers are close to each other.

There is also "equalize" option which do packet-by-packet balancing but to
do it working You need special setup and cooperation with Your
gateway AFAIK. [If You have the same gateway on both interfaces maybe its
possible to prepare network config to work with equalize option]


I am not shure what I wrote is 100% true but I
believe that it works in such a manner.


Regrds
tw
-- 

----------------
 ck.eter.tym.pl

"Never let shooling disturb Your education"


_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

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