A registered slice on PlanetLab, connected to a node supports emulation.
A GoogleTechTalk on dummynet by Luigi Rizzo, Università di Pisa, is available on YouTube
These are the steps required to use the emulation.
- Enable the slice to use emulation
- Install the ipfwslice package
- Configure emulation for the experiment
- Start the experiment
- Check results
- Cleanup emulation after the experiment
The first three steps are required just once, the last three need to be repeated for each experiment.
- Enable Emulation
To enable the slice to use emulation, send an email to PlanetLab Support requesting that emulation be enabled. The email should say:
"Can you please enable the emulation tag (vsys ipfw-be) for <slicename> on all nodes?"
You must send a separate request for each slice you want emulation enabled. You need send the request only once for each slice.
You will receive an email confirming the emulation has been enabled.
You can check the tag state from the slice page, in the tag menu.
- Install the ipfwslice Package
To access the emulator, install the ipfwslice package on the sliver.
Log in to your sliver using ssh.
Run the command
sudo yum install ipfwslice
This installs the ipfwslice package is installed on the sliver.
- Configure the Emulation
Use the "netconfig" program to configure emulation for your experiment.
Here is an example on how to configure an emulated link. Run the command:
/sbin/netconfig config client 80 IN delay 100ms OUT bw 1Mbit/s
This configures the emulation in "client" mode, i.e. intercepting traffic between a local client and a remote server on port 80. In this experiment the link is configured with a delay of 100ms on incoming traffic, and a bandwith of 1Mbit/s on outcoming traffic.
You can configure emulated links in three modes.
- Client emulates a node hosting clients that connect to external servers, whose ports and/or addresses are known
- Server emulates the case where the local node hosts a server on one or more well known local ports
- Service emulates the same pair of emulated links for both client and server modes described above
The emulator is configured. You can start your experiment.
- Start your experiment
In our example the emulator is configured to intercept the traffic on port 80, and a simple http request should match the emulator rule.
For example you can download a file running the following command:
wget www.google.com
You can modify the configuration, repeating the netconfig command, even while the experiment is running.
- Check the results
In addition to the output of your experiment, you can read from the emulator a count of matching and dropped packets and bytes, by running the commands
/sbin/netconfig show rules
and
/sbin/netconfig show pipes
The "show rules" command shows how many bytes and packets matched our rules. The "show pipes" command shows statistics for the input and output links, including dropped packets due to queue overflows.
- Clean up
Once you are done with your experiment you should remove the emulated link previously installed.
To cleanup your rules, run the command
/sbin/netconfig delete client 80
If you do not remove the link, it will be removed automatically after a timeout of approximately 1 day.
More information about ipfw and dummynet configuration