A client was putting together and testing an equipment package that was to be installed in their Disaster Recovery site. After getting everything up and running and tested, they wanted to test the replication performance in a 'real' WAN environment. One way to do this is to use a real WAN. The other way is to simulate a WAN. Consdering their DR site is several thousand miles away, simulating the WAN would be logistically better.
To emulate a WAN, one needs to be able to control:
- variable delay
- delay distribution
- packet loss
- packet re-ordering
- rate control
In researching possible tools for emulating an WAN environment, I came across two open
source tools WAN emulation tools. The first one I saw was
NIST Net. Although it hasn't
received too many recent updates, it does still have an active forum. And it appears to be
quite sophisticated. It does require an x-windows for a library during compile time. With
X11 Forewarding, you don't need to burden the WAN emulating computer with a GUI, can
use another computer as a terminal. You can reference one of my
Cygwin pages on how to
remote X11 applications.
It is said that NIST Net is a bit better than NetEm as NIST Net has tighter controls on
its delay mechanisms.
I came across the second wAN Emulator purely by chance. In reading through some of the
NIST Net forum articles, one of the mentioned that the Linux Kernel already has one built
in: NetEm. One may
need to enable it and rebuld the kernel. It doesn't have a user interface, but instead
relies on command line utilities. Someone did do up a GUI for NetEm, but has removed it for
one reason or another.
A newsgroup article has a reference to where it can be obtained. Someone
else mentioned that MasterShaper could be used as an interface to the capabilities of NetEm.
Page 15 of a slide presentation
shows command line examples for running NIST Net as well as NetEm. Another
document
offers up an example of using NetEm.
I was able to get NIST Net built on a Debian box. But the DR equipment had to be shipped
out before I could actually give it a try. Oh well, I'll find another project to try it out
on. Here are some build instructions for a recent Debian Kernel. There are some variations
regarding availability of config.h depending upon the 2.6 kernel version you have available.
When obtaining the NistNet code in one of the commands below, some of the instructions
assume you've expanded the library in /usr/src. As such, when the library is expanded,
you'll need to change four lines in /usr/src/nistnet-3.0a/kernel/knistnet.c from
return ippt->func(skb, dev, ippt);
to:
return ippt->func(skb, dev, ippt, NULL);
You may need to comment out the following line in
/usr/src/nistnet-3.0a/kernel/nistnet_table.c:
/* typedef enum {false = FALSE, true = TRUE} boolean; */
You may need to add a dummy config.h in
/usr/src/linux-headers-2.6.21-2-686/include/linux/ with:
#ifndef _LINUX_CONFIG_H
#define _LINUX_CONFIG_H
#include
#endif
You should also confirm that this file exists (depending upon your kernel version):
/usr/src/linux-headers-2.6.21-2-686/include/linux/autoconf.h
Here are remaining installation instructions:
apt-get install vlan
apt-get install linux-headers-2.6.21-2-686
apt-get install x-window-system-core
apt-get install libxaw-headers libxmu-headers
apt-get install libxp-dev
apt-get install xaw3dg-dev
# might need:
ln -s /usr/lib/libXaw7.so.7 /usr/lib/libXaw.so
wget http://www-x.antd.nist.gov/nistnet/dist/nistnet.2.0.12c.tar.gz
tar -zxvf nistnet.2.0.12c.tar.gz
./configure
make
make install
depmod
modprobe nistnet
lsmod | grep nistnet
cnistnet -G