diff options
Diffstat (limited to 'lib/Vyatta/Qos/Util.pm')
-rw-r--r-- | lib/Vyatta/Qos/Util.pm | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/lib/Vyatta/Qos/Util.pm b/lib/Vyatta/Qos/Util.pm index ee1b722..7f5454d 100644 --- a/lib/Vyatta/Qos/Util.pm +++ b/lib/Vyatta/Qos/Util.pm @@ -21,7 +21,7 @@ use warnings; our @EXPORT = qw(getRate getPercent getBurstSize getProtocol getDsfield getTime getAutoRate); -our @EXPORT_OK = qw(getIfIndex RedParam); +our @EXPORT_OK = qw(getIfIndex); use base qw(Exporter); sub get_num { @@ -319,26 +319,4 @@ sub ethtoolRate { return $rate; } -# Compute parameters for RED algorithim based on bandwidth and latency -# -# 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 RedParam { - my ( $bandwidth, $latency, $avgpkt ) = @_; - my $qmax = ( $bandwidth * $latency ) / 8000000; - my $qmin = $qmax / 3; - my $burst = ( 2 * $qmin + $qmax ) / ( 3 * $avgpkt ); - - return ($qmin, $qmax, $burst, 0.1); -} - 1; |