Secure Reliable Transport

{{short description|Open source video transport protocol}}

{{Distinguish|SubRip}}

{{Multiple issues|

{{more citations needed|date=March 2019}}

{{Lead too short|date=August 2020}}

}}

{{Use British English|date=December 2020}}

{{IPstack}}

Secure Reliable Transport (SRT) is an open source video transport protocol that utilises the UDP transport protocol. The SRT Protocol specification is available as an Internet Draft from the IETF.{{cite IETF |title=The SRT Protocol |draft=draft-sharabayko-srt-01 |last1=Sharabayko |first1=M.P |last2=Sharabayko |first2=M.A |year=2021 |publisher=IETF |access-date=20 October 2023}}

Overview

SRT provides connection and control, reliable transmission similar to TCP; however, it does so at the application layer, using UDP protocol as an underlying transport layer. It supports packet recovery while maintaining low latency (default: 120 ms). SRT also supports encryption using AES.

The protocol was derived from the UDT project,{{Cite web|title=UDT: Breaking the Data Transfer Bottleneck|url=https://udt.sourceforge.io/|access-date=2020-08-27|website=udt.sourceforge.io}} which was designed for fast file transmission. It provided the reliability mechanism by utilizing similar methods for connection, sequence numbers, acknowledgements and re-transmission of lost packets. It utilizes selective and immediate (NAK-based) re-transmission.

SRT added several features on top of that in order to support live streaming mode:

  1. Controlled latency, with source time transmission (timestamp-based packet delivery)
  2. Relaxed sender speed control
  3. Conditional "too late" packet dropping (prevents head-of-line blocking caused by a lost packet that wasn't recovered on time)
  4. Eager packet re-transmission (periodic NAK-report)

Packet header

SRT packets are created at the application layer and handed to the transport layer for delivery. Each unit of SRT media or control data created by an application begins with the SRT packet header.

class="wikitable" style="text-align:center"

|+SRT packet header

!Offsets

!Octet

! colspan="8" |0

! colspan="8" |1

! colspan="8" |2

! colspan="8" |3

Octet

! Bit{{efn|name=fn1|Bits are ordered most significant to least significant; bit offset 0 is the most significant bit of the first octet. Octets are transmitted in network order. Bit transmission order is medium dependent.}}

! 0

!1

! colspan="1" | 2

! colspan="1" | 3

!4

!5

!6

!7

! colspan="1" | 8

!9

!10

!11

!12

!13

!14

!15

!16

!17

!18

!19

!20

!21

!22

!23

!24

!25

!26

!27

!28

!29

!30

!31

align="center"

!0

! 0

| colspan="1" |F

| colspan="31" |Field meaning depends on the packet type

align="center"

!4

! colspan="1" |32

| colspan="32" |Field meaning depends on the packet type

align="center"

!8

! 64

| colspan="32" |Timestamp

align="center"

!12

! 96

| colspan="32" |Destination Socket ID

align="center" style="height: 5em;"

! ...

! ...

| colspan="32" |Packet Contents
(depends on the packet type)

= Data packet =

class="wikitable" style="text-align:center"

|+SRT data packet header

!Offsets

!Octet

! colspan="8" |0

! colspan="8" |1

! colspan="8" |2

! colspan="8" |3

Octet

! Bit{{efn|name=fn1}}

! 0

!1

! colspan="1" | 2

! colspan="1" | 3

!4

!5

!6

!7

! colspan="1" | 8

!9

!10

!11

!12

!13

!14

!15

!16

!17

!18

!19

!20

!21

!22

!23

!24

!25

!26

!27

!28

!29

!30

!31

align="center"

!0

! 0

| colspan="1" |0

| colspan="31" |Packet Sequence Number

align="center"

!4

!32

| colspan="2" |PP

| O

| colspan="2" |KK

| R

| colspan="26" |Message Number

align="center"

!8

! 64

| colspan="32" |Timestamp

align="center"

!12

! 96

| colspan="32" |Destination Socket ID

align="center" style="height: 5em;"

! ...

! ...

| colspan="32" |Data

The fields in the header are as follows:

  • Packet Sequence Number (31 bits)
  • PP (2 bits): Packet Position Flag
  • O (1 bit): Order Flag
  • KK (2 bits): Key-based Encryption Flag
  • R (1 bit): Retransmitted Packet Flag
  • Message Number (26 bits)
  • Data (variable length)

= Control packet =

class="wikitable" style="text-align:center"

|+SRT control packet header

!Offsets

!Octet

! colspan="8" |0

! colspan="8" |1

! colspan="8" |2

! colspan="8" |3

Octet

! Bit{{efn|name=fn1}}

! 0

!1

! colspan="1" | 2

! colspan="1" | 3

!4

!5

!6

!7

! colspan="1" | 8

!9

!10

!11

!12

!13

!14

!15

!16

!17

!18

!19

!20

!21

!22

!23

!24

!25

!26

!27

!28

!29

!30

!31

align="center"

!0

! 0

| colspan="1" |1

| colspan="15" |Control Type

| colspan="16" |Subtype

align="center"

!4

!32

| colspan="32" | Type-specific Information

align="center"

!8

! 64

| colspan="32" |Timestamp

align="center"

!12

! 96

| colspan="32" |Destination Socket ID

align="center" style="height: 5em;"

! ...

! ...

| colspan="32" |Control Information Field (CIF)

The fields in the header are as follows:

  • Control Type (15 bits): Control Packet Type
  • Subtype (16 bits)
  • Type-specific Information (32 bits)
  • Control Information Field (variable length)

History

Secure Reliable Transport is an open source video transport protocol developed originally by Haivision{{When|date=December 2024}}. According to SRT Alliance, an organisation that promotes the technology, it optimises streaming performance. This helps minimise effects of jitter and bandwidth changes, while error-correction mechanisms help minimise packet loss. SRT supports end-to-end encryption with AES.{{cite web

|url = https://github.com/Haivision/srt

|title = Secure, Reliable, Transport

|author = Haivision

|date = 26 September 2021

|publisher = GitHub

}} When performing retransmissions, SRT only attempts to retransmit packets for a limited amount of time based on the latency as configured by the application.{{cite web

|url = https://www.collabora.com/news-and-blog/blog/2018/02/16/srt-in-gstreamer/

|title = SRT in GStreamer

|author = Olivier Crête

|date = 16 February 2018

}}

According to Marc Cymontkowski, the architect of SRT, in addition to sending MPEG transport streams over the public internet, it is also being used for IoT connectivity, metadata exchange, as a communication protocol, as well as for uncompressed data delivery.{{cite web

|url = https://blog.medialooks.com/it-glues-everything-together-an-interview-with-marc-cymontkowski-evangelist-of-srt-ad1d08790bd0

|title = It glues everything together: an interview with Marc Cymontkowski, evangelist of SRT

|periodical = Medialooks Blog

|date = 5 November 2019

}}

The reference implementation of the protocol was originally published under the Lesser General Public License version 2.1,{{cite web

|url = https://www.phoronix.com/scan.php?page=news_item&px=SRT-Open-Sourced

|title = SRT Video Transport Protocol Open-Sourced

|author = Michael Larabel

|date = 24 April 2017

|publisher = Phoronix

}} but was relicensed under the Mozilla Public License on 22 March 2018.{{cite web

|url = https://github.com/Haivision/srt/commit/a75d4c40cd6e140ffa0491fe93fe4d759085877d#diff-9879d6db96fd29134fc802214163b95a

|title = Change License to MPLv2.0 · Haivision/srt@a75d4c4

|author = Roman rndi

|date = 22 March 2018

|publisher = GitHub

}}

SRT is supported in the free software multimedia frameworks GStreamer, FFmpeg, OBS Studio and in VLC free software media player.{{cite news

|url = https://www.collabora.com/news-and-blog/blog/2018/06/25/secure-video-comes-of-age/

|title = Secure Video Comes of Age

|author = Olivier Crête

|magazine = Linux Format magazine

|issue = 237

|date = June 2018

}}

The UDP-based Data Transfer Protocol (UDT) project has been a base for the SRT project.

Marc Cymontkowski.

[https://www.haivision.com/blog/broadcast-video/created-srt-difference-srt-udt/ "Why We Created SRT and the Difference Between SRT and UDT"].

The SRT C API is largely based in design on the UDT API

[https://github.com/Haivision/srt/blob/master/docs/API.md "Haivision srt API docs"]

SRT was designed for low-latency live video transmission.

Haivision released the SRT protocol and reference implementation as open source at the 2017 NAB Show.

In March 2020, an individual Internet-Draft, draft-sharabayko-mops-srt, was submitted for consideration to the Media OPerationS (MOPS) working group of the Internet Engineering Task Force.

SRT Alliance

SRT Alliance is an organisation whose members develop, use and promote the Secure Reliable Transport protocol and software based on it. The founding members of the alliance are Haivision and Wowza Streaming Engine.{{cite web

|url = https://www.thebroadcastbridge.com/content/entry/12014/microsoft-joins-srt-open-source-streaming-project

|title = Microsoft Joins SRT Open Source Streaming Project

|date = 17 September 2018

|periodical = The Broadcast Bridge

}}

Implementations

There are two available implementations, the open-source SRT library from Haivision written in C and GoSRT, a version written in pure Go{{cite web

|url = https://github.com/datarhei/gosrt

|author = datarhei

|title = Implementation of the SRT protocol in pure Go

|publisher = GitHub

|date = 25 February 2025

}}

= Haivision C Library=

The C language API is mainly based on the previous UDT API, with further changes as new features are added. The API is very similar to the one of TCP.

SRT offers actually three working modes, of which the first two were derived from UDT:

  • File-stream mode: like TCP
  • File-message mode: similar to SCTP protocol – sending blocks of data with clearly defined boundaries
  • Live mode: the data should be sent in small packets (usually up to 1316 bytes, if the transmitted stream is MPEG-TS) with already appropriate time intervals between them. The same single packets with the same time intervals between them are then delivered at the receiver side.

The SRT library also offers these features:

  1. Encryption using a pre-shared key. Encryption support was originally provided by OpenSSL, now also alternatively, Nettle (GNU TLS) or mbedTLS can be used.
  2. SRT Access Control (aka "StreamID") can be used by applications to identify resources and use user-password access method while using the same service port number for multiple purposes.{{cite web

|url = https://github.com/Haivision/srt/blob/master/docs/AccessControl.md

|title = SRT Access Control Guidelines

|website = GitHub

|date = 7 November 2019

}}

  1. The optional Forward Error Correction mechanism.

Further and more detailed documentation can be found in the [https://github.com/Haivision/srt/tree/master/docs Source code documentation].

See also

  • Reliable Internet Stream Transport, intended to fill a gap in the market for professional protocols as opposed to the 'prosumer' SRT.{{Cite web|title=5 Reasons You Should Pick RIST over SRT|url=https://www.rist.tv/articles-and-deep-dives/2020/5/27/5-reasons-you-should-pick-rist-over-srt|access-date=2021-12-04|website=RIST Forum|date=27 May 2020 |language=en-US}}

Notes

{{Notelist}}

References

{{reflist}}