Instruction for Experimental Tools

1. Run Rapid

Rapid Network Topology
Six machines that are capable of running rapid code is smithfd-rapid1, smithfd-rapid2, smithfd-rapid21,smithfd-rapid22,smithfd-linux1 and smithfd-linux2. Try use rapid machines becahse they have better configuration.
Check the kernel version use command: "uname -r". The kernel version should be 2.6.32-220.7.1.el6.i686. Otherwise, you might have problems inserting the kernel module. Please contact Murray to solve the problem.

2. Enable rapid21 as a router

Murray has two scripts on rapid machines to enable the routing path. You can also download them here: rapid-router.sh and via-rapid21.sh

1) sh doexecute.sh on/off
#!/bin/sh
no_of_servers=2
i=1
option=$1
while [ $i -le $no_of_servers ]
do
  expect dologin.exp smithfd-rapid$i.cs.unc.edu $option
  i=`expr $i + 1`
done
2) expect dologin.exp machine option(on/off)
#!/usr/bin/expect -f
set ipaddress [lindex $argv 0]
set option [lindex $argv 1]
set username qianwen
set passwd jellyjar@530
spawn ssh $username@$ipaddress 
expect {
"yes/no" { send "yes\r";exp_continue }
"password:" { send "$passwd\r" }
}
expect -re "\](\$|#) "
send "sudo cp /root/via-rapid21.sh /home/qianwen \r"
expect -re "\](\$|#) "
send "$passwd\r"
expect -re "\](\$|#) "
send "ls \r"
expect -re "\](\$|#) "
send "sudo sh via-rapid21.sh $option \r"
expect -re "\](\$|#) "
send "exit\r"

3. Net-lib

1) set up passwordless-ssh

On the controller machine(smithfd-rapid21 for example) run:
    ssh-keygen
    ssh-copy-id -i ~/.ssh/id_rsa.pub qianwen@smithfd-rapidX
If problem "ambiguous output redirect" happens, just append id_rsa.pub to the file ~/.ssh/authorized_keys on smithfd-rapidX.
now the authorized_keys file contains the public key of qianwen@smithfd-rapid21. And you can "ssh smithfdrapidX" from smithfd-rapid21 without password.
Murray and Don has set up everything else. 
Notice: Do not set the permission to your home directory 777.
        Check /var/log/secure for clues  if fails.
change lines on smithfd-rapidX:/etc/ssh/sshd_config:
	RSAAuthentication yes
	PubkeyAuthentication yes
	#AuthorizedKeysFile     .ssh/authorized_keys
	#PubkeyAgent none
	#PubkeyAgentRunAs nobody
and change file mode: chmod 640 ~/.ssh/authorized_keys
		      chmod 700 ~/.ssh

2) Password-less sudo

On all end hosts, run the following commands:
  sudo visudo
  edit lines:
     Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
  add lines :
     qianwen ALL=(ALL)       NOPASSWD: /sbin/insmod,/sbin/rmmod,/sbin/lsmod,/sbin/ethtool,/sbin/ip,/usr/sbin/tcpdump,/sbin/sysctl,/sbin/reboot,/sbin/tc 
This line allows you to use auto-sudo to some commands. You must specify the full path of those commands. Use whereis command to find out the path of the command.
     Donot add command that is executable for all uses, e.g. ifconfig and netstat. 

  More privileges: -- not recommended!!!!!
            username ALL=(ALL) NOPASSWD: /usr/bin/,/usr/lib/,/sbin/
  Last straw: Default !authentication (Open a large security loophole)

3) Get net-lib source code

git clone https://code.google.com/p/net-lib/
to update the git:
  cd net-lib
  git putt origin master 
edit python path:
  vi ~/.bash_profile # then edit:
  export PYTHONPATH=.:$PYTHONPATH:$HOME/net-lib/ 

You may also need to change a few lines in the source code to let it run successfully:
  in net-lib/net/iperf.py: change KILL_STRING = 'killall -q -r \".*iperf*\"'
                         to KILL_STRING = 'killall iperf'
  in shell/bash.py: change ifconfig to /sbin/ifconfig

4) Write your own config.py and experiment.py

Here are my example .py files to run iperf among 4 end hosts:
config.py and myPerf.py

4. generate per-connection delays on the router

Download the module used on the router
Usage: 
"make all" to compile the module
Specify the 4-tuple+delay pairs in insertModule.pl. 
There are 4 options for the module:
  my $usingTrafficGenerator =  0 : only compare source port
                               1 : only compare dst port
                               2 : compare 4-tuple
                               3 : ignore the qdisc module

"sudo perl insertModule.pl" to install the module
"tc qdisc add dev ethX root amrr" to use the qdisc scheduler on the outgoing interface

Here is a test result for this module running over cubic:
[qianwen@smithfd-rapid2 receiver]$ iperf -s -p 5678 -i 0.5
------------------------------------------------------------
Server listening on TCP port 5678
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 192.168.134.6 port 5678 connected with 192.168.135.6 port 49359
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0- 0.5 sec  1.05 MBytes  17.6 Mbits/sec
[  4]  0.5- 1.0 sec  15.3 MBytes   257 Mbits/sec
[  4]  1.0- 1.5 sec  20.7 MBytes   347 Mbits/sec
[  4]  1.5- 2.0 sec  21.5 MBytes   361 Mbits/sec
[  4]  2.0- 2.5 sec  20.3 MBytes   341 Mbits/sec
[  4]  2.5- 3.0 sec  20.6 MBytes   345 Mbits/sec
[  4]  3.0- 3.5 sec  21.5 MBytes   361 Mbits/sec
[  4]  3.5- 4.0 sec  20.0 MBytes   335 Mbits/sec
[  4]  4.0- 4.5 sec  20.8 MBytes   349 Mbits/sec
[  4]  4.5- 5.0 sec  21.5 MBytes   361 Mbits/sec
[  4]  5.0- 5.5 sec  19.9 MBytes   334 Mbits/sec
[  4]  5.5- 6.0 sec  20.9 MBytes   351 Mbits/sec
[  4]  6.0- 6.5 sec  21.5 MBytes   361 Mbits/sec
[  4]  6.5- 7.0 sec  19.8 MBytes   333 Mbits/sec
[  4]  0.0- 7.2 sec   274 MBytes   318 Mbits/sec
^C[qianwen@smithfd-rapid2 receiver]$ iperf -s -p 5679 -i 0.5
------------------------------------------------------------
Server listening on TCP port 5679
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 192.168.134.6 port 5679 connected with 192.168.135.6 port 60786
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0- 0.5 sec   390 KBytes  6.39 Mbits/sec
[  4]  0.5- 1.0 sec  3.29 MBytes  55.2 Mbits/sec
[  4]  1.0- 1.5 sec  13.0 MBytes   218 Mbits/sec
[  4]  1.5- 2.0 sec  15.0 MBytes   251 Mbits/sec
[  4]  2.0- 2.5 sec  15.0 MBytes   252 Mbits/sec
[  4]  2.5- 3.0 sec  15.0 MBytes   252 Mbits/sec
[  4]  3.0- 3.5 sec  15.0 MBytes   252 Mbits/sec
[  4]  3.5- 4.0 sec  15.0 MBytes   252 Mbits/sec
[  4]  4.0- 4.5 sec  15.0 MBytes   252 Mbits/sec
[  4]  4.5- 5.0 sec  15.0 MBytes   252 Mbits/sec
[  4]  5.0- 5.5 sec  14.7 MBytes   247 Mbits/sec
[  4]  5.5- 6.0 sec  14.9 MBytes   249 Mbits/sec
[  4]  6.0- 6.5 sec  14.6 MBytes   245 Mbits/sec
^CWaiting for server threads to complete. Interrupt again to force quit.
[  4]  6.5- 7.0 sec  14.7 MBytes   247 Mbits/sec
[  4]  7.0- 7.5 sec  14.7 MBytes   246 Mbits/sec
[  4]  7.5- 8.0 sec  14.8 MBytes   248 Mbits/sec
^C[qianwen@smithfd-rapid2 receiver]$ iperf -s -p 5680 -i 0.5
------------------------------------------------------------
Server listening on TCP port 5680
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 192.168.134.6 port 5680 connected with 192.168.135.6 port 49010
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0- 0.5 sec   161 KBytes  2.64 Mbits/sec
[  4]  0.5- 1.0 sec   950 KBytes  15.6 Mbits/sec
[  4]  1.0- 1.5 sec  4.74 MBytes  79.4 Mbits/sec
[  4]  1.5- 2.0 sec  11.5 MBytes   194 Mbits/sec
[  4]  2.0- 2.5 sec  11.8 MBytes   198 Mbits/sec
[  4]  2.5- 3.0 sec  10.7 MBytes   179 Mbits/sec
[  4]  3.0- 3.5 sec  12.5 MBytes   210 Mbits/sec
[  4]  3.5- 4.0 sec  10.0 MBytes   168 Mbits/sec
[  4]  4.0- 4.5 sec  12.5 MBytes   210 Mbits/sec
[  4]  4.5- 5.0 sec  11.7 MBytes   197 Mbits/sec
[  4]  5.0- 5.5 sec  10.8 MBytes   181 Mbits/sec
[  4]  5.5- 6.0 sec  12.5 MBytes   210 Mbits/sec
[  4]  6.0- 6.5 sec  10.0 MBytes   168 Mbits/sec
[  4]  6.5- 7.0 sec  12.5 MBytes   210 Mbits/sec
[  4]  7.0- 7.5 sec  11.9 MBytes   199 Mbits/sec
[  4]  0.0- 7.6 sec   146 MBytes   161 Mbits/sec
^C[qianwen@smithfd-rapid2 receiver]$ 

5. Generate web traffic with diverse RTTs

1) install a Qdisc model for delaying packets for every connection: Download Qdisc module
2) use a modified version of thttp client which specifies per-connection delays to ask the Qdisc module to delay acknowledgements: Download Qdisc thttp client. thttpd is the same as the original version.

6. Generate on/off UDP cross traffic

#usage sh on-off-udp.sh interval loops bandwidth
#!/bin/sh
interval=$1
times=$2
bandwidth=$3
i=1
while [ $i -le $times ]; do
  iperf -u -c pvt-rapid2.netlab -b $3 -t $interval -i 1
  start=$(date +%s.%N)
  sleep $interval
  end=$(date +%s.%N)
  i=$[$i + 1]
  sleeptime=$(echo "$end - $start"|bc)
  echo "sleeptime= $sleeptime"
done

Back to top