HTB question, tokens.

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

What exactly are the "tokens"? 

I thought each token allowed the sending of one byte, that tokens are
stored in a bucket that can hold a max of "burst" tokens, and that this
bucket is filled with tokens at "rate".

But theory does not seem to explain the "tc -s .." output in the
examples below. And I can't figure out why or how...

#tc qdisc del dev eth0 root
#tc qdisc add dev eth0 root handle 1: htb default 1 
#tc class add dev eth0 parent 1:0 classid 1:1 htb rate 2mbit
#tc -s -d class show dev eth0
class htb 1:1 root prio 0 quantum 25000 rate 2000Kbit ceil 2000Kbit burst 2599b/8 mpu 0b overhead 0b cburst 2599b/8 mpu 0b overhead 0b level 0 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 rate 0bit 0pps backlog 0b 0p requeues 0 
 lended: 0 borrowed: 0 giants: 0
 tokens: 10649 ctokens: 10649

#tc qdisc del dev eth0 root
#tc qdisc add dev eth0 root handle 1: htb default 1 
#tc class add dev eth0 parent 1:0 classid 1:1 htb rate 1mbit
#tc -s -d class show dev eth0
class htb 1:1 root prio 0 quantum 12500 rate 1000Kbit ceil 1000Kbit burst 2099b/8 mpu 0b overhead 0b cburst 2099b/8 mpu 0b overhead 0b level 0 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 rate 0bit 0pps backlog 0b 0p requeues 0 
 lended: 0 borrowed: 0 giants: 0
 tokens: 17203 ctokens: 17203

Why do the amount of tokens go UP if the configured rate (and burst) is
lower?
(The commands where run from a script so these amounts of tokens
available right after the creation of the class.)

If I set the rate to 9mbit the amount of tokens is always lower then the
burst size. Wouldn't that mean that there are always too few tokens
available to actually burst the "burst" amount of data?

Regards,
Mark.


_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux