Commit 16059fee authored by Mike Hibler's avatar Mike Hibler
Browse files

Packet loss is specified as percentage (0-100) in netem, not a fraction.

parent 55877c93
......@@ -425,6 +425,10 @@ sub DelaySetup
$lp1 = $np1; $np1 += $pinc;
$lp2 = $np2; $np2 += $pinc;
# packet loss in netem is percent
$plr1 *= 100;
$plr2 *= 100;
# next, plr and delay on the link
push @upcmds,"$TC qdisc add dev $iface1 handle $np1 parent ${lp1}:1 netem drop $plr1 delay ${delay1}us";
push @upcmds,"$TC qdisc add dev $iface2 handle $np2 parent ${lp2}:1 netem drop $plr2 delay ${delay2}us";
......@@ -688,6 +692,9 @@ sub LinkDelaySetup()
}
}
else {
# packet loss in netem is percent
$plr *= 100;
#
# See comments in DelaySetup for why we have to reverse
# the normal shaping order for netem!
......@@ -738,6 +745,9 @@ sub LinkDelaySetup()
}
}
else {
# packet loss in netem is percent
$rplr *= 100;
print DEL "$TC qdisc add dev $imqdev handle ";
print DEL "". ($pipeno+20) ." root ";
print DEL "htb default 1\n";
......
#!/usr/bin/perl -wT
#
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -425,6 +425,10 @@ sub DelaySetup
$lp1 = $np1; $np1 += $pinc;
$lp2 = $np2; $np2 += $pinc;
# packet loss in netem is percent
$plr1 *= 100;
$plr2 *= 100;
# next, plr and delay on the link
push @upcmds,"$TC qdisc add dev $iface1 handle $np1 parent $lp1:1 netem drop $plr1 delay ${delay1}us";
push @upcmds,"$TC qdisc add dev $iface2 handle $np2 parent $lp2:1 netem drop $plr2 delay ${delay2}us";
......@@ -688,6 +692,9 @@ sub LinkDelaySetup()
}
}
else {
# packet loss in netem is percent
$plr *= 100;
#
# See comments in DelaySetup for why we have to reverse
# the normal shaping order for netem!
......@@ -738,6 +745,9 @@ sub LinkDelaySetup()
}
}
else {
# packet loss in netem is percent
$rplr *= 100;
print DEL "$TC qdisc add dev $imqdev handle ";
print DEL "". ($pipeno+20) ." root ";
print DEL "htb default 1\n";
......
......@@ -330,6 +330,9 @@ sub LinkDelaySetup()
# our home grown stuff on newer kernels.
#
if ($useifb) {
# packet loss in netem is percent
$plr *= 100;
print DEL "ifconfig $iface txqueuelen $queue\n";
print DEL "$TC qdisc del dev $iface root\n";
print DEL "$TC qdisc del dev $iface ingress\n";
......@@ -367,6 +370,9 @@ sub LinkDelaySetup()
my $idev = ($useifb ? "ifb" : "imq") . "$inum";
if ($type eq "duplex") {
if ($useifb) {
# packet loss in netem is percent
$rplr *= 100;
print DEL "ifconfig $idev up\n";
print DEL "$TC qdisc del dev $idev root\n";
print DEL "$TC qdisc add dev $iface handle ffff: ingress\n";
......
......@@ -2766,6 +2766,10 @@ sub createExpNetworkScript($$$$$$$)
my @cmds = ();
if ($xeninfo{xen_major} >= 4) {
# packet loss in netem is percent
$plr *= 100;
$rplr *= 100;
push(@cmds,
"$TC qdisc add dev $iface handle $pipe20 root htb default 1");
if ($bandw != 0) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment