Skip to content
Dennis Schwerdel edited this page Feb 14, 2014 · 3 revisions

Emulation Test

Test Topology

<topology name="dummynet_test">
	<device id="openvz1" pos="189,242" template="debian-6.0-standard_6.0-2_i386" type="openvz">
		<interface id="eth0" use_dhcp="true"/>
		<interface id="eth1" ip4address="10.1.1.1/24"/>
	</device>
	<device id="openvz2" pos="408,244" template="debian-6.0-standard_6.0-2_i386" type="openvz">
		<interface id="eth0" use_dhcp="true"/>
		<interface id="eth1" ip4address="10.1.1.2/24"/>
	</device>
	<connector id="switch1" pos="298,245" type="switch">
		<connection device="openvz1" interface="eth1"/>
		<connection device="openvz2" interface="eth1"/>
	</connector>
	<connector id="internet1" pos="303,109" type="real">
		<connection device="openvz1" interface="eth0"/>
		<connection device="openvz2" interface="eth0"/>
	</connector>
</topology>

Loss emulation

Commands

On the server:

iperf -u -s

On the client:

iperf -u -c IP -i 1 -t 60 -b 50M

Results

Configured loss Measured loss
0% 0%
0.125% 0.122%
0.25% 0.244%
0.5% 0.499%
1% 1.03%
2% 2.03%
5% 5.01%
10% 9.94%
20% 20.08%
40% 39.82%
80% 80.00%

Delay emulation

Commands

On the client:

ping IP -c 100

Note: The configured delay is half of the configured RTT

Results

Configured RTT Mean RTT StdDev
2000 ms 2000.001 ms 1.718 ms
1000 ms 1000.975 ms 0.532 ms
500 ms 499.942 ms 0.679 ms
200 ms 199.979 ms 0.278 ms
100 ms 99.942 ms 0.396 ms
50 ms 49.973 ms 0.311 ms
20 ms 19.975 ms 0.150 ms
10 ms 9.974 ms 0.132 ms
4 ms 3.978 ms 0.070 ms
2 ms 1.974 ms 0.078 ms
0 ms 0.394 ms 0.078 ms

Bandwidth emulation

Commands

iperf -u -s -i 1 -y c > data 
head -n 60 < data | cut -d, -f 9 > data2
./analyze.pl data2

On the client:

iperf -u -c 10.1.1.2 -t 60 -b 1000M -i 1

analyze.pl:

#!/usr/bin/env perl
use strict;
use warnings;
use Math::NumberCruncher;
my @data;
open (IN, "<", "$ARGV[0]") or die ("Cannot open $ARGV[0]: $!\n");
while (<IN>) {
  push @data, $1 if (/(\d+)/);
}
close (IN);
printf("Mean: %f\tMedian: %f\tStdDev: %f\n",
Math::NumberCruncher::Mean(\@data),
Math::NumberCruncher::Median(\@data),
Math::NumberCruncher::StandardDeviation(\@data));

Results

Note that TCP/IP can not reach the available bandwidth due to protocol overhead and StdDev of about 5 Kbits/sec is expected because of the packet size of 1470 bytes and the measurement interval of 1 second.

Configured Mean % StdDev
unlimited 476 Mbits/sec 21.3 Mbits/sec
100 Mbits/sec 98.4 Mbits/sec 98.4% 209.2 Kbits/sec
50 Mbits/sec 49.1 Mbits/sec 98.2% 40.0 Kbits/sec
20 Mbits/sec 19.6 Mbits/sec 98.0% 5.54 Kbits/sec
10 Mbits/sec 9.82 Mbits/sec 98.2% 5.87 Kbits/sec
5 Mbits/sec 4.91 Mbits/sec 98.2% 5.20 Kbits/sec
2 Mbits/sec 1.96 Mbits/sec 98.0% 3.53 Kbits/sec
1 Mbits/sec 982 Kbits/sec 98.2% 5.85 Kbits/sec
500 Kbits/sec 491 Kbits/sec 98.2% 5.20 Kbits/sec
200 Kbits/sec 196.4 Kbits/sec 98.2% 5.39 Kbits/sec
100 Kbits/sec 98.2 Kbits/sec 98.2% 5.61 Kbits/sec
50 Kbits/sec 49.1 Kbits/sec 98.2% 4.55 Kbits/sec
20 Kbits/sec 19.8 Kbits/sec 99% 5.47 Kbits/sec
10 Kbits/sec 10 Kbits/sec 100% 4.72 Kbits/sec