pub struct Timers {
pub ta: Duration,
pub pacing_floor: Duration,
pub rto_floor: Duration,
pub rc: u32,
pub rm: u32,
pub tr: Duration,
pub tn: Duration,
}Expand description
The timers of RFC 8445 §14 and RFC 5389 §7.2.1, plus the one stopping value that is sipx’s own.
Every field is a value the deployment may change; Timers::default is what the RFCs
recommend. Two of them have normative floors that Timers::pacing and Timers::rto
enforce rather than trust: Ta may not pace faster than 5 ms across every agent in the process
(§14.2), and an RTO may never be below 500 ms (§14.3).
Fields§
§ta: DurationTa — the pacing interval: one check leaves per tick, across the whole checklist set (§14.2). Default 50 ms.
pacing_floor: DurationThe floor under Ta, “as though there were one global Ta value for pacing all agents” (§14.2). Default 5 ms.
rto_floor: DurationThe floor under the RTO. §14.3: agents “MUST NOT use an RTO value smaller than 500 ms”.
rc: u32Rc — how many times a request is transmitted before the transaction fails (RFC 5389 §7.2.1). Default 7.
rm: u32Rm — the multiplier on the wait after the last transmission (RFC 5389 §7.2.1). Default 16.
tr: DurationTr — how long a selected pair may carry no data before a keepalive is sent (§11). Default 15 s, which §11 also makes the minimum: “MUST NOT use a value smaller”.
tn: DurationTn — sipx’s own stopping value: how long the controlling agent keeps checking after the first valid pair appears before it nominates (spec §8). Default 1 s.
§8.1.1 leaves the stopping criterion to local optimisation and requires only that exactly one pair is eventually nominated. A number here rather than an emergent behaviour is what makes that choice testable.
Implementations§
Source§impl Timers
impl Timers
Sourcepub fn pacing(&self) -> Duration
pub fn pacing(&self) -> Duration
The interval between checks: Ta, but never below the process-wide floor (§14.2).
Sourcepub fn rto(&self, checks: usize, outstanding: usize) -> Duration
pub fn rto(&self, checks: usize, outstanding: usize) -> Duration
The retransmission interval for a check being sent now (§14.3):
RTO = MAX(500ms, Ta * N * (Num-Waiting + Num-In-Progress))checks is N, the total number of connectivity checks to be performed — the size of the
checklist set, not of one checklist. outstanding is Num-Waiting + Num-In-Progress
across that same set, which is why this cannot be computed once: it falls as the checks
drain, and §14.3 says so outright.
Sourcepub fn final_wait(&self, rto: Duration) -> Duration
pub fn final_wait(&self, rto: Duration) -> Duration
The wait after the last transmission of a check, after which the transaction has timed out (RFC 5389 §7.2.1: “a duration equal to Rm times the RTO”).
Trait Implementations§
impl Copy for Timers
impl Eq for Timers
impl StructuralPartialEq for Timers
Auto Trait Implementations§
impl Freeze for Timers
impl RefUnwindSafe for Timers
impl Send for Timers
impl Sync for Timers
impl Unpin for Timers
impl UnsafeUnpin for Timers
impl UnwindSafe for Timers
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more