diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-05-23 08:57:19 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-05-23 15:19:54 -0700 |
commit | 87794a3d5ddb55af9cc298ec97b2892918e657d4 (patch) | |
tree | da72c22470325ba2b891350e7c435a0bad2a2960 /lib/Vyatta/Qos/ShaperClass.pm | |
parent | a7ec99d913b0169b987a4ebdf2d26a36670b20bb (diff) | |
download | vyatta-cfg-qos-87794a3d5ddb55af9cc298ec97b2892918e657d4.tar.gz vyatta-cfg-qos-87794a3d5ddb55af9cc298ec97b2892918e657d4.zip |
Reimplementation of WRED
Make a simpler version of WRED that acts more like Cisco.
Use Diffserv on Linux paper for example of how to use DSMARK and GRED
to achieve similar result.
Diffstat (limited to 'lib/Vyatta/Qos/ShaperClass.pm')
-rw-r--r-- | lib/Vyatta/Qos/ShaperClass.pm | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/lib/Vyatta/Qos/ShaperClass.pm b/lib/Vyatta/Qos/ShaperClass.pm index c3fae16..4e0ada1 100644 --- a/lib/Vyatta/Qos/ShaperClass.pm +++ b/lib/Vyatta/Qos/ShaperClass.pm @@ -21,7 +21,7 @@ use warnings; require Vyatta::Config; use Vyatta::Qos::Match; -use Vyatta::Qos::Util qw/getDsfield getRate RedParam/; +use Vyatta::Qos::Util qw/getDsfield getRate/; sub new { @@ -153,11 +153,27 @@ sub fifoQdisc { # make some assumptions to make this sane (based on LARTC) # average size = 1000 bytes # latency = 100ms +# +# Bandwidth (bits/sec) * Latency (ms) +# Maximum Threshold = -------------------------------------- +# (bytes) 8 bits/byte * 1000000 us/sec +# +# Minimum Threshold = Maximum Threshold / 3 +# Avpkt = Average Packet Length +# Burst = ( 2 * MinThreshold + MaxThreshold) / ( 3 * Avpkt ) +# Limit = 4 * MaxThreshold +# +# These are based on Sally Floyd's recommendations: +# http://www.icir.org/floyd/REDparameters.txt +# sub redQdisc { my ( $self, $dev, $rate ) = @_; my $avg = 1000; my $latency = 100000; - my ($qmin, $qmax, $burst, $maxp) = RedParam($rate, $latency, $avg); + my $qmax = ( $rate * $latency ) / 8000000; + my $qmin = $qmax / 3; + my $burst = ( 2 * $qmin + $qmax ) / ( 3 * $avg ); + my $maxp = 0.1; my $limit = $self->{_limit}; my $qlimit; @@ -169,7 +185,7 @@ sub redQdisc { printf "red limit %d min %d max %d avpkt %d", $qlimit, $qmin, $qmax, $avg; printf " burst %d probability %f bandwidth %d ecn\n", - $prob, $burst, $maxp, $rate / 1000; + $burst, $maxp, $rate / 1000; } my %qdiscOptions = ( |