0
In order to test a network application in a controlled manner I want to create some sort of virtual network on a single machine in which I can control latencies. (I am running Ubuntu 14.04 x64). I have researched a bit and got up the following:
Using tap interfaces: vde_switch to create a virtual switch like so:
sudo vde_switch -tap tap0 -tap tap1
sudo ip addr add 10.0.0.100 dev tap0
sudo ip addr add 10.0.0.101 dev tap1
An alternative way to create the tap interfaces I've tried is:
sudo ip tuntap add dev tap0 mode tap
sudo ip link set dev tap0 up
sudo ip addr add 10.0.0.100 dev tap0
[repeat for tap1 and any further interfaces]
So far so good. Now my problem is introducing artificial latency to these tap interfaces. I managed to do this using the following for actual interfaces like lo and eth0:
sudo tc qdisc add dev eth0 root netem delay 15ms
However, the above command does not seem to work with the tap interfaces. After I have executed it for one of the tap interfaces, nothing seems to have changed. The commend does not provide any output, so seems to find the interface alright and complete successfully. However, pinging e.g. 10.0.0.100 shows no change in latency.
Is there anything obvious I am missing? (Or am I approaching this completely in the wrong way?) Thank you!