How ST 2110-20 bandwidth is actually calculated

Written against Calculator v1.5.1 · Updated against Calculator v1.6.0

Some background

When I first started working with ST 2110 I did what many people probably do. I Googled ST 2110 bandwidth calculator. I came across vibe-coded calculators and some methods that essentially added a multiplier on top of the data rate of a frame. Both options work as quick rule-of-thumb but I wanted the confidence that I was getting as close to a real number as possible - this is where the rabbit hole of reading, researching and measuring began.

A lot of the arithmetic that has been implemented into 2110.tools can be in-part attributed to the SMPTE Course taught by Wes Simpson “SMPTE ST 2110 Standards Overview” and the SMPTE ST 2110 Suite of Standards

Creating a packet

2110 uses the Real-time Transport Protocol (RTP) to move media over a network. RTP typically transmits its data in UDP Packets or UDP Datagrams if you’re fancy. Without going into too much detail here; UDP has lower overhead than other methods like TCP - this becomes important when we’re handling hundreds-of-thousands of packets per second in such situations as UHD -20 video.

We’ll go through the steps of how Calculator generates the mathematical UDP datagram.

How much space is available in the payload to pack pixels into?

The ST 2110 spec defines that the typical MTU maximum transmission unit is 1500 bytes. We have to subtract the IP header from this MTU value to work out the size of our UDP packet. ST 2110 states that 40 bytes (the size of an IPv6 header) should always be subtracted from the MTU. You might think “I’m not using an IPv6 network” - neither am I. However, diverging and instead subtracting the size of an IPv4 header would be a violation of the standard - and we don’t want to be doing that. So subtracting 40 bytes it is - giving us a UDP Datagram size of 1460 bytes.

In the 1460-bytes UDP datagram we need to contain the following:

  • UDP Header = 8 bytes
  • RTP Header = 12 bytes
  • RTP Payload Header = 8/14 bytes*
  • The RTP Payload itself - this is the bit that contains our video pixels

*The smallest size the payload header could be is 8 bytes. If the particular payload spans two or three lines of video we have to extend the payload header by 6 bytes per extra line. This has a dynamic effect on how many pixels can be packed into our RTP payload. Calculator does this dynamically depending on what packing method you choose.

Calculating our available payload space goes something like this:

Payload Space=Max UDP Size−(UDPheader+RTPheader+Payloadheader)\text{Payload Space} = \text{Max UDP Size} - \left(\text{UDP}_\text{header} + \text{RTP}_\text{header} + \text{Payload}_\text{header}\right)

1460−(8+12+6)=14321460 - \left(8 + 12 + 6\right) = 1432

How many bytes are in a pgroup?

I should first start off by explaining what a pgroup is. It’s short hand for Pixel Group and it’s the smallest group of pixels whose samples pack into a whole number of octets (or bytes). The sampling method like YCbCr-4:2:2 or RGB and bit-depth change how big pgroups are and how many pixels they cover. The ST 2110 specification outlines how these pgroups should be constructed based on bit-depth and sampling method.

For the rest of the example in this article we’ll work with the common SDI Sampling of 10-bit YCbCr-4:2:2 which has a pgroup size of 5 octets and coverage of 2 pixels which means that 5 bytes can represent two pixels horizontally.

Not all sampling methods have horizontal coverage. For example YCbCr-4:2:0 covers a 2x2 grid spanning two consecutive lines of pixels.

Calculator in 2110.tools uses the following lookup table for its pgroup coverage and size:

SamplingBit DepthPgroup sizePgroup coverage
RGB / YCbCr-4:4:4831
RGB / YCbCr-4:4:410154
RGB / YCbCr-4:4:41292
RGB / YCbCr-4:4:41661
YCbCr-4:2:2842
YCbCr-4:2:21052
YCbCr-4:2:21262
YCbCr-4:2:21682
YCbCr-4:2:0864
YCbCr-4:2:010158
YCbCr-4:2:01294

Pgroups per packet

Calculator doesn’t work on pixels/packet because the number of pixels are derived from the Pgroups. Instead calculator bundles as many pgroups into the packets as possible. In this case we need to work out how many complete pgroups fit:

pgroups in payload=⌊available payload spacepgroup size⌋\text{pgroups in payload} = \left\lfloor \frac{\text{available payload space}}{\text{pgroup size}} \right\rfloor

⌊14325⌋=⌊286.4⌋=286 pgroups/pkt\left\lfloor \frac{1432}{5} \right\rfloor = \lfloor 286.4 \rfloor = 286\ \text{pgroups/pkt}

Now we know that 265 full pgroups fit in our 1432 byte available payload space we know how much of that payload we’re actually going to use.

active payload size=pgroups in payload×pgroup size\text{active payload size} = \text{pgroups in payload} \times \text{pgroup size}

286×5=1430=active payload size286 \times 5 = 1430 = \text{active payload size}

In the case where our active payload is smaller than the available space in the payload our packet will get smaller. In our example the packet is two bytes smaller than it could be.

Small packets are less efficient than larger ones. This is because the header, IPv4 overhead and physical layer transmission characteristics are a constant that’s always added on top of the size of the payload. The more packets it takes to transmit your video, the more of that overhead you’ve got to transmit too.

Packets per second

This is where Calculator get’s a bit more complex and the methodology doesn’t really work for the on-paper calculations we’ve been doing. So I will explain what Calculator does, and tell you the results.

The keen eyed amongst you might ask “What if the number of pixels in my frame doesn’t cleanly work out to 286 pgroups per packet?” - we have to truncate our packets with the remaining number of pgroups. Without getting into the weeds the RTP payload header contains a value that lets the receiving device know how many pgroups this packet contains. So instead of saying we have 286 pgroups in this packet, we can just say we have the remaining pgroups and send a shortened, or truncated packet.

This can happen in a few ways - SMPTE aren’t completely prescriptive on how device makers handle this. It could be that the end of each line has a truncated packet - this is how Calculator handles the problem by default. Or it could be a combination of wrapped and truncated packets per line. Or just wrapped packets until the very last set of pgroups in a frame, which then will possibly be the only truncated packet.

Calculator has an option to chose how you want to handle this end-of-row scenario called Enable Packet Wrapping. With Packet Wrapping disabled Calculator does as described above which is an easy way a device could achieve packet assembly according to the General Packing Method. A device could be more efficient and use ‘wrapped’ packets which add an additional SRD to the RTP Payload header which allows the packet to contain pixels from the next row. This method is more effective because we’re still filling as much of the payload space as possible, though there is less guarantee that your transmitter is handling truncated and wrapped packets in the same way as calculator, or even another type of transmitter. However, because this is the most efficient way to packetise -20 I believe manufacturers should be using this method and therefore it is the default option in Calculator.

Either way, for our purposes we have: 2160 truncated packets per frame (one per line) that have a payload of 1020 bytes. 12,960 full packets per frame that have a payload of 1430 bytes as calculated previously.

Assembly

Now we’re ready to build our Layer 2 packets that contains our UDP payload. We’re using the following header values:

  • UDP Header = 8 bytes
  • RTP Header = 12 bytes
  • RTP Payload Header = 8 bytes
  • IPv4 Header = 20 bytes
  • Ethernet Header = 22 bytes

Calculator adds RTP, UDP, IPv4 and Ethernet headers to the calculated payload sizes to give us a full Layer 2 packet for each payload size. These results then get aggregated giving us the Layer 2 Bandwidth which in this case is 8.72 Gbps

At this point Calculator does some additional arithmetic to calculate bytes on the wire (or Layer 1 bandwidth) which is the total number of bytes that are actually transmitted. This includes transmission overheads like inter-packet-gap and the Ethernet preamble.

*Calculator doesn’t vary the size of it’s ethernet header, yet. It includes a checksum and a single VLAN tag in its calculations. I figured this would be a fairly common scenario particularly across links between switches. On the roadmap is a VLAN tag toggle to include or omit this data from the calculation.

All of this brings us to a final Layer 1 bandwidth result of 8.84Gbps

That’s it!

Some technical notes

Traffic shaping

There are a few types of senders (devices that transmit -20 video) outlined in the ST 2110 specification - N, NL, & W. N, or narrow senders have their traffic shaped across the active picture period. Meaning that packet egress is spread (as best as possible) throughout the duration of that particular period and pauses during what would be the blanking interval - mimicking SDI signal timing. NL or narrow linear senders are similar except they spread their packets evenly across whole frame period including what would be the blanking interval. Whereas W, or Wide senders are permitted more deviation and are more ‘bursty’ - producing the majority of their packets in a very short time window. This bursty behaviour can cause problems with switch egress buffers when multiple W senders align with each other - possibly overwhelming those switch egress buffers. Even at link utilisations well below what the link should comfortably carry. The number that Calculator produces is an average across a whole frame, roughly similar to what NL senders would look like in practise. So although the bandwidth is correct at a frame-by-frame or second-by-second interval, it doesn’t know what sender type your video is being transmitted from. If you’re working with wide senders, real-world behaviour can differ in substantial ways.

Interlaced

For interlaced signals we do the same mathematics per field of an interlaced signal and sum those fields appropriately. There is some nuance to what is contained in the payload header for interlaced fields but it doesn’t affect the size of the payload or overall bandwidth. It’s just a signal to say “Hey I contain pixels from field2”, for example.


As you can imagine there is more nuance under the hood of how Calculator works and its a project I am continuously improving. If any of this article, or 2110.tools is helpful then please consider supporting the project by buying me a coffee.