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

Automatic multipath routes



Hi, please CC me when answering.
I have been developing a small program to keep multipath routes. I want to share
it and if it's of interest of the community I would improve it (got some new
ideas, but don't know if it is worth the effort).

The motivation was the following: At work, we have several connections to the
Internet, and some of these are a bunch of poor performance ADSLs. "Poor" means
they drop packets, packets arrive out of sequence very often, links go down,
latency grows suddenly, and all this in a (apparently) random manner. Sometimes
they do well all day; mostly, they don't (and all this in production time).
Fortunatetly, we have other links to use for the *really* important stuff, and
we use these bad ones to serve the "mass". Oh, forgot to say, the ISP is a
headache and the modems too. Hardware problems were discarded with the arrival
of new equipment, isolation transformer (to eliminate completely any potential
diff between neutral and ground) and other stuff.

The scripts only need a few commands to work, and are written in bash. Tested
the program on:
* (2x) Ubuntu 12.04 amd64 (both up to date). Software involved:
iputils-sss20101006, iproute2-ss111117, coreutils-8.13, bash-4.2.25.
* Fresh Gentoo Linux amd64 (installed a couple of days ago). Software involved:
iputils-s20121221, iproute2-ss130221, coreutils-8.20, bash-4.2.45.
* Old-old Debian amd64. Software involved: iputils-sss20071127,
iproute2-ss080725, coreutils-6.10, bash-3.2.39.
Works like a charm (in production for the last few days), and is sufficiently
generic as to keep several multipath routes, which can be in the same or
diferent tables (one of the requirements of the new networking architecture) and
detects the following issues in the connections:
* If ping fails, it throws.
* If it gets <X> consecutive ICMP messages saying something not good
(network/host unreachable, administratively prohibited, frag needed, etc.) it
throws.
* If ping doesn't give any response in a certain period of time, it throws.
* If it recieves <Y> number of consecutive replies which are out of sequence, it
throws.
* If the ping time grows beyond a treshold, it considers the connection has a
high latency, and may decide to drop the weight of that path to a smaller weight
specified before in order to favor other paths.
* If nothing of the above happens for <Z> consecutive replies, it considers the
connection is "acceptable", and will make sure that path is up and with a higher
weight.
The script runs in a daemon-like fashion, and as the ADSLs failed, grew in
latency, and recovered I could see how changes *would* have been done to the
configured multipath routes. "Would" because it also supports a "PRETEND" mode,
in which nothing is actually done to the routing tables but you get the problems
detected and the solution it would take on stdout. Thinking it deserves some
respect, I took the liberty to add a "TROUBLESHOOT" option to make a description
of the system to attach to bug reports (like utilities versions and so).
What you need to get it working is an INI file which can define a "[general]"
section where you can overwrite default values (even though they are safe enough
for many situations, I think), and then define as many multipath routes as you
want, each with it's own list of "possible" paths.
Note that after a path is deleted from the route, only the routes cached through
that entrie's router are flushed (useful to woraround old kernel's issues).
By the way, you can download the project from
"https://github.com/diegommm/ampr";, it's published under GPLv2 and it's name is
"Automatic Multi Path Route".

Greetings.

-- 
Diego Augusto Molina
diegoaugustomolina@gmail.com

ES: Por favor, evite adjuntar documentos de Microsoft Office. Serán
desestimados.
EN: Please, avoid attaching Microsoft Office documents. They shall be discarded.
LINK: http://www.gnu.org/philosophy/no-word-attachments.html


Reply to: