Discussion:
[zebra 15203] RE: AW: OSPF Loadbalancing
Josiah DeWitt
2002-08-23 16:15:35 UTC
Permalink
My Kernelversion is 2.4.19 and I did the compilation with "IP: Advanced
Router" and "IP: equal cost multipath" ... but it's still the same (had a
look with netstat -r) - just one default route.
I don't think zebra will do loadbalancing but if it can, I'd like to know. I've configured ECMP as a test on Red Hat Linux 7.1 kernel version 2.4.7-10 so I know it works. As a side note, ECMP has about the least specific documentation of any kernel feature I have used to date. There is a big gap in the iproute2 HOWTO when it comes to this. Here's how I got a cable modem and 56K dial up line (I did it at home so I don't want to hear anything about that from the connection snobs) to packet-wise loadbalance using ECMP. I can't guarantee that everything below is correct except the ip route command; just trying to help.

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

Equal Cost Multipath Routing will Round Robin multiple "Default gateways"
(i.e. your two internet connections). This can work with 2 or *more*
connections, and can be weighted to favor one connection over another by
adding more routes for that connection.

You will also need the iproute2 tools to implement this.

Equal-cost Multipath allows you to configure your router with two default
networks. Outbound traffic is then round-robined by destination, so that IP
address 1 goes down circuit A, address 2 goes down circuit B, &c.
Unfortunately, equal-cost multipath is a kernel configuration option, and
2.1.x or better at that. That means compiling your own kernel -- see
http://lrp.c0wz.com and http://www.linux.com for further instructions. I
couldn't find any documentation on configuring it, unless you count the Linux
Networking Mailing List Archives. There is also this snippet from the
config help file:

CONFIG_IP_ROUTE_MULTIPATH
Normally, the routing tables specify a single action to be taken in
a deterministic manner for a given packet. If you say Y here
however, it becomes possible to attach several actions to a packet
pattern, in effect specifying several alternative paths to travel
for those packets. The router considers all these paths to be of
equal "cost" and chooses one of them in a non-deterministic fashion
if a matching packet arrives.


EQL (serial line load balancing) support
CONFIG_EQUALIZER
If you have two serial connections to some other computer (this
usually requires two modems and two telephone lines) and you use
SLIP (the protocol for sending Internet traffic over telephone
lines) or PPP (a better SLIP) on them, you can make them behave like
one double speed connection using this driver. Naturally, this has
to be supported at the other end as well, either with a similar EQL
Linux driver or with a Livingston Portmaster 2e.

Say Y if you want this and read Documentation/networking/eql.txt.
You may also want to read section 6.2 of the NET-3-HOWTO, available
via FTP (user: anonymous) from
ftp://metalab.unc.edu/pub/Linux/docs/HOWTO

This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called eql.o. If you want to compile it as a
module, say M here and read Documentation/modules.txt. If unsure,
say N.

TEQL queue
CONFIG_NET_SCH_TEQL
Say Y here if you want to use the True Link Equalizer (TLE) packet
scheduling algorithm for some of your network devices or as a leaf
discipline for the CBQ scheduling algorithm. This queueing
discipline allows the combination of several physical devices into
one virtual device. (see the top of net/sched/sch_teql.c for
details).

This code is also available as a module called sch_teql.o ( = code
which can be inserted in and removed from the running kernel
whenever you want). If you want to compile it as a module, say M
here and read Documentation/modules.txt.



If you specify two routes with an equal metric value (using the
"metric" or "preference" keyword), load balancing is done on a per
connection basis;


. if you specify the "equalize" keyword on two routes (which of course
must have the usual triplet matching) then load balancing is done on a
packet basis;


In this case the route is just recomputed for every packet. Without it
the route stays cached and bound to a specific nexthop (unless the nexthop
dies)


Example of the command that worked:

ip route change default equalize nexthop via 64.81.188.33 dev ppp0 nexthop via 63.231.55.86 dev eth1
Bryan Swann
2002-08-23 18:46:30 UTC
Permalink
I'm no OSPF expert, but ny impression is that a routing device that has
two equally weighted OSPF routes should distribute the load across the
routes. I would "technically" not call this load balancing. But, it
does distribute the load.
Post by Josiah DeWitt
My Kernelversion is 2.4.19 and I did the compilation with "IP: Advanced
Router" and "IP: equal cost multipath" ... but it's still the same (had a
look with netstat -r) - just one default route.
I don't think zebra will do loadbalancing but if it can, I'd like to know. I've configured ECMP as a test on Red Hat Linux 7.1 kernel version 2.4.7-10 so I know it works. As a side note, ECMP has about the least specific documentation of any kernel feature I have used to date. There is a big gap in the iproute2 HOWTO when it comes to this. Here's how I got a cable modem and 56K dial up line (I did it at home so I don't want to hear anything about that from the connection snobs) to packet-wise loadbalance using ECMP. I can't guarantee that everything below is correct except the ip route command; just trying to help.
-------------------------------------
Equal Cost Multipath Routing will Round Robin multiple "Default gateways"
(i.e. your two internet connections). This can work with 2 or *more*
connections, and can be weighted to favor one connection over another by
adding more routes for that connection.
You will also need the iproute2 tools to implement this.
Equal-cost Multipath allows you to configure your router with two default
networks. Outbound traffic is then round-robined by destination, so that IP
address 1 goes down circuit A, address 2 goes down circuit B, &c.
Unfortunately, equal-cost multipath is a kernel configuration option, and
2.1.x or better at that. That means compiling your own kernel -- see
http://lrp.c0wz.com and http://www.linux.com for further instructions. I
couldn't find any documentation on configuring it, unless you count the Linux
Networking Mailing List Archives. There is also this snippet from the
CONFIG_IP_ROUTE_MULTIPATH
Normally, the routing tables specify a single action to be taken in
a deterministic manner for a given packet. If you say Y here
however, it becomes possible to attach several actions to a packet
pattern, in effect specifying several alternative paths to travel
for those packets. The router considers all these paths to be of
equal "cost" and chooses one of them in a non-deterministic fashion
if a matching packet arrives.
EQL (serial line load balancing) support
CONFIG_EQUALIZER
If you have two serial connections to some other computer (this
usually requires two modems and two telephone lines) and you use
SLIP (the protocol for sending Internet traffic over telephone
lines) or PPP (a better SLIP) on them, you can make them behave like
one double speed connection using this driver. Naturally, this has
to be supported at the other end as well, either with a similar EQL
Linux driver or with a Livingston Portmaster 2e.
Say Y if you want this and read Documentation/networking/eql.txt.
You may also want to read section 6.2 of the NET-3-HOWTO, available
via FTP (user: anonymous) from
ftp://metalab.unc.edu/pub/Linux/docs/HOWTO
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called eql.o. If you want to compile it as a
module, say M here and read Documentation/modules.txt. If unsure,
say N.
TEQL queue
CONFIG_NET_SCH_TEQL
Say Y here if you want to use the True Link Equalizer (TLE) packet
scheduling algorithm for some of your network devices or as a leaf
discipline for the CBQ scheduling algorithm. This queueing
discipline allows the combination of several physical devices into
one virtual device. (see the top of net/sched/sch_teql.c for
details).
This code is also available as a module called sch_teql.o ( = code
which can be inserted in and removed from the running kernel
whenever you want). If you want to compile it as a module, say M
here and read Documentation/modules.txt.
If you specify two routes with an equal metric value (using the
"metric" or "preference" keyword), load balancing is done on a per
connection basis;
. if you specify the "equalize" keyword on two routes (which of course
must have the usual triplet matching) then load balancing is done on a
packet basis;
In this case the route is just recomputed for every packet. Without it
the route stays cached and bound to a specific nexthop (unless the nexthop
dies)
ip route change default equalize nexthop via 64.81.188.33 dev ppp0 nexthop via 63.231.55.86 dev eth1
--
---- Bryan Swann EEEEE M M AAA
---- ***@spawar.navy.mil E MM MM A A
---- (843)218-6610 EEE M M M AAAAA
---- Fax (843)218-5461 E M M A A
---- Cell (843)296-7865 EEEEE M M A A

Would you like fries with that?....
arek
2002-08-26 07:01:36 UTC
Permalink
Zebra DOES load balancing on OSPF protocol (i tested RIPD and there it
wasn't working, but on ospf it works)

Look at it :)
# uname -r
2.2.22

#ip ro sh
(...)
127.0.0.0/8 dev lo scope link
default proto zebra metric 1
nexthop via 195.117.137.78 dev eth0 weight 1
nexthop via 212.160.166.145 dev eth3 weight 1

#telnet localhost 2604
##show ip ospf route
(...)
============ OSPF external routing table ===========
N E2 0.0.0.0/0 [140/1] tag: 1
via 195.117.137.78, eth0
via 212.160.166.145, eth3
(...)

You jus must set the costs to be the same via 2 neighbours.

A.Binder
Post by Josiah DeWitt
I don't think zebra will do loadbalancing but if it can, I'd like to
know. I've configured ECMP as a test on Red Hat Linux 7.1 kernel
(...)
Loading...