{
    "content": [
        {
            "type": "text",
            "text": "# tc-tbf (info)\n\n## NAME\n\ntbf - Token Bucket Filter\n\n## SYNOPSIS\n\ntc  qdisc ... tbf rate rate burst bytes/cell ( latency ms | limit bytes\n) [ mpu bytes [ peakrate rate mtu bytes/cell ] ]\nburst is also known as buffer and maxburst. mtu is also known  as  min-\nburst.\n\n## DESCRIPTION\n\nThe Token Bucket Filter is a classful queueing discipline available for\ntraffic control with the tc(8) command.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **ALGORITHM**\n- **PARAMETERS**\n- **SEE ALSO**\n- **AUTHOR**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "tc-tbf",
        "section": "",
        "mode": "info",
        "summary": "tbf - Token Bucket Filter",
        "synopsis": "tc  qdisc ... tbf rate rate burst bytes/cell ( latency ms | limit bytes\n) [ mpu bytes [ peakrate rate mtu bytes/cell ] ]\nburst is also known as buffer and maxburst. mtu is also known  as  min-\nburst.",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "tc",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/tc/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 14,
                "subsections": []
            },
            {
                "name": "ALGORITHM",
                "lines": 28,
                "subsections": []
            },
            {
                "name": "PARAMETERS",
                "lines": 70,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 4,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "tbf - Token Bucket Filter\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "tc  qdisc ... tbf rate rate burst bytes/cell ( latency ms | limit bytes\n) [ mpu bytes [ peakrate rate mtu bytes/cell ] ]\n\nburst is also known as buffer and maxburst. mtu is also known  as  min-\nburst.\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The Token Bucket Filter is a classful queueing discipline available for\ntraffic control with the tc(8) command.\n\nTBF is a pure shaper and never schedules traffic. It  is  non-work-con-\nserving and may throttle itself, although packets are available, to en-\nsure that the configured rate is not exceeded.  It is able to shape  up\nto 1mbit/s of normal traffic with ideal minimal burstiness, sending out\ndata exactly at the configured rates.\n\nMuch higher rates are possible but at the cost of  losing  the  minimal\nburstiness. In that case, data is on average dequeued at the configured\nrate but may be sent much faster at millisecond timescales. Because  of\nfurther queues living in network adaptors, this is often not a problem.\n",
                "subsections": []
            },
            "ALGORITHM": {
                "content": "As  the  name  implies, traffic is filtered based on the expenditure of\ntokens.  Tokens roughly correspond to bytes, with the  additional  con-\nstraint  that  each packet consumes some tokens, no matter how small it\nis. This reflects the fact that even a zero-sized packet  occupies  the\nlink for some time.\n\nOn  creation,  the  TBF  is stocked with tokens which correspond to the\namount of traffic that can be burst in  one  go.  Tokens  arrive  at  a\nsteady rate, until the bucket is full.\n\nIf  no  tokens  are  available,  packets are queued, up to a configured\nlimit. The TBF now calculates the token deficit,  and  throttles  until\nthe first packet in the queue can be sent.\n\nIf  it  is  not  acceptable  to  burst  out packets at maximum speed, a\npeakrate can be configured to limit the speed at which the bucket  emp-\nties.  This  peakrate  is implemented as a second TBF with a very small\nbucket, so that it doesn't burst.\n\nTo achieve perfection, the second bucket  may  contain  only  a  single\npacket, which leads to the earlier mentioned 1mbit/s limit.\n\nThis  limit is caused by the fact that the kernel can only throttle for\nat minimum 1 'jiffy', which depends on HZ as 1/HZ. For perfect shaping,\nonly  a  single  packet can get sent per jiffy - for HZ=100, this means\n100 packets of on average 1000 bytes each, which roughly corresponds to\n1mbit/s.\n",
                "subsections": []
            },
            "PARAMETERS": {
                "content": "See tc(8) for how to specify the units of these values.\n\nlimit or latency\nLimit  is the number of bytes that can be queued waiting for to-\nkens to become available. You can also specify  this  the  other\nway around by setting the latency parameter, which specifies the\nmaximum amount of time a packet can sit in the TBF.  The  latter\ncalculation  takes into account the size of the bucket, the rate\nand possibly the peakrate (if set). These two parameters are mu-\ntually exclusive.\n\nburst  Also known as buffer or maxburst.  Size of the bucket, in bytes.\nThis is the maximum amount of bytes that tokens can be available\nfor instantaneously.  In general, larger shaping rates require a\nlarger buffer. For 10mbit/s on Intel, you need at least  10kbyte\nbuffer if you want to reach your configured rate!\n\nIf your buffer is too small, packets may be dropped because more\ntokens arrive per timer tick than fit in your bucket.  The mini-\nmum buffer size can be calculated by dividing the rate by HZ.\n\nToken  usage  calculations  are performed using a table which by\ndefault has a resolution of 8 packets.  This resolution  can  be\nchanged by specifying the cell size with the burst. For example,\nto specify a 6000 byte buffer with a 16 byte cell  size,  set  a\nburst of 6000/16. You will probably never have to set this. Must\nbe an integral power of 2.\n\nmpu    A zero-sized packet does not use zero bandwidth.  For  ethernet,\nno  packet  uses less than 64 bytes. The Minimum Packet Unit de-\ntermines the minimal token usage  (specified  in  bytes)  for  a\npacket. Defaults to zero.\n\nrate   The  speed  knob.  See remarks above about limits! See tc(8) for\nunits.\n\nFurthermore, if a peakrate is desired,  the  following  parameters  are\navailable:\n\npeakrate\nMaximum depletion rate of the bucket. The peakrate does not need\nto be set, it is only necessary if perfect millisecond timescale\nshaping is required.\n\nmtu/minburst\nSpecifies the size of the peakrate bucket. For perfect accuracy,\nshould be set to the MTU of the interface.   If  a  peakrate  is\nneeded,  but  some  burstiness  is  acceptable, this size can be\nraised. A 3000 byte minburst allows around 3mbit/s of  peakrate,\ngiven 1000 byte packets.\n\nLike the regular burstsize you can also specify a cell size.\n\nEXAMPLE & USAGE\nTo  attach a TBF with a sustained maximum rate of 0.5mbit/s, a peakrate\nof 1.0mbit/s, a 5kilobyte buffer, with a pre-bucket  queue  size  limit\ncalculated  so  the  TBF  causes  at most 70ms of latency, with perfect\npeakrate behaviour, issue:\n\n# tc qdisc add dev eth0 handle 10: root tbf rate 0.5mbit \\\nburst 5kb latency 70ms peakrate 1mbit       \\\nminburst 1540\n\nTo attach an inner qdisc, for example sfq, issue:\n\n# tc qdisc add dev eth0 parent 10:1 handle 100: sfq\n\nWithout inner qdisc TBF queue acts as bfifo.  If  the  inner  qdisc  is\nchanged the limit/latency is not effective anymore.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "tc(8)\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Alexey N. Kuznetsov, <kuznet@ms2.inr.ac.ru>. This manpage maintained by\nbert hubert <ahu@ds9a.nl>\n\niproute2                       13 December 2001                          TC(8)",
                "subsections": []
            }
        }
    }
}