Skip to main content

IEEE 802.1Qav CBS: the credit-based shaper

· 6 min read
PhD candidate, LyRIDS (ECE) × CEDRIC (Cnam)

The credit-based shaper (CBS) is the oldest TSN shaper. It comes from Audio Video Bridging (AVB). It needs no clock, only a counter per queue, and it turns bursts into an even flow of frames.

The IEEE 802.1Q bridge: architecture and data-plane actionsIEEE 802.1Q bridge ↗Control planeSRP (Qat), TSN configuration (Qcc), path control (Qca)frame inframe outIngressPSFP (Qci)FRER (CB)Relayforwardingexplicit treesQueuingCBS (Qav)ATS (Qcr)Tx selectiongates (Qbv)CQF (Qch)MAC / PHYpreemption(Qbu, 802.3br)Common time: gPTP (802.1AS)
Figure 1. Where the credit-based shaper acts: it is a transmission selection algorithm attached to a traffic-class queue of an 802.1Q egress port. The queues, the relay and the MAC are unchanged.Source: own drawing, after the bridge architecture, data-plane actions and QoS function chain in J. Farkas, TSN Basic Concepts, DetNet–TSN workshop, 11 November 2018, slides 7, 8 and 10.
Abbreviations used in this post (6)
AbbreviationStands forMeaning
ATSAsynchronous Traffic ShapingIEEE 802.1Qcr: per-stream token-bucket shaping at every hop using local clocks only.
AVBAudio Video BridgingThe predecessor of TSN: gPTP, the credit-based shaper and stream reservation, combined for audio and video (profile: IEEE 802.1BA).
CBSCredit-Based ShaperThe IEEE 802.1Qav shaper that limits a traffic class to its reserved rate (idleSlope) with a per-queue credit. In MEF bandwidth profiles, CBS instead means Committed Burst Size.
IEEEInstitute of Electrical and Electronics EngineersThe professional association whose Standards Association publishes the IEEE 802 LAN/MAN standards.
MACMedium Access ControlThe lower sublayer of the data link layer, which frames data and controls access to the medium. A MAC address identifies a network interface.
TSNTime-Sensitive NetworkingThe set of IEEE 802.1 standards that give Ethernet bounded latency, time synchronisation and high reliability.

1. Definition​

The credit-based shaper is a transmission selection algorithm for one traffic-class queue of an egress port. It was introduced by IEEE 802.1Qav and is now part of IEEE 802.1Q. Each shaped queue keeps a credit, counted in bits. A frame of that queue may start transmission only while the credit is zero or positive [2][3].

The credit changes according to two slopes:

ParameterMeaning
idleSlopeRate at which credit grows while frames are waiting. It equals the bandwidth reserved for the class.
sendSlopeRate at which credit falls during a transmission: idleSlope − portTransmitRate, which is negative.
hiCredit, loCreditThe largest and smallest values the credit can reach. They follow from the interfering frame sizes and the slopes.

2. The credit rules​

Credit of the credit-based shaper rising with idleSlope while frames wait and falling with sendSlope while they are sent, with the queue depth and the transmitted frames below
Figure 2. Credit of the credit-based shaper. While interfering traffic is sent, the credit of the waiting AVB queue rises with idleSlope. Each AVB frame then lowers it with sendSlope. A frame is held while the credit is negative (red background) and released when it returns to zero.Source: Traffic-shaping.svg by Michael Johas Teener (Mikejt), from the Wikipedia article “Time-Sensitive Networking”, Wikimedia Commons, CC BY-SA 3.0.

Figure 2 follows these rules:

  1. Frames waiting, not transmitting: the credit increases at idleSlope. This happens when the queue is blocked by another frame or by a higher-priority queue.
  2. Transmitting: the credit decreases at sendSlope.
  3. Queue empty with positive credit: the credit is reset to zero. A queue cannot save credit while it has nothing to send.
  4. Queue empty with negative credit: the credit rises at idleSlope back to zero.

Over a long interval the class therefore never uses more than idleSlope. Within a short interval it can send a burst only to the extent that it was held back before. That burst is bounded by hiCredit.

3. The AVB setting​

Two AVB domains made of AVB bridges and end points; a path that crosses a non-AVB bridge cannot carry a reserved stream
Figure 3. AVB domains. Reserved streams can only be carried along paths in which every bridge supports AVB. Boundary ports filter or re-tag the priority of reserved traffic so that it cannot leak into or out of the domain.Source: AVB-Ethernet-connections.svg by Michael Johas Teener (Mikejt), converted from PDF and cleaned up by Johannes Rössel, from the Wikipedia article “Time-Sensitive Networking”, Wikimedia Commons, CC BY-SA 3.0.

AVB defines two shaped stream reservation classes [2]:

ClassObservation intervalTarget worst-case latency
A125 µs2 ms over 7 hops
B250 µs50 ms over 7 hops

Together, the reserved classes may use at most 75 % of the link bandwidth [2]. The idleSlope of each class is the sum of the bandwidths reserved by the stream reservation protocol, described in the stream reservation post. Figure 3 shows why a reservation needs every bridge on the path: a single non-AVB bridge breaks the guarantee [2].

4. Worst-case latency​

In network calculus terms, a CBS queue offers a rate-latency service with rate idleSlope. Its latency term grows with the largest frame of lower priority, which may already be on the wire, and with the bursts of higher classes. The TSN shapers post gives the service curve and its residual for lower classes.

A 2026 tutorial on decentralised latency models adds several points that matter in practice [4]:

  • The 802.1BA formula is not a bound. The example latency formula of the AVB profile was shown to be inaccurate. The tutorial derives a network calculus model with formal proofs instead.
  • CBS shapes classes, not streams. One shaper instance serves the aggregate of all streams in the class. Aggregation adds latency jitter, so the effective burstiness of each stream grows from hop to hop despite the shaping.
  • CBS does not fit a clean shaper-to-shaper split. Its credit reset depends on whether other frames of the class are still waiting. The shaping step therefore includes queuing and transmission, and each CBS bridge must compute its own queuing delay. With the other shapers studied, the downstream bridge computes the queuing delay of the upstream one. The ATS post shows that split.
  • It works best when the egress slope covers the ingress slopes. CBS performs very well when the idleSlope of an egress port is at least the sum of the idleSlopes feeding it. When that ratio falls below 1, which happened in almost all of the industrial topologies tested, performance degrades quickly. There, plain strict priority with a network calculus bound was the better choice [4].

A review of industrial IoT networking places CBS between the other shapers. CBS fits traffic that is regular but occasionally bursty. Scheduled traffic fits regular, critical traffic. Asynchronous shaping fits sporadic critical events [5].

5. Summary​

PropertyCredit-Based Shaper
StandardIEEE 802.1Qav, now in IEEE 802.1Q
Acts onOne traffic-class queue at an egress port
StateOne credit per shaped queue
Needs time synchronisationNo
GranularityPer class; all streams of the class share the shaper
Main parameteridleSlope, the reserved rate

References​

  1. IEEE 802.1, Time-Sensitive Networking (TSN) Task Group. Web page
  2. Wikipedia, "Time-Sensitive Networking," sections on AVB, stream reservation and the credit-based shaper; "Audio Video Bridging." TSN, AVB
  3. J. Farkas, "TSN Basic Concepts," DetNet–TSN workshop, 11 November 2018. Slides
  4. A. Grigorjew, S. Geissler, J. Schmitt, T. Hossfeld, "Decentralized Latency Models and Information Flow for TSN Shapers – A Tutorial," arXiv:2610.11999, 2026, Sections VI-E, VII-F and VIII. arXiv
  5. I. Behnke, H. Austad, "Real-Time Performance of Industrial IoT Communication Technologies: A Review," arXiv:2311.08852, 2023, Section III-D. arXiv