TCP Libra Linux Implementation Notes

Contents

This document describes how to get started with the tcp_libra kernel module and conduct experiments. It is organized as follows:

  1. Building the kernel package in Ubuntu
  2. Updating just the tcp_libra module
  3. Inserting the tcp_libra module into your running kernel
  4. Removing the tcp_libra module from your running kernel
  5. Measurement

If you have any questions, please feel free to email Thomas Kho <tkho@ucla.edu>.

Building the kernel package in Ubuntu

Our tcp_libra module works with Linux 2.6.14 (and possibly 2.6.13, which first implementated TCP congestion control as a module, but nothing earlier). You will need to compile and install this kernel on your test machine.

  1. Apply the tcp_libra patch in your linux-2.6.14 source directory:
    linux-2.6.14$ patch -p0 < tcp_libra.patch
  2. Build a kernel package:
    linux-2.6.14$ export CONCURRENCY_LEVEL=2
    linux-2.6.14$ make-kpkg --rootcmd fakeroot --initrd --append_to_version -libra\
    --revision 1 kernel_image
    
  3. Copy the package (kernel-image-2.6.x-xxx.deb) to your test machine, and `dpkg -i kernel-image-2.6.x-xxx.deb` install your newly built kernel. Reboot.

Updating just the tcp_libra module

For subsequent changes to the tcp_libra kernel module, from the linux source directory on your host (the build machine) run:

linux-2.6.14$ make net/ipv4/tcp_libra.ko
linux-2.6.14$ scp net/ipv4/tcp_libra.ko tkho@192.168.0.10:/lib/modules/2.6.14-libra/kernel/net/ipv4/
where 192.168.0.10 is your test machine, and tkho has write permissions for tcp_libra.ko in the test machine.

Inserting the tcp_libra module into your running kernel

The tcp_libra module is not loaded by default. To load the module into your kernel, as root, run:

insmod /lib/modules/2.6.14-libra/kernel/net/ipv4/tcp_libra.ko t0=1 t1=1 k1=2 k2=2 penalty_fcn=0
where t0, t1, k1, and k2 are the module parameters, and penalty_fcn is 0 or 1 depending on the desired penalty function

To verify that tcp_libra is being used, run:

cat /proc/sys/net/ipv4/tcp_congestion_control

Removing the tcp_libra module from your running kernel

As root, run:

rmmod /lib/modules/2.6.14-libra/kernel/net/ipv4/tcp_libra.ko
The module will not unload if there are open TCP connections that are using the tcp_libra module for congestion control.

Measurement

netcat is a great tool to create TCP traffic. It's very easy to use on both the client and server side. On the server:

netcat -l -p [port_num]
This tells netcat to listen for the first connection on port [port_num]. On the client, run
head /dev/zero -c [bytes] | netcat [host] [port] -q 0
which tells netcat to send [bytes] bytes of data to [host]:[port].



Thomas Kho <tkho@tommykho.com>
Last Updated: December 16, 2005