Bandwidth Management
We need to manage and throttle bandwidth at the Internet gateway so that abuse of the network, e.g. a user persistently downloading large files, does not affect other users and ensures best possible performance.
We use a free piece of software called "Bandwidth Arbitrator" to achieve this. The arbitrator bases its decision to levy penalties on some common sense fairness rules:
- How persistent is this user, how long have they been using bandwidth, the longer they have been around the more likely they are to get a penalty
- How much bandwidth is this user using relative to the total size of the trunk? If a user is gobbling up 1 megabit of a 1.5 megabit trunk they are very likely to get a penalty, where as a user listening to a 56kbs music stream is not likely to get a penalty.
- How many users are on the trunk, the more users the less bandwidth the arbitrator will allow per user before issuing a penalty.
Thus fair use of the network is ensured.
How we built our arbitrator machine on RedHat 9 using the free software available at the BA website:
You need the .tar.gz of the ba source, the bridge utils, the kernel patch and RH9 up and running on your machine. I would set this up on a dedicated machine.
Additional How to documents and a support forum is also available at the site.
Make sure you've installed the 2.4.19 kernel source:
Download the kernel source file from ftp.kernel.org into some temporary directory. Then...
cd /usr/src
tar zxfv /placewheregzfileis/filenameofkernel.tar.gz
rm linux
rm linux-2.4
Ignore any message from the above two commands the links may not exist.
Create symbolic link to linux kernel source
ln -s linux-2.4.19 linux
ln -s linux-2.4.19 linux-2.4
CD linux
The very first time after installing the source do
make mrproper
Never do that again or it will erase your old config and all of your choices you just made to the config.
Now if you want some starting values for your new kernel then do:
cp /boot/config-2.4.20-8 ./.config
If you have upgraded the kernel using up2date already on Redhat 9 then you may have a newer config that that in /boot, if so then use that one instead.
If you used an old config then do:
make oldconfig
patch -p1 < ../bridge-nf-0.0.7-against-2.4.19.diff (THIS IS ASSUMING THE DIFF IS IN /usr/src
Now go toggle what you need.
make menuconfig
Some thing to keep in mind is you are not supposed to choose M for any file system that is your root file system so if you already are running on ext3 then compile that into the kernel and not as an M or compile ext2 in and leave ext3 as an M.
Bridging should be installed as a module
Compile kernel (takes approx 2 hours):
make dep
make clean
make
make bzImage
make modules
make modules_install
make install
Check your /boot/grub/grub.conf
pico -w /boot/grub/grub.conf
title Red Hat Linux (2.4.19)
root (hd0,0)
kernel /vmlinux-2.4.19 ro root=/dev/hda2
initrd /initrd-2.4.19.img
The /dev/hda2 is an example, you need to put your correct partition.
Reboot into 2.4.19 kernel!
If you reboot and get some Kernel Panic and it tells you something about change root=LABEL=/ Then reset the machine and boot into a previous kernel and fix the grub.conf like shown above.
Also in your grub.conf make sure you didn't just copy one of the other set of lines and didn't change vmlinuz to vmlinux in your new kernels file name./vmlinux-2.4.19 is correct and /vmlinuz-2.4.19 would be wrong.
Prepare bridge utils (utils NEED to be in this dir):
mkdir /bridge
CD /bridge
tar -xvf <source dir>/bridge-utils-0.9.5.tar
CD bridge-utils
make
Make sure bridging is OK
modprobe -v bridge should show no errors; ifconfig should show both network cards up and running
Test bridging:
Set-up bridge: (see http://www.tldp.org/HOWTO/BRIDGE-STP-HOWTO/set-up-the-bridge.html)
Create the bridge interface:
root@mbb-1:/bridge/bridge-utils/brctl addbr mybridge
Add interfaces to the bridge.
root@mbb-1:/bridge/bridge-utils/brctl addif mybridge eth0
root@mbb-1:/bridge/bridge-utils/brctl addif mybridge eth1
Zero IP the interfaces.
root@mbb-1:~ # ifconfig eth0 0.0.0.0
root@mbb-1:~ # ifconfig eth1 0.0.0.0
Put up the bridge.
root@mbb-1:~ # ifconfig mybridge up
Optionally you can configure the virtual interface mybridge to take part in your network. It behaves like one interface (like a normal network card). Exactly that way you configure it, replacing the previous command with something like:
root@mbb-1:~ # ifconfig mybridge 192.168.100.5 netmask 255.255.255.0 up
Test bridge
ifconfig should show bridge up and running. Computer conn to eth1 should be able to reach computer on eth0 so long as they're on the same subnet
Delete bridge
ifconfig mybridge down
root@mbb-1:/bridge/bridge-utils/brctl delbr mybridge
Setup arbitrator
cp <sourcedir>arbitrator6.2.tar.gz to any dir
mkdir /art
tar zxfv arbitrator6.2.tar.gz
cd arbitrator6.2
Run the following command as root
./install.sh
answer y to cont install
CONFIG_BRIDGE_NF in /usr/src/linux/.config nneds to be toggled on if you plan to use the arbitrator co-resident with a firewall. Do this now is you want it to work! I found this option under the Appletalk section
Rebuild kernel (another hour or so):
root@mbb-1:/usr/src/linux #make dep
root@mbb-1:/usr/src/linux #make clean
root@mbb-1:/usr/src/linux #make
root@mbb-1:/usr/src/linux #make bzImage
root@mbb-1:/usr/src/linux #make modules
root@mbb-1:/usr/src/linux #make modules_install
root@mbb-1:/usr/src/linux #make install
Rebuild the bridge user space utilities
cd /bridge/bridge-utils
make
Reboot into 2.4.19 kernel!
Start arbitrator
The file /etc/arbdefault.conf contains the start up configuration and is self documenting, you may edit this file as appropriate. "etc/init.d/arbitrate [start /stop]" is executed to start everything
Remember all the open source tools require ./ in front of them e.g. /art/./MODIFY_CONFIG ...
Last update
Wednesday, March 14, 2007 2:24 PM
|