[LARTC] Token Bucket: how does it really work?

Linux Advanced Routing and Traffic Control

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

 



Hello!

I would like to know, how  the Token Bucket filter really works.

An example:
 r = 10 Kbyte/sec
 b = 10 Kbyte
I send 0.5 sec with 5 Kbyte/sec (A-> 2,5 Kbyte) and
0.5 sec with 15 Kbyte/sec (B-> 7,5 Kbyte), and
0.5 sec with 10 Kbyte/sec (C-> 5 Kbyte)
after each other: ABCABCABC... and it goes through the tbf.

What will happen?
 1. All A phase will be sent from the tbf with 5 Kbyte/sec,
     all B phase with 15 Kbyte/sec, and all C phase with 10 Kbyte/sec
     without delay. => The sending rate really change and exceed the
    average rate (10Kbyte/sec) by the B phases.
 2.  0.0 : sending begins
      0.5 : first A phase sent
      1.0 : first 5Kbyte sent from B
      1.25: remained 2,5 Kbyte sent from B
      1.75: first C phase sent
      2.0: second A phase sent
       and so on => B and C was delayed, but sent continuously
 3.  0.0 : sending begins
      0.5 : first A phase sent
      1.0 : first 5 Kbyte sent from B
      1.5:  first C phase sent
      1.75:second A phase sent
       2.0: remained 2,5 Kbyte sent from B
       and so on  -> here I mean that the traffic,
       which couldn't be sent in time, will be sent
       only then, when there is enough bandwidth
       for it => B was delayed and cutted in two
       parts, but A and C was sent in time.
Which is the valid case? If none of them, than how
would it happen?
If the first case is valid, what does happen in the case
of more tbf  and all of them wants to exceed the average
rate, but the sum of the rates would be more than the
availablebandwidth?
Or it can't happen, because at an admission control
for the tbf would be reserved a peak rate (like everybody
want to send in the same time with peak rate), and if
there is no more place for a next tbf, it would be
rejected?
(How is tbf implemented? Where can I find it?)

I hope I was clear, if not please ask back!

Greetings,

Peter



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