rtci 0.2.0
Released 2026-11-26.
From CHANGELOG.md of rtci at its release tag.
The second release under the rtci names. Since 0.1.0: trains 21 to 34 of the clause-by-clause conformance work (the audit's open MUST rows down to 7, none a violation, and no SHOULD row marked violated), and defaults of the congestion and repair path under which, in the capacity instrument's measured cells (tests/capacity_instrument.rs, figures in docs/performance.md), a call through a sudden capacity drop, an outage or a slow path keeps a recent picture and its audio.
- Breaking changes (below, each with its migration): the NACK responder declines repairs that cannot be useful and gives a video stream up after a halving of the target; the default pacer discards queued video at a collapse;
SampleBuildergives a gap up after 300 ms; the RTP circuit breaker restarts a ceased flow; a ULPFEC packet in a RED stream reaches the application without a payload; new public fields on several configuration structs; the stream driver runs on an injected async runtime and loses some auto traits. - Security: key material in rtci-dtls, rtci-srtp and rtci-crypto is erased when no longer needed, with both providers;
DisplayandDebugno longer print keys. - Known limits (below): both directions capped at once, a deep queue on the path, copies of SRTP keys in the dead stack frames of the thread that built the context, the
Chromeprofile's picture after a collapse, and the recovery after a deep cap without the opt-in probing. - The engine's STUN SOFTWARE text is
rtci-ice 0.2.0, 4 bytes shorter than master'srtci-ice 0.2.0-dev: every STUN packet is 4 bytes shorter, which re-draws the capacity instrument's seeds (performance ledger rowrelease-0.2.0).
Security
- Key material left in freed memory by rtci-dtls, rtci-srtp and rtci-crypto is now erased (
conf/zeroize-1-dtls-srtp-key-erasure; RFC 5246 section 8.1, RFC 8446 section 7.1, RFC 3711 section 9.3, RFC 7714 section 13.1; docs/key-erasure.md). In 0.1.0 (and on master until this change) these stayed in heap memory after it was freed, until the allocator reused it: DTLS 1.2: the PRF (prf_p_hash) built its output and intermediate values in plain vectors, so the master secret, the key block (every record key and IV) and the DTLS-SRTP exporter output (the SRTP master keys and salts) were left behind;Stateheld the master and premaster secrets in plain vectors (replaced or dropped without erasure; the ECDHE shared secret was unwrapped from itsSecretVec); a PSK returned by the application's callback was not erased;EncryptionKeysprinted every key throughDisplayandDebug; the record ciphers' write IVs were plain; the serializedStateand ticket plaintexts left copies while being built; the previous cookie secret of an endpoint (after a rotation) was never erased, and cookie secrets, like ticket keys and the DTLS 1.3 HelloRetryRequest cookie secret, stayed in the buffered generator's output buffer. DTLS 1.3: record IVs held inline in epochs that live in vectors were copied into memory the vectors freed. SRTP and DTLS with the ring provider: the RustCrypto HMAC-SHA1 states (the AES-CM and NULL profiles' authentication keys, the AES-CBC suite's MAC keys) were not erased; RustCryptoaeswas built withoutzeroize, so AES-CBC and AES-CCM key schedules and the per-packet AES-CM ones were not erased. With the ring provider, ring's own key objects were freed as they were: the SRTP AES-GCM session keys and every AES round key (ring::aead::LessSafeKey), the DTLS record keys of the AES-GCM and ChaCha20-Poly1305 suites, the DTLS 1.3 record-number keys (aead::quic::HeaderProtectionKey) and the HMAC-SHA-2 states of the PRF, HKDF and cookie keys (hmac::Key); the ECDHE private key, left in the freed key-exchange object (agreement::EphemeralPrivateKey), and the certificate's Ed25519 and ECDSA P-256 key pairs. Key schedules and shared secrets also left copies in dead stack frames that later moves carried into heap padding. All of these are now erased:SecretVeceverywhere (it implementsZeroizeandZeroizeOnDrop), structs that hold keys derive both, buffers are sized up front,aes/ctrare built withzeroize, the HMAC-SHA1 state is overwritten on drop, ring's key objects live in an allocation of the provider's own that is overwritten after ring has dropped them (ErasedOnDrop; ring declines to erase them itself, ring issue #15),crypto::scrub_stackruns after keyed objects and shared secrets are built, and secrets are drawn with the newRTCRandom::fill_secret(the built-in providers read the operating system for it). Tests:tests/dtls_secret_erasure.rs(every freed heap block and every block still allocated, all platforms; the whole process on Linux outside dead stack frames, see Known limits), the DTLS 1.2 exporter test oftests/dtls_srtp_keying_material_erasure.rs(was a known limit),with_ring_no_key_*inrtci-srtp/tests/key_schedule_erasure.rsandkey_erasure_process_memory.rs(were theknown_limit_*tests),rtci-crypto/tests/ring_key_object_erasure.rs(each ring key object, the ECDHE private key drawn from a known seed through the new test-support seamring_key_exchange_with_seed, the signing key pairs). What remains: a ring RSA key pair keeps its private limbs in ring's own heap allocations (not reachable, not measured); stack copies left while key objects are built are scrubbed but not observed by any test (a copy moved onto the stack is not caught), so their absence is not guaranteed (docs/key-erasure.md); RFC7714-13.1-3 stayspartial(class E) for that. No wire or handshake behaviour changes. Additions to the API:RTCRandom::fill_secret(default:fill),crypto::scrub_stack,Zeroize/ZeroizeOnDropforSecretVecandSessionKeys. Cost (rtci-srtpandrtci-dtlscriterion benchmarks against master 6939a3e8 on the same runner, run 45660052237; master figures in brackets): DTLS record-cipher setup 1.07 µs AES-128-GCM (0.39 µs) and 1.38 µs AES-256-CBC (0.47 µs), of which about 0.7 µs is the 32 KiB stack overwrite (crypto::scrub_stack, one bulk fill; the first form, a volatile write per byte, took 13.8 µs and 22.5 µs, run 45654600978); SRTP context setup 1.48 µs AES-CM (1.43 µs) and 1.31 µs AES-128-GCM (1.12 µs: ring's key object in an allocation of its own); per packet SRTP AES-CM RTP 1.52 µs / 1.23 µs encrypt / decrypt (1.53 / 1.26 µs), RTCP 271 ns / 307 ns (264 / 279 ns), SRTP AES-128-GCM RTP 625 ns / 330 ns (627 / 337 ns), DTLS records 258 / 270 ns AES-128-GCM and 3.16 / 2.89 µs AES-256-CBC (within 1-4 % of master, faster). Thatscrub_stackstill overwrites is tested: emptied, or with its fill left unobservable to the optimiser, the DTLS erasure tests fail in a release build (the second case cannot be told apart in a debug build, where nothing is optimised away).
Breaking changes
- interceptor, peer connection (
conf/nack-11-decline-useless-repairs): the NACK responder declines repairs that cannot be useful, and asks for a key frame instead. Two rules, on by default in every chain (RFC 8834 section 6.1: "It is not appropriate to blindly retransmit RTP packets in response to a NACK. The importance of lost packets and the likelihood of them arriving in time to be useful need to be considered"; RFC 4588 section 7: "If congestion is not kept under control, then retransmission SHOULD NOT be used"): (1) a NACK for a packet written more than 2 s ago is not answered (NackResponderBuilder::with_max_repair_age,NACK_MAX_REPAIR_AGE); (2) when the requests waiting would take 2 s or more to send at the target and the target has fallen to half or less within 2 s, they are given up (with_repair_backlog_bound,NACK_REPAIR_BACKLOG_BOUND). Giving a video stream up forgets everything sent on it so far, releases the retransmission reserve at once and asks the application for one key frame of it (a PLI with sender SSRC 0 onpoll_read,OnKeyFrameRequest: the pacer's flush has the same request); the targets from before a give-up no longer count, so the key frame that answers is given up in its turn only if the target halves again. Audio is only declined by age. Anrtx-timetakes the place of the age bound (RFC 4588 section 8.1: "the maximum time a sender will keep an original RTP packet in its buffers available for retransmission"): where one is in force for a stream (NackControl::LocalRtxTimefrom the session description or the application,NackResponderBuilder::with_max_packet_age), a packet of the stream is repaired for that long, shorter or longer than 2 s, and past it the packet is not retransmitted and nothing else happens, as before (no give-up, no key-frame request); the 2 s are the sender's own judgement where no time was set. Thertx-timeis that of the packet's own retransmission format (RFC 4588 section 8.6: a parameter of each RTX payload type; with red-2 a RED packet goes under the RTX ofred), and the same value governs all three uses for that packet: the age cut, the 2 s rule and the give-up. So a RED packet whose RTX ofredannounces nortx-timefalls under the 2 s rule and gives the stream up, whatever the media format's RTX announces, and the reverse. A NACK entry that would never be answered (a FEC packet in RED on a stream without RTX, a payload type with no RTX format on a stream that has RTX) never gives the stream up by its age: the receiver is not waiting for a picture because of it (conf/red-2r; testsrtci-interceptor/tests/ nack_rtx_red.rs::an_old_red_packet_is_held_to_the_repair_age_when_only_the_media_rtx_announces_a_time,a_red_packet_is_repaired_for_the_rtx_time_of_the_rtx_of_red_and_a_plain_packet_is_not,an_old_packet_that_is_never_answered_does_not_give_the_stream_up,the_backlog_counts_red_packets_at_the_size_of_their_answers). Ordinary loss at a steady target is repaired as before and asks for no key frame. Before, every NACK for a packet still in the 1024-packet buffer was served in order: a call without a pacer that met a capacity drop from 2.5 Mbit/s to 300 kbit/s sent 142 retransmissions (38 dropped again) with its target held at the reserve's floor, now 18 (16), median target under the cap 229 -> 257 kbit/s (behind a 100 ms queue 142 -> 252); a receiver without a bound in time showed a picture 7.5 s old, now 1.1 s; after a 4 s outage the default chain resumed later than 2 s in 66 of 200 calls with such a receiver, now in none (docs/capacity-collapse.md, "The NACK responder": the figures by cell, why 2 s).DefaultInterceptorOptionshas two new public fields,nack_max_repair_ageandnack_repair_backlog_bound(a struct literal without..Default::default()no longer compiles), governed by the behaviour profiles (nack.max-repair-age,nack.repair-backlog-bound:Nonein theChromeprofile, whose sender never asks itself for a key frame).PacerBacklog::Keepnow also switches both rules off in the default interceptor set: the option means "keep and repair everything" (its name is unchanged). Migration, for a receiver that plays strictly in order and cannot resume at a key frame:options.pacer_backlog = PacerBacklog::Keep, or on a chain built by handNackResponderBuilder::with_max_repair_age(None).with_repair_backlog_bound(None). An application must answer a key-frame request with a key frame, as for a remote PLI. Nortx-timeis announced for the age bound.DELIVERED_MEMORY(4 s) is unchanged: under the default age bound a packet's memory is unreachable once the packet is 2 s old, and it is the bound where a packet is repaired longer (anrtx-timeover 2 s, the age rule off). Known small effect: a give-up does not tell the pacer, so a retransmission of a forgotten packet already queued there still leaves (counted in 700 paced calls with 247 give-ups: 3 in all, at one give-up). A small cost, accepted: in a chain without a pacer behind a 100 ms queue the climb back after the cap is slightly slower (seconds to 1000 kbit/s median 17.85 -> 18.30, 90th percentile 19.10 -> 20.40, per seed +0.26 +-0.24 s; target 15-25 s after the cap 1215 -> 1195 kbit/s; 200 calls), and calls over 20 s go from 3 to 31 of 200 since the climb clusters at 17-21 s; with both directions capped the 15-25 s target is 44-66 kbit/s lower (not significant) against 89-90 kbit/s more target while the cap holds. Paced chains move too on the tree this landed on (train 34 round 7, 58ba8a93, against round 6's rows; the branch's own base showed the paced cells identical): the rules decline repairs there as well, a declined repair leaving an unusable frame that a key frame answers. Both directions capped (cap/paced/gap300/both/q300/rl0, 111 of 200 calls move): unusable frames 1.07 -> 2.75 a call, key frames 4.9 -> 5.1, target 15-25 s after the cap 1375 -> 1369 kbit/s, against retransmissions 4.8 -> 2.7 and an oldest picture 2.49 -> 2.44 s; 5 % loss on the reverse path (cap/paced/gap300/up/q300/rl5, 107 of 200): target 15-25 s after 1367 -> 1354 kbit/s, seconds to 1000 kbit/s 16.44 -> 16.53, a peer outsideconnectedat the end 1 -> 2 of 200; the 4 s outage (outage/paced/gap300/up/q300/rl0, 66 of 200: the calls whose picture the restart of probing at a path change had made older) gains: oldest picture 4.76 -> 4.32 s, retransmissions 133 -> 36, first picture after the new pair 0.71 -> 0.26 s. The reference cells (1000 calls each) and the 100 ms queue are identical; the 1000 ms queue moves in 2 of 200 (instrument runs 45695138492 / 45695149408 against 45686735759 / 45686744374; the merge-point rule holds, nothing flagged). Fixed with it: a probe cluster asked for while the responder's buffer is empty (after a give-up or the pacer's flush, before the next packet is written) is still padded, under the header of the newest packet the buffer held; before, no padding left, and a chain without a pacer stopped probing. - peer connection, interceptor, media (
conf/red-3-fec-sequence-holes): a ULPFEC packet received in a RED stream is delivered to the application as an RTP packet without a payload, under the payload type of the stream's media, with the FEC packet's sequence number and timestamp (RTCMessage::RtpPacketwith an emptypayload; the peer connection used to drop it). ULPFEC in RED packets of its own (the form browsers send, and theChromebehaviour profile's) takes sequence numbers of the media stream, so an application that puts frames together saw a missing packet at each of them: a frame of more than five packets was never complete, and each hole between frames waited out the gap bound and cost a key-frame request. Between two engines of theChromeprofile at 2 Mbit/s no frame was usable while FEC was sent. Migration: give every packet of the stream to the frame assembly, empty ones included (SampleBuilder::pushandrtci-video's receiver take them as present and no media); code that readspayload[0]of every packet must skip an empty payload. The receive interceptor's emptied packet (UlpfecRepair) now has the media's payload type instead of theulpfecone (theulpfecone only before any media of the stream arrived). - interceptor (
conf/red-3-fec-sequence-holes): withRedPlacement::OwnPacketthe FEC packets follow the last packet of a frame (the one with the marker bit) instead of each block's last packet:UlpfecSendBuilder::with_fec_after_frame, on by default, as libwebrtc places them (ulpfec_generator.cc:134,157-159at a222406d). A receiver, libwebrtc's included, finds a frame only over consecutive sequence numbers, so a FEC packet inside a frame left it incomplete. Each FEC packet protects the same media packets as before; only the order on the wire changes (RFC 5109 and RFC 2198 say nothing about it). At mostULPFEC_MAX_HELD_FEC_PACKETS(128) FEC packets wait for a marker bit. Migration: none for video with marker bits;with_fec_after_frame(false)restores the old order. The other placements and carriages are unchanged. - media (
conf/red-3-fec-sequence-holes):SampleBuildertakes a packet without a payload as present and no media. It is left out of the sample it lies in (a sample with one inside it used to be lost to a depacketizer error); it starts no sample, so a sample followed by such packets waits for the next packet with a payload and has its realduration(it used to come out at once with a duration of zero); between samples it is counted inprev_padding_packetswhatever its timestamp (only one with the last sample's timestamp was); andpopgoes on to the next sample after dropping packets that belong to none (it used to returnNoneonce for each such run). Migration: none needed; code that relied on a zero duration to spot padding readsprev_padding_packets. - interceptor, peer connection (
conf/flush-1r-backlog-flush-at-collapse): the default pacer discards queued video when the path's capacity collapses. When what waits in the pacer would take a second or more to leave and the target is half or less of what it was when that media was written (or within the last two seconds), the queue and its retransmissions are discarded, the NACK responder answers no NACK for what was sent before, and the application is asked for a key frame of each video stream (a PLI with sender SSRC 0 onpoll_read,OnKeyFrameRequest,OnPacerDiscard); the source is not paused. Before, the source was paused and everything was delivered in order, which left the receiver's picture 7.9 s old in the median after a drop from 2.5 Mbit/s to 300 kbit/s; now 1.33 s (docs/capacity-collapse.md: the texts, the figures by cell, the limits). An application must answer a key-frame request with a key frame, and a receiver must bound its wait for a missing packet or resume at a key frame (SampleBuilderdoes by default). Migration, for a receiver that plays strictly in order:options.pacer_backlog = PacerBacklog::Keep, orPacerBuilder::with_backlog(PacerBacklog::Keep).DefaultInterceptorOptionshas a new public field,pacer_backlog: a struct literal without..Default::default()no longer compiles. Performance: flush-1r - media (
conf/flush-2-receiver-gap-bound):SampleBuildergives a gap up by default. A builder of a video format (Depacketizer::has_key_frames: VP8, VP9, AV1, H.264, H.265) (1) waits for a missing packet at mostDEFAULT_MAX_GAP_WAIT, 300 ms from the arrival of the first packet after it, then gives the gap up and raisestake_key_frame_request()(it held a gap formax_latepackets, which were 8.6 s at 100 kbit/s); (2) gives up everything before a complete key frame the moment the key frame is whole (Depacketizer::is_key_frame_start), with no request; and every builder (3) ignores a packet older than what it has already built or given up (it buffered it, where it looked like a new gap). An audio builder is otherwise unchanged. An application that drives the builder without a clock should callpop(now)atpoll_timeout()and send a PLI whentake_key_frame_request()says so. Migration (the old behaviour):SampleBuilder::new(..).with_max_gap_wait(None).with_key_frame_release(false).with_max_gap_waitnow takesimpl Into<Option<Duration>>: a call with aDurationcompiles as before. No RFC sets the bound; 300 ms is the value the capacity instrument measured best of 300, 600 and 1000 ms, and libwebrtc's receiver (3 s without a decodable frame, 200 ms while waiting for a key frame) isrtci-video'sReceiveConfig::chrome():docs/receiver-gap-policy.md. Performance: flush-2 - interceptor, peer connection (breaker-1):
DefaultInterceptorOptionshas two new public fields,circuit_breakerandcircuit_breaker_automatic_restart(bothtrue; see "Fixed" and "Added"). Migration: a struct literal adds them or builds on..DefaultInterceptorOptions::default().CircuitBreakerHandle::report_round_trip_timenow takes each round trip measurement as it is made and smooths them itself (RFC 8083 section 3); it used to store the value given. Migration: a caller that handed in an average hands in the samples. The RTP circuit breaker restarts a ceased flow by itself when the receiver's reports show the cause has gone (it never did). Migration: an application that wants every restart to be its own setscircuit_breaker_automatic_restart: false(CircuitBreakerBuilder::with_automatic_restart(false)). With theChromebehaviour profile the default chain has no circuit breaker (cb.enabled). - ice (
conf/ice-26-consent-late-responses):ice::AgentConfighas a new public field,consent_response_wait(ConsentResponseWait, defaultRto), and so has the setting engine'sicegroup. Migration: a struct literal of either adds..Default::default()orconsent_response_wait: ConsentResponseWait::Rto.stun::timer::RtoEstimatoris nowCopy(an addition). Performance: ice-26-consent - turn, ice (
conf/transport3-mays):turn::client::ClientConfighas a new public field,software_in_indications, andice::agent::agent_config::AgentConfigone,new_tie_breaker_on_restart(both off by default, see "Added"). A struct literal of either adds..Default::default()or the field set tofalse. - workspace: this release is 0.2.0 (every crate, and every requirement on a workspace crate;
mastercarried0.2.0-devuntil the release): it takes changes that 0.1.0 users cannot take without a change of their own. Each such change is listed here. Git dependents that need the 0.1 API pin the tagv0.1.0or use the crates.io release. - interceptor (fec-1):
StreamInfohas a new public field,fec_session(ULPFEC in an RTP session of its own, see "Added"). A struct literal ofStreamInfoadds..Default::default()orfec_session: None. - ice / peer connection (
conf/ice-24-address-policy):AgentConfigand the setting engine'sCandidateshave a new public field,address_policy(anIceAddressPolicy, see "Added"). A struct literal of either adds..Default::default()oraddress_policy: IceAddressPolicy::default()(which allows every address, as before). - ice / jsep (mdns-5): new public fields
AgentConfig::multicast_dns_expose_known_public_addressesandAgentConfig::multicast_dns_expose_temporary_ipv6_addresses,MulticastDNS::expose_known_public_addressesandMulticastDNS::expose_temporary_ipv6_addresses(see "Added"). Migration: a struct literal ofAgentConfigorMulticastDNSadds..Default::default()(or the fields set tofalse). - rtci-sdp (jsep-79, pass2):
MediaDescription::connection_informationis aVec<ConnectionInformation>, everyc=line of the media description in order (RFC 8866 section 5.7: "Multiple addresses or "c=" lines MAY be specified on a per-media basis", for layered multicast). The parser kept only the last one. RFC8866-5.7-7 istested(grammar_test::several_connection_lines_in_a_media_description_are_all_kept). Generated SDP is unchanged (onec=line per section). Migration:connection_information: Some(c)becomesvec![c],Nonebecomesvec![]; readconnection_information.first()where one address was read, andis_empty()foris_none(). - interceptor (rtp-1):
RtcpSessionEventhas a new variant,ReportingSsrc, beforeRoundTripTime, so the implicit discriminants of the later variants moved (cargo-semver-checksenum_no_repr_variant_discriminant_changed). The enum is#[non_exhaustive]and its variants carry data, so no code could cast it withas; amatchalready needed a wildcard arm. Nothing to change in practice. - statistics (vp-8r,
conf/vp-4-engine-boundary):DecoderStatsUpdatehas four new public fields (jitter_buffer_delay,jitter_buffer_target_delay,jitter_buffer_minimum_delay,jitter_buffer_emitted_count). A struct literal adds..Default::default(). - stream-driver:
PeerDriverConfighas a new public fieldmdns_rate_limit(None: the process's budget). Migration: a configuration written as a struct literal addsmdns_rate_limit: None, or builds on..PeerDriverConfig::on(addresses). - stream-driver (runtime-1): the driver runs on an injected async runtime (
runtime::Runtime, an object-safe trait used asArc<dyn Runtime>: spawn, the clock and timers, UDP sockets multicast included, TCP listen / connect, name resolution,block_on). It is given per driver (StreamDriver::with_runtime,PeerDriver::with_runtime); there is no global or default runtime. Built-in runtime types are features:runtime-tokio(default) givesTokioRuntime. Changes for users:StreamDriver::new,StreamDriver::defaultandPeerDriver::newneedruntime-tokio(on by default) and are otherwise unchanged. Migration: none with default features; withdefault-features = falseaddfeatures = ["runtime-tokio"]or callwith_runtime.sockets::bind_tcp_listener_in_range(ip, range, reuse)takes the runtime first and returnsArc<dyn runtime::AsyncTcpListener>;sockets::accept_by_ufrag(&listener, timeout)isaccept_by_ufrag(runtime, listener, timeout)over adyn AsyncTcpListener;SharedAccept::streamis anArc<dyn runtime::AsyncTcpStream>;nat_mapping::map_porttakes the runtime first. Migration: pass&TokioRuntime::new()and make listeners withruntime.listen_tcp(addr, false).dns-recordsturnsruntime-tokioon: the per-family and SRV / NAPTR lookups areTokioRuntime's (Runtime::resolve_family,Runtime::resolve_records; another runtime answers the default: both families together, no records).- The datagram marking of ccrows-7 is the socket's (
runtime::Transmit::traffic_class,AsyncUdpSocket::unmarked,runtime::TrafficClassMarker);PeerDriver's counters are unchanged. - (runtime-2) With
default-features = falsethe crate has no async runtime in its normal dependency tree (no tokio, mio, smol, async-io, hickory): CI checks it (tests/dependency_tree.rs, thecargo.ymlstep "Stream driver without a built-in runtime"). - (runtime-3)
runtime-smolgivesSmolRuntime(smol's global executor, async-io's reactor and timers, smol's resolver). Several runtime features can be on at once; drivers on different runtimes live in one process (tests/runtimes.rs: a peer on tokio and a peer on smol connect and exchange data-channel messages). - (runtime-4)
examples/custom-runtime(packagertci-custom-runtime-example, not published):Runtimeimplemented over async-executor and async-io, the driver withdefault-features = false; CI checks its tree has no tokio and runs it (two peer connections on it exchange data-channel messages). New public helpers for such runtimes:runtime::{std_udp, std_multicast, std_tcp_listener, std_tcp_bound, std_tcp_connect_start, set_and_read_traffic_class, reset_on_close, TrafficClassMarker}. - (runtime-5)
runtime-mockgivesMockRuntime: a virtual clock (MockClock::advance, andMockRuntime::runmoves it to the next timer whenever nothing can run, panicking on a deadlock instead of hanging) and an in-memory network (MockNet: UDP, multicast and TCP between mock sockets; per-directionLinkConfigdelay, seeded loss and blocking; a datagram filter; a log with each datagram's traffic class and fate; a host table). TwoPeerDrivers connect on it with no socket and no wall time (tests/virtual_time.rs: a data-channel exchange over 20 ms links, ICE consent expiry after 30 s reported as failed, a lost DTLS ClientHello retransmitted after its timer).
- stream-driver (runtime-1,
conf/runtime-1-trait, on master since train 25):StreamDriveris no longerSync,Unpin,UnwindSafeorRefUnwindSafe, andPeerDriverno longerUnpin;Accepted,SharedAcceptandDriverInputare no longerUnwindSafe/RefUnwindSafe(cargo-semver-checksauto_trait_impl_removedagainst v0.1.0). The driver holds the injected runtime and its tasks as trait objects (Arc<dyn Runtime>,Box<dyn runtime::JoinHandle>, which isSendbut notSync; TCP streams asArc<dyn runtime::AsyncTcpStream>) and its input queue is anasync_channelchannel, whose receiver is notUnpin.Sendis kept everywhere. Migration: share a driver across threads behind aMutex(or keep it on one task and talk to it through its handles), pin it (Box::pin/pin!) where a future that owns it must beUnpin, and wrap it inAssertUnwindSafeforcatch_unwind. StreamTransmithas a new public field,dscp(rtci-shared): the codepoint the driver sets on the TCP connection (RFC 8837 section 5: one per TCP connection, the highest-priority flow's). Code that builds aStreamTransmitwith a struct literal addsdscp: 0.- ice / jsep / stream-driver (mdns-4): new public fields
AgentConfig::multicast_dns_fail_closedandAgentConfig::multicast_dns_publishing,MulticastDNS::fail_closed(the setting engine's mDNS settings) andPeerDriverConfig::mdns_sockets(see "Added"). Migration: a struct literal ofAgentConfigorMulticastDNSadds..Default::default()(ormulticast_dns_fail_closed: false, multicast_dns_publishing: Default::default()/fail_closed: false); one ofPeerDriverConfigaddsmdns_sockets: true, or builds on..PeerDriverConfig::on(addresses). - stream-driver (
conf/mdns-6-regression-test):runtime::Transmithas a new public field,source: Option<IpAddr>, the address a datagram is to leave from (the engine names one for each mDNS datagram, RFC 6762 section 14). Migration: a struct literal ofTransmitaddssource: None; a third-partyAsyncUdpSocketmay ignore it where it sends from a bound address. - stream-driver (
conf/mdns-7-per-interface):runtime::MulticastConfigreplacesinterface_v4: Ipv4Addrandinterface_v6: u32withinterfaces: Vec<IpAddr>(one group membership per interface holding one of the addresses; empty: the default interface), andMulticastConfig::mdnstakes them as a second argument. A runtime'sAsyncUdpSocketis expected to honourTransmit::sourcefor a multicast destination (runtime::MulticastInterfaceSelectordoes it for a socket with a descriptor). Migration:MulticastConfig::mdns(group)becomesMulticastConfig::mdns(group, vec![]); a literal setsinterfaces: vec![interface.into()]forinterface_v4, or the address of the interface forinterface_v6; a third-party socket adds aMulticastInterfaceSelectorand callsapplybefore each send. - stream-driver (
conf/mdns-8-send-failures):<dyn AsyncUdpSocket>::try_sendreturnsio::Result<usize>(the system's error,WouldBlockwhen the socket cannot take the datagram now) instead ofbool, andruntime::mock::Fatehas a new variant,SendError. Migration:socket.try_send(&t)used as aboolbecomessocket.try_send(&t).is_ok(); amatchonFateadds an arm forFate::SendError.
Behaviour changes
- The session bandwidth an RTCP session measures counts UDP and IP (RFC 3550 section 6.2: "Bandwidth calculations for control and data traffic include lower-layer transport and network protocols (e.g., UDP and IP)"). Where no
b=AS/b=TIASgives the session bandwidth, the session measures the RTP sent and received over the last two seconds; each packet now counts with 28 octets of UDP and IPv4, as the RTCP packets always did in the average packet size. Before, the RTP header and payload alone were counted, which understated the session (and so its 5 % of RTCP) by 28 octets a packet: 2 to 3 % beside video, a quarter for 20 ms Opus packets. Testthe_measured_session_bandwidth_counts_udp_and_ip. Audit: RFC3550-6.2-1 (note). GccInterceptorBuilderprobes for bandwidth by default (with_bandwidth_probing(false)turns it off). The pull-style GCC interceptor (a chain without a pacer) never probed: its estimate climbed from 300 kbit/s at 8% a second. It now sends the start-up clusters and the others the default interceptors send (RFC 8836 section 2, requirement 4, SHOULD), as bursts of padding on the RTX stream, when the chain has a NACK responder and RTX is negotiated; without them nothing changes. Probing asks for nothing above the estimator's own maximum (BandwidthEstimator::max_bitrate, new, default none). WHAT CHANGES FOR A CALL: a chain without a pacer now reaches the path's rate at the start (2.5 Mbit/s 0.5 s into the call, where it was at 1.4 Mbit/s after 20 s), and so meets a later capacity collapse from a higher rate, as a call through the default interceptors always has. Measured with the capacity instrument (200 calls a cell, the path drops from 2.5 Mbit/s to 300 kbit/s for 20 s; train 32 round 3 withconf/instrument-4, hosted runs 45568561644 / 45568566803 before, 45568576304 after, and round 4 with the sender's flush, 45574610547 / 45574618542: the same figures to the digit), ParolNet's chain with the reference receiver (a gap given up after 300 ms, the default since the receiver's bounded wait): the three requirements are met before and after (a picture over 2 s old for more than 0.5 s, over 2 s without a new picture, over 1 s without audio: 0 of 200 calls each); the target under the cap 249 -> 229 kbit/s, retransmissions 67 -> 142 a call, audio packets lost 28 -> 39, the oldest picture 1.09 -> 1.18 s; 1000 kbit/s is reached 17.5 s after the capacity returns (18.2 s before). With a receiver that waits without a bound in time the oldest picture is 7.9 s where it was 3.6 s: the repairs of a collapse from 2.5 Mbit/s take that much longer than from 1.4. Behind a short queue (100 ms at the capped rate) the repairs take about 12 s instead of 5.5 s and more than half of them are dropped at the queue again (263 retransmissions a call against 145), during which the encoder's target is at its floor: a known limit of a chain without a pacer at a collapse from full rate (nothing pauses or flushes; the NACK responder repairs in order). With both directions capped, 25 of 200 calls of ParolNet's chain show a picture over 2 s old for more than 0.5 s where 3 did (the same limit: the feedback path is capped too). One seeded call ofrtci-video/tests/receive_rtc2rtc.rsrendered nothing for 1.13 s at such a collapse (bound 1 s): that file's calls keep a sender without probes, and the same call with the builder as it comes stands beside it as the ignoredknown_limit_a_capacity_drop_from_the_paths_rate_leaves_no_long_freeze(docs/test-exclusions.md), which fails until the limit is gone. (conf/nack-11-decline-useless-repairsremoves the repair tail and the unbounded receiver's old picture named above, see "Breaking changes"; that one seeded call still renders nothing for 1.15 s with 2 retransmissions: the collapse itself, not the repairs.) THE WAY BACK:GccInterceptorBuilder::with_bandwidth_probing(false)gives the old start (8% a second) and the old figures. A chain without a pacer probes at the start and while the application sends less than the target allows, not after a large drop of the target (ProbeController::set_unpaced, set by the congestion controller when it measures a cluster that left as one burst): a burst is padding on top of the media into the queue that caused the drop, where a paced cluster is mostly the media itself (measured, same instrument: with such bursts 7 of 200 calls were over 2 s without a new picture against 3, and behind a 1000 ms queue the audio paused for over a second in 72 of 200 calls against 21). A chain with the pacer probes after a drop as before.cb.packet-size, a governed behaviour:BehaviourProfile::StrictRfctakes RFC 8083 section 3's packet size for the RTP circuit breaker (CircuitBreakerPacketSize::LastFrames, the mean over the last 4 * G frames).Rfc(the default),ChromeandPerformancekeep the sending window's mean (libwebrtc has no RTP circuit breaker). Measured (tests/circuit_breaker_reordering_rtc2rtc.rs::the_last_frames_packet_size_ceases_a_talking_call_the_default_keepsand the sweep, hosted run 45409132256): a talking call over a jittered link is ceased with section 3's form in 14 of 24 cells (5 % loss: after 3.8 to 5.0 s), with the default in none. With breaker-1's rate-now rule (see "Fixed") section 3's form ceases that call in 5 of the test's 6 runs (after 3.6 to 31.6 s; hosted run 45521916073), the default still in none. Audit: RFC8083-3-3 issetting(measured); it waspartial. Returned inconf/ccrows-8r-cb-last-frames-testafter train 24 took it out: with the RTP/RTCP family (rtp-1, -2, -3, -5, -6, -8) its test, then one seed's first 15 s, saw no trip. The breaker read every report as before (each block matched to the flow, same report rate); the link's seeded loss is drawn per SRTP and SRTCP datagram, so the changed RTCP moved where the losses fell. The test now states the measurement's requirement: a 60 s call, seeds 11, 1 and 2 at 40 and 100 ms jitter, ceased with section 3's s every time, never with the default (on the train's tree, seeds 1 to 10: ceased after 1.5 to 12.6 s, hosted run 45455917556).- jsep (mdns-5): servers given by
set_configurationreach the engine's own STUN and TURN gathering (W3C webrtc-pc "set the configuration": "Set the ICE Agent's ICE servers list to iceServers. As defined in [RFC9429], if a new list of servers replaces the ICE Agent's existing ICE servers list, no action will be taken until the next gathering phase"; RFC 9429 section 4.1.18). They kept the servers the connection was built with. Now each ICE generation of each transport gathers from the list in force when it began: a generation already gathering keeps its list, the next one (an ICE restart, a new transport) asks the new STUN servers and allocates on the new TURN servers, and the allocations on servers that left the list are deleted then. Tests:tests/srflx_gathering.rs::servers_set_by_set_configuration_are_asked_from_the_next_gathering_phase,tests/turn_udp.rs::turn_servers_set_by_set_configuration_are_allocated_on_from_the_next_gathering_phase. - jsep (mdns-5): in mDNS
QueryAndGather, a STUN answer equal to its base is a server-reflexive candidate (draft-ietf-mmusic-mdns-ice-candidates section 3.1.2.2, MDNSICE-3.1.2.2-1: "a server-reflexive candidate will be generated; [...] and as such MUST NOT be considered redundant per the guidance in [RFC8445], Section 5.1.3"). The engine's STUN gathering dropped it as redundant with the host candidate, which in this mode carries only its.localname: a host with a public address offered no usable candidate to a peer that cannot resolve the name. It is now provided with raddr0.0.0.0/::and rport 9 (MDNSICE-3.1.2.2-2), as libwebrtc keeps it under mDNS obfuscation (p2p/base/stun_port.cc,UDPPort::OnStunBindingRequestSucceeded). Other modes unchanged (redundant, dropped). Test:tests/ice_mdns_exposure.rs::in_hiding_mode_a_stun_answer_equal_to_its_base_is_a_candidate_with_the_base_hidden. - stream-driver (mdns-4): with mDNS
QueryAndGatherthe driver binds the host's mDNS sockets when its connection begins gathering, before the first host candidates (before: at the first mDNS datagram), and tells the connection for which address families it has none (RTCPeerConnection::set_multicast_dns_publishing). The names of host addresses of such a family are not registered: their candidates go out under a.localname that is not published (draft-ietf-mmusic-mdns-ice-candidates section 3.1.1), or not at all withwith_multicast_dns_fail_closed(true). Before, the name was registered and announced into a socket that did not exist. - ice (mdns-4): a host candidate whose mDNS name cannot be registered keeps one unpublished name per address (its UDP and TCP candidates share it, section 3.1.1 steps 2 and 5); before, each candidate past the cap of 64 names got a name of its own. No
QueryAndGatherpath writes the literal address any more except the fixed-IP mode's other addresses (the agent without an mDNS connection used to, a path thatAgent::newnever takes). - stream-driver:
PeerDrivercarries a connection's mDNS, within one process-wide budget (draft-ietf-mmusic-mdns-ice-candidates section 7.1, MDNSICE-7.1-1). At the connection's first mDNS datagram the driver binds the host's mDNS sockets (port 5353, joined to 224.0.0.251 and, where the host has IPv6, ff02::fb), sends the engine's queries, probes and answers there and hands back what arrives; before, those datagrams were counted as unsent. Every mDNS datagram of every driver of the process takes one message from oneMdnsRateLimit(peer::process_mdns_rate_limit, 40 at once then 10 a second); one the budget refuses waits, in order.PeerDriver::mdns_datagrams_sentcounts them.MdnsRateLimit::takeandready_atare public. - video (
conf/vp-9-no-keyframe-on-resume): the send pipeline no longer forces a key frame when sending resumes after a pause (a target of 0 from the pacer). Nothing encoded is lost in a pause (the pacer keeps and sends what was written before it), so the receiver's references are intact; no RFC asks for a key frame there, libwebrtc encodes the next picture as it comes (video/video_stream_encoder.ccOnBitrateUpdated), and the engine's note onRTCRtpSender::target_bitratessays none is needed. A receiver that did lose something asks with a PLI or FIR, and the pacer's discards ask too; a request made during the pause is served by the first picture after it.SendConfig::key_frame_on_resume(default nowfalse) keeps the forced key frame as an option;SendConfig::chrome()no longer sets it, since libwebrtc's form is the default. Tests:a_pause_stops_the_encoder_and_the_resume_continues_with_delta_frames,with_key_frame_on_resume_the_first_picture_after_a_pause_is_a_key_frame,a_key_frame_asked_for_during_a_pause_is_the_first_picture_after_it(a forced key frame by default fails the first andthe_chrome_profile_resumes_as_the_default_does; hosted run 45410448247), and in the capacity calla_pacer_pause_stops_the_encoder_and_the_video_resumes_within_a_second(there the receiver's requests during the long pause make a key frame due at the resume either way). - ice: a TCP host candidate on a Teredo address (2001::/32) is ranked as the UDP-tunnelled candidate it is (RFC 6544 section 5.4): type preference 75 (section 4.2,
candidate::UDP_TUNNELLED_TYPE_PREFERENCE) instead of the TCP host preference 125, so it comes after TCP host and server-reflexive candidates. Newcandidate::is_teredo. Conformance rows RFC6544-5.4-1 and RFC6544-4.2-2 aretested. - ice: a remote candidate whose address is an FQDN is ignored, not refused (RFC 8839 section 5.1, draft-ietf-mmusic-mdns-ice-candidates sections 3.2.1 and 4; MDNSICE-3.2.1-1, MDNSICE-4-1).
add_remote_candidatewith such a line now returnsOkand the candidate reaches neither the agent nor the statistics, as a description's line already did; before, it failed withErrAddressParseFailed. A.localname of more than one "." and a.localname on a non-host candidate count as FQDNs (only a host<name>.localis resolved by mDNS); in a description, the first used to reach the agent as an mDNS name and the second refused the description. A trickled line of an unknown transport or candidate type is ignored the same way. - rtci-dtls: a resumption that carries no certificate where one should be is refused when a
verify_peer_certificatecheck is configured (fails closed): a client fails a handshake that would resume such a ticket or session withbad_certificate, and a DTLS 1.3 or 1.2 server that asks its clients for a certificate (anyClientAuthTypebutNoClientCert) resumes none (a full handshake runs, in which it asks again, with the normal check). Before, the check was skipped for an empty list. Two handshakes have no certificate by their nature and are not refused (conf/dtls-resume-3, after the second review): an external PSK handshake (RFC 8446 sections 2.2 and 4.2.11: it authenticates by possession of the key; the check is not called, as before), which the first form of this change failed for every configuration that had both external PSKs and a check (the server aborted withbad_certificate); and a resumption at a server withNoClientCert, whose first handshake had no client certificate to check either, which the first form silently turned into a full handshake every time.ConfigBuilder::with_verify_peer_certificateandwith_external_psksnow say what the check covers. Not reachable from the peer connection (its tickets always carry certificates, it configures no external PSK and its servers require a client certificate); reachable by other users ofrtci-dtls. Tests:dtls13/psk_test.rs::a_client_with_a_check_refuses_a_resumption_that_carries_no_certificate,a_server_that_asks_for_a_certificate_resumes_no_ticket_without_one_for_its_check,a_server_that_asks_for_no_certificate_resumes_with_a_check_configured,an_external_psk_handshake_completes_for_a_client_with_a_certificate_check,an_external_psk_handshake_completes_for_a_server_with_a_certificate_check,an_external_psk_handshake_completes_for_a_server_that_requires_client_certificates,resumption_test.rs::a_client_with_a_check_refuses_a_resumption_that_carries_no_certificate,a_server_that_asks_for_a_certificate_resumes_no_session_without_one_for_its_check,a_server_that_asks_for_no_certificate_resumes_with_a_check_configured. rtci-stream-drivermarks what it sends (RFC 8835 section 4.2 SHOULD, RFC 8837).PeerDriversetsIP_TOS/IPV6_TCLASSon its UDP socket before each datagram whose byte differs from the last (the newRTCPeerConnection::traffic_class: the RFC 8837 DSCP with the datagram's ECN bits), andStreamDriversets each TCP connection's fromStreamTransmit::dscp. Linux, macOS and the BSDs mark; Windows acceptsIP_TOSand leaves the packets unmarked (marking there needs qWAVE or a Group Policy QoS rule; the driver uses neither). New:sockets::set_traffic_class/traffic_class,PeerDriver::socket_traffic_class,PeerDriver::unmarked_sockets,StreamDriver::socket_traffic_class.- A media flow whose DSCP the network blocks goes back to DSCP 0 (RFC 8835 section 4.2 MAY). Under the default
RTCDscpMarking::Rfc8837, a flow sent with a codepoint other than DF that the peer's sender and receiver reports on its transport never name (three of them, at least two seconds after the flow began) is marked DF from then on, its RTX and FEC streams too; the other flows keep theirs.RTCPeerConnection::dscp_blocked_flowslists them.SettingEngineBuilder::with_dscp_marking(RTCDscpMarking::WithoutFallback)keeps marking,RTCDscpMarking::Offmarks nothing. Nothing changes on a path that delivers the marked packets. Audit: RFC8835-4.2-2tested; RFC8835-4.2-1, RFC8837-5-1 and 5-8 cite the driver. - interceptors (NACK responder, TWCC sender), repeat repairs follow the feedback (
conf/rtx-1r-duplicate-repairs): a request for a packet whose retransmission per-packet feedback reported received is no longer answered, and one whose retransmission left without a report yet waits for it: answered at once when the retransmission is reported lost, or when two round trips and the feedback interval (REPAIR_REPORT_MARGIN, 100 ms; 1 s before a round trip is known) pass without a report; held requests keep their place and those behind them are served meanwhile. The receiver asks again every round trip while a packet is missing, and a retransmission can wait longer than that in the path's queue: after a sudden capacity drop 24 to 28 of 92 to 101 retransmissions (a chain without a pacer) and 35 to 41 of 90 to 103 (the default chain) repeated a packet whose first repair then arrived first (hosted traces 45341865225, 45342290711). The TWCC sender reports what transport-wide feedback says of each retransmission it numbered (RetransmissionsReported, new, on an empty RTCP carrier application-ward; keyed asRetransmissionsLeft); with RFC 8888 feedback (the default between two endpoints of this engine) the responder reads the report on the RTX stream itself. Without per-packet feedback of either kind every request is answered as before. RFC 4588 section 7: the sender "MAY selectively retransmit only the packets that it deems important and ignore NACK messages for other packets"; RFC 8834 section 6.1: "It is not appropriate to blindly retransmit RTP packets in response to a NACK": the sender's choice, bounded. Measured intests/capacity_cap_video_rtc2rtc.rs(cap after 20 s, six seeds on three wall clocks, hosted run 45408404348; 0.1.0: run 45407054812): without a pacer the oldest picture 2.90 to 3.15 s (4.35 to 4.51), 57 to 64 retransmissions (89 to 97), longest freeze 1.28 to 1.29 s (1.28 to 1.32); the default chain 4.14 to 7.13 s (5.56 to 10.23), 59 to 80 (90 to 104), 0.75 to 1.13 s (0.97 to 1.91), and the recovery's mean 15 to 25 s after the cap 898 to 2500 kbit/s (646 to 2500). After a 4 s outage and an ICE restart (six seeds) the chain without a pacer is frozen 0.33 to 0.92 s from one second after the switch (0.70 to 0.99), the default chain still shows no usable frame to the end of the run (a known limit of 0.1.0). The tests' bounds on the picture's age and the retransmissions on this branch are the tripwires of the perturbed ensemble (conf/capmatrix-1-perturbed-ensemble, measured on the tree before this change; this change sits well inside them). Not offered: libwebrtc's form (no resend within one round trip,rtp_packet_history.ccVerifyRtt) loses a repair (vp8_nack_jitter_buffer_rtc2rtc::a_jitter_buffer_deeper_than_the_feedback_delay_repairs_ every_detectable_lossfails, hosted run 45346502179), and first repairs ahead of repeats (measured, run 45349364771: freezes of 1.62 to 2.39 s without a pacer, against 1.28 to 1.29 s; the repeats left are repairs of lost repairs, which a receiver that plays in order waits for first). This narrows two known limits of 0.1.0 (the 1.4 Mbit/s cliff's cause (2), and the picture's age after a sudden drop with the pacer). Tests:rtci-interceptor/tests/nack_repeat_repairs.rs. What is remembered of a repair is one packet's and ends by the clock (conf/rtx-1r2-duplicate-repairs, after an independent review proved two defects in the first form, hosted run 45477234586: a "received" memory pruned only when another report came, so a request could be declined for ever and the packet that reused a 16-bit sequence number a cycle later was never retransmitted; and a transport-wide number kept for a retransmission by count only, so feedback on the packet that had the number a cycle later was taken for the old retransmission arriving). The responder keeps one record per packet for its latest retransmission (waiting in the pacer, left with no report yet, report overdue, reported received), named by the packet's place in the order the stream was written, which no later packet has again; a waiting request is for its packet too. Every state ends by the engine's clock at the request, write, notice or timeout at hand, whether or not another report or pacer notice ever comes: in the pacer 4 s, the wait for a report two round trips and 100 ms, a late report 4 s (RETRANSMISSION_REPORT_HORIZON), reported received 4 s (DELIVERED_MEMORY). A report counts once, for a retransmission of the packet held now: a report repeated (RFC 8888 reports a span of packets every time) does not extend the memory, one on nothing remembered begins none, the loss of an earlier copy does not end the wait for a later one. So a receiver whose feedback reports repairs it did not get stops the repairs of its own packet for 4 s per retransmission and no longer, and what is remembered is at most one record per place of the send buffer. The TWCC sender's number is a retransmission's until it is handed out again, until the numbering is half a cycle past it, and for 4 s.RetransmissionsReportednames each retransmission with the instant it was made (ReportedRetransmission, new). Tests (the reviewer's three among them): sequence numbers and transport-wide numbers coming round at 100 000 packets a second, feedback and pacer notices that never come, a receiver that reports every repair received, feedback naming every number, requests and lost reports without end against the rate limit, and the sizes of what is remembered (nack_repeat_repairs.rs,nack::responder::tests,twcc::sender::tests); each rule has a mutation a test catches. Performance: rtx-1r2 - interceptor (fec-14): an audio packet rebuilt from a RED block (RFC 2198) takes the RFC 6464 / RFC 6465 audio level extensions of the RED packet that carried it, as RFC 8854 section 4.1 asks ("attempt to approximate this information"), where it had no header extension before; other extensions of the RED packet are still left out.
- fec (fec-12): a FEC session's m= section (RFC 5109 section 14.1,
add_fec_session) states the per-packet congestion feedback the media sections state for the kind: the transport-wide sequence number extension (a=extmap:1, its own id in a section of its own) witha=rtcp-fb:<pt> transport-cc, anda=rtcp-fb:<pt> ack ccfb(RFC 8888), and an answerer keeps one of them (RFC 8888 section 6), RFC 8888 when both sides state it as for the media, the extension under the offer's id. The FEC session's packets then carry the transport-wide sequence number of their own transport and are reported on, so that transport's congestion controller (each transport is a path, RFC 8836 section 2) has the feedback it ran without before. A section without these lines (an earlier peer) is taken as before: no extension, no feedback. - congestion control (GCC), the over-use detector's threshold adapts over the arrival gaps (
conf/gcc-9-draft-threshold-time-base): draft-ietf-rmcat-gcc-02 section 5.4,del_var_th(i) = del_var_th(i-1) + (t(i)-t(i-1)) * K(i) * (|m(i)|-del_var_th(i-1)), t(i) the arrival time of group i, is now the default (ThresholdTimeBase::Arrival, forGcc,DefaultInterceptorOptions::gcc_threshold_time_baseand theRfcprofile rowgcc.threshold-time-base). The earlier default, the gap between the readings on the sender's clock capped at 100 ms, stays asThresholdTimeBase::Departure(a setting, no profile selects it);Chromekeeps libwebrtc's capped arrival gap (ArrivalCapped). It was kept as the default because it measured better; since the draft's decrease on every update (0.1.0) it no longer does. Measured (rtci-interceptor/tests/rfc8836_multi_flow.rs, hosted run 45416144506, against Departure): two flows on one bottleneck share 0.48 / 0.50 with a queueing delay of 2.9 ms mean and 11.0 ms p95 (0.49 / 0.49, 18.5 and 93.2 ms); a late flow 0.49 (0.50); beside a TCP-like transfer 0.33 of the path with a 0.05 s buffer (0.25) and 0.14 with a 0.2 s buffer (0.22): the cost, above the tests' bound of 0.05. The capacity-cap call (tests/capacity_cap_video_rtc2rtc.rs, six seeds on three wall clocks, hosted run 45416130268 against 0.1.0's 45407054812): without a pacer freeze, oldest picture and retransmissions unchanged, 249 to 281 kbit/s under the 300 kbit/s cap (246 to 252), 1101 to 1501 kbit/s on average 15 to 25 s after it (1060 to 1363); with the pacer freeze 0.97 to 1.87 s (0.97 to 1.91), oldest picture 6.01 to 9.83 s (5.56 to 10.23), 94 to 106 retransmissions (90 to 104), 154 to 231 kbit/s under the cap (122 to 230), recovery 862 to 2500 kbit/s (646 to 2500). The lossy reordering sweep (48 cells) is unchanged but for two cells of 100 ms reordering at 2 Mbit/s, higher (1 %: 331 -> 340 kbit/s, 5 %: 100 -> 218); the rate-limited link 574 / 539 / 535 kbit/s (574 / 538 / 535). Audit row GCC-5.4-4 istested. Performance: gcc-9 - media:
H26xWriter(H.264) gives the depacketizer each packet's sequence number, as it did for H.265: the fragments of a NAL unit after a lost one are dropped with it, not written as a NAL unit with a hole in it (RFC 6184 section 5.8). Conformance rows RFC6184-5.8-14, RFC7798-4.4.3-12 (SampleBuildernever depacketizes across a missing packet, now tested) and RFC7798-4.3-1 aretested. - jsep / sdp: the
o=line of a peer connection's descriptions is drawn once, when it is built (conf/jsep-75-session-version). The session version starts at a timestamp, the seconds since 1900 of the wall clock at that moment (RFC 8866 section 5.2: "it is RECOMMENDED that a timestamp be used"), instead of the clock's sub-second nanoseconds, and still goes up by one with each description that differs (RFC 9429 section 5.2.2). The session id comes from the crypto provider'srandom()and is below 2^63 - 1 (RFC 9429 section 5.2.1).SessionDescription::new_jsep_session_descriptionwrites the same kind of version. Peers see a larger first version (about 3.9e9, still below 2^32). Tests:tests/jsep_session_version.rs::the_first_session_version_is_the_wall_clocks_seconds_since_1900,rtci-sdpgrammar_test::the_jsep_templates_write_the_lines_rfc_9429_section_5_2_1_gives. RFC8866-5.2-3 istested. - jsep: an offer with empty
a=grouplines (RFC 5888 section 9.3 capability indication) is answered with an emptya=groupline for each semantics the engine understands and the answer does not use (BUNDLE, LS, DDP) (conf/jsep-77-small-rows). Offers without such lines, which is every browser's, are answered as before. Test:tests/jsep_sweep_rfc5888.rs::empty_group_lines_of_an_offer_are_answered_with_this_endpoints_capabilities. - jsep: a section an answer rejects after writing it (outside the offered BUNDLE group under
must-bundle, or beyond what the bundle policy takes from an offer without BUNDLE) no longer carriesa=candidate/a=end-of-candidates(RFC 8839 section 4.2.1.6); the next section written takes them, and the local description puts the candidates in the first section that is not rejected (it used to be the first section) (conf/jsep-77-small-rows). Test:tests/jsep_sdp_rows.rs::a_section_answered_with_port_zero_has_no_candidates. - tests (
conf/jsep-77-small-rows): a late identification-tag does not end the session (RFC 9143 section 15,tests/jsep_sweep_media_rtc2rtc.rs::a_late_identification_tag_does_not_end_the_session); the end-of-gathering event names its section (RFC 9429 section 4.1.20). RFC9143-15-3, RFC5888-6-5, RFC8839-4.4.1.2.1-2, RFC9429-4.1.20-4, RFC3264-6.1-15 and 7-3 aretested, RFC3264-6.1-20n/a. RFC5888-9.3-1 istested; RFC8866-5.8-4 and 6.7.3-1 and RFC8122-7-1 gain the tests they lacked (tests/jsep_sdp_rows.rs::bandwidth_lines_use_registered_modifiers_only,tests/jsep_sweep_media_rtc2rtc.rs::a_sendonly_endpoint_processes_the_rtcp_it_receives,rtci-dtlsa_client_hello_offering_only_the_null_suite_is_refused). - sdp / jsep: a remote description with two direction attributes at one level is refused (RFC 8866 section 6.7: at most one at session level and one per media description); the first was taken before. The informational attributes
a=tool,a=type,a=orientanda=quality(RFC 8866 sections 6.3, 6.9, 6.8, 6.14) now have their grammar checked, so a remote description with a malformed one, or one at the wrong level, is refused (RFC 9429 section 5.8) (conf/jsep-78-sdp-informational). Browsers send neither. - rtp:
Vp8Payloaderstarts each partition of a VP8 frame in a packet of its own, with the partition'sPIDandSon its first packet (RFC 7741 sections 3, 4.2, 4.4): it reads the frame tag, the token partition count from the first partition's header (RFC 6386 section 19.2) and the partition sizes. A frame with one token partition now goes out in at least two packets (the first partition, then the residual). A frame whose sizes do not add up is cut at MTU boundaries as before.Vp8Payloader::ignore_partitions(new public field) selects the old cut, which is libwebrtc's. Conformance rows RFC7741-4-1, 4.2-7, 4.2-11, 4.4-4 and 4.4-6 aretested. vp8.ignore-partitions, a governed behaviour: theChromeprofile packetizes VP8 as libwebrtc does (conf/vp-9r-vp8-partitions). NewMediaEngine::set_vp8_ignore_partitions(falseby default, RFC 7741 section 3's partition packets;trueunderChrome: libwebrtc'sRtpPacketizerVp8cuts the whole frame,Son the first packet only,PID0),MediaEngine::payloaderandRTCRtpSender::payloader(&codec), which build a payloader with the connection's packetization settings (RTCRtpCodec::payloaderkeeps the default form).rtci-video'sVideoSendertakes its payloader from the sender, so its VP8 follows the profile. Tests:tests/vp8_packetization_profile.rs.- sdp: an interleaved H.264 format (
packetization-mode=2, registered by the application; no default format is one) is offered and answered withdeint-buf-cap=33554432, the de-interleaving buffer the depacketizer holds (MAX_DEINTERLEAVING_BYTES), unless the application gave its own value (RFC 6184 section 8.2.2). Default offers are unchanged. - rtp:
rtp::codec::h264::mtapwrites its units in decoding order (ascending DON from the DON base), whatever order they are given in (RFC 6184 section 5.7.2). Conformance rows RFC6184-5.7.2-3, 7.2.1-1, 7.2.1-2 and 8.2.2-9 aretested. - RFC 8108 section 6.1: an endpoint starts sending on the SSRC it reported from. A connection that sends no media reported from an SSRC its RTCP session drew, and when its first stream started (a receiver that turns
sendrecv, anaddTrackafter the call is up) that SSRC said BYE and the stream joined as a second participant. The RTCP session now announces the reporting SSRC it draws (RtcpSessionEvent::ReportingSsrc, new;Noneonce the SSRC is a stream's or said BYE); the first media SSRC the connection mints is that one, and the stream bound under it takes the reporting SSRC over: no BYE, one participant, its reports become sender reports. Later streams, and SSRCs the application names in a track's codings, are unchanged. On the wire: a peer sees RTP and sender reports arrive from the SSRC that sent the receiver reports (as libwebrtc does with its own receiver-report SSRC), signalled in the next description as usual. Engine behaviour change (SSRC handling). Rows: RFC8108-6.1-1 (violated->tested). - RFC 4585 section 3.5.4: congestion control feedback sent at once counts in the average RTCP packet size. The transport-wide and RFC 8888 feedback the RTCP session sends as it is built (
with_immediate_congestion_feedback, the default) was left out ofavg_rtcp_sizewhen sent, though the peer's was counted when received; the clause has the average "updated accordingly" for every packet, Early or Regular. Now every packet sent moves it, so the regular report interval reflects the packets the endpoint actually sends (slightly longer where that feedback is larger than the regular reports). Withwith_congestion_feedback_in_budget(thePerformanceprofile) the regular reports' budget still rests on their own size. Engine behaviour change (RTCP timing). Rows: RFC4585-3.5.4-2 (partial->tested). - RFC 8108 section 5.2: senders report first when not every SSRC fits. When an endpoint's SSRCs cannot all report in one aggregated compound packet (the MTU), the RTCP session now puts the sending SSRCs' reports in first ("those most useful to the peers"), then the others by their timers; before, the order was the timers' alone. The SSRCs left out still report when their own timers expire. Engine behaviour change (report content on the wire, only for endpoints with more SSRCs than one packet holds). Rows: RFC8108-5.2-3 (
missing->tested); RFC8108-5.2-1 (initial report at zero delay, already done bywith_first_report_at_join) markedtested. - RFC 7164: no RTCP timestamps around a possible leap second. Taking up section 5.1's assumption of a positive leap second at the end of every month, the RTCP session sends no sender report and no XR receiver reference time stamped in the last second of a month's last day or the second after it (UTC): the SSRC reports with a receiver report there, keeping its schedule. A sender report received with such a timestamp is not used for LSR / DLSR or the remote-outbound timestamps (its counts are). New:
rtci_shared::time::near_leap_second. Engine behaviour change (report content on the wire, two seconds a month). Rows: RFC7164-5.1-1 to 5.1-5 (missing->tested), 5-3 (missing->partial: the RFC 8888 report timestamp and the NTP header extensions are still written there). - RFC 8108 section 5.1: the RFC form of
with_report_from_every_ssrcreports on the co-located SSRCs too. WithRtcpSessionBuilder::with_report_from_every_ssrc(true)(DefaultInterceptorOptions::rtcp_report_from_every_ssrc, theStrictRfcprofile) each local SSRC's SR or RR now also carries a block for each of the endpoint's other SSRCs that has sent ("including those co-located at the same endpoint": nothing lost, no jitter, the highest sequence number sent, that SSRC's last SR). The default staysfalse(blocks once, libwebrtc's form), measured: the RFC form's larger compound packets made the video freeze longer through a capacity cap (measure_report_blocks_from_every_ssrc_against_once: mean 1.73 s against 1.60 s). No change with the default. Rows: RFC8108-5.1-1 (partial->setting, measured). - rtp:
HevcPayloaderputs the parameter sets, AUD and prefix SEI that precede a slice in the slice's aggregation packet when the slice does not fit the packet being filled and they fit one together, instead of leaving them with the units before them (RFC 7798 section 5). Conformance row RFC7798-5-5 istested. - sdp: an H.265 answer to an offer with
sprop-max-don-diffabove 0, and an H.265 format of this endpoint with it, statedepack-buf-cap=33554432, the de-packetization buffer the depacketizer holds (MAX_DEPACKETIZATION_BYTES), unless the application gave one (RFC 7798 section 7.2.2). Default offers, and answers to browsers' H.265 offers (which carry nosprop-max-don-diff), are unchanged. Conformance row RFC7798-7.2.2-10 istested. - stream-driver, mdns (
conf/mdns-7-per-interface, review F1, F7, F8):PeerDrivertook part in mDNS on the system's default multicast interface only, with one socket, and ignored the address the engine names for each mDNS datagram: names of addresses on any other interface (loopback included) never resolved, and every name was announced on the default link (RFC 6762 section 14: "addresses ... MUST be valid for use on the interface on which the response is being sent"). Now its mDNS sockets join the groups on the interface of every configured address, and each message leaves by the interface of its source (IP_MULTICAST_IF/IPV6_MULTICAST_IF, set per send by the tokio, smol and custom-runtime sockets, honoured by the mock); a query leaves once from each interface, on both families' groups.rtci-mdnsnames an IPv6 record's own address as the source of its messages (it named 0.0.0.0), and the driver sends them on ff02::fb (and on 224.0.0.251 from the IPv4 address of the same interface, where it has one): an IPv6-only link gets mDNS, and the per-family publishing report (set_multicast_dns_publishing) says what is actually sent. UnderQueryAndGatherno two UDP sockets of a driver share a port (a.localcandidate names its socket by port only); a range with no such port left falls back to a shared one. Tests:mdns_virtual_time.rs::drivers_whose_link_is_not_the_default_multicast_interface_resolve_each_other,a_multi_homed_driver_answers_for_each_name_on_the_interface_of_its_address,a_publishing_driver_gives_each_of_its_sockets_a_port_of_its_own,mdns.rs::drivers_on_loopback_resolve_each_other_on_the_loopback_interface. The mock network gives each address its own ephemeral ports and has a default multicast interface (MockNet::set_default_multicast_interface). Engine behaviour change (rtci-mdns: the source address of an IPv6 record's messages; IPv6 records of different addresses are no longer aggregated into one message, as IPv4 records already were not). - ice (
conf/ice-25-mdns-tcp-candidate, also in 0.1.0): a TCP host candidate whose address is an mDNS name was built as a UDP candidate (CandidateHostConfig::new_candidate_hostgave every.localcandidateNetworkType::Udp4), so the agent's own ICE-TCP candidates underQueryAndGatherwere signalled… 1 udp … <uuid>.local 35225 typ host tcptype passiveand a peer'stcp … .localcandidate was taken for UDP: two publishing peers had no ICE-TCP path. It now keeps its transport (RFC 6544 section 4.5; draft-ietf-mmusic-mdns-ice-candidates section 3.1.1 step 6 replaces only the address), and resolves toTcp4/Tcp6. Testscandidate_test.rs::test_tcp_host_candidate_under_an_mdns_name_is_signalled_as_tcp,to_json_of_a_tcp_candidate_under_an_mdns_name_says_tcp. Engine behaviour change (SDP). - stream-driver (
conf/mdns-8-send-failures, review F2, F10, F11): where mDNS cannot be sent (the socket binds but every send to the group fails, as on GitHub's macOS image or in a Mac application without the Local Network permission), two publishingPeerDrivers sat in Connecting for ever and the application was told nothing; a bind failure was kept for the life of the connection. Now a refused send (at once for "no route" / "no permission", else after three in a row) or a failed bind is reported asPeerDriverEvent::MdnsUnavailable(PeerDriver::poll_driver_event, with the OS error), counted (mdns_send_failures,mdns_bind_failures,mdns_available), and fed to the connection as a family it cannot publish for (set_multicast_dns_publishing, sowith_multicast_dns_fail_closedapplies to the candidates gathered next); the socket is bound again at the next gathering and after a back-off (1 s doubling to 60 s), and the first send that works is reported asPeerDriverEvent::MdnsAvailable. What the mDNS sockets receive waits in a bounded queue (256, oldest dropped,mdns_datagrams_dropped). Teststests/mdns_failures.rs(virtual time, every platform; the mock network refuses sends withMockNet::set_send_error) andtests/mdns_unavailable.rs(real network,--ignored, run on hosted runners). Not an engine change. - stream-driver (
conf/mdns-9-shutdown, review F3): mDNS goodbyes (RFC 6762 section 10.1, TTL 0) left only when the application closed the connection and kept stepping the driver; dropping the driver sent none, and the link's caches held the names for 120 s. NewPeerDriver::shutdown(linger): closes the connection, sends every goodbye within the mDNS budget (waiting up tolinger), then closes the driver's sockets, leaving the groups. Dropping a driver that was not shut down now closes its connection and sends at once what the budget lets go (an async driver on a pluggable runtime cannot wait indrop). Teststests/mdns_shutdown.rs. Not an engine change. - mdns, ice, peer connection, stream-driver (
conf/mdns-10-on-link, review F6, F9, F12 and its observation on peer-reflexive candidates):- RFC 6762 section 11's first test ("All responses received with a destination address in the IP header that is ... 224.0.0.251 or ... FF02::FB are necessarily deemed to have originated on the local link, regardless of source IP address") now applies through
handle_readtoo: with the destination declared as reported (with_multicast_dns_destination_reported, new at run timeRTCPeerConnection::set_multicast_dns_destination_reported,Agent::...,Mdns:: set_destination_reported), a group address inlocal_addris an arrival at the group. Before, onlyMdns::handle_datagramapplied it, so through a peer connection a LAN of public addresses resolved no.localname.PeerDriverdeclares it and reports each mDNS datagram's destination where it knows it (Linux IPv4, bound to the group; a runtime that fillsRecvMeta::dst_ip); unknown elsewhere (tokio, smol: noIP_PKTINFOread), where the scope of the source still decides. - Under
QueryAndGathera local peer-reflexive candidate (RFC 8445 7.2.5.3.1) no longer shows its base in the related address, and one whose mapped address is a hidden host address shows the host's name (draft-ietf-mmusic-mdns-ice-candidates 3.3.1, first MUST). RTCIceCandidate's string form ran the related address into the port (udp prflx 10.1.0.135:55410172.17.0.1); it now reads... related 172.17.0.1:40000.- The process's mDNS budget can be set once before first use (
peer::set_process_mdns_rate_limit); a driver on a runtime with a virtual clock (Runtime::virtual_clock, new,trueforMockRuntime) takes from a budget of its own instead of the process's wall-clock one, so a mock clock can neither empty it for real drivers nor wait on it. - F9 decided: QU stays off with the driver (its IPv4 socket on Linux is bound to the group and receives no unicast; RFC 6762 section 15.1). Tests:
mdns_answer_trust_test.rs::test_a_reported_multicast_destination_in_local_addr_makes_a_public_source_on_link,mdns_virtual_time.rs::drivers_on_a_lan_of_public_addresses_resolve_each_other,agent_checklist_test.rs::test_a_local_peer_reflexive_candidate_does_not_show_a_hidden_host_address,candidate.rs::the_string_form_separates_the_related_address_from_the_port,tests/mdns_budget.rs. Engine behaviour change (rtci-mdns trust with a reported destination; rtci-ice local peer-reflexive candidates; the candidate string form).
- RFC 6762 section 11's first test ("All responses received with a destination address in the IP header that is ... 224.0.0.251 or ... FF02::FB are necessarily deemed to have originated on the local link, regardless of source IP address") now applies through
Changed
- SRTP re-keying (RFC 5764 section 4.4) starts at a margin measured in time as well as in packets: the larger of a sixteenth of the key's lifetime and the packets the key protects, at the rate it has been used since its first packet, in the time a re-keying needs as measured on the handshake that gave it (twice the handshake's duration, for the handshake and the ICE checks of the restart, plus one DTLS retransmission timer). On a slow path with a short lifetime the re-keying starts earlier instead of the key running out and the transport failing (0.1.0's known limit); with the default lifetimes, and wherever the sixteenth is the larger, nothing moves.
OnSrtpKeyLifetimeExpiringstill comes at the sixteenth; the DTLS client still asks first (with_srtp_rekeying_dtls_client_first: the client measures its handshake from its first flight, the server from the first datagram it reads). Engine behaviour change. - conformance (sctp-20): nine RFC 9260 rows the code had already caught up with are closed with their tests, each checked by mutation: the ABORT with Unresolvable Address (3.3.2), the negotiated stream count (5.1.1), the stale cookie of a restart or collision (5.2.4, SHOULD), route changes (7.2.5.2), the protocol parameters and failure threshold as settings (11.1), and the COOKIE ACK bundled with the SACK for the DATA that came with the cookie (3.3.12, 5.1, 5.1.5; the test now checks the one packet). Supported Address Types in INIT (5.1.2) is
n/a: RFC 8261 6.1 forbids it over DTLS. Engine behaviour change: no. - A video RED format is not negotiated without ULPFEC (RFC 5109 section 14.3). "In cases in which the redundancy payload format is used with FEC as the only secondary codec, when the FEC stream is rejected the redundant encoding payload type SHOULD also be removed": a
video/redformat without an fmtp line (it names no encodings, so ULPFEC is the only thing it can carry) is left out of the negotiated formats when noulpfecformat of its rate is negotiated, and the RTX format that names it goes too. This changes the answer of an application that registeredvideo/redand notulpfec; the default codecs register neither, and audio RED is untouched. - A new m= section that an offer keeps outside every BUNDLE group although the offer has groups (
RTCRtpTransceiver::set_bundle_request(Some(false))on a transceiver the last answer did not have) gets a transport of its own, as the method's documentation says; it was put on the BUNDLE transport. A section a description leaves outside every group is never writtena=bundle-only. - sctp (sctp-18):
AssociationStatscounts DATA chunks sent again (get_num_retransmissions), messages abandoned (get_num_abandoned_messages), losses Fast Retransmit found in messages whose retransmission budget was spent and abandoned instead (get_num_fast_retrans_abandoned), FORWARD TSN chunks sent (get_num_forward_tsns) and the time T3-rtx expiries waited (get_t3_wait, the RTO at each expiry);RTCSctpTransport:: association_statsgives them for the live association (a diagnostic, not a W3C member). The documentation ofget_num_datassaid "sent"; it counts DATA chunks received. - tests (sctp-18): the test environment's 1000-message unreliable channel at 10 % loss (
testenv_impairment::unreliable_channel_loses_without_retransmitting) asserts on counted protocol events: no DATA of the channel sent twice, every lost message abandoned and skipped with FORWARD TSN, at least 45 % of the losses found by Fast Retransmit, T3-rtx expiries at most 3/4 of the losses and their mean wait at most 3 s, and the time not spent waiting for T3-rtx under 40 s; the wall time is a 120 s ceiling only (was the assertion, at 90 s). It prints the T3-rtx expiries and their wait beside the drain figure. Engine behaviour change: no (counters only). - sctp (sctp-24, pass2): the INIT sent after a Stale Cookie ERROR carries a Cookie Preservative (RFC 9260 3.3.2.1.3, 5.2.6) asking for what the cookie was late by, at least the round trip of the COOKIE ECHO / ERROR exchange and at most a second beyond it (the 5.2.6 SHOULD);
AssociationStats::get_num_sack_lossescounts SACKs found lost from Duplicate TSN reports of timer retransmissions (6.2 MAY). RFC9260-3.3.2.1.3-1, 5.2.6-3, 6.2-25 aretested. Engine behaviour change: yes, small (a 8-byte parameter in an INIT that follows a stale cookie; a counter). - sctp (sctp-23, pass2): an association that ends with user messages it did not deliver reports them (RFC 9260 8.1: "report the failure to the upper layer and optionally report back all outstanding user data"): one
Event::SendFailure { unsent, unacknowledged }(11.2.2) beforeAssociationClosed, andAssociation::take_undelivered_messages()hands back each message (UndeliveredMessage: stream, SSN, PPI, unordered, modeUnsent/Unacknowledged, partial flag, the bytes not acknowledged) as Receive Unsent / Receive Unacknowledged Message do (11.1.14, 11.1.15). A graceful shutdown leaves none. - sctp (sctp-23, pass2):
Event::CommunicationError { causes }for each ERROR chunk the peer sends (11.2.5),ErrorCauseCode::value();Association::request_heartbeat(now)(11.1.10, also with heartbeats disabled);Association::status()(AssociationStatus, 11.1.8) andpeer_receive_window(). RFC9260-8.1-5, 11.1-2, 11.1-3, 11.1-5, 11.2-2 aretested. Engine behaviour change: new events only (bothEventvariants under#[non_exhaustive]); the outbound queues of an ended association are emptied into the undelivered list. - sctp (sctp-19): three optional behaviours of RFC 9260. A SHUTDOWN goes with a SACK when what was received has gaps, which the SHUTDOWN's Cumulative TSN Ack cannot report (3.3.8); the last DATA chunk sent in SHUTDOWN-PENDING carries the I bit, so the receiver acknowledges it without the SACK delay the SHUTDOWN waits for (3.3.1, RFC 7053); and
TransportConfig::with_fragmentation(false)turns fragmentation off, refusing a message larger than one DATA chunk of a full-sized packet withErrOutboundPacketTooLarge(6.9; on by default). Engine behaviour change (shutdown packets): yes. The answer to a refused INIT (an ABORT to its Initiate Tag, 3.3.2) was already there; its audit row is closed with its test.
Features
- SettingEngineBuilder::with_wall_clock (
conf/jsep-75-session-version): the wall-clock time paired with the instant the peer connection is built, for the values it writes on the wall clock itself: theo=session version, the receivers' source timestamps and the NTP times of the RTCP session it installs. With a seeded crypto provider theo=line is the same in every run under virtual time. Alsosdp::description::session::Origin::jsep,SessionDescription::new_jsep_session_description_with_originandNTP_UNIX_EPOCH_OFFSET_SECS. - SettingEngineBuilder::with_rtcp_mux_only_in_subsequent_offers (
conf/jsep-76-spec-conflicts): RFC 8858 section 4.5's form, a subsequent offer sayinga=rtcp-mux-onlyagain in the m= sections it carries over (under therequiremux policy; in the tagged section, or in every bundled one with the bundle attributes repeated). Off by default and in theRfcandChromeprofiles, on inStrictRfc: RFC 9429 section 5.2.2, which governs a JSEP endpoint, says "The 'a=rtcp-mux-only' line MUST NOT be added". No change to what the engine generates by default. RFC8858-4.5-1 isconflict(wasviolated), withtests/jsep_rtcp_mux.rs::when_asked_a_subsequent_offer_says_rtcp_mux_only_again; RFC8858-4.5-4 isn/a. - jsep: RFC9429-4.1.1-4 (ignore
max-bundle) isconflict(wasviolated): the existingwith_max_bundle_as_must_bundle(false)is RFC 9429's form and the default is W3C webrtc-pc 4.2.5's; the test is split in two, one per form (tests/jsep_bundle_policy.rs::max_bundle_selects_must_bundle_by_default,max_bundle_is_ignored_when_set_to_be_ignored). - rtci-sdp: typed
Tool,ConferenceType,OrientandQualityattributes withSessionDescription::tool,conference_typeandMediaDescription::orient,quality(conf/jsep-78-sdp-informational); the SDP fuzz targets cover them. RFC8866-6.3-1, 6.8-1, 6.9-1, 6.14-1 and 6.7-1 aretested, 6.4-1, 6.5-1 and 5.8-7 too (their notes were stale). - A connection can take an existing connection's RTCP CNAME (RFC 8834 section 4.9 MAY).
RTCPeerConnectionBuilder::with_rtcp_cname(existing.rtcp_cname()): "if explicitly requested at creation, an RTCPeerConnection MAY use the same CNAME as an existing RTCPeerConnection", so a receiver can synchronise the streams of both. Without it each connection generates its own (unchanged). A CNAME outside 1 to 255 octets failsbuildwith the newError::ErrRtcpCnameLength. Audit: RFC8834-4.9-5tested; with new tests RFC8835-4.2-8 (bundling by media type), RFC8837-5-6 (AF3x for non-interactive video) and the stale RFC8834-8-2 (RTCP XR generation)tested. - statistics (
conf/vp-4-engine-boundary):DecoderStatsUpdatehas four new public fields,jitter_buffer_delay,jitter_buffer_target_delay,jitter_buffer_minimum_delayandjitter_buffer_emitted_count: a struct literal without..Default::default()needs them. - video pipeline, phase 3: the send pipeline (
conf/vp-7-send,docs/video-pipeline.md6.5; built onconf/gcc-5-app-limited, merged in, for the pacer's pause and discards):rtci_video::send::SendPipeline: pictures in, RTP packets out (the negotiated codec's payloader, timestamps from the capture time). The target (RTCRtpSender::target_bitrates, the estimate less the retransmission reserve) sets the encoder's rate, never below the encoder's minimum (pictures dropped in the ratio target / minimum instead); a target of 0 (the pacer's pause) stops the encoder, and the first picture after it is coded as it comes (conf/vp-9-no-keyframe-on-resume, below); PLI, FIR and the pacer's discards ask for a key frame, not served within two round trips of the last one (RFC 5104 3.5.1; 500 ms until a round trip is known, RFC 7728 8.1); resolution and frame-rate steps when the target falls under what the format needs, in the order of the W3CdegradationPreference(defaultbalanced), with a 5 s hold before a step back up.SendConfig::chrome(): libwebrtc's choices (one request served per 300 ms,maintain-framerate).rtci_video::engine::VideoSender: the glue to anRTCRtpSender(target, events, round trip,update_encoder_statswithqualityLimitation*).VideoEncoder::set_ratesandmin_bitrate_bps(both with defaults),EncoderFactory,picture::scale_into.- Breaking for an exhaustive
match(rtci-videois not published):engine::Errorhas a new variantEncode. - Measured with the VP8 backend in a two-peer call on the default interceptors (640x360, 30 fps): open link, encoded rate within 0.1 % of the target over 10 s windows; the capacity test's 300 kbit/s cap on six seeds, longest freeze 1.19 to 1.71 s, 0 frames discarded by the pacer, 0 pictures encoded in a pause, a key frame after each, 1186 to 1385 kbit/s 20 s after the cap; known cost: the oldest picture shown is 10.2 to 11.7 s old after the cap (the pacer's backlog of the 2.5 Mbit/s before the estimate fell); 2 % loss repaired by NACK with no wait beyond the slowest repair. Each reaction mutation-checked.
- Not built yet: simulcast, temporal layers and SVC, the rate allocators, the encoder bitrate adjuster, the zero-hertz cadence adapter.
- video pipeline: codec safety (
conf/vp-6-codec-safety,docs/video-pipeline.md4.7, 4.8, 6.4):- Breaking:
rtci-video'svp8feature is opt-in again (default features:engine). The default build decodes no video until the application enables a codec. Supply-chain review ofvp8-decoder/vp8-encoder0.1.3 (publisher, contents against the tagged commit,unsafe, build-time code, licences, prior art) with a recommendation for the owner;scripts/check-video-codec-pins.pyfails on any other version or checksum. codec::av1: the 96-byte leak found by fuzzing is rav1d 1.1.0's (memorysafety/rav1d#1522: everydav1d_picture_unrefand every emptydav1d_get_pictureleaves a 48-byteArc; about 50 to 100 bytes a frame), documented on the feature. Separately, a temporal unit'sDav1dDatais now released when taking out a waiting picture fails (found by reading). The abort on hostile input is rav1d 1.1.0's (memorysafety/rav1d#1497, fixed on its main branch, unreleased), documented on the feature in plain words; reproducer inrtci-video/tests/data/rav1d-abort.ivf.- Feature
isolation:codec::isolated::IsolatedDecoderruns any decoder in a child process (serveon the child's side); a child that aborts, crashes or hangs costs that frame. codec::vp8catches a panic of the decoder and replaces it (DecodeError::Corrupt).- Features
libvpx(VP8 / VP9 decode and encode),dav1d(AV1 decode) andopenh264(H.264 decode and encode with Cisco's binary only, accepted by its published SHA-256): each loads its library at run time, so building them needs no system library (cargo check --all-featuresstays pure Rust). libvpx's decode of the VP8 fixture equals libvpx's reference output; libdav1d survives every single-bit flip of a key frame (19,352) and 1500 seeded mutations that abort rav1d. The AV1 wrappers no longer refuse a key frame after an accepted hostile delta frame (an error met while taking out a waiting picture is the earlier unit's). A CI job installing the libraries is proposed, not added. - The root crate no longer dev-depends on
rtci-video: the interop peer'spipelinescenario is built by the newrtci-video-interoppackage (featurepipeline, binaryinterop-peer-video, which the browser stage now starts), so workspace builds compile no codec.
- Breaking:
- video pipeline, phase 2: codecs (
conf/vp-5-codecs,docs/video-pipeline.md4.6):rtci-videofeaturevp8(default): VP8 decode and encode in pure Rust withvp8-decoder/vp8-encoderpinned to=0.1.3. Checked on hosted runners: the WebM project's 59 VP8 test vectors bit-exact, libvpx's decode of the same streams identical (58 of 60; the two others change resolution, which the comparison tool rescales), every encoded stream decoded identically by libvpx, 720p decode at 257 fps or more and encode at 53 fps or more on one core, 15 min of libFuzzer with no finding.- Feature
av1(opt-in): AV1 decode withrav1dand encode withrav1e, both without assembly. rav1d matches dav1d on libaom's vectors (10 of 10) and decodes 720p at about 40 fps, but aborts the process on a hostile frame (a panic across its C API); rav1e makes 5 to 8 pictures a second at 360p (not real time) and holds 4 pictures back. picture(I420 view and buffer, PSNR, a synthetic source), theencoder::VideoEncodertrait,VideoDecoder::picture,codec::decoder_for.- Tests: PSNR at 640x360 and 600 kbit/s (VP8 39.5 dB), hostile VP8 frames (no panic), the libvpx fixture's MD5, the VP8 fixture and a rav1e stream through loss decoded bit-exactly, a two-peer call with the real VP8 codecs.
scripts/video-codec-check.shandrtci-video/examples/codec_check.rsreproduce the evidence. - interop-peer scenario
{"media":"pipeline","video":"VP8"|"AV1"}and the browser cellspipeline receive VP8/AV1; the root crate dev-depends onrtci-video(path only). deny.toml: libfuzzer-sys (NCSA, a permissive licence) allowed; it is acfg(fuzzing)-only dependency of rav1e. The dev profile optimises the codec crates (their tests code video).
- video pipeline, phase 1b: the engine boundary (
conf/vp-4-engine-boundary,docs/video-pipeline.md2.6, 2.9):RTCRtpReceiver::set_nack_horizon(now, ssrc, oldest_useful)andinterceptor::NackControl::Horizon: the receiving application tells the NACK generator the oldest sequence number it can still use (RFC 4588 6.3: a retransmission is asked for only while it "would still be useful"); the generator asks for no older missing packet and forgets its requests for them (wrap-aware;Noneremoves the horizon) (packets_older_than_the_horizon_are_not_asked_for,a_receiver_stops_asking_for_packets_behind_its_nack_horizon). The RTCP session drops them from a NACK it still holds for its next packet as well (RFC 4585 3.5.2, step 4a: stored feedback is sent only if it is still useful), and sends no NACK that is left asking for nothing: before, a request made just ahead of the horizon left with the next regular RTCP packet, up to about two seconds after the application had given the packet up (conf/vp-9r2-vp8-partitions;a_nack_held_for_the_regular_packet_drops_what_the_nack_horizon_passed).rtci_video::engine:: VideoReceiver::pollmoves it on after every released picture (ReceiveConfig:: nack_horizon, on by default, as libwebrtc'sNackRequester::ClearUpTo).- The jitter buffer members (
jitterBufferDelay,jitterBufferTargetDelay,jitterBufferMinimumDelay,jitterBufferEmittedCount) inDecoderStatsUpdate, winning over the audio update's (the_decoder_update_carries_the_jitter_buffer_members_of_a_video_stream);rtci-videono longer goes throughupdate_audio_receiver_stats. rtci-video's two-peer tests trace every lost packet (gap seen, first NACK, RTX sent and arrived) and count NACKs for packets behind the horizon (none, asserted in the capacity scenario);docs/video-repair-latency.mdholds the trace.
- video pipeline, phase one: the receive side (
conf/vp-2-receive, design onconf/vp-1-design,docs/video-pipeline.md; on master byconf/vp-3-on-master). A new crate,rtci-video, sans-I/O, pure Rust, no codec dependency, not published with 0.1.0 (publish = false):assembly::PacketBuffer: frames from RTP packets per payload format (VP8 S / PID, VP9 B / E, AV1 and the Dependency Descriptor's start / end of frame, H.264 / H.265 by RTP timestamp and marker), key frames and key-frame sizes, duplicates, late packets, overflow and backward jumps as libwebrtc'spacket_buffer.cc.reference::ReferenceFinder: frame ids and references with libwebrtc's dispatch: VP8 temporal layers (TL0PICIDX, TID, Y), picture-id-only and sequence-number-only streams (padding closes gaps), VP9 flexible mode with inter-layer dependency and non-flexible picture groups, the Dependency Descriptor's fdiffs.buffer::FrameBuffer: decodable temporal units, dropping of frames passed over (framesDropped,packetsDiscarded), libwebrtc's limits (800 frames, 8192 decoded ids).timing: ports of libwebrtc's jitter estimator (Kalman filter on frame delay variation and size, noise threshold, retransmission term, frame-rate scaling), timestamp extrapolator, decode-time percentile and render-time model, the playout-delay extension,jitterBufferTargetand an A/V sync delay input; release at render time minus decode and render time, late pictures skipped (kMaxAllowedFrameDelay), the low-latency path.keyframe::KeyFramePolicy: PLI on a first frame that is not a key frame, packet buffer overflow, a missing Dependency Descriptor structure, the decode timeouts (200 ms / 3 s, or fromrtx-time), decoder errors, repeated every 200 ms until a key frame decodes, and a repair window (5 RTT, at least 1 s) after which pictures stuck behind a gap ask for a key frame (ReceiveConfig::chrome()keeps libwebrtc's decode timeout only).render::RenderStats: W3CfreezeCount,totalFreezesDuration,pauseCount,totalPausesDuration,totalInterFrameDelay,totalSquaredInterFrameDelay,framesRendered(W3C definition; libwebrtc's 5-interval warm-up inchrome()).decoder::VideoDecodertrait andReferenceCheckingDecoder;engine::VideoReceiver(featureengine): one pipeline per SSRC of anRTCRtpReceiver, PLI throughwrite_rtcpwhennack pliwas negotiated,report_received_frame, the statistics throughupdate_decoder_stats(the jitter buffer members throughupdate_audio_receiver_statsfor now).- Tests: libvpx VP8 / VP9 IVF and H.264 / H.265 Annex B fixtures through 5 % loss with 0..40 ms reordering and retransmission (every picture byte-identical, in an order the stream allows, no freeze); calls between two peer connections at 2 % and 10 % loss and a 300 kbit/s capacity drop (no wait beyond the slowest repair, no corrupt picture, no decode out of order).
Added
- interceptor / bandwidth probing: recovery probing, an opt-in (off by default and in every behaviour profile; ungoverned: it is tuning, no specification asks for it and Chrome does not do it):
ProbeController::with_recovery_probing,CongestionControlBuilder::with_recovery_probing,DefaultInterceptorOptions::recovery_probing. A sender that keeps up with its target is asked nothing once the probes after a drop have ended (five seconds after it), so when a capacity that fell comes back, the climb is the delay-based controller's 8% a second. With the setting the highest rate before a large drop is remembered for a minute (PROBE_DROP_MEMORY); while the target is below 85% of it and the estimator does not read over-use (BandwidthEstimator::usage), a cluster at twice the target is asked for every five seconds (PROBE_RECOVERY_INTERVAL), with follow-ons at twice the result while the path carries what is asked. Paced chains only: clusters that leave as bursts are not sent for it, and a path change forgets the remembered rate. WHAT A CALL GAINS AND PAYS, measured on the capacity instrument (default chain, a 2.5 Mbit/s path that drops to 300 kbit/s for 20 s, 200 calls a cell, hosted runs 45607015088 without and 45607025736 with the setting, on master f9242b4d with the two probing branches before this one): the target is back at 1 Mbit/s 4.9 s after the limit went (5.4 s at most) instead of 17.3 s, and at the 2.5 Mbit/s maximum 15 to 25 s after it instead of 1283 kbit/s on average; the same behind a 100 ms queue (17.6 -> 5.0 s) and with both directions limited (16.2 -> 4.8 s); behind a 1000 ms queue in nine calls of ten (median 17.6 -> 5.0 s, the slowest tenth 17.5 s). It costs 3% of the target under the limit (238 against 246 kbit/s), and behind a 100 ms queue 11 more audio packets lost a call (52 against 41) and a quarter more packets dropped at the queue (201 against 159; with the pacer's backlog kept,PacerBacklog::Keep, behind the 300 ms queue 149 against 121 in the two-peer test's call); the counts of calls with an old picture, a freeze or an audio gap do not move in any cell. After a limit that outlasts the minute (held 60 s) it gains nothing: 17.6 s against 16.9 s, the rate not back within 20 s in 33 of 200 calls against- Sent as bursts in a chain without a pacer the gain was the same and the calls with an old picture rose in every cell that had any (both directions limited: 25 -> 31 of 200), so the setting does not act there. The default's figures do not move. Tests: seven in
cc::probe::tests(recovery_probing_…,a_recovery_cluster_the_path_carries_is_followed_up,without_recovery_probing_a_sender_at_its_target_is_not_probed_after_the_drop),rtci-interceptor/tests/recovery_probing.rs,tests/recovery_probe_requests.rs,tests/capacity_cap_video_rtc2rtc.rs::with_recovery_probing_a_call_is_back_at_full_rate_when_the_capacity_returns.
- Sent as bursts in a chain without a pacer the gain was the same and the calls with an old picture rose in every cell that had any (both directions limited: 25 -> 31 of 200), so the setting does not act there. The default's figures do not move. Tests: seven in
- interceptor / bandwidth probing: the probe after a large drop has three forms (
AfterDropProbe:Repeated,Libwebrtc,Off), set withProbeController::with_after_drop_probe,CongestionControlBuilder::with_after_drop_probeandDefaultInterceptorOptions::probe_after_drop; the behaviour rowcc.probe-after-dropgoverns it (RfcandStrictRfc:Repeated;Chrome:Libwebrtc).with_probe_after_drop(bool)stays (trueisRepeated,falseisOff). THE DEFAULT DOES NOT CHANGE:Repeatedis what the engine did (from a second after the target fell below two thirds of its 2 s high, once a second for five seconds, a cluster at 85% of that high); on the capacity instrument 1400 calls in seven cells of the default chain are identical to the tree before, figure for figure (hosted run 45607015088 against 45582695439).Libwebrtcis libwebrtc'sProbeController::RequestProbe: a drop is one update of the estimate below 0.66 of the one before it, and one cluster at 0.85 of the estimate before it is asked when the delay detector has returned from under-use to normal, only for a sender that is application limited or was within 3 s, within 5 s of the drop, at most once in 5 s, and only when 95% of it is above the estimate. For it the estimator says how it reads the path:BandwidthEstimator::usage() -> Usage(new, defaultUsage::Normal;Gcc: the reading of the last feedback), passed on withProbeController::set_usage. No specification says how to probe after a drop (RFC 8836 section 2, 1f, asks that a flow regain its share quickly), so the default is the form that measured best. Four forms, the default chain, a 2.5 Mbit/s path that drops to 300 kbit/s for 20 s, 1000 calls in each of the two reference cells and 200 in six others, each form against the default by the merge-point rule ofdocs/capacity-instrument.md: without a probe and with libwebrtc's (which never fires for a sender that keeps up with its target: the two measure alike) seven figures are worse (both directions limited: oldest picture 3.07 s against 2.64 s; 5% of the feedback lost: the rate not back within 20 s in 30 and 24 of 200 calls against 2; target 15 to 25 s after the limit 1205 against 1278 kbit/s); the repeated probe aimed at the highest rate of the last minute instead of the last drop's own high makes fifteen worse (audio packets lost 27 -> 35 a call; behind a 1000 ms queue over 2 s without a new picture in 33 of 200 calls against 6) and was not taken. What the default costs against no probe: behind a 1000 ms queue 96 audio packets lost a call against 66, under a limit that lasts a minute 74 against 45. Tests:cc::probe::tests::libwebrtcs_probe_after_a_drop_is_one_cluster_once_overuse_has_ended,libwebrtcs_probe_after_a_drop_has_its_conditions,gcc::estimator::tests::usage_follows_the_last_feedback,rtci-interceptor/tests/after_drop_probe_requests.rs,tests/default_probe_after_drop.rs. - congestion control feedback cadence as a setting (rtcpbudget-2):
CongestionFeedbackCadence(ReceivedMedia,PerFrame,SendEstimate),TwccReceiverBuilder::with_cadence,Rfc8888Builder::with_cadence,DefaultInterceptorOptions::congestion_feedback_cadenceand the governed behaviourcc.feedback-cadence. The default does not change: feedback every 50 to 250 ms, sized to 5% of the media received (ReceivedMedia), which is the engine's own choice and no specification's.PerFrameis the drafts' cadence (draft-ietf-rmcat-gcc-02 section 3, draft-holmer-rmcat-transport-wide-cc-extensions-01 section 3: a lone video stream is reported when each frame ends, anything else every 30 ms, up to 100 ms where this endpoint's share of the RTCP bandwidth does not hold that), on in theStrictRfcprofile; as the default it measured worse in the capacity instrument (send target under a 300 kbit/s cap 210 -> 186 kbit/s, the picture requirement of the pacer-less chain missed in 36 instead of 4 of 200 calls, RTCP 122 -> 135 kbit/s on an open call), and so did 100 ms always and two forms between (audit rows TWCC-3-4 and GCC-3-2:setting, measured).SendEstimateis libwebrtc's cadence (50 to 250 ms from 5% of the endpoint's own send estimate, 100 ms before one is known), now theChromeprofile's (a behaviour change for that profile only: its feedback was sized to the media received). New attributes on what the chain hands application-ward:RtcpBandwidthShare(this endpoint's share of the RTCP bandwidth, from the RTCP session) andSendEstimate(the congestion controller's estimate besideTargetBitrateChanged). The capacity instrument's chain tokenperframeruns the drafts' form. - interceptors (rtcpbudget-5): an option, off by default and in every behaviour profile, for an endpoint's own share of the RTCP bandwidth to follow the rate its congestion controller allows it to send at:
RtcpSessionBuilder::with_share_following_send_rate,DefaultInterceptorOptions::rtcp_share_follows_send_rate,RtcpSessionControl::SendRateandCongestionControlBuilder::with_send_rate_told_to_rtcp(the congestion controller tells the RTCP session of its chain the estimate whenever it has moved by a twentieth). It is tuning with no specification behind it: RFC 3550 section 6.2 sizes the RTCP bandwidth from the session bandwidth (here the media measured both ways) and section 6.3.1 shares it equally among the members whatever each direction carries, so an endpoint whose uplink has collapsed to 300 kbit/s while the other direction still carries 2.5 Mbit/s keeps sending about 80 kbit/s of RTCP on it. With the option the endpoint's own SSRCs schedule their regular reports with at most 5% of a session in which every endpoint sends at this endpoint's rate (5% x send rate x members / local SSRCs, no less than 5% of the minimum session bandwidth); the intervals calculated for the other members (RtcpReportingInterval, what the circuit breaker takes for the peer's reporting interval), member timeouts, BYE and sender status keep RFC 3550's value, and congestion control feedback is not slowed. Measured in the capacity instrument (default chain, one direction capped at 300 kbit/s): RTCP on the capped link 80 -> 34 kbit/s, the open call unchanged (122 kbit/s); figures for the picture and the recovery are indocs/capacity-instrument.md. ThePerformanceprofile does not take it: itsT_rr_intervalof one second already brings that RTCP to 22 kbit/s, and beside it the option changed nothing that was measured. Teststhe_rtcp_share_follows_the_send_rate_the_session_is_told,the_interval_calculated_for_the_peer_does_not_follow_the_send_rate. - interceptor (collapse-2):
ProbeFill, an attribute the pacer adds to aProbeRequest's carrier on its way application-ward: the padding the cluster needs beyond the media and retransmissions waiting in the pacer's queue. The NACK responder fills the cluster with that much; a chain without a pacer has no such attribute and the whole cluster is padding, as before. - interceptor (
conf/flush-1r-backlog-flush-at-collapse):PacerBacklog(Flush, the default, andKeep),PacerBuilder::with_backlog,DefaultInterceptorOptions::pacer_backlog, the noticePacerFlush { ssrcs }the pacer sends application-ward at a flush (the NACK responder forgets those streams), andPacerInterceptor::flushes(). - rtp, media (
conf/flush-2-receiver-gap-bound):Depacketizer::has_key_frames()andDepacketizer::is_key_frame_start(payload)(both with a default offalse, so an implementation outside the workspace compiles unchanged): the first packet of a key frame by the payload format's own rule, for VP8 (P=0 in the payload header, RFC 7741 section 4.3), VP9 (P=0 at the start of a base-layer frame, RFC 9628 section 4.2), AV1 (the aggregation header's N bit), H.264 (the first slice of an IDR picture, alone, in an FU-A / FU-B or an STAP-A / STAP-B;IDR_NALU_TYPE,SEI_NALU_TYPE) and H.265 (the first slice segment of an IRAP picture, alone, in a fragmentation unit or an aggregation packet, with or without DONL).SampleBuilder:DEFAULT_MAX_GAP_WAIT,with_key_frame_release(bool),key_frame_releases() -> u64, andnack_horizon() -> Option<u16>(the oldest sequence number still of use, forRTCRtpReceiver::set_nack_horizon). Tests:rtci-rtp/src/codec/key_frame_start_test.rs,rtci-media/src/io/sample_builder/sample_builder_key_frame_test.rs,sample_builder_gap_wait_test.rs. - interceptors (breaker-1):
CircuitBreakerBuilder::with_automatic_restartandDefaultInterceptorOptions::circuit_breaker_automatic_restart(on by default: RFC 8083 section 4.5's restart on information that the congestion has dissipated; off leaves every restart to the application);DefaultInterceptorOptions::circuit_breakerand the governed behaviourcb.enabled(RfcandStrictRfcon: RFC 8834 section 7.1;Chromeoff: libwebrtc has no RTP circuit breaker);RtcpReportingInterval, the deterministic reporting interval the RTCP session calculates, attached to the RTCP it hands application-ward. - rtci, interceptor (collapse-3):
RTCPeerConnectionEvent::OnCircuitBreakerandCircuitBreakerNotice(see "Fixed"). An application that sends media should handle the event: a flow the circuit breaker ceased stays silent until the application restarts it (DefaultInterceptorHandles::circuit_breaker,CircuitBreakerHandle::restart). - ice:
ConsentResponseWait, how long a consent request waits for its response (conf/ice-26-consent-late-responses):AgentConfig::consent_response_wait,SettingEngineBuilder::with_ice_consent_response_wait.Rto(the default) is RFC 7675 section 5.1's wait based on the round-trip time (see "Fixed");Fixed(duration)is a fixed wait. A governed behaviour,ice.consent-response-wait:BehaviourProfile::ChrometakesFixed(60 s), libwebrtc'skConnectionResponseTimeout("in some networks (2G), we observe up to 60s RTTs",p2p/base/p2p_constants.h@ a222406d), which takes an answer however far the round trip jumped;Rfc,StrictRfcandPerformancekeepRto. Test:agent_consent_delay_test.rs::test_a_response_after_its_wait_renews_nothing_unless_the_wait_is_fixed,test_no_consent_transaction_is_kept_past_the_consent_expiry. - DTLS session resumption between a connection's transports, opt-in (RFC 5764 section 3 SHOULD, "as an optimization";
conf/dtls-resume-3, after two security reviews ofconf/dtls-resume-1and-2):SettingEngineBuilder::with_dtls_session_resumption(true). Off by default, a standing departure from that SHOULD (docs/conformance.md, "Standing departures from a SHOULD"; audit row RFC5764-3-4), because it is not free and most peers cannot take part. What it costs, measured with three unbundled transports on links with latency, time until every DTLS transport is connected: at a 100 ms round trip 453 ms off, 753 ms on against a peer that issues no ticket (+300 ms, about 3 round trips: the others start one whole handshake later and resume nothing), 703 ms on between two engines with tickets (+250 ms, about 2.5 round trips); at 300 ms 1.353 s, 2.253 s (+900 ms) and 2.103 s (+750 ms). One datagram lost on the first handshake delays every transport, not one. What it saves is one signature and one verification per other transport. No browser can take part: libwebrtc setsSSL_OP_NO_TICKET(and has anSSL_CTXper transport), Firefox'sTransportLayerDtls::Setup()turns session tickets and the session cache off; against a browser the setting only adds the wait. With BUNDLE (one transport) it does nothing. When the negotiation that sets up the transports sets up more than one in a DTLS role, the first client transport runs a full handshake and the others resume with the peer's DTLS 1.3 tickets (psk_dhe_keonly, a fresh (EC)DHE exchange); server transports share the connection's ticket keys for their first handshake only. No DTLS 1.2 session id or ticket is asked for, issued or accepted by the peer connection in any configuration (a DTLS 1.2 ticket carries the master secret, and a resumed 1.2 association runs no key exchange). The wait is bounded: a transport waits for the first handshake at most three of its initial flight intervals (1.2 s at 400 ms; 4.5 round trips where ICE measured one) and never more than 3 s (LEADER_WAIT_MAX: the ICE figure is one sample, which a slow-answering peer could stretch), not at all once the first failed, was closed or could not start, and not for a ticket that does not come: against a peer that issues none the others start as soon as the first handshake is complete (which is the cost above). The first reviewed form waited without bound for a stalled first handshake, and added 800 ms (two flight intervals) of waiting for a ticket against a peer without tickets; both are gone. A bundled connection asks for and issues no ticket (the same DTLS datagrams as without the setting); a transport added later, re-keying and a server's later handshake on the same transport are full handshakes; same remote fingerprints only, and each section's fingerprint check runs on the certificates stored with the ticket; client tickets are kept at most five minutes and dropped once every transport has started, andclose()wipes the tickets left and the server side's ticket keys (newsession::SessionTicketIssuer::retire/is_retiredinrtci-dtls), not only the drop of the connection. RFC5764-3-4 ispartial(implemented, not the default). New inrtci-dtls:ConfigBuilder::with_dtls12_resumption(DTLS 1.2 out of resumption, DTLS 1.3 kept),ConfigBuilder::with_session_ticket_issuerandsession::SessionTicketIssuer(ticket keys shared by several configurations),Tls13Session::peer_certificates/limit_lifetime,Dtls12Session::peer_certificates,HandshakeConfig::supports_dtls13(now public). Tests:tests/multi_transport_rtc2rtc.rs(unbundled_transports_wait_for_the_first_and_resume_its_dtls_session,a_first_handshake_that_never_completes_holds_the_others_back_three_flight_intervals_at_most,the_others_do_not_wait_for_a_ticket_that_does_not_come,the_session_costs_the_other_transports_the_first_handshake_on_links_with_latency,a_datagram_lost_on_the_first_handshake_delays_every_transport_with_the_session_on,a_first_handshake_that_never_completes_costs_the_others_the_bounded_wait_on_links_with_latency,a_final_answer_naming_another_certificate_is_checked_by_a_full_handshake_as_the_dtls_clientand_as_the_dtls_server,by_default_a_final_answer_with_other_fingerprints_is_refused_with_the_session_made,with_dtls12_the_transports_neither_wait_nor_ask_for_a_ticket,a_bundled_connection_exchanges_no_ticket_with_the_session_on,a_transport_added_by_a_later_negotiation_runs_a_full_handshake, the wrong-fingerprint and re-key tests);transport/dtls/resumption.rs(the re-check behind the admission gate in both roles, a final answer with other fingerprints, the store's lifetime and emptying, its filter on tickets without certificates, the wipe at close, the wait rules);handler/dtls.rs(the bound and its cap,the_wait_for_the_leader_is_capped_whatever_round_trip_ice_measured, a leader that cannot start, no resumption of a later handshake in place);transport_close_test.rs(closing_the_connection_wipes_its_dtls_session);rtci-dtlsserver-side re-check tests in DTLS 1.3 and 1.2 (the_server_runs_its_peer_certificate_check_again_on_a_resumed_client). - mDNS may leave two kinds of host address unwrapped, each an opt-in setting, off by default (mdns-5; MDNSICE-3.1.2.2-4, -3.1.2.2-5, -3.1.2.3-1). Only in
QueryAndGather; in every behaviour profile off; neither ever unwraps an addressice::mdns::is_global_unicastrefuses (private, loopback, link-local, unique-localfc00::/7, CGNAT100.64.0.0/10, documentation, IPv4-mapped, NAT64, ...), whatever a STUN server answered or the application marked.SettingEngineBuilder::with_multicast_dns_expose_known_public_addresses(true)(AgentConfig::multicast_dns_expose_known_public_addresses), draft section 3.1.2.2: an address is shown public when a server-reflexive candidate's address is its base's ("the STUN response returns the same value as the local IP address") and the base is one of the transport's own host candidates. The gathering that shows it is unchanged (the.localcandidate first, then the server-reflexive one, raddr0.0.0.0rport 9); host candidates of the next ICE generation carry the address ("skip mDNS protection for that address in future ICE gathering phases"), kept candidates included, as long as each restart's gathering shows it again. Per agent;Agent::set_ice_servers(called byRTCPeerConnection::set_configuration) discards it when the set of STUN / TURN servers changes (the section's SHOULD). The evidence is the server-reflexive candidate equal to its base, whichQueryAndGathernow always provides (see "Behaviour changes").SettingEngineBuilder::with_multicast_dns_expose_temporary_ipv6_addresses(true)(AgentConfig::multicast_dns_expose_temporary_ipv6_addresses), draft section 3.1.2.3: the addresses the application marks as RFC 4941 temporary (RTCPeerConnection::set_temporary_ipv6_addresses,Agent::set_temporary_ipv6_addresses) go out as they are; an unmarked address stays hidden.rtci-sharedhasifaces::temporary_ipv6_addresses()(Linux / Android/proc/net/if_inet6IFA_F_TEMPORARY; macOS / iOSSIOCGIFAFLAG_IN6IN6_IFF_TEMPORARY, not observed on a runner; Windows and elsewhereUnsupported: on Windows no flag has been shown to tell a temporary address from the stable one, so the setting has no effect there), andrtci-stream-driver'sPeerDrivermarks its addresses from it at each gathering.
What each exposes, and to whom: the first, an address the remote peer and the application (a web page, in a browser) already received as the server-reflexive candidate, now also as the host's own interface address; the second, the temporary address, to the same two, for its lifetime. Tests:
rtci-ice/src/agent/agent_mdns_exposure_test.rs,rtci-ice/src/mdns/mdns_exposure_test.rs,tests/ice_mdns_exposure.rs,stream-driver/tests/mdns_temporary.rs(Linux, a temporary address made as root). - mDNS host candidates can fail closed (mdns-4, MDNSICE-3.1.1-6). With mDNS
QueryAndGather, a host candidate whose name cannot be registered (the application has no mDNS socket for its address family, or the agent holds the most names it can, 64) goes out, by default, under a.localname that is not published: draft-ietf-mmusic-mdns-ice-candidates section 3.1.1, "the ICE agent SHOULD still provide mDNS candidates in step 6 even if the local network does not support mDNS or mDNS registration fails in step 4".SettingEngineBuilder::with_multicast_dns_fail_closed(true)(AgentConfig::multicast_dns_fail_closed) provides no host candidate for such an address instead, UDP or TCP, for an embedder that must never offer a candidate its peer cannot resolve; its server-reflexive candidates are still gathered (raddr0.0.0.0rport 9). The literal address is written in neither case. An application with sockets of its own says which families it can send mDNS on withRTCPeerConnection::set_multicast_dns_publishing(MulticastDnsPublishing { ipv4, ipv6 })(Agent::set_multicast_dns_publishing) before it adds host candidates;RTCPeerConnection::multicast_dns_modereads the mode;Agent::multicast_dns_withholdssays whether an address's host candidates were withheld.rtci-stream-driver'sPeerDriverdoes it by itself, andPeerDriverConfig::mdns_sockets(trueby default) turns its mDNS sockets off. - fec (fec-15): libwebrtc's ULPFEC form for the pacer-written extensions, a
Chromeprofile row (fec.ulpfec-zero-mutable-extensions,DefaultInterceptorOptions::ulpfec_zero_mutable_extensions):UlpfecSendBuilder::with_mutable_extensions_zeroedprotects the transport-wide sequence number, abs-send-time and toffset values as zeros (libwebrtc computes its FEC before it writes them,RtpSenderEgress::SendPacket@ a222406d) andUlpfecReceiveBuilder::with_mutable_extensions_zeroedzeroes them in the decoder's copies (ZeroMutableExtensions), so a packet rebuilt on either side is exact with those values zero.configure_video_red_ulpfec_with(registry, media_engine, zero); theChromeprofile's chain has it on.Rfckeeps RFC 5109 section 8's FEC over the packet as sent. - fec (fec-13): RFC 8854 section 5.2's
video/flexfecin the offer as a setting:DefaultInterceptorOptions::video_flexfec/configure_video_flexfecregistersvideo/flexfec(payload type 49,repair-window=10000000) and runs the RFC 8627 coder in the standard chain at slots of its own (FLEXFEC_ENCODER_SLOT5_100,FLEXFEC_WIRE_IMAGE_SLOT1_510,FLEXFEC_DECODER_SLOT10_310), beside ULPFEC's, so a chain can run both. On in theStrictRfcprofile (rowfec.video-flexfec); off by default and inChrome, because RFC 8627 section 1.1.7 has an answerer offered FlexFEC and RTX answer with FlexFEC only, which would leave two default peers without RTX (audit row RFC8854-5.2-1,conflict). No change to the default's offers. - ULPFEC across an SRTP key change (RFC 5109 section 11, row RFC5109-11-3 untested -> tested):
tests/ulpfec_across_srtp_rekeying_rtc2rtc.rssends a FEC block whose first media packet leaves under one DTLS association's keys and whose second media packet and FEC packet leave under a new association's (renew_dtls_association), after the receiver dropped the old keys; whichever media packet the network loses is rebuilt. No engine change. - Browser cell: the engine's ULPFEC in RED rebuilt by the browser.
scenarios.spec.mjshas Rust send VP8 in RED with ULPFEC (theChromeprofile's form), NACK off on both sides, and checks that the browser decodes every frame although Rust's sender discarded every tenth media packet after the FEC protected it (examples/interop-peer?drop_video_every=N, reported asvideoDropped). The earlier finding that Chromium does not rebuild from the engine's FEC was wrong: the packets are byte for byte what libwebrtc'sUlpfecReceiverreads, and Chromium rebuilds from them; the earlier cell's threshold under random netem loss failed on frames whose media and FEC packets were both dropped (VP8 without NACK then waits for a key frame). The browser offers VP8, red and ulpfec only (setCodecPreferences): as offerer Firefox otherwise also receives the VP9 and AV1 it offered, with its default NACK, and turns NACK on for the whole receive stream. Firefox rebuilds every dropped packet too; it never decodes the fixture's first group of pictures in that cell, loss or not, which its column leaves out. No engine change. - FlexFEC-03 repair packets within the path MTU (draft-ietf-payload-flexible-fec-scheme-03 section 6.2):
FlexFec03Encoderbuilds no repair packet larger thanFLEXFEC03_MAX_REPAIR_PACKET_SIZE(1436 octets: a 1500-octet path under IPv6, UDP and a 16-octet SRTP tag;with_max_packet_sizesets another); the block goes without it and the repair stream's sequence numbers skip nothing. Engine behaviour change only for media packets above about 1400 octets. - RFC 8854 audit (
docs/conformance/audit/rfc8854.md): 23 rows (MUST 3 tested, 1 n/a; SHOULD 6 tested, 6 partial, 2 missing, 3 n/a; MAY 1 tested, 1 missing), and a test that no behaviour profile offers a FEC-only m= section (section 5.2). - Browser cell: video RED + ULPFEC from the browser.
examples/interop-peertakes?video_red_ulpfec=1(DefaultInterceptorOptions::video_red_ulpfec) and reports the engine's FEC counts (fec);scenarios.spec.mjshas the browser send VP8 in RED with ULPFEC, NACK off, through netem loss, and checks that the engine rebuilt packets from it.scripts/test-env/hosted-cell.shruns a browser cell on a disposable Linux machine (a GitHub-hosted runner throughagent-test.yml) outside the test image. - Video
red+ulpfecin theChromebehaviour profile.DefaultInterceptorOptions::video_red_ulpfec(profile rowfec.video-red-ulpfec:Rfcfalse,Chrometrue):register_default_interceptorsthen registersvideo/red(116), RTX for it (117,apt=116) andvideo/ulpfec(43) after the video codecs, as Chromium offers them (libwebrtcGetDefaultSupportedFormats), andconfigure_video_red_ulpfecinstalls ULPFEC in RED in both directions (FEC in RED packets of its own, read from the wire tap, loss-driven amount). The default stays RFC 8854 section 7's: neither is offered for video.UlpfecReceiveInterceptornow reads RED and FEC under the payload types the stream's section negotiated (as the sender already did), not only the builder's: an answer keeps the offerer's numbers. Engine behaviour change for theChromeprofile (its video offers and chain). - FEC statistics. The receiver's webrtc-stats now count all the FEC received for a stream (8.5):
fecPacketsReceivedandfecBytesReceivedinclude the FEC blocks of the stream's RED packets (RFC 5109 section 14.2) and the packets of a FEC session of its own (section 14.1; those also count inpacketsReceived/bytesReceived, webrtc-stats 7.1), besides a FEC SSRC's;fecPacketsDiscardedis measured for ULPFEC (FEC whose packets all arrived or were rebuilt, FEC the recovery window left behind or that arrived outside it, malformed FEC).RTCPeerConnection::fec_stats()(FecStats,FecSentStats,FecReceivedStats) has what webrtc-stats has no member for: the FEC each outbound stream sent (packets and payload octets, any carriage, ULPFEC and FlexFEC), the media packets FEC rebuilt, and the discards by reason. In the interceptor crate:UlpfecDecoderStatsgainsdiscarded_unneeded,discarded_expiredanddiscarded();UlpfecReceiveInterceptorpassesUlpfecReceiveStatsapplication-ward on an empty RTCP carrier when its counts change (andreceive_stats(ssrc)); every packet a ULPFEC or FlexFEC encoder puts FEC into carries aFecSentmark. An application that drives a chain itself sees the carriers (empty RTCP packets with that attribute) on the read leg. - data channel (up-340, test only):
tests/data_channel_close_sibling_rtc2rtc.rsholds the reproduction of webrtc-rs/rtc#340 by @schiapellone. A channel closed by the receiver while the peer still sends on it, beside a healthy channel, used to make the read of its stream fail mid-pass and drop the messages already read from the other streams in that pass (acknowledged, so lost for good). The fork had the fix without a test: b91196d7 (the read of a closed stream ends its data, not the pass) and e9b19fa3 (a stream the application stopped reading drops what arrives on it). No behaviour change. - rtp (up-336): the H.264 / H.265 Annex B splitter (
annex_b_nal_units, used byH264PayloaderandHevcPayloader) finds start codes withmemchr::memmeminstead of a byte at a time; the NAL units are the same (testh264_test::annex_b_nal_units_are_those_a_byte_scan_finds). Measured on a GitHub-hosted ubuntu runner, release build, best of 15: a 30 KB one-slice frame 14.0 us to 0.57 us, a 1 MB eight-slice frame 500 us to 27 us, SPS + PPS + a 100 B slice 106 ns to 92 ns; 1000 NAL units of 5 B each 19.8 us to 21.5 us (+8%). Same change as webrtc-rs/rtc#336 by @g4lb. - tooling (up-watch):
scripts/upstream-watch.pylists what webrtc-rs did since the fork last looked:webrtc-rs/rtccommits after the merged one, its pull requests and issues opened or updated since the triage day, andwebrtc-rs/webrtccommits (master,v0.17.x). Both points are FORK.md's (new row "Open upstream work last triaged"). Read-only GitHub API calls; no workflow runs it. SettingEngineBuilder::with_dtls_session_resumption(bool)(defaultfalse): withtruethe transports of a connection's unbundled sections share one DTLS session (RFC 5764 section 3; see the entry "DTLS session resumption between a connection's transports, opt-in" for what it costs);false, the default, gives every association a full handshake at once, as before.- rtci-dtls:
session::SessionTicketIssuerandConfigBuilder::with_session_ticket_issuer: ticket keys (and the record of used tickets) several configurations share, so that a ticket one issued is accepted, once, by another;SessionTicketIssuer::retirewipes the keys (zeroized) before the last holder is dropped, after which no ticket is issued or accepted.Tls13Session::peer_certificatesandDtls12Session::peer_certificates. - rtci-dtls (documentation): what DTLS 1.2 session resumption costs is stated on
ConfigBuilder,with_session_tickets,with_session_store,with_session_cache,with_dtls12_resumption, thesessionmodule and the crate: a resumed DTLS 1.2 association runs no key exchange and an RFC 5077 ticket is the master secret sealed under the server's ticket key, so there is no forward secrecy against the ticket key, the session cache or the client's store; DTLS 1.3 resumption (psk_dhe_ke) keeps it. The stand-alone default is unchanged: once tickets, a cache or a store are configured both versions resume unlesswith_dtls12_resumption(false). - turn (
conf/transport3-mays):ClientConfig::software_in_indicationsputs the client's SOFTWARE in its Send indications too (RFC 8489 section 6.1: "Indications MAY include a SOFTWARE attribute"). Off by default, so nothing changes on the wire: Send indications are the relayed data path. Test:rtci-turnclient_software_mtu_test.rs::test_send_indications_carry_software_only_when_configured. RFC8489-6.1-3 istested. - ice (
conf/transport3-mays):AgentConfig::new_tie_breaker_on_restartandSettingEngineBuilder::with_ice_new_tie_breaker_on_restartdraw a new tiebreaker at each ICE restart (RFC 8445 section 16.1: "The agent MAY change the number when an ICE restart occurs"); a restart that is rolled back gives the old one back. Off by default: the tiebreaker stays for the agent's life, as before and as in libwebrtc. Test:rtci-iceagent_rfc8445_test.rs::test_ice_restart_draws_a_new_tie_breaker_only_when_configured. RFC8445-16.1-4 istested. - An embedder address policy for ICE, both directions (
conf/ice-24-address-policy):SettingEngineBuilder::with_ice_address_policy(IceAddressPolicy)(andAgentConfig::address_policyfor the agent alone). One predicate over aSocketAddr, anAddressDirection(inbound / outbound) and anAddressPurpose(RemoteCandidate,PeerReflexiveSource,StunTurnServer,InboundDatagramSource), asked wherever an address enters the ICE agent or the peer connection: a datagram (direct, relayed by the engine's TURN allocation, or ICE-TCP stream data) from a refused source is dropped before the agent, DTLS or the media read it (no STUN response, no peer-reflexive candidate, no consent, no pair, no data accepted: agenthandle_read,data_path,is_valid_non_stun_traffic; peer connectionread_on_transport); an ICE-TCP connection from it is refused (handle_stream_accepted) and one that turns refused is reset (handle_stream_read); a TURN TCP peer connection from it is not bound; a refused remote candidate (signalled, or an mDNS name's address) is never held or paired, andadd_remote_candidatetreats it as W3C webrtc-pc 4.4.2 "administratively prohibited"; a refused peer-reflexive source is not learned (RFC 8445 7.3.1.3) and so not answered, a request that arrives before the peer's credentials included (RFC 8445 7.3: it was answered at once, with only the destination policy asked;conf/ice-24r-address-policy); a remote TCP candidate on a refused address gets no permission on the engine's TURN TCP allocation (RFC 6062 5.3); a STUN or TURN server address the policy refuses, after its name resolved, is never sent anything (skipped as a failed address). The predicate sees IPv4-mapped IPv6 addresses as IPv4. With the "relay" ICE transport policy and a policy refusing private peers, no datagram leaves from or goes to a host address and none is signalled. The default allows everything and asks nothing: engine behaviour is unchanged without it.with_remote_address_filteris kept as it was (it refuses remote candidates and peer-reflexive sources only) and composes with the policy. Tests:rtci-iceaddress_policy_test.rs(six),tests/ice_address_policy.rs(seven),tests/turn_tcp_relay.rs(two). The two-peer tests draw the engine's random numbers from a seed and carry what a peer writes before time moves on: as first written, their loop delivered the answer to a consent request (RFC 7675) only after the next timer, often the requester's own end of the transaction, and the answerer then left the connected state on 54 of 200 seeds, with or without a policy. Audit: RFC8828-5.2-P5 is a newtestedcontrol row; notes on WEBRTC-4.4.1.4-4 and RFC8445-7.3.1.3-1. - ULPFEC in an RTP session of its own, in the chain (RFC 5109 sections 7.2, 14.1).
StreamInfo::fec_session(FecSessionStream: the SSRC the FEC stream has inside the chain, the payload type ofulpfecin the FEC session's m= section,onelevelonly) says that a stream's FEC runs in a second RTP session.UlpfecSendInterceptorthen sends the stream's FEC as a stream of its own under that SSRC andUlpfecReceiveInterceptorreads it there, whatever carriage the builder names and whatever the media section lists (section 14: the multiplexing is "indicated out of band"); the media stream is left as it is, not wrapped in RED.FecSessionSsrcMapis the boundary between the chain, which keys what it keeps on the SSRC, and the FEC session's transport, where "the SSRC value SHALL be the same as the SSRC value of the media stream it protects": every SSRC of the session's RTP and RTCP is the wire SSRC XOR one key, in both directions, with no table. A packet the FEC of another transport rebuilt is delivered with the media stream's transport context. Breaking:StreamInfohas a new public field (..Default::default()in a struct literal covers it). - ULPFEC as a separate stream: a FEC session of its own (RFC 5109 sections 7.2, 14.1, 14.3).
RTCPeerConnection::add_fec_session(transceiver, semantics)offers, for the media of one transceiver, a second m= section that lists onlyulpfec(one dynamic payload type, the media's rate), outside the BUNDLE group and so on a transport of its own (its own candidates, DTLS association and SRTP keys), grouped with the media section bya=group:FEC-FR <media> <fec>(RFC 5956 section 4.1, the default) ora=group:FEC ...(RFC 4756, the semantics RFC 5109 names;RTCFecGroupSemantics). The returned transceiver is the session: it has a mid, a direction, can be stopped, and never has a track (fec_session_of,fec_session_protects). Once the answer keeps the section and repeats the grouping, the ULPFEC of the protected sender's streams travels there, each FEC stream with the SSRC of the media stream it protects, marker 0, sequence numbers of its own and RTCP of its own; what arrives there repairs the protected receiver's streams and is never delivered as media.SettingEngineBuilder::with_separate_fec_sessions(true)accepts an offered FEC session (same grouping and payload type in the answer, the direction of the transceiver it protects).configure_ulpfec_sessionsadds the interceptors (encoder with its wire tap, decoder); the amount of FEC follows the reported loss and comes out of the target the application encodes at. In the interceptor crate:FecSessionPacketmarks what was read in a FEC session for the decoder, andUlpfecReceiveBuilder::sessions()keeps a decoder for each bound stream. Defaults are unchanged: nothing offers a FEC session by itself, and an offered one is refused (port 0, the group left out), as RFC 8854 section 5.2 asks of a WebRTC endpoint ("SHOULD NOT be offered"; "Answerers SHOULD reject any FEC-only "m=" lines, unless they specifically know how to handle such a thing"). No browser accepts one. Known limits: the FEC section negotiates no header extension, so the FEC session's congestion controller has no per-packet feedback and stays at its start estimate; FEC for a stream whose SSRC the description does not declare is used from that stream's first media packet on.
Fixed
- ICE: a peer that can only reach us by its own checks is not failed at end-of-candidates (ice-27, reported by a consumer's ICE-TCP tests). Since the RFC 8445 checklist (first released in 0.1.0 and v0.22.0+brainwires.6), an agent failed at once when both sides had signalled end-of-candidates and its checklist had no pair. Two kinds of peer have no pair until their own check arrives: one whose only candidates are
tcptype active(it dials our passive TCP candidate; the agent pairs nothing with an active candidate) and one whose only candidates are.localnames the agent does not resolve (mDNS off, or the query timed out). Against either the connection failed before the peer's first check could arrive, so a peer that could only dial our passive ICE-TCP candidate never connected once both sides senta=end-of-candidates. Now the agent notes such signalled candidates, and while one of them can reach a local candidate (an active one, a local passive TCP candidate of its family; a.localname, a local candidate of its transport) the checklist stays Running (RFC 8838 section 8: "MUST keep each checklist in the Running state as long as it expects candidate pairs to be incrementally added"): the peer's check forms the peer-reflexive pair and the agent connects, and if no check comes the checking timeout fails it as before (disconnected_timeout + failed_timeout, 30 s by default). The peer connection now hands remote active candidates to the agent instead of dropping them itself, and no longer takes an active candidate for administratively prohibited because of its port: RFC 6544 section 4.5 sets that port to 9, a Fetch bad port, but no connection is ever made to it (the W3C rule prohibits connections to bad ports). A checklist with no remote candidate at all, or whose pairs have all failed with nothing that could still dial in, fails at once as before. Tests:agent_checklist_test.rs:: a_peer_reached_only_by_its_own_checks_keeps_the_empty_checklist_running_and_connects,a_peer_reached_only_by_its_own_checks_that_never_checks_fails_by_the_timeout,an_active_tcp_candidate_with_nothing_of_ours_to_dial_fails_the_empty_checklist_at_once,an_ice_restart_forgets_the_candidates_that_could_only_dial_us,tests/ice_tcp_active_passive.rs:: test_ice_tcp_passive_side_connects_when_the_peer_signals_only_active_and_end_of_candidates. - congestion control: packets sent before a new path carried anything are not the new path's loss. At a path change (the peer connection's
PathChanged, or packets from new addresses) the estimate starts over and the packets sent into the path that was left are forgotten. The two ends do not take the new path into use at the same instant, though: what an endpoint sends between its own change and the moment the path carries media to the other end goes nowhere, and those packets were reported as the new path's loss. With bandwidth probing on, a probe cluster asked for at the instant of the change (23 padding packets in a chain without a pacer) is among them: after an ICE restart whose controlled side learned of the pair 10 ms before the controlling side, 24 of the first 47 packets it sent were counted lost and the estimate that had just started over at 300 kbit/s was cut to 298.9 (tests/capacity_cap_video_rtc2rtc.rs:: an_estimate_started_over_on_a_new_path_does_not_fall_without_evidence, which only held while retransmissions of old packets watered the fraction down to under 10 %). Now a packet sent on a new path earlier than every packet reported received over it, and reported as not received, is released without a verdict (the send history,before_the_path_carried), as the packets of the old path are; a packet lost after one that arrived is a loss as ever. Tests:rtpfb::history::tests:: a_loss_before_anything_arrived_on_a_new_path_is_not_reported,a_loss_before_the_first_arrival_of_a_call_is_reported,gcc::twcc_gcc::tests:: packets_sent_before_a_new_path_carried_anything_are_not_its_loss. - without a retransmission format, a NACK was never answered on the wire with the default interceptors (nortx-1). When no
rtxformat is negotiated (a peer that does not support RFC 4588, an application that registers none) the NACK responder answers a request with the packet again as it was sent: the media SSRC, the same sequence number, and so the SRTP packet index of the first transmission. A packet index protects one packet (RFC 3711 section 3.3.1; RFC 7714 section 8.1): the SRTP sender protects the same packet again and refuses a different one. The default set stamps the abs-send-time extension (offered on video since it joined the default set) and, where negotiated, the RFC 6051 timestamp, wire-ward of the responder, at the instant a packet leaves: the retransmission got a new stamp, was a different packet under a used index, and was dropped below the interceptors (unsent_index_reused), silently. No lost packet was repaired (a receiver waited for a key frame), while the responder had lowered the media target to make room for each retransmission (RFC 4588 section 7) and the congestion controller had recorded each as sent. Both stampers now give a packet that passes again, marked a retransmission under an SSRC and sequence number they have seen, what its first transmission left with (the stamp, or no timestamp), as the TWCC sender already kept its transport-wide number: the packet reaches the SRTP sender byte for byte as it first left. An RTX retransmission is a new packet and is stamped as it passes, as before. Also in 0.1.0. Not affected: a stream with RTX (every default codec has it), and a chain without those stampers. Teststests/nack_without_rtx_rtc2rtc.rs::a_lost_packet_is_sent_again_as_it_was_and_arrives_when_no_rtx_is_negotiated,a_packet_sent_again_as_it_was_keeps_its_abs_send_time,a_packet_sent_again_as_it_was_leaves_as_its_first_transmission_did. - video sent as RED was never repaired by retransmission (red-2; the
Chromeprofile'sfec.video-red-ulpfec). Two defects, either of which made every retransmission of a RED packet useless:- The NACK responder sent every retransmission of a stream under the one RTX payload type of the format the stream was bound with. RFC 4588 section 8.1 ties a retransmission format to one original payload type (
apt: "the payload type of the associated original stream"), and a receiver restores the payload type from theaptof the format the retransmission arrives under: a RED packet (payload type 116) retransmitted under the RTX of VP8 (97,apt=96) came back as VP8 with the RED header in front of it (traced call: 87 retransmissions, none usable). The responder now takes the RTX format whoseaptis the payload type the packet left under, among the formats of the stream's section and the stream's own pair, as libwebrtc does (rtp_sender.cc,BuildRtxPacket). A packet whose payload type has no RTX format, on a stream that negotiated RTX, is not retransmitted at all (libwebrtc sends nothing either): never as a second copy on the media SSRC. A stream that negotiated no RTX is repaired with the packet again as it was sent, as before. This also holds for a source that switches between the formats of its section (RFC 7160): each packet goes under its own format's RTX. - An offerer dropped
rtx apt=<red>when it applied the answer: entering the answer's formats under its own payload type numbers counted only media and FEC formats as the primary of an RTX format, so the RTX of a RED format was left out of the negotiated list, and the offerer could neither send nor read a retransmitted RED packet (between two engines only the answerer's direction had the format). - The FEC data of a FEC packet in RED (ULPFEC in a RED packet of its own, in the media's sequence space) is not retransmitted when the packet is asked for: the media's own retransmission answers the loss. Its sequence number is answered, with three octets under the RTX of
red: the original sequence number and the RED block header. A receiver that puts frames together in sequence-number order cannot tell a lost FEC packet from a lost one-packet frame, and would wait for it and ask for a key frame; restored, the answer is a FEC packet with nothing in it, which reaches the application as any FEC packet does, without a payload. libwebrtc keeps no FEC packet for retransmission (ulpfec_generator.cc:233,set_allow_retransmission(false)) and ignores a NACK for one (rtp_sender.cc:348-351); its receiver finds frames without the number. Without an RTX stream a FEC packet is not sent again.
Tests
rtci-interceptor/tests/nack_rtx_red.rs,in_the_chrome_profile_a_lost_red_packet_is_retransmitted_under_the_rtx_of_red,an_rtx_format_whose_primary_is_a_red_format_is_numbered_with_it. Not affected: streams not sent in RED with one media format (the default profile). - The NACK responder sent every retransmission of a stream under the one RTX payload type of the format the stream was bound with. RFC 4588 section 8.1 ties a retransmission format to one original payload type (
- media (
conf/red-3-fec-sequence-holes):SampleBuildergave a sample a duration of zero when the packet that follows it had the last sequence number before the wrap (65535): the search for the next packet's timestamp ran over a range that does not wrap. It walks the sequence numbers as they wrap now. - a stream received as RED had no RTCP feedback: with video RED / ULPFEC (the
Chromeprofile) two engines never raised their send rate (red-1). A receiver learns a stream's format from the payload type of its first packet; when that is theredformat (RFC 2198), which is described withouta=rtcp-fblines, the stream was bound to the interceptors with no feedback at all, while the sender, which knows the stream by its media codec, expected the feedback negotiated for that codec. With RFC 8888 congestion control feedback (ack ccfb, what two engines negotiate) the receiver therefore reported the audio stream only: the sender's congestion controller saw a path that carried 50 kbit/s, its estimate stopped at the first step above the start value (315 kbit/s) and after a capacity collapse stayed at the floor; NACK and key frame requests about the video were not bound either. A stream bound underrednow has the feedback of the format it carries (the one its fmtp names, else the section's first media format) beside any of its own, as libwebrtc configures a stream from its first media codec whatever payload type arrives. Found with the capacity instrument'schromechain (send target 90 kbit/s for the whole call); the row at fault wasfec.video-red-ulpfec, alone. Not affected: the default profile (no video RED), and a peer whose feedback is transport-wide (bound by the header extension: Chromium). Testa_red_stream_has_the_feedback_of_the_format_it_carries. Still open after this entry: a RED packet retransmitted over RTX is not usable by the receiver (it leaves under the media format's RTX payload type); see red-2. - circuit breaker: a receiver that reports from several of its SSRCs is counted once (rtcpbudget-4). RFC 8108 section 5.1 has every SSRC of an endpoint report on every stream it receives, so a peer that follows it (this engine with
rtcp_report_from_every_ssrc, theStrictRfcprofile) sends several report blocks about each flow in one compound packet, the same reception each time. The RFC 8083 breaker took each copy for a report of its own: the media timeout's count of reports without progress was reached in a fraction of the reporting intervals, a loss interval's packets were taken by the first copy and the others showed none, and the spacing between copies read as a reporting interval of zero. A flow now follows one reporting SSRC and takes another only once the one it follows has been silent for the RTCP timeout (the reporter left or changed its SSRC). With a peer that reports once (the default, libwebrtc) nothing changes. Testsevery_ssrc_of_the_receiver_reporting_counts_as_one_report,another_reporting_ssrc_is_followed_once_the_first_has_been_silent_for_the_rtcp_timeout. - interceptor / pacer (pacing-3): the deadline the pacer names is an instant at which the packet leaves, at every rate. Where a packet's wait is not a whole number of nanoseconds (12 000 bits at 840 kbit/s) the budget, refilled to the named instant, could be a fraction of a nanosecond's worth short: the packet stayed, and
poll_timeoutnamed the same instant again, so a driver that follows the deadlines exactly span (the test worlds hid it by pushing their clock on). The budget now covers a packet to within what the rate adds in two nanoseconds.pacer::tests::a_packet_is_releasable_at_the_instant_named_for_it,pacer_deadline.rs::every_deadline_the_pacer_names_releases_a_packet_and_the_next_is_later. Known effect, measured with the capacity instrument (1000 seeds each way, a capacity drop from 2.5 Mbit/s to 300 kbit/s behind a 300 ms drop-tail queue): with packets leaving at the named instants, a STUN consent datagram (RFC 7675) meets the full link queue in the overload after the drop in 30.6 % of calls instead of 25.2 %, and a peer reportsdisconnectedfor a moment in 17.4 % instead of 12.8 % (behind a 1000 ms queue 21.2 % instead of 14.0 % of 400). Most are the transient that one lost consent check gives (in that cell: median 0.5 s, longest 1.1 s of 1000 calls; no peer stayed disconnected, none failed), and the picture, audio and recovery figures do not move. Not every episode is that short: over the six paced cells of the instrument's record on the landing tree (train 34 round 1, 629 calls with an episode, median 0.6 s) 10 calls had one longer than 2 s, the longest 6.58 s behind a 100 ms queue and 9.20 s with 5 % loss on the reverse path, where 2 of 200 calls were still outsideconnectedat the end of the run; long single episodes and those 2 of 200 are there without this change too (5.92 s and 6.31 s the longest, 2 of 200). STUN does not pass the pacer; the drop is the link's. - Bandwidth probing in a chain without a pacer never got a result (in 0.1.0 too). A probe cluster was measured on the packets the pacer marked as the cluster's; with the pacer taken out of the default interceptors (or in any chain built without one) nothing marked a packet, so the congestion controller asked for clusters, the NACK responder sent each one's padding as a burst, and no result ever came: the start-up clusters among them, so an open 2.5 Mbit/s path was reached at the 8% a second of draft-ietf-rmcat-gcc-02 section 5.5 (about 1.4 Mbit/s after 20 s from the 300 kbit/s start) instead of within a second (RFC 8836 section 2, requirement 4). Now the responder's padding carries the cluster's mark (
ProbePacket) when no pacer took the request, and a cluster whose packets left in one instant is measured by how far apart the path delivered it (burst_estimate: the narrowest link's rate, never above the rate the cluster was asked for at). Where no cluster can be sent at all (no pacer and no RTX stream to pad on) the controller stops asking after the first cluster no packet left for, until another stream is bound or starts to send: a request that can have no result is not repeated. The start is now 1 Mbit/s after 0.37 s and the 2.5 Mbit/s maximum after 0.47 s in both chains without a pacer (tests/capacity_cap_video_rtc2rtc.rs:: an_open_link_is_found_within_a_second_without_a_pacer). A known limit of the burst measurement: a path that delivers a burst as one aggregate shows no spread and is credited with the rate asked for; the delay-based controller corrects it once the media follows (burst_estimate). Tests:rtci-interceptor/tests/probe_without_pacer.rs. - After an ICE restart onto a new path the default chain climbed at 8% a second (in 0.1.0 too): bandwidth probing was told nothing of a path change. The estimator starts over at its starting rate on a new selected pair (
PathChanged, orCongestionControlHandle::notify_path_change), but the probe controller kept what it had noted of the old path. During an outage the estimator halves at every feedback timeout, and each halving is a "large drop" that the probe after a drop asks about a second later: the cluster for the rate before the last halving (133 kbit/s), asked into the dead path, still awaited its result when the new pair was selected, held the controller's one slot through the half second in which a cluster for an application-limited sender would have been due, and no start-up cluster followed. On the capacity instrument's outage cell (a 4 s outage ended by an ICE restart, the new path open at 2.5 Mbit/s, 200 calls) the target was back at 1 Mbit/s 15.1 s after the new pair and averaged 1504 kbit/s 15 to 25 s after it; with the probe after a drop turned off, 1.0 s in 134 of the 200 calls and 12 to 13 s in the others. Now a path change starts probing over as at the start of the call (ProbeController::on_path_change, new): the start-up clusters again, at three and six times the rate the estimator starts over at and on while the new path carries what is asked, and the target's recent high, the drop below it and the cluster awaiting its result are dropped with the old path (the fall to the starting rate is not a capacity drop). libwebrtc does the same (GoogCcNetworkController::OnNetworkRouteChange:ProbeController::Reset, then the exponential probes again). MEASURED on the same cell (200 calls, hosted runs 45609964155 against 45607015088): 1 Mbit/s 0.8 s after the new pair (1.02 s at most; no call slower) and the 2.5 Mbit/s maximum through the 15 to 25 s window; with a receiver that has no bound on a gap the first new picture comes 2.3 s earlier in two thirds of the calls (0.74 s after the new pair against 3.08 s on average). WHAT IT COSTS: with the reference receiver (a gap given up after 300 ms) the first new picture comes 0.12 s later in those calls (0.70 s after the new pair against 0.58 s): the start-up clusters share the first moments of the new path with the key frame. The chains without a pacer were at 1 Mbit/s 0.5 s after the new pair before and are now (their probe after a drop is off, so no cluster was outstanding). The OTHER direction gains in every chain: the callee's target over the ten seconds after the new pair averages 1521 kbit/s against 507 with the pacer, and 1345 to 1367 against 395 without one. There the callee, which selects the new pair 10 ms before the caller, loses its first cluster whole (nothing but STUN crosses until both have switched); it used to ask for that one cluster only, and now the next start-up cluster follows when the first is given up a second later. Every other cell of the instrument is unchanged (4600 calls in fifteen cells, 0 differ). Tests:cc::probe::tests::a_path_change_starts_probing_over_and_forgets_the_drop,the_fall_to_the_starting_rate_at_a_path_change_is_not_a_drop,rtci-interceptor/tests/probing_across_a_path_change.rs,libwebrtcs_probe_after_a_drop_is_not_asked_across_a_path_change,tests/capacity_cap_video_rtc2rtc.rs::an_ice_restart_onto_an_open_path_finds_its_rate_within_a_second_in_the_default_chain,::the_peer_that_selects_the_new_pair_first_finds_the_path_though_its_first_cluster_is_lost. - interceptor / GCC (collapse-1): over-use that lasts through several feedback reports while a probe's measurement is held no longer multiplies the estimate by 0.85 on every report. draft-ietf-rmcat-gcc-02 section 5.5 sets
A_hat(i) = beta * R_hat(i); the controller took the probe's measurement for what the path delivers whenever one was held (six seconds after any probe result), and from the second report of an over-use on that measurement was the estimate itself, so the estimate fell by 15% every 50 ms whatever arrived: 268 kbit/s to the 100 kbit/s floor in 0.3 s while 213 to 252 kbit/s was received (the path oftests/capacity_cap_video_rtc2rtc.rs, where the estimate under a 300 kbit/s cap averaged 200 kbit/s and fell to the floor again and again). The measurement now stands in for the received rate only while the sender is received below it (application limited, as before); a sender received at the measurement or above it is cut to 0.85 times the received rate, and over-use never raises an estimate that rests on a probe.rate_control::tests::lasting_over_use_with_a_probe_measurement_follows_the_received_rate. - interceptor / bandwidth probing (collapse-2): a probe cluster's padding belongs to the cluster. The NACK responder made a whole cluster of padding-only RTX packets for every
ProbeRequest, and the pacer kept what did not leave in the cluster "until budget was spare". With a backlog in the pacer (after a capacity drop, during its pause) every cluster was filled by the backlog and its 22 padding packets stayed queued, for seconds: 191 of them after ten clusters intests/capacity_cap_video_rtc2rtc.rs. They left inside later clusters with the RTX sequence numbers they were given when made, far behind the stream's newest, where the receiver's replay protection and feedback window no longer take them; no report ever named them, so those clusters were never reported in full and gave no result (every cluster after the cap; an estimate at its floor with an application-limited sender then stayed there, 35 s on an open path in the cap matrix's seed 5 and 3 of 1000 seeds of the capacity review). Now the pacer says how much padding a cluster needs beyond the media it holds (ProbeFill, on the request's carrier), the responder makes that much (none while a backlog waits), and padding that could not leave in its cluster is discarded when the cluster ends (PacerInterceptor::padding_discardedcounts it). The congestion controller counts in a cluster only the packets per-packet feedback will report (audio without feedback that left during a cluster was waited for and never came), and a cluster one of whose reports is still missing 500 ms after it left is measured on the others instead of being given up.rtci-interceptor/tests/probe_cluster_padding.rs. - interceptors (RTP circuit breaker, RFC 8083): a call's voice no longer goes silent for good after a capacity drop (breaker-1). In a call between two peers of this engine a sudden drop of the path's capacity ceased the voice 145 ms later (seven voice packets dropped in a row at the bottleneck's full queue; the peer reports every 25 ms, so MEDIA_TIMEOUT = 5 reports), and with both directions capped, or a 1 s queue, the video (and voice) a few seconds later for congestion. Nothing restarted them. Read against the text:
- Restart (section 4.5). "RTP flows halted by the circuit breaker SHOULD NOT be restarted automatically unless the sender has received information that the congestion has dissipated". The breaker now restarts a ceased flow, never before the triggering interval has passed again, on the receiver's reports on another flow sent over the same transport: packets of that flow arriving (media timeout); its loss over a whole hold at which the rate that tripped is within ten times TCP again (congestion); loss and round trip inside the application's bound (media usability); a report on an SSRC of this endpoint (RTCP timeout). A flow that trips again within ten holds of a restart is held twice as long each time (up to 64 times). When every flow of a transport has ceased there is nothing a report could speak of, and the restart is the application's:
OnCircuitBreaker, thenCircuitBreakerHandle::restartoncerestart_afterhas passed. - The sending rate (section 4.3) compared with ten times the TCP throughput was the average over all of CB_INTERVAL, which after a drop still holds what was sent before the congestion controller reacted. "The actual sending rate" is now also taken over the last round trip (RFC 3551: "The timescale on which TCP throughput is measured is the round-trip time"): the breaker trips on a flow that was above the bound over the interval the loss is averaged over and still is.
- The media timeout (section 4.2) counted reports that could not have shown the packet they were held against (they arrived less than a round trip after it left), and went on counting for a flow that had stopped sending (a paused pacer); "When stopping sending an RTP stream, a sender MUST cancel the corresponding media timeout circuit breaker".
- Tr (section 3) was smoothed twice in the default chain (by the congestion controller and again by the breaker) and trailed a filling queue; once now.
- Tdr (section 3) was the spacing of the receiver's reports; it is the estimate of the receiver's calculated interval: what the chain's RTCP session calculates (RFC 3550 6.3.1;
RtcpReportingInterval), or the spacing of the reports where that is longer. Reports that come closer together than the calculated interval are each counted and no longer stretch the counts (section 5). What stays as the RFC has it: with a peer that reports every few tens of milliseconds (RTP/AVPF without aT_rr_interval, this engine's default beside video) five reports without a new packet of a flow that is being sent are a media timeout, in a quarter of a second or less. The flow now comes back when the flow beside it is seen arriving. A ceased encoding takes no share of the congestion controller's target (RTCRtpSender::target_bitrates) until it is restarted; dividing the target again for that sets the streams' shares only, so a flow that ceases or restarts while the pacer has the source paused (a target of zero) leavesavailableOutgoingBitrateat the congestion controller's estimate (interceptor_circuit_breaker_test::a_flow_ceasing_while_the_source_is_paused_leaves_the_estimate_alone). Measured (the capacity instrument's cells, 300 kbit/s cap for 20 s; hosted runs 45516841561 / 45516852677, 45516861432 / 45516870845; before = the same tree without this change): with a 300 ms bottleneck queue the caller's voice was silent to the end of the call in 63 of 534 runs, now no flow is ceased in any; with a 1000 ms queue it was ceased for good in 96 of 300, now the congestion breaker ceases it in 84 of 300 and the engine restarts it every time (silent 3.7 s in the median, 7.3 s at the 90th percentile, 10.9 s at worst: a known limit,docs/circuit-breaker.md); with both directions capped a flow was left ceased in 94 of 100 runs, now one ceases in 7 and is restarted. The capacity file's per-seed check that a sender following the target never freezes for more than 2 s (a_sender_following_the_target_is_paused_and_loses_nothing_at_the_pacer, retired with the capacity instrument in favour of its ensemble requirement) had been met in seed 6 only with the call's voice dead: there the breaker ceased the caller's audio 0.166 s after the cap and it never came back, which left the video the whole floor (freeze 0.98 s); with the voice alive that seed freezes 2.22 s (the link then carries 74 kbit/s of audio, 22 of new video and 91 of retransmissions in the pause). Over seeds 1 to 200 of that cell at the test's phase the voice was dead in 29; in the other 171 the freeze is the same to the digit with and without this change, and over 2 s in 14 of them (8.2 %) either way (hosted runs 45516852677, 45516841561). The bound is not changed and no seed is chosen: the requirement is the instrument's, over the ensemble, where it is a known limit. Audit rows RFC8083-3-1, 3-6, 4.2-4, 4.2-5, 4.2-6, 4.3-4, 4.5-1, 4.5-2, 5-3.
- Restart (section 4.5). "RTP flows halted by the circuit breaker SHOULD NOT be restarted automatically unless the sender has received information that the congestion has dissipated". The breaker now restarts a ceased flow, never before the triggering interval has passed again, on the receiver's reports on another flow sent over the same transport: packets of that flow arriving (media timeout); its loss over a whole hold at which the rate that tripped is within ten times TCP again (congestion); loss and round trip inside the application's bound (media usability); a report on an SSRC of this endpoint (RTCP timeout). A flow that trips again within ten holds of a restart is held twice as long each time (up to 64 times). When every flow of a transport has ceased there is nothing a report could speak of, and the restart is the application's:
- rtci, interceptor / RTP circuit breaker (collapse-3): the application is told when the circuit breaker (RFC 8083, in the default interceptor set) ceases one of its flows. A ceased flow's packets are dropped until the application restarts it (section 4.5: "SHOULD NOT be restarted automatically"), and nothing said so: the state could only be polled (
CircuitBreakerHandle::ceased). With a peer that sends a receiver report with every congestion feedback packet (this engine does, every 25 to 50 ms) a breaker trips within a fraction of a second of a sudden capacity drop (the media timeout after five reports without a new packet of the flow: 145 ms after a 2.5 Mbit/s path fell to 300 kbit/s intests/capacity_cap_video_rtc2rtc.rs's scenario; the congestion breaker over ten round trips: 2 to 3.4 s), and the call lost its audio or its video for good, silently: the audio in 17 of 100 runs of that scenario, the video in the runs "that never show video again" of the capacity review (both directions capped; a 1000 ms queue). Now the breaker sendsCircuitBreakerNoticeapplication-ward when a flow ceases and when a restart takes effect, and the peer connection raisesRTCPeerConnectionEvent::OnCircuitBreaker(sender, RID, SSRC, the breaker that tripped, how long until a restart is accepted). The pacer reads the notice too and no longer charges a ceased flow's packets to its budget: a voice the application kept writing took 76 of a 100 kbit/s target for packets that never left, and the estimate, bound by one and a half times what arrives, could not climb.circuit_breaker.rs::a_ceased_flow_and_its_restart_are_announced_application_ward,pacing.rs::a_flow_the_circuit_breaker_ceased_is_not_charged_to_the_budget. - interceptors (pacer): the target the pacer announces carries the congestion controller's minimum (
conf/breaker-2-pacer-ceased-flow). When a pause of the source begins or ends the pacer says the controller's target again application-ward (Attribute::TargetBitrateChanged), and it did so without the controller's minimum (MinimumTarget). The NACK responder takes the minimum from each target it reads and never tells the original media less; from the end of a pause until the controller's next target it read "no minimum" and lowered the target by its whole retransmission reserve, floor or not, and the peer connection reported that asavailableOutgoingBitrate(46 850 bit/s with the estimator at its 100 000 bit/s floor: a 53 150 bit/s reserve announced before the target reached the floor; hosted run 45501349668, the reasonconf/collapse-4was not green). The pacer now keeps the minimum that rode with the controller's last target and attaches it to its own announcements.pacing.rs::the_target_the_pacer_announces_carries_the_controllers_minimum. Performance: breaker-2 - rtci (statistics):
availableOutgoingBitratesurvivesset_parametersduring a pacer pause (conf/breaker-2-pacer-ceased-flow).RTCRtpSender::set_parametersdivides the transport's target among the encodings again; while the pacer had the source paused that target is zero, and the division wrote it as the transport's estimate: the statistic was gone until the congestion controller's next target. The division now sets the streams' shares only.interceptor_circuit_breaker_test::dividing_the_target_again_while_the_source_is_paused_leaves_the_estimate_alone. - tests (
conf/rtp-9-reporting-ssrc-intermittent): the RFC 8108 section 6.1 testa_receiver_that_starts_sending_sends_on_the_ssrc_it_reported_fromno longer fails about one run in fifty (28 of 1500 runs on master, alike under every crypto feature set; in CI it happened to show in the ring-only jobs). The engine was right. The test took the first packet of each SRTCP datagram, all that is readable on the wire, for the reporting SSRC's report. Once the stream sends, its RTX SSRC is a participant too (the congestion controller's padding goes out on it, RFC 4588 section 6.1), a compound packet carries the reports of both SSRCs (RFC 8108 section 5.3.2) and is led by the one whose timer expired: in the runs that failed the RTX SSRC led every compound packet sent while the stream had sender status, the stream's sender report second in each. The test now reads the compound packets whole, below the session, and states the requirement: from the stream's first packet on and while it sends, every report of that SSRC is a sender report (RFC 3550 section 6.4); nothing says BYE; no SSRC reports but that one and the stream's RTX SSRC. It sends until the SSRC has reported twice instead of for a fixed number of packets. No engine change. - tests (
conf/rtp-9-reporting-ssrc-intermittent): RFC 8108 section 5.1 is checked in the RTCP between two peer connections (every_ssrc_reports_on_the_others_with_the_setting_and_the_blocks_go_once_without: withrtcp_report_from_every_ssrceach of a stream's SSRC and its RTX SSRC reports on the remote SSRC and on the other; without it the report blocks are carried once and none names a co-located SSRC).report_blocks_from_every_ssrc_measured_against_once, which asserted that the RFC form froze the video longer through a capacity cap on two seeds, is now the ignored measurementmeasure_report_blocks_from_every_ssrc_against_once: it prints the figures and asserts nothing, because that order is chance on so few runs (it failed with the order reversed under an unrelated change). Row RFC8108-5.1-1 cites the new test. No engine change. - ice: a working path whose round trip rose above half a second lost its consent after 30 seconds (
conf/ice-26-consent-late-responses; RFC7675-5.1-7, -5.1-2, new row -5.1-16). Engine behaviour change. A consent request (RFC 7675) waited for its response four times the pair's last round-trip time, clamped to 500 ms .. 4 s; at the end of the wait its transaction was forgotten, so the response, when it came, was discarded as an unknown transaction: it renewed no consent and gave no round-trip time, and the wait never adapted. A path whose round trip jumped from 20 ms to 600 ms and more (a queue filling behind a capacity drop: hosted runs 45493039743 and 45493049553, four consent requests answered after 785, 523, 608 and 918 ms) wasdisconnected5 s after the first such request andfailed30 s after the last answer that had come within 500 ms, with every request answered. A pair whose round trip was over 500 ms from its first check failed 30 s after it was selected when all its checks had been retransmitted (a retransmitted request gives no round-trip time, so the wait stayed at 500 ms); it survived only when a check happened to be answered without a retransmission, as a cancelled one is. Now a consent request's transaction is in progress for what RFC 8489 section 6.2.1 gives a transaction after its last request,Rm(16) times the RTO, where the RTO is the candidate pair's, computed as RFC 6298 does (smoothed round-trip time plus four times its variation, 500 ms at least;stun::timer::RtoEstimator) from every request answered without a retransmission, and never longer than the consent expiry: 8 s at least, 30 s at most (RFC 7675 section 5.1: "An endpoint SHOULD await a binding response for each request it sends for a time based on the estimated round-trip time (RTT) [...] with an allowance for variation in network delay", and "a response might be for a previous request (rather than for the most recently sent request)"). A response within that renews consent and teaches the RTO, so a round trip that keeps growing is followed; one after it is for a transaction that is no longer in progress (RFC 8489 section 6.3) and is discarded, as is, always, a response that matches no request the agent sent, fails its integrity check, comes twice or comes from another address. The same holds on the path an ICE restart keeps (which also takes over the consent requests still open on the selected pair; its own had no end but their number) and over ICE-TCP. Consent still expires 30 s after the last response that renewed it, and the agent is stilldisconnectedwhen a consent request has gone 5 s without any response. What the RFC's wait does not cover: a round trip that jumps past 16 times the current RTO at once (20 ms to more than 8 s);ConsentResponseWait::Fixeddoes (see "Added").iceCandidatePair.currentRoundTripTimenow also reflects the late answers. Found on the way and left open (audit row RFC7675-1-1,partial): consent is kept per remote candidate, not per candidate pair, so a response on another pair to the same remote candidate renews the selected pair's consent. Known limit of 0.1.0 (for its release notes): a connection can fail 30 s after a path's round trip rises above 500 ms although the path works. Tests:rtci-ice/src/agent/agent_consent_delay_test.rs(17 tests),agent_open_rows_test.rs::test_consent_is_kept_on_a_tcp_pair_whose_round_trip_is_long,tests/ice_consent_slow_path_rtc2rtc.rs(two peers, the whole stack; three of its four tests fail on master d914b929, hosted run 45501729474).agent_checklist_test.rs::test_consent_response_is_awaited_for_a_time_based_on_the_rtt, which asserted the old rule, is removed. - sctp (up-333):
ChunkForwardTsn::unmarshalreads within the chunk's own length. It checked the buffer's length and read from the chunk's value, so a FORWARD TSN chunk of length 4 followed by other bytes read a New Cumulative TSN it does not hold and panicked. Not reachable from a peer:Packet::unmarshalslices each chunk to its length first; a direct caller and thechunk_chunk_forward_tsn_unmarshalfuzz target could reach it. A value whose length is not 4 plus a multiple of 4 is an error, as for I-FORWARD-TSN. Found while checking the siblings of webrtc-rs/rtc#333 by @mitsuhiko (error-cause length and DCEP threshold panics), whose two sites the fork had fixed in 3866ed31. Test:chunk_test::test_chunk_forward_tsn_is_read_within_its_own_length. - turn (up-316): a CreatePermission the application asked for that fails no longer drops a permission the server granted meanwhile. A permission is per IP address (RFC 8656 section 9):
create_permissionfor two ports of one address before the first answer sends two requests, and when the first was granted and the second refused, the address lost its permission here (send_tofailed withErrNoPermissionand the refresh left it out) though the server held it. The refusal is still reported (CreatePermissionError). Same defect as webrtc-rs/rtc#316 by @hsdfat (whose other half, permissions keyed per IP, the fork already had). Engine behaviour change (TURN client). Test:client_permission_test::test_a_refused_request_keeps_a_permission_granted_meanwhile. - examples / stun (up-954): the
trickle-ice,trickle-ice-srflxandrtci-stunstun_clientexamples sent their STUN Binding requests with the all-zero transaction id (Box::<TransactionId>::default()); they useTransactionId::new(), which RFC 8489 section 5 requires ("MUST be cryptographically random"), andTransactionId's documentation saysDefaultis never for a request. The engine itself always drew random ids (ICE checks, srflx gathering, the TURN client:rand::rng(), a CSPRNG). Same defect as webrtc-rs/webrtc#954 (webrtc-rs/rtc#283), in an application's gatherer there. No engine behaviour change. - interceptor (fec-13): the RFC 8627 FlexFEC encoder no longer takes a retransmission on the media SSRC (a NACK answered without RTX, as after an answer that kept only FlexFEC, RFC 8627 section 1.1.7) into its current block: its old sequence number broke the run of consecutive source packets, and the block went unprotected.
- sctp (sctp-17): two stream-reset faults. (1) A peer's Outgoing SSN Reset Request that arrives ahead of the last DATA it covers (RFC 6525 5.2.2 E2, answered "In progress") is performed when DATA or a FORWARD TSN brings the cumulative TSN to its Sender's Last Assigned TSN; it was then never answered with this side's own reset (RFC 8831 6.7), so the peer's channel stayed "closing" and the stream id stayed taken there, and the reset of a stream with no state here was not reported. It is now answered as a reset performed at once is. (2) Whether this side has reset its direction of a stream (so that the peer's reset is not answered with a second one) was the Readable bit of the stream's
RecvSendState, which the peer's Incoming SSN Reset Request cleared: the stream stopped being readable although the peer had not reset its direction (RFC 6525 5.2.3), and its unread messages were dropped when the peer's reset came. It is now a flag of its own; the peer's direction stays readable until the peer resets it. Engine behaviour change. Tests:rtci-sctp/src/association/reset_answer_test.rs. - A repair packet (RTX, FEC) that arrives before the stream it repairs, for a section whose SSRCs are not signalled (RFC 9143 section 9.2), is dropped without being counted in
discarded_rtp_packetsor reported byOnUnassociatedRtpDiscarded: its payload type names a repair format of the section, so it is not unassociated media (RFC 8830 section 3.1), and there is nothing to repair yet (RFC 4588 section 5.3 associates the RTX SSRC once the original stream has arrived). The likely source of the Firefox interop cell'sdiscardedRtp 15withdiscardedSsrcs= its RTX SSRC (RTX by payload type, SSRCs unsignalled): RTX packets, probes most likely, before the first packet of the video stream. Engine behaviour change (a counter and an event; nothing was ever delivered from such a packet).
Known limits
- Stack copies of key material with either provider (
conf/zeroize-1-dtls-srtp-key-erasure; RFC 7714 section 13.1): building a key object leaves copies in dead stack frames, and the providers' own stack temporaries are not erased by them. The engine scrubs 32 KiB of stack after building keyed objects (DTLS); the tests catch stack residue where it reaches the heap (DTLS), and a copy deliberately moved onto the stack is not caught, so this is a measure, not a tested guarantee (RFC7714-13.1-3partial, class E). CORRECTED (this entry first said the Linux process scan found none in dead worker stacks): building SRTP contexts DOES leave keys in the dead stack frames of the thread that built them. Train 34's test environment (rustc 1.99.1, run 45714962513) found, after the contexts were dropped, the SRTCP encryption key and its AES round keys, the SRTCP HMAC-SHA1 states and the master key (all ten profiles, ring; 120 key forms), in that thread's stack only, none in the heap; the same sources fail in 20 of 20 runs inside the test-environment image and in 0 of 40 directly on GitHub's Ubuntu runners (rustc 1.99.1 and 1.100.0): environment-dependent, the reason not identified (conf/zeroize-2b-claim-matches-proof). The copies stay until later calls on that thread overwrite them, or, after the thread ends, until its cached stack is given to another thread. An application can build contexts on a long-lived thread or callcrypto::scrub_stack()from the frame that built them (it reaches the 32 KiB below that frame only). The process-memory tests now fail on any key outside those dead frames and print what they find inside them; the ignoredknown_limit_with_{ring,aws_lc}_building_an_srtp_context_leaves_keys_in_dead_stack_framesare the limit as tests (docs/test-exclusions.md). With the ring provider an RSA signing key keeps its private limbs in ring's own heap allocations, which ring frees without erasure (not measured). Until this branch, ring's AEAD, header-protection, HMAC, ECDHE and Ed25519/P-256 signing key objects were also left in freed memory; they are now erased (Security). - the
Chromeprofile shows a stale picture after a capacity collapse (red-2; docs/capacity-collapse.md, "The Chrome profile keeps its backlog"). Its pacer row is libwebrtc's (pacer.queue-overflowDrain): the backlog is never flushed, the source is paused and the queued repairs are delivered in order. One direction of a 2.5 Mbit/s call capped at 300 kbit/s, 1000 seeds, with the profile's RED video repaired (red-1, red-3, red-2): oldest picture 5.5 s, older than 2 s for more than half a second in every call (the default: 1.3 s, none); both directions capped 11.5 s against 2.6 s. Not a defect: the profile with that one row set toDropis at 1.46 s, the default withDrainat 6.6 s (200 seeds). An application that wants the profile's other rows and a fresh picture setsDefaultInterceptorOptions::pacer_queue_overflowtoDrop. The four-profile table of docs/capacity-instrument.md has the profile's column measured with the repairs. - a sudden capacity drop, with the backlog flushed (
conf/flush-1r-backlog-flush-at-collapse, docs/capacity-collapse.md; 200 seeds per cell; this supersedes the default-chain figures of the entry below): the default chain now meets the picture and freeze requirements in the standard cell and with a receiver without a bound in time (0 of 200; oldest picture 1.33 s), and the resume requirement after an outage with the bounded receiver (0 of 200); their tests areon_demand_requirement_*. Still missed:- both directions capped: 119 of 200 runs miss the picture requirement (oldest picture 2.6 s in the median, 10.9 s at worst; 200 and 12.9 s before). The estimate falls only by the rule for missing feedback; there is no backlog at the sender to flush.
- a 1000 ms queue on the path: 109 of 200 (2.52 s in the median; 200 and 7.0 s before): the second already in the path's queue cannot be recalled; about 2.0 s is reachable.
- an outage with a receiver that has no bound in time: 66 of 200 runs resume later than 2 s (200 before): no flush fires when nothing queued at the sender during the outage.
- congestion control, default (paced) chain: a sudden capacity drop can freeze the video for more than 2 s (
tests/capacity_cap_video_rtc2rtc.rs, the 300 kbit/s cap arriving at 2.5 Mbit/s). Over 108 runs (six seeds, three wall clocks, six perturbations of incidental wire sizes and seeded draws) the longest freeze is 0.88 to 2.31 s (median 1.35 s) and 1 run is over the 2 s the test requires (4 of 108, 2.10 to 2.28 s, before train 24; one of them a seedRTC_CAP_FULLruns, so the full matrix failed then). Not a regression of train 23:conf/jsep-75-session-versiondraws theo=session id from the crypto provider, which the test seeds, and that one draw moved every seeded figure (with the draw removed every cell is train 22's again). The freeze is the repair of the drop's losses inside the pacer's pause;conf/rtx-2r-smooth-limiter(withconf/rtx-1r-duplicate-repairs) brings all 108 runs to 0.75 to 1.28 s. - a sudden capacity drop (2.5 Mbit/s to 300 kbit/s), measured as its user sees it (
tests/capacity_instrument.rs, docs/capacity-instrument.md; master 63e1b8b8, 1000 seeds in the default chain's cells and 200 in the others; each is an ignoredknown_limit_*test that states the requirement, "in at most 5 % of calls", and a tripwire holds today's level; this supersedes the entry above, whose freeze counted any frame however old):- default chain, a receiver that gives a gap up after 300 ms and asks for a key frame: the screen shows a picture older than 2 s in every run (required: for no more than 0.5 s, in at most 5 % of calls); the oldest picture is 9.0 s in the median (10.2 s at the 90th percentile) and there is no new picture under a second old for 8.7 s. The source is paused about 8 s while the backlog written before the drop and its repairs drain inside the new rate.
- default chain, a receiver that waits without a bound in time (the one
tests/capacity_cap_video_rtc2rtc.rsasserted on): more than 2 s without a frame of any age in 27.2 % of runs (that test's two to six seeds at one phase of the cap showed 8 %, and passed more often than not); the picture on the screen is 8.3 s old in the median all the same. - (no longer a limit, breaker-1: the audio never returned in 8.9 % of runs of the default chain, 33 % with a 1000 ms queue; now no flow is left ceased in any cell, and
ensemble_requirement_no_flow_is_left_ceased_and_audio_is_alive_at_the_endguards it on every pull request.) With a 1000 ms queue the voice is still silent for some seconds in about a quarter of runs while the congestion breaker holds it (53 of 200 runs with more than 1 s without audio; 3.7 s in the median):docs/circuit-breaker.md. - both directions capped: every run of the default chain misses the picture requirement (20.4 s in the median), 8.5 % never show a new picture again, and the circuit breaker ceases a flow in 187 of 200; without the pacer 32 % miss it and 28.5 % never return.
- both directions capped, why: each sender's congestion feedback crosses the other sender's overloaded uplink and is dropped there for about the first second (the queue drops RTCP like media), and what arrives is 0.33 s late, so the estimate is under 400 kbit/s 0.8 to 1.9 s after the drop where one way it is 0.5 s. A missing-feedback timeout of three observed feedback intervals (RFC 8888 section 5 permits it) brings that to 0.8 s in the median and was measured and NOT taken: with one direction capped it cuts the healthy direction's target to 915 from 2373 kbit/s (audit row RFC8888-5-2).
- a peer reports
disconnectedfor 0.2 to 1.4 s in 13 to 17 % of calls through the drop (one ICE consent datagram lost at the full queue; none stays so, none fails): the documented meaning of the state (docs/conformance/audit/rfc7675.md). - without the pacer: the picture requirement is violated in 7.0 % of runs (interval 4.2 to 11.4 %) and the freeze one in 5.5 %: at the bound, neither met nor missed can be claimed (their 300-run tests pass on one draw and fail on the next; run on demand).
- a peer leaves Connected (ICE consent answers arrive later than the consent wait) in 16 % of runs of the default chain, and in 197 of 200 without the pacer with a 1000 ms queue, 3 of them to Failed.
- an outage of 4 s ended by an ICE restart: in the default chain the next new picture comes later than 2 s after the new pair in 67 % of runs.
- met: ParolNet's chain (no pacer, the TWCC-driven estimator) with the bounded receiver meets the picture, freeze and audio requirements (0 of 200; oldest picture 1.33 s), and the outage without the pacer meets the resume requirement (0 of 200).
Testing
- The browser loss-recovery cells no longer depend on who wins a NACK race (
scripts/test-env/interop/scenarios.spec.mjs,common.mjs,examples/interop-peer;conf/test-2-firefox-loss-cells-count-repairs-without-the-race; test harness only, no engine change). "loss recovery: NACK and RTX repair a browser's video under netem" asserted that the browser received RTX from Rust while netem dropped only the browser-to-Rust leg. The reflecting peer sends back the browser's packets under their own sequence numbers, so each such loss is a gap toward the browser too, and the browser's NACK for it crosses the same netem as the browser's own RTX of it: about 93% of those NACKs reached Rust before the packet did, so there was nothing to resend and the packet reached the browser as a late original. Firefox then counted no retransmission in about 1 run in 40, on the 0.2.0 release head and before nack-11 alike (test-env run 45796440553; 40-run loops 45805447289 and 45805457083: 0 give-ups, 2337 of the 2338 NACKed packets Rust held answered). The cell now also drops what Rust sends (impairFromRust, netem on the Rust host), and asserts Rust'sretransmittedPacketsSentas well as the browser'sretransmittedBytesReceived. The reflecting peer now passes key-frame requests for what it sends back on to the browser's encoder (a PLI for the source SSRC, at most one per 200 ms), as a forwarder does: "loss recovery with the browser's SSRCs unsignalled" failed in 3 of 80 Firefox loop runs (and in 45796440553) with its decoder waiting, after one late packet, for the encoder's own next key frame (29 requests reached Rust, none went on). - The SRTP process-memory tests use keys of their own per test and classify every hit by its address (
rtci-srtp/tests/key_erasure_process_memory.rs,conf/zeroize-2b-claim-matches-proof). A test thread computes the keys it looks for on its own stack; two tests looking for the same keys could find each other's computations in a dead thread stack the C library had handed to a later worker (10 of 50 runs with two tests per provider, runs 45726164797, 45726174061, 45726181744, 45726197738), the likely source of the one after-drop finding zeroize-1 left unexplained (45641590609). The worker is given its master key in zeroizing heap buffers; a hit in the worker's stack below its live frame is reported (STACK RESIDUE), any other (heap, other mappings, the worker's live frame and TLS) fails the test, and the live-key check now requires the key outside those dead frames. No engine code changed. - The released-sections gate compares with the newest release tag that is an ancestor of the commit, not the newest tag in the repository (
scripts/check-changelog-released.py). A maintenance release of an earlier line, tagged on its own branch after this line's last release (v0.22.0+brainwires.5.1, 2026-11-25), made the gate ask every tree of this line for a section its history never had. In a shallow checkout the script fetches the history first;--tagstill names a tag outright. Tests:scripts/test_check_changelog_released.py(a throwaway repository with a release on main and a newer tag on a side branch), run in CI beside the gate. - RFC 4585 section 4.2: receivers do not rely on a reaction to feedback; RFC 7714 section 13.1: every key form searched for after the drop (
conf/must-2-feedback-reliance-and-key-erasure; tests and audit only, no engine behaviour change).tests/feedback_not_negotiated_rtc2rtc.rsandsample_builder_gap_wait_test.rs::a_receiver_does_not_wait_for_feedback_the_sender_never_answers: with no feedback negotiated and a sender that reacts to nothing, the receiving engine sends no feedback, audio is delivered in thehandle_readthat brought it, video after a loss is delivered withinDEFAULT_MAX_GAP_WAITand decoding resumes at the sender's next scheduled key frame (RFC4585-4.2-7tested, out of class E).rtci-srtp/tests/key_schedule_erasure.rs(freed Rust heap, every platform),rtci-srtp/tests/key_erasure_process_memory.rs(the whole process, Linux) andtests/dtls_srtp_keying_material_erasure.rs: every key an SRTP context derives, its AES round keys, GHASH key and HMAC-SHA1 states, computed by the tests themselves, are found while alive and searched for after the drop (RFC7714-13.1-3 stayspartial; class E afterconf/zeroize-1-dtls-srtp-key-erasure: see Security and Known limits). - benchmarks compared on every pull request; a performance ledger (
conf/perf-1-ledger-and-bench-gate): the pull-request job "Benchmarks compared with the base" ofbench.ymlbuilds the pull request and its base on one runner and runs every criterion bench of both in alternating rounds (scripts/bench-compare.sh), and fails when a bench is slower in every round than the measured noise allows unlessbenches/accepted-regressions.tomlaccepts it with a ledger row (scripts/bench-compare.py). New benches: every DTLS 1.2 record cipher (AES-CCM, AES-CCM-8 and ChaCha20-Poly1305 added) and a whole in-memory DTLS 1.2 handshake (rtci-dtls/benches/record_protection.rs); the pacer, the NACK responder, GCC feedback handling and ULPFEC encoding (rtci-interceptor/benches/interceptor.rs). The once-per-merge run that feeds the published history runs on pushes to master only and now includesrtci-dtlsandrtci-interceptor.docs/performance.mdrecords every measured performance decision (accepted, queued or refused) with its figures, guard and runs; a CHANGELOG entry that moves a measured figure carries a linePerformance: <row id>, andscripts/check-performance-ledger.pyholds the tags, the allowlist and the rows' files and tests to the tree. Performance: perf-1 - No test needs the public internet (
conf/test-1-no-public-network): on train 34rtci-turn'stest_client_with_stun_send_binding_requestsent a STUN Binding request to a public Google server and blocked inrecv_fromwith no timeout until CI cancelled the macOS job after 90 minutes. It andtest_client_with_stun_send_binding_request_to_parallelnow ask a STUN server on a loopback socket of the same process, which answers with the address it saw; the tests still check that the client sends a Binding request and reads the server-reflexive address from the response, now that it is the client's own address, and every read waits at most 5 s, then fails naming what did not arrive. In all, 17 default tests sent packets to a public STUN server: those two and fifteentests/*_interop.rsfiles, whose upstreamwebrtcpeer resolvedstun.l.google.com, sent Binding requests to it and waited for them in its gathering. That peer has no STUN server now; both peers connect over host candidates on this machine. The two QueryOnly tests oftests/mdns_query_and_gather_interop.rshad connected on Windows only through that public server (the upstream server-reflexive socket, bound to the unspecified address, was the one path to the rtc peer's loopback candidate): on Windows and macOS their rtc peer now binds the mDNS egress address, as the QueryAndGather tests' already did on Windows. The engine-side ICE server of the rtc2rtc and interop tests (configured, never resolved: no test driver answers the engine's resolve command) is nowstun:stun.invalid:3478(RFC 6761), so nothing could be looked up even by a driver that answered. Two loopback TCP reads intests/ice_tcp_active_passive.rsare bounded. New gatescripts/check-no-public-network-in-tests.py(with its unit tests,cargo.ymlTest inventory job) fails on a test source that names a public STUN/TURN server or connects, sends or resolves to an address off the machine; lines that only parse or configure such a name are rows ofscripts/check-no-public-network-in-tests.allow, each with its reason and an exact count. Test and CI only; no engine change. - capacity instrument: the recovery as an absolute figure, the start-up, a cap that stays (
conf/instrument-4-absolute-recovery-and-long-cap): new figuresto1000(seconds from the capacity's return until the target is at 1000 kbit/s;recoverwaits for 0.4 of the target before the drop, which is a different rate in a chain that met the drop lower, so it does not compare chains) andstartup(seconds from the start of the call until the target is within 5 % of the 2.5 Mbit/s maximum; 99 when not before the drop); new scenariocap60(the cap held 60 s instead of 20; measurement only). The baseline gains two tripwires per cell (the 90th percentile of each new figure) when it is next recorded. Test only. - capacity instrument: how long a peer is disconnected, the direction that was not capped, a feedback outage (
conf/instrument-3-disconnect-and-reverse-columns): new figuresdisc_time,disc_max,disc_open(episodes outside Connected: total, longest, still open at the end),stun_lost(ICE consent datagrams that did not arrive),low/mean10(the caller's lowest and mean target after the drop) andback_low/back_mean(the callee's: the direction whose capacity did not change); new scenariofbgap(no capacity change, the callee's RTCP lost for 300 ms). The baseline gains three tripwires per cell (disc_open> 0,disc_max> 2 s, the 10th percentile ofback_mean) when it is next recorded. Test only. - Congestion control feedback inside the RTCP bandwidth, measured on a call (row RFC4585-3.5.2-5, a measured setting; the default, feedback sent as it is built, is unchanged).
feedback_inside_the_rtcp_bandwidth_halves_an_estimate_while_only_audio_is_sent(tests/capacity_cap_video_rtc2rtc.rs): with RFC 4585 section 3.5.2's timing for the feedback, an audio-only call's estimate halves to its floor on a clean link (5 % of a 64 kbit/s session holds a feedback packet every one to four seconds; half a second without feedback is taken for over-use). The capacity instrument on the same seeds: one direction capped, nothing worse (oldest picture -0.33 s); both directions capped, recovery slower than 20 s in 64 % of runs against 18.5 %. The capacity world'sSetuptakesimmediate_congestion_feedback. - audit and capacity instrument (rtcpbudget-4): RFC 8108 section 5.1's report blocks from every SSRC stay a setting (
rtcp.report-from-every-ssrc:StrictRfcon, the default andChromeonce), now on the capacity instrument's evidence in place of a two-seed print: as the default it made the picture through a capacity collapse 0.53 s older (8.00 -> 8.53 s, 1000 seeds), the send target under the cap 24 kbit/s lower and three times as many calls slow to recover (81 -> 244 of 1000), because its compound packets are twice the size (RTCP of an endpoint 122 -> 149 kbit/s on an open 2.5 Mbit/s call). The instrument's chain tokeneveryruns it; the ParolNet chain of the capacity world takesSetup::report_from_every_ssrctoo. Audit rows corrected: RFC8108-5.3-2 (an aggregated compound packet begins with SR or RR: tested, was "no aggregation"), RFC8108-5.3.1-1 (the conditional limit of two aggregated reports for non-updated peers: missing, was "met by not aggregating"), RFC8108-5.3.2-5 (untested, was "no step b"), RFC4585-4.3-1 (b=RS/b=RRof the remote description reach the session: tested, was "the SDP layer does not feed it"). - capacity instrument: the behaviour profiles through a collapse (rtcpbudget-4):
docs/capacity-instrument.mdhas the table of the default,Performance, the default withrtcp_share_follows_send_rateandChromeon the same 1000 seeds, paired: RTCP on the capped link 80 / 22 / 33 / 20 kbit/s, oldest picture 7.9 / 6.1 / 6.2 / 5.8 s, calls over 20 s to recover 128 / 0 / 0 / 18 of 1000;Performancepays when both directions collapse (picture +1.6 s). TheChromecolumn was measured before the repair of retransmitted RED packets and is marked so. - capacity instrument (rtcpbudget-5): chain tokens for the default chain with other settings, measurement only:
share(the defaults withrtcp_share_follows_send_rate),perf(thePerformanceprofile's interceptor settings),perfshare,perfnoshare,chrome(theChromeprofile's);Setup::profileandSetup::share_follows_send_ratein the capacity world. - capacity-cap test: bounds from a perturbed ensemble (
conf/capmatrix-1-perturbed-ensemble):measure_the_capacity_captakesRTC_CAP_PERTURB(the ICE SOFTWARE text absent, 27 or 40 bytes; one or two seeded draws dropped first),RTC_CAP_RULES=defaultand runs side by side. Each bound says whether it is a requirement (the 2 s freeze: unchanged everywhere) or a tripwire, set at the ensemble's most measured and some 15 %: without a pacer at a 1 Mbit/s target, oldest picture 3.5 s (4 s underUpToTarget) -> 2.9 s and retransmissions 100 -> 63; the cap after 20 s, oldest picture 5.5 -> 6.1 s (one draw per seed had put it 4 % over the most measured) and retransmissions 130 -> 122; the paced test, retransmissions 130 -> 127. The paced test's recovery is measured from the lowest target of the first second after the lift; its ordinary seeds are 1 and 4 (the ensemble's medians; seed 2 was among its mildest), and it reports every failing seed, not the first. - the capacity instrument (
conf/instrument-1-user-visible-ensemble):tests/capacity_instrument.rsmeasures what the user of a call sees at a capacity drop and after an outage, per run: the age of the picture on the screen (oldest, time over 1 s and 2 s, time-weighted percentiles), the longest time without a new picture under a second old, the audio (longest gap, share delivered each way, delay), the time to recover the rate, the flows the circuit breaker ceased and whether a peer left Connected; over cells (default chain, pacer-less, ParolNet's; a receiver with a 300 ms bound on a gap and one without; one or both directions capped; queue 100 / 300 / 1000 ms; 5 % loss on the reverse path; the outage with an ICE restart) and seeds, the cap at three phases of the frame clock. Requirements are shares tested with a stated power (300 runs, at most 21 violating: 0.951 to pass at 5 %, 0.954 to fail at 10 %); regressions are tripwires against a recorded baseline (tests/fixtures/capacity-instrument-baseline.tsv); a run is a function of its seed, and that is asserted.scripts/capacity-instrument.py(tables, the merge-point rule of docs/capacity-instrument.md, the baseline) has its unit tests. The world model moved totests/capacity_common/mod.rs, shared withtests/capacity_cap_video_rtc2rtc.rs, unchanged in what it does (the instrument reproduces an independent 1100-seed ensemble of v0.1.0 to the digit). tests/capacity_cap_video_rtc2rtc.rs: the freeze and oldest-picture assertions are retired. "Never more than 2 s without a usable frame" (a requirement) and the oldest picture (2.9 s, 6.1 s and 11.75 s tripwires) were asserted on two to six seeds and counted a frame however old it was; the instrument above asserts what is on the screen instead. The file keeps its other checks: retransmissions, the rate under the cap, the recovery after the cap, the pacer's pause and discards, the path change, the cameras, the open link.
Test environment and documentation
- video (
conf/vp-9r-vp8-partitions): the golden-stream tests ofrtci-video(*_ivf_survives_loss_and_reordering_intact,*_annexb_*,vp8_ivf_through_loss_decodes_bit_exactly_with_the_vp8_decoder) no longer require 99 % of the frames decoded at 5 % loss, a figure calibrated to one packetization and one seeded loss pattern: RFC 7741's partition packets (every VP8 frame at least two packets) took 296 of- They now state the requirement: every released frame decodes, and a frame is left out only when a repair held it up (its own, or that of a frame it predicts from, completed after the frame's packets were all due without loss) and a key frame after it was released: the frame buffer then released the key frame while it waited, or dropped it as too late (libwebrtc's late-frame drop). The VP8 frames skipped were 208 (repaired), 209 (predicts from 208), 239 and 269 (repaired), each just before a key frame. No pipeline change: no frame split at a partition boundary was mishandled. A mutation where a key frame drops every older frame, complete or not, fails them (VP8 260, VP9 154 released).
- audit: the library's advisory check (
.github/deny-library.toml, no ignores) covers the published crates (exclude-unpublished); the whole-workspace check (deny.toml) now resolves every feature, so the unpublished crates' optional backends are still checked there. It ignores RUSTSEC-2024-0436 (paste1.0.15 unmaintained, no vulnerability, no safe upgrade): an unmaintained build-time proc-macro reached only throughrav1d/rav1ein the unpublishedrtci-videocrate's opt-in AV1 features; remove when those drop it. Recorded inFORK.md"Dependency audit". - docs:
docs/video-pipeline.md, the design of the video half of the media pipeline (conf/vp-1-design): what the engine already gives video, what a complete receiver and sender need beyond it, each element against libwebrtc (a222406d) and the RFCs / W3C specifications, the codecs available under the licence and pure-Rust constraints (with the H.264 / H.265 patent situation and Cisco's OpenH264 binary conditions,specs/openh264-BINARY_LICENSE.txtquoted), the crate layout, threading and A/V sync, the phases with their acceptance figures, and the decisions left to the owner. - stream-driver (
conf/mdns-6-regression-test): a return of 0.1.0'sPeerDriverdefect (the UDP sockets of.localcandidates closed when the signalling state returns to stable) was caught on Linux only.tests/mdns_virtual_time.rsconnects two publishing drivers on the mock runtime (whose multicast sockets now send from the address a transmit names, as the engine asks for mDNS) and runs on Linux, macOS and Windows in CI;tests/mdns.rs(real multicast) runs on Windows as well as Linux (on a Windows host with no interface that carries multicast to the group, as some hosted images, its two tests on the default interface print why and skip).