Skip to main content

Module tsbpd

Module tsbpd 

Source
Expand description

Timestamp-Based Packet Delivery (TSBPD) + Too-Late Packet Drop — SRT receiver-side delivery scheduling.

Spec grounding: draft-sharabayko-srt-01 §4.5 “Timestamp-Based Packet Delivery”, §4.5.1 “Packet Delivery Time”, §4.5.1.1 “TSBPD Time Base Calculation”, §4.6 “Too-Late Packet Drop”, and §4.7 “Drift Management” (for the Drift term in the PktTsbpdTime formula). Curated behavioral rules: specs/rules/srt-tsbpd.md.

§Sans-IO contract

TsbpdScheduler never reads a wall clock. All timing is driven by:

  • TsbpdScheduler::feed_data — submit a received data packet’s sequence number + 32-bit timestamp (from the SRT header). The scheduler computes the packet’s PktTsbpdTime (rule 9) and stores it for timed delivery.
  • TsbpdScheduler::tick — advance the virtual clock to now and release any packets whose play time has arrived, in sequence order. Also drops packets whose play time has already passed the too-late threshold (rule 17-19, if enabled).

§Delivery model

tick returns a TickOutcome containing:

  • delivered — sequence numbers released to the application in order.
  • dropped — sequence numbers dropped because they arrived after their play time (too-late drop, rules 17-18).

Packets are always released in monotonically increasing sequence order. A packet whose PktTsbpdTime has not yet arrived is withheld.

§Non-goals (explicit follow-ups)

  • Drift correction (§4.7 packet-count-based drift sampling, rule 26-27): Drift is exposed as a constructor parameter; this module does not estimate it internally.
  • Fake ACK generation on receiver skip (rule 22 / srt-arq.md rule 13): left to the ARQ layer integration.
  • Sender-side TLPKTDROP (rule 18-20): out of scope for the receiver.
  • Wrapping-period adjustment (rule 15-16): the scheduler handles 32-bit timestamp wrapping via modular arithmetic, but the wrapping-period TsbpdTimeBase adjustment (rule 16) is not implemented — it is a separate concern driven by the handshake/connection layer.

Structs§

TickOutcome
Outcome of one TsbpdScheduler::tick call.
TsbpdScheduler
SRT receiver-side TSBPD delivery scheduler + Too-Late Packet Drop (draft-sharabayko-srt-01 §4.5/§4.6).