Jan 7, 2020 Deepanshi Zood
Audio Video Bridging & Credit Based Traffic Shaping

Switched Ethernet

Undoubtedly, Switched Ethernet is extensively used for all kind of services and applications. However, for distributed multimedia streaming services in a fully-loaded network, legacy Ethernet cannot be the best solution due to its restricted Quality-of-Service (QoS) support. Ideally, the network should be able to meet the requirements of different applications so that switched ethernet could be used in other fields as well, for instance, aeronautics or in-vehicle networks.

 

Audio/Video Bridging

Here we come, Audio/Video Bridging group added many IEEE standards to enhance the QoS requirements of network. The specification of the IEEE 802.1 Audio/Video Bridging (AVB), an extension to legacy Ethernet, offers the QoS needed for multimedia streaming i.e. Time synchronized low latency streaming and bandwidth reservation on Layer-2. Audio Video Bridging (AVB) is a general name for the set of technical standards first advanced with the aid of the Institute of Electrical and Electronics Engineers (IEEE) Audio Video Bridging task group of the IEEE 802.1 requirements committee, which give stepped forward synchronization, low-latency, and reliability for switched Ethernet networks.

AVB incorporate the following technology and requirements:

  • IEEE 802.1AS-2011: Timing and Synchronization for Time-Sensitive Applications (PTP);
  • IEEE 802.1Qav-2009: Forwarding and Queuing for Time-Sensitive Streams (FQTSS);
  • IEEE 802.1Qat-2010: Stream Reservation Protocol (SRP);
  • IEEE 802.1BA-2011: Audio Video Bridging (AVB) Systems;
  • IEEE 1722-2011 Layer 2 Transport Protocol for Time Sensitive Applications (AV Transport Protocol, AVTP);
  • IEEE 1722.1-2013 Device Discovery, Enumeration, Connection Management and Control Protocol (AVDECC).

 

AVB is implemented as a switched Ethernet network which works by reserving a fraction of the Ethernet for AV traffic. There are three primary differences added via the AVB structure:

  • Precise synchronization using Precision Time Protocol (PTP) profile (IEEE 802.1AS),
  • Traffic shaping for AV streams using frame priorities (IEEE 802.1Qav) and
  • VLAN tags (IEEE 802.1Q), and Admission controls with Stream Reservation Protocol (IEEE 802.1Qat).

Credit Based Shaper Selection:

The intention of the Credit-Based Shaper is to ensure provision of the most required bandwidth for an audio/video transmission over a time sequence, without a significant interruption of the Best Effort records visitors that is simultaneously transmitted.

 

The credit- based shaper (CBS) transmission selection algorithm select AVB frames for the transmission. The algorithm defines credits associated to each of the SR classes (Class-A, Class-B) where a transmission is only allowed when the credits given in bits are greater or equal than zero and no other frames are transmitted at the same time, which means no conflicting frames.

 

In this case, an AVB frame is dequeued and transmitted where the credits are decreased at a rate of a sendSlope. In the other case, the credits are increased at a rate of idleSlope and a frame from the SR-Class is not transmitted. The algorithm limits the maximum and minimum number of credits that can be accumulated by using the parameters hiCredit and loCredit.

Figure above shows an example which describes the operation of a CBS algorithm.

 

In a first step, a single AVB frame (“Frame-A”) arrives and is queued due to conflicting frames.

  • The credits are increased by a rate of idleSlope and the frame is selected for the own transmission as soon as the previous transmission is finished.
  • The credits are decreased by a rate of send-Slope when the frame is transmitted.
  • The credits are set to zero when no frames exist for transmission for a given SR-Class queue so that the algorithm has to wait for the next transmission.

 

In a next step another AVB frame (“Frame-B”) arrives and it is transmitted immediately due to the credit values (≥0) and no conflicting frames.

  • The credits are decreased by a rate of sendSlope and they are increased by idleSlope after the complete transmission.
  • Furthermore, there is a fixed interval time where an AVB frame is transmitted depending on the AVB streaming class (A, B).
  • The interval for an AVB SR-Class A frame is 125μs while it is 250μs in case of an AVB SR-Class B frame.

 

idleslope:

Idleslope is the rate of credits that is accumulated (in kilobits per second) when there is at least one packet waiting for transmission. Packets are transmitted when the current value of credits is equal or greater than zero. When there is no packet to be transmitted the amount of credits is set to zero. This is the main tunnable of the CBS algorithm and represents the bandwidth that will be consumed.

When calculating idleslope, the entire packet size must be considered, including headers from all layers i.e. MAC framing and any overhead from the physical layer, as described by IEEE 802.1Q-2014 section 34.4.

For example, an ethernet frame carrying 284 bytes of payload, and with no VLAN tags, you must add

  • 14 bytes for the Ethernet headers,
  • 4 bytes for the Frame check sequence (CRC), and
  • 20 bytes for the L1 overhead i.e.
    • 12 bytes of interpacket gap,
    • 7 bytes of preamble and
    • 1 byte of start of frame delimiter.

That results in 322 bytes for the total packet size, which is then used for calculating the idleslope.

 

sendslope:

Sendslope is the rate of credits that is depleted (it should be a negative number of kilobits per second) when a transmission is occurring. It is calculated as follows:

                        sendslope = idleslope - port_transmit_rate

 

hicredit:

Hicredit defines the maximum amount of credits (in bytes) that can be accumulated. Hicredit depends on

the characteristics of interfering traffic, 'max_interference_size' is the maximum size of any burst of traffic that can delay the transmission of a frame that is available for transmission for this traffic class:

                        hicredit = max_interference_size * (idleslope / port_transmit_rate)

 

locredit:

Locredit is the minimum amount of credits that can be reached. It is a function of the traffic flowing through this qdisc:

                        locredit = max_frame_size * (sendslope / port_transmit_rate)

 

offload:

When offload is 1, cbs(8) will try to configure the network interface so the CBS algorithm runs in the controller. The default is 0.

 

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 when following parameters are used

  • idleslope is 20mbit/s,
  • the transmission rate is 1Gbit/s and
  • the maximum interfering frame size is 1500 bytes.

To replace the current queuing disciple by CBS in the current queueing discipline connected to traffic class number 0, issue: