We've implemented a fairly simple set of test programs which demonstrate the use of the Congestion Manager from userland with UDP programs. The programs use a very simple protocol between the client and server:
* Please note that this simple demonstration does NOT account for packet re-ordering.
The test programs all link against the test_framework.c file;
it contains a simple main() function which sets up the sockets
the programs need, and then dispatches into a function
called test_run. test_run should be defined in a separate
file for each test, named "test_
The test_run function implements the program's event loop.
Many of the test programs make use of some convenience
functions defined in the test_framework.c file, send_pkt
and receive_pkt. Please read the comments in the code
for these functions if you're considering using them in
your own code - they have some important restrictions
of which you should be aware.
First, run the receiver program. We'll assume you're running it
on the machine "test1"
This program can run on any Linux or BSD system; it does NOT require
the congestion manager.
Then, run any of the example programs. For instance, to send 10
packets to the receiver with the buffered UDP API, run:
The test programs included herein are intended only to give
a flavor for how the Congestion Manager may be used. The
CM is compatable with a variety of different program architectures,
including those based on select loops, timers, or signals.
You'll need to determine the best way to integrate the
CM into your programs, of course, but we hope we've provided
an easy framework for you to accomplish this.
The program registers a cmapp_update() function with the CM, and then
waits for the CM library to call cmapp_update(). Upon receiving
this callback, it picks a suitable transmission rate and clocks
its transmissions. It implements its own event loop so it can
receive notifications of successfully received and lost packets
from the client.
How do I run the programs?
./test_receiver
./test_bufudp -n 10 -d test1
But my program has a different <event loop, style, etc>!
What do each of the test programs do?