From 5c88da7d5516565df2eeedd74d067517da5d81e5 Mon Sep 17 00:00:00 2001 From: Bert Hubert Date: Sat, 8 Dec 2001 15:32:33 +0000 Subject: [PATCH] yeah! --- manpages/Makefile | 2 +- manpages/tc-sfq.8 | 2 +- manpages/tc-tbf.8 | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 119 insertions(+), 2 deletions(-) create mode 100644 manpages/tc-tbf.8 diff --git a/manpages/Makefile b/manpages/Makefile index b6eef6a..b1159db 100644 --- a/manpages/Makefile +++ b/manpages/Makefile @@ -1,7 +1,7 @@ all: tc.txt tc.dvi tc.pdf tc.ps tc.ps.gz clean: - rm *.txt *.dvi *.pdf *.ps *.ps.gz + rm *.txt *.dvi *.pdf *.ps *.ps.gz *~ %.txt: %.8 groff -man -Tascii -P-u -P-b ./$< > $@ diff --git a/manpages/tc-sfq.8 b/manpages/tc-sfq.8 index a6f5076..8c4654d 100644 --- a/manpages/tc-sfq.8 +++ b/manpages/tc-sfq.8 @@ -63,7 +63,7 @@ Defaults to the MTU of the interface which is also the advised value and the min To attach to device ppp0: .P -# tc qdisc add dev ppp0 root perturb 10 +# tc qdisc add dev ppp0 root sfq perturb 10 .P Please note that SFQ, like all non-shaping SFQs, is only useful if it owns the queue. This is the case when the link speed equals the actually available bandwidth. This holds diff --git a/manpages/tc-tbf.8 b/manpages/tc-tbf.8 new file mode 100644 index 0000000..912f17a --- /dev/null +++ b/manpages/tc-tbf.8 @@ -0,0 +1,117 @@ +.TH TC 8 "8 December 2001" "iproute2" "Linux" +.SH NAME +sfq \- Token Bucket Filter +.SH SYNOPSIS +.B tc qdisc ... perturb +seconds +.B quantum +bytes + +.SH DESCRIPTION + +The Token Bucket Filter is a classless queueing discipline available for +traffic control with the +.BR tc (8) +command. + +TBF is a pure shaper and never reorders traffic. On all platforms except for Alpha, +it is able to shape up to 1mbit/s of normal traffic with ideal minimal burstiness, +sending out data exactly at the configured rates. + +Much higher rates are possible but at the cost of losing the minimal burstiness. In that +case, data is on average dequeued at the configured rate but may be sent much faster at millisecond +timescales. Because of further queues living in network adaptors, this is often not a problem. + +Kernels with a higher 'HZ' can achieve higher rates with perfect burstiness. On Alpha, HZ is ten +times higher, leading to a 10mbit/s limit to perfection. These calculations hold for packets of on +average 1000 bytes. + +.SH ALGORITHM +As the name implies, traffic is filtered based on the expenditure of +.B tokens. +Tokens roughly correspond to bytes, with the additional constraint that each packet consumes +some tokens, no matter how small it is. This reflects the fact that even a zero-sized packet occupies +the link for some time. + +On creation, the TBF is stocked with tokens which correspond to the amount of traffic that can be burst +in one go. Tokens arrive at a steady rate, until the bucket is full. + +If no tokens are available, packets are queued, up to a configured limit. The TBF now +calculates the token deficit, and throttles until the first packet in the queue can get sent. + +If it is not acceptable to burst out packets at maximum speed, a peakrate can be configured +to limit the speed at which the bucket empties. This peakrate is implemented as a second TBF +with a very small bucket, so that it doesn't burst. + +To achieve perfection, the second bucket may contain only a single packet, which leads to +the earlier mentioned 1mbit/s limit. + +This limit is caused by the fact that the kernel can only throttle for at mininum 1 'jiffy', which depends +on HZ as 1/HZ. For perfect shaping, only a single packet can get sent per jiffy - for HZ=100, this means 100 +packets of on average 1000 bytes each, which roughly corresponds to 1mbit/s. + +.SH PARAMETERS +.TP +limit or latency +Limit is the number of bytes that can be queued waiting for tokens to become available. You can also specify this +the other way around by setting the latency parameter, which specifies the maximum amount of time a packet can sit +in the TBF. The latter calculation takes into account the size of the bucket, the rate and possibly the peakrate (if set). + +These two parameters are mutually exclusive. +.TP +burst (also known as buffer or maxburst). +Size of the bucket, in bytes. This is the maximum amount of bytes that tokens can be available for instantaneously. +In general, larger shaping rates require a larger buffer. For 10mbit/s on Intel, you need at least 10kbyte buffer +if you want to reach your configured rate! + +If your buffer is too small, packets may be dropped because more tokens arrive per timer tick than fit in your bucket. +The minimum buffer size can be calculated by dividing the rate by HZ. + +Token usage calculations are performed using a table which by default has a resolution of 8 packets. +This resolution can be changed by specifying the +.B +cell +size with the burst. For example, to specify a 6000 byte buffer with a 16 byte cell size, set a burst of 6000/16. You will +probably never have to set this. Must be an integral power of 2. +.TP +mpu +A zero-sized packet does not use zero bandwidth. For ethernet, no packet uses less than 64 bytes. The Minimum Packet Unit +determines the minimal token usage for a packet. Defaults to zero. +.TP +rate +The speedknob. See remarks above about limits! +.P +Furthermore, if a peakrate is desired, the following parameters are available: + +.TP +peakrate +Maximum depletion rate of the bucket. Limited to 1mbit/s on Intel, 10mbit/s on Alpha. The peakrate does +not need to be set, it is only necessary if perfect millisecond timescale shaping is required. + +.TP +mtu/minburst +Specifies the size of the peakrate bucket. For perfect accuracy, should be set to the MTU of the interface. +If a peakrate is needed, but some burstiness is acceptable, this size can be raised. A 3000 byte minburst +allows around 3mbit/s of peakrate, given 1000 byte packets. + +Like the regular burstsize you can also specify a +.B cell +size. +.SH EXAMPLE & USAGE + +To attach a TBF with a sustained maximum rate of 0.5mbit/s, a peakrate of 1.0mbit/s, +a 5kilobyte buffer, with a pre-bucket queuesize limit calculted so the TBF causes +at most 70ms of latency, with perfect peakrate behaviour, issue: +.P +# tc qdisc add dev eth0 root tbf rate 0.5mbit \\ + burst 5kb latency 70ms peakrate 1mbit \\ + minburst 1540 + +.SH SEE ALSO +.BR tc (8) + +.SH AUTHOR +Alexey N. Kuznetsov, . This manpage maintained by +bert hubert + + -- 2.11.4.GIT