Skip to content

libsrt Comparison

Date: 2026-03-27 Last updated: 2026-03-28 (after SRT FEC, advanced config params, expanded stats — full v1.5.5 feature parity)

Note: libsrt v1.5.5 is not yet a stable release — only release candidates (rc.0a, rc.1) exist as of March 2026. bilbycast-srt already advertises wire compatibility with v1.5.5 (0x010505).

bilbycast-srtlibsrt v1.5.5-rc
LanguagePure Rust (zero C/C++ deps)C++ with C API
Architecture3 crates: srt-protocol (no I/O), srt-transport (tokio), srt-ffi (WIP)Monolithic C++ library
Async modelTokio async/awaitEpoll + threads
Crypto depsRustCrypto (pure Rust)OpenSSL-EVP (default), mbedTLS, GnuTLS, Botan
Version advertised0x010505 (1.5.5)0x010505 (1.5.5)
Featurebilbycast-srtlibsrt v1.5.5Notes
HSv5 HandshakeYesYesInduction + Conclusion, extension blocks
Caller modeYesYes
Listener modeYesYes
Rendezvous modeYesYes
Live mode (TSBPD)YesYesBoth default 120ms latency
File mode (AIMD)YesYes
AES-CTR encryptionYesYes
AES-GCM (AEAD)ProductionPreviewbilbycast-srt ships GCM as first-class; libsrt still behind ENABLE_AEAD_API_PREVIEW build flag, AEAD epic #2336 still open
Key sizes 128/192/256YesYes
PBKDF2 key derivationYesYesHMAC-SHA1, 2048 iterations
AES Key Wrap (RFC 3394)YesYes
Key rotation (even/odd)YesYes16M pkt refresh, 4096 pkt pre-announce
Enforced encryptionYesYes
ARQ (NAK retransmit)YesYes
FEC (row-only)YesYesConfig: "fec,cols:10,rows:1". Negotiated via SRT_CMD_FILTER (ext type 7) in handshake.
FEC (staircase/2D)YesYesConfig: "fec,cols:10,rows:5,layout:staircase". Staircase column offsets match libsrt. 2D cascade recovery.
FEC ARQ modesYesYesarq:always (parallel), arq:onreq (FEC-first, default), arq:never (FEC-only). NAK suppression matches libsrt.
Too-Late Packet DropYesYes
Stream ID (send + receive)YesYesUp to 512 chars. Caller sends SRT_CMD_SID (ext type 5) in CONCLUSION; listener parses and stores. Structured #!::key=value format parsed via StreamIdInfo.
Stream ID on accepted socketYesYesbilbycast-srt: socket.stream_id() getter; libsrt: srt_getsockopt(SRTO_STREAMID)
Drift trackingYesYesbilbycast-srt: 1000-sample window
Statistics (80+ counters)YesYesIncludes FEC stats (recovered/lost/overhead), ACK/NAK, flow control, buffer state, TSBPD delays, reorder metrics
Epoll multiplexingYesYes
Bidirectional dataYesYes
NAK reportYesYes
Loss max TTLYesYesReorder tolerance
Access Control callbacksYesYesbilbycast-srt: AccessControl trait + access_control_fn() closure API with HandshakeInfo (peer addr, stream ID, encryption state); libsrt: srt_listen_callback() with SRTSOCKET handle
Retransmit bandwidth capYesYesBoth use Token Bucket algorithm; bilbycast-srt: max_rexmit_bw config (SRTO_MAXREXMITBW); libsrt: CShaper class
Rejection with reason codesYesYesbilbycast-srt sends HandshakeType::Failure(RejectReason) on reject; 18 reason codes matching libsrt
Socket Groups / BondingNoYesBroadcast + Main/Backup (Balancing still WIP)
Auto startup/cleanupN/AYesNew in v1.5.5 — automatic global init (Rust doesn’t need this)
Windows ARM64UntestedYesNew in v1.5.5
HarmonyOS (OHOS)NoYesNew in v1.5.5
C FFIWIPNativelibsrt’s primary interface

Access Control — Implementation Comparison

Section titled “Access Control — Implementation Comparison”
Aspectbilbycast-srtlibsrt v1.5.5
API styleAccessControl trait or closure via access_control_fn()C callback via srt_listen_callback()
Info providedHandshakeInfo { peer_addr, stream_id, is_encrypted, peer_socket_id, peer_version }SRTSOCKET handle (query any socket option)
RejectionReturns Err(RejectReason) — 18 standard codesReturns -1 with srt_setrejectreason() — same codes
Stream ID formatSends/parses SRT_CMD_SID extension (type 5) in CONCLUSION. StreamIdInfo parses #!::key=value format (keys: r, m, s, t, u, h).Same wire format
Per-connection passphraseNot yet (callback sees is_encrypted but can’t override)Yes — callback can call srt_setsockopt(SRTO_PASSPHRASE)
Stored on accepted socketsocket.stream_id() gettersrt_getsockopt(SRTO_STREAMID)

Token Bucket Shaper — Implementation Comparison

Section titled “Token Bucket Shaper — Implementation Comparison”
Aspectbilbycast-srtlibsrt v1.5.5
AlgorithmClassic Token BucketToken Bucket (CShaper class)
Configmax_rexmit_bw: i64 in SrtConfigSRTO_MAXREXMITBW socket option
Rate values-1 = unlimited (default), 0 = disable retransmit, > 0 = bytes/sec-1 = unlimited, 0 = disable, > 0 = bytes/sec
Burst sizingmax(10ms of bandwidth, 2 * MSS)Similar heuristic in CShaper
Integration pointsend_retransmissions() — checks bucket per packet, defers rate-limited packetsCSndQueue::worker — similar per-packet gating
Builder API.max_rexmit_bw(bytes_per_sec) on socket and listener builderssrt_setsockopt(SRTO_MAXREXMITBW)
v1.5.5 ChangeImpact on comparison
Token Bucket for MAXREXMITBWParity — bilbycast-srt now has its own TokenBucket shaper for max_rexmit_bw
Thread safety fixes (lock-free m_bListening, shared mutex, fork safety, strerror reentrancy)Non-issue for bilbycast-srt — Rust’s ownership model prevents these classes of bugs
Cookie contest restored from v1.4.5bilbycast-srt should verify its cookie contest logic matches the restored behavior for interop
Blocking srt_connect error codes fixedN/A — bilbycast-srt is async, no blocking API
Buffer overflow fix in handshake group dataN/A — bilbycast-srt doesn’t implement groups; Rust would catch this at bounds check anyway
Late-rejection for mismatched packet filterParity — bilbycast-srt rejects with RejectReason::Filter when FEC parameters conflict
CMake LIBSRT_ prefixN/A — Cargo workspace, no CMake
Windows ARM64 + HarmonyOSPlatform gap — bilbycast-srt compiles on any Rust target but hasn’t been tested on these
  1. AES-GCM is production-ready — libsrt v1.5.5 still gates GCM behind a preview build flag with open issues (TSBPD required, listener can’t force GCM mode, epic #2336 incomplete).
  2. Memory safety by construction — Many v1.5.5 fixes (buffer overflow, data races, lock-order inversions, reentrancy bugs, use-after-free patterns) are structurally impossible in Rust.
  3. Clean protocol/transport separationsrt-protocol has zero I/O dependencies, embeddable in any runtime (WASM, no_std, custom event loops). libsrt tightly couples protocol with threading.
  4. Tokio-native async — Natural fit in Rust async ecosystems. No thread pool management.
  5. Zero system dependencies — No OpenSSL, no pkg-config, no C toolchain. Single cargo build.
  6. Ergonomic access control API — Rust trait + closure API is more composable than C callback. HandshakeInfo struct provides typed fields rather than requiring socket option queries.
  1. Socket Groups / Bonding — Broadcast and Main/Backup for hitless failover. The only remaining major feature gap. (Balancing mode still WIP even in libsrt.)
  2. Per-connection passphrase override — libsrt’s srt_listen_callback can set SRTO_PASSPHRASE per connection; bilbycast-srt’s access control can accept/reject but not override the passphrase dynamically.
  3. C FFI maturity — Used by FFmpeg, OBS, GStreamer, VLC. bilbycast-srt’s FFI is scaffolding.
  4. Platform breadth — Now includes Windows ARM64 and HarmonyOS. bilbycast-srt is untested on mobile/embedded.
  5. Ecosystem adoption — De facto industry standard with broad tooling support.

Since bilbycast-srt advertises version 0x010505, it should verify:

  • Cookie contest logic matches the restored v1.4.5 method (changed in v1.5.5)
  • Packet filter late-rejection handlingDone: bilbycast-srt rejects with RejectReason::Filter when FEC parameters conflict during negotiation
  • AES-GCM 12-byte IV (changed in v1.5.4, carried into v1.5.5)
  • Stream ID extension interop — bilbycast-srt now sends and parses SRT_CMD_SID (ext type 5) in CONCLUSION; verify round-trip with libsrt callers and listeners

bilbycast-srt now matches libsrt v1.5.5 on access control, retransmission bandwidth shaping (token bucket), Stream ID sending and parsing, structured Stream ID format (#!::key=value), and FEC (row-only, staircase/2D, ARQ integration, handshake negotiation). The only remaining major feature gap is bonding/socket groups. bilbycast-srt leads on AES-GCM maturity, memory safety, architectural cleanliness, and API ergonomics.

For bilbycast’s use case (media transport gateway with its own relay infrastructure for redundancy), the bonding gap is mitigated by bilbycast-edge’s own hitless redundancy and tunnel failover mechanisms.

CategoryCoverage
Core protocol (handshake, ARQ, TSBPD, timers)100%
Encryption (AES-CTR, AES-GCM, key rotation)100% (GCM ahead)
FEC (row, staircase, ARQ integration)100%
Congestion control (Live, File)100%
Access control (Stream ID, accept/reject)~90% (missing per-connection passphrase override)
Retransmit shaping (Token Bucket)100%
Connection modes (caller, listener, rendezvous)100%
Bonding / socket groups0%
C FFI~10% (scaffolding)