Server and client with network latency

In this tutorial, we will show you how to set up a client and server node, with layer 2 network in between with a certain latency. The server will run an iPerf server instance, after which we will run an iPerf client instance on the second node. By using the correct IP addresses, we make sure that the iPerf traffic stream is routed over the dedicated layer 2 network.

The following steps should guide you through the entire process

Reserve 2 nodes on the virtual wall using jFed

Just drag in 2 physical nodes. (note everything works also with Xen VMs, but only on Virtual Wall 2 we have dedicated servers for this)

Right click on the link to add e.g. 100ms latency.

Configure the server in the RSpec

Before running the experiment, we will use the shell script option in the RSpec to install iperf. Go to the Raw RSpec view and add the following in the node part of the ap (first line is already there):

<sliver_type name="raw-pc"/>
<services>
     <execute shell="sh" command="sudo apt-get update ; sudo apt-get install iperf"/>
</services>

Note: it should be valid XML, so if you want to use &&, then escape it.

Configure the IP address:

<interface client_id="node0:if0">
  <ip address="10.0.1.1" netmask="255.255.255.0" type="ipv4"/>
</interface>

Configuration of the client in the RSpec

Do the same RSpec edit but now give the client 10.0.1.2 as IP address.

Running the experiment

Run the experiment in jFed and wait till the nodes become green.

Open a terminal on server and client and become root:

sudo su

Check if you can ping:

ping 10.0.1.2  (or ping client)

iPerf measurement

Start an iPerf server instance (TCP in this case) on the server:

iperf -s -i 1

Configure the iPerf client:

iperf -c 10.0.1.1 -i 1

If you have a small latency, you will reach normally 1Gb/s, with larger latencies you will have less (TCP window size too small).

Changing the latency

If you used an impairment bridge, you can login with ssh on that bridge (FreeBSD) from client or server, or if you turn on the SSH proxy in jFed. (the bridge does not have an IPv6 address).

If you didn’t used a bridge, impairment is done with tc on the nodes itself:

Check /var/emulab/boot/rc.linkdelay
or: tc qdisc show