Eqlplus is
a Linux modem combining strategy based upon IP masquerading and
eql. Modern browsers typically open many simultaneous HTTP TCP-based
connections to fetch text and images from remote servers. TCP
multiplexing distributes these simultaneous connections across
several active links thereby increasing the apparent bandwidth
to the Web user.
Impressed
by the ability of several commercial products to multiplex independent
dialup connections to the Web, we wanted to see if we could do
a similar trick for free under Linux. We started with eql, Linux's
kernel level link multiplexer written by Simon Janes. Unfortunately
eql is not connection oriented and only works when a remote communications
server also speaks eql's load balancing protocol. The remote connection
could be another Linux box running eql or some models of the Livingston
Portmaster terminal server. Since remote server multiplexing is
not available from most Internet Service Providers, eql cannot
be used with ordinary ISPs.
So we explored
the idea of combining the TCP connection handling of the Linux
IP masquerading software with the load balancing capabilities
of eql. It worked!
We patched
the Linux IP masquerade software with a kernel-level call to ask
eql for the next link to use when establishing a new TCP connection.
This is when the IP masquerade software sets up the mapping between
the local "hidden" IP address/port numbers and the IP masquerade
port number that stands in as a proxy for the hidden address.
We use the link offered by eql to determine the masquerade sender's
new IP address, replacing the sender's masqueraded address derived
from the eql master interface which kernel routing chose. This
works because kernel routing chooses the eql interface for Internet
bound packets when eql is active and is designated as the default
gateway interface. We are, in effect, refining the granularity
of the source addressing by further specifying which eql slave
interface will be used.
Next, when
the masquerade software hands off the packet to eql, a modified
eql driver chooses the requested address's interface instead of
recomputing a potentially different address. In this way, the
packet is sent over the correct interface and responses will be
routed by the ISP connected to the selected interface back to
the corresponding address and interface. IP masquerade receives
the response, resolves the masquerade port mapping and sends the
packet on its way to the original "hidden" sender.
The "eqlplus"
package contains the following components:
Patches to
eql.c, ip_masq.c and if_eql.h. In the Linux source tree, these
files are located, respectively, at
/usr/src/linux/drivers/net/eql.c,
/usr/src/linux/net/ipv4/ip_masq.c, and
/usr/src/linux/include/linux/if_eql.h.
We have also
included several small utilities.
- A sample cron job, chkeql.cron, to call the eql check script,
checkeql.sh.
- A script, checkeql.sh, to keep the eql interface configured
in the face of the loss of slave ppp links managed by eql. This
script assumes that getpppinfo has been installed in /usr/local/bin
and that ppp scripts have been written to handle bringing up your
ppp links. In checkeql.sh, these ppp scripts are called ppp-on-ttyS0
and ppp-on-ttyS1 and are assumed to exist in /usr/sbin.
- A script, checklinks.sh, which displays on the command line
the current balance of receive and transmit traffic between ppp0
and ppp1
- A C program, getpppinfo.c, to obtain current local or remote
link information from /proc. This program is invoked by checkeql.sh.
- Finally, we have provided a small X-based utility, xeqlinfo,
to graphically monitor the load sharing provided by 2 links (although
any number of links can be handled by the modified eql driver
itself.) This display utility is an adaptation of Gabor Herr's
xsysinfo application.
WHAT YOU NEED TO DO:
This version
of the eqlplus software has been developed and tested on RedHat
6.1 (2.2.12 kernel).
- First, you must patch your kernel source files by running
patch -p0 -d /usr/src < eqlplus.patch
The patch file, eqlplus.patch, assumes that your source is in a subdirectory
called "linux" and the above command assumes that this subdirectory is
in "/usr/src". Your may also run "make dopatch", which also assumes
your Linux source is in "/usr/src". You can change the Makefile if your
source lives elsewhere. This will patch
/usr/src/linux/drivers/net/eql.c
,
/usr/src/linux/net/ipv4/ip_masq.c
,
and /usr/src/linux/include/linux/if_eql.h
.
- Then, configure and build your kernel selecting eql and IP
Masquerading.
- Run "make" in the eqlplus directory to build getpppinfo and
eql_enslave. getpppinfo and eql_enslave are required by checkeql.sh.
Next run "make install" to move getpppinfo and eql_enslave into
/usr/local/bin.
- You should create a script for using eql to enslave multiple
ppp connections to your ISP(s). A sample script, checkeql.sh,
is provided. This script may be run as a cron job to keep your
multiple link configuration active in the face of line drops.
- If you are multiplexing two ppp connections onto the Internet
you can build and run a small X utility, xeqlinfo, and watch the
instantaneous behavior of load sharing. A dynamically changing
graphical bar displays the percentage of ppp0 activity in pink
and the complementary percentage of ppp1 activity in red. To build
xeqlinfo, cd to xeqlinfo-1.0/ and run "make" and then "make install",
or run "make xeqlinfo" followed by run "make xeqlinfo_install"
from the top level directory.
Please email
us, at eqlplus@cwareco.com,
if you have any questions or even just to let us know how you are
using this tool.
[DOWNLOAD]