{
    "mode": "man",
    "parameter": "CBS",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/CBS/8/json",
    "generated": "2026-10-06T12:41:37Z",
    "synopsis": "tc qdisc ... dev dev parent classid [ handle major: ] cbs idleslope idleslope sendslope send‐\nslope hicredit hicredit locredit locredit [ offload 0|1 ]",
    "sections": {
        "NAME": {
            "content": "CBS - Credit Based Shaper (CBS) Qdisc\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "tc qdisc ... dev dev parent classid [ handle major: ] cbs idleslope idleslope sendslope send‐\nslope hicredit hicredit locredit locredit [ offload 0|1 ]\n\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The  CBS  (Credit  Based  Shaper)  qdisc implements the shaping algorithm defined by the IEEE\n802.1Q-2014 Section 8.6.8.2, which applies a well defined rate limiting method to  the  traf‐\nfic.\n\nThis  queueing  discipline is intended to be used by TSN (Time Sensitive Networking) applica‐\ntions, the CBS parameters are derived directly by what is described by the  Annex  L  of  the\nIEEE  802.1Q-2014  Specification.  The  algorithm and how it affects the latency are detailed\nthere.\n\nCBS is meant to be installed under another qdisc that maps packet flows to  traffic  classes,\none example is mqprio(8).\n\n",
            "subsections": []
        },
        "PARAMETERS": {
            "content": "idleslope\nIdleslope  is  the  rate  of credits that is accumulated (in kilobits per second) when\nthere is at least one packet waiting for transmission.  Packets are  transmitted  when\nthe current value of credits is equal or greater than zero. When there is no packet to\nbe  transmitted  the amount of credits is set to zero. This is the main tunable of the\nCBS algorithm and represents the bandwidth that will be consumed.  Note that when cal‐\nculating idleslope, the entire packet size must be considered, including headers  from\nall  layers  (i.e. MAC framing and any overhead from the physical layer), as described\nby IEEE 802.1Q-2014 section 34.4.\n\nAs an example, for an ethernet frame carrying 284 bytes of payload, and with  no  VLAN\ntags,  you must add 14 bytes for the Ethernet headers, 4 bytes for the Frame check se‐\nquence (CRC), and 20 bytes for the L1 overhead: 12 bytes of interpacket gap,  7  bytes\nof  preamble and 1 byte of start of frame delimiter. That results in 322 bytes for the\ntotal packet size, which is then used for calculating the idleslope.\n\n\nsendslope\nSendslope is the rate of credits that is depleted (it should be a negative  number  of\nkilobits  per  second)  when a transmission is occurring. It can be calculated as fol‐\nlows, (IEEE 802.1Q-2014 Section 8.6.8.2 item g):\n\nsendslope = idleslope - porttransmitrate\n\n\nhicredit\nHicredit defines the maximum amount of credits (in bytes) that can be accumulated. Hi‐\ncredit depends on the characteristics of interfering traffic,  'maxinterferencesize'\nis the maximum size of any burst of traffic that can delay the transmission of a frame\nthat  is available for transmission for this traffic class, (IEEE 802.1Q-2014 Annex L,\nEquation L-3):\n\nhicredit = maxinterferencesize * (idleslope / porttransmitrate)\n\n\nlocredit\nLocredit is the minimum amount of credits that can be reached. It is a function of the\ntraffic flowing through this qdisc (IEEE 802.1Q-2014 Annex L, Equation L-2):\n\nlocredit = maxframesize * (sendslope / porttransmitrate)\n\n\noffload\nWhen offload is 1, cbs(8) will try to configure the network interface so the CBS algo‐\nrithm runs in the controller. The default is 0.\n\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "CBS is used to enforce a Quality of Service by limiting the data rate of a traffic class,  to\nseparate  packets  into  traffic classes the user may choose mqprio(8), and configure it like\nthis:\n\n# tc qdisc add dev eth0 handle 100: parent root mqprio numtc 3 \\\nmap 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \\\nqueues 1@0 1@1 2@2 \\\nhw 0\n\nTo replace the current queuing disciple by CBS in the current queueing  discipline  connected\nto traffic class number 0, issue:\n\n# tc qdisc replace dev eth0 parent 100:4 cbs \\\nlocredit -1470 hicredit 30 sendslope -980000 idleslope 20000\n\nThese values are obtained from the following parameters, idleslope is 20mbit/s, the transmis‐\nsion rate is 1Gbit/s and the maximum interfering frame size is 1500 bytes.\n\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Vinicius Costa Gomes <vinicius.gomes@intel.com>\n\niproute2                                    18 Sept 2017                                      CBS(8)",
            "subsections": []
        }
    },
    "summary": "CBS - Credit Based Shaper (CBS) Qdisc",
    "flags": [],
    "examples": [
        "CBS is used to enforce a Quality of Service by limiting the data rate of a traffic class,  to",
        "separate  packets  into  traffic classes the user may choose mqprio(8), and configure it like",
        "this:",
        "# tc qdisc add dev eth0 handle 100: parent root mqprio numtc 3 \\",
        "map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \\",
        "queues 1@0 1@1 2@2 \\",
        "hw 0",
        "To replace the current queuing disciple by CBS in the current queueing  discipline  connected",
        "to traffic class number 0, issue:",
        "# tc qdisc replace dev eth0 parent 100:4 cbs \\",
        "locredit -1470 hicredit 30 sendslope -980000 idleslope 20000",
        "These values are obtained from the following parameters, idleslope is 20mbit/s, the transmis‐",
        "sion rate is 1Gbit/s and the maximum interfering frame size is 1500 bytes."
    ],
    "see_also": []
}