Adding the +/-50%RTO jitter applies only to paths, which are not potentially failed and which are not unconfirmed and not idle.
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
sys/netinet/sctputil.c | ||
---|---|---|
2292–2293 | Should SCTP_ADDR_REACHABLE be checked here? This might be enough? if ((net->dest_state & (SCTP_ADDR_UNCONFIRMED | SCTP_ADDR_PF)) == 0) { In that way, we don't add the jitter and heartbeat interval if the path is unconfirmed or potentially failed. | |
2295–2304 | I might be mistaken, but before we had (assuming that RTO > 1): And now we have (assuming that RTO > 1): And I think that we would want this (assuming that RTO > 1)? I think the switch case could be easier to understand with a new variable called rto, like in this example: uint32_t to_ticks; uint32_t rto, rndval, jitter; ... if (net->RTO == 0) { rto = stcb->asoc.initial_rto; } else { rto = net->RTO; } // to_ticks == RTO to_ticks = rto; if ((net->dest_state & (SCTP_ADDR_UNCONFIRMED | SCTP_ADDR_PF)) == 0) { if (rto > 1) { rndval = sctp_select_initial_TSN(&inp->sctp_ep); // jitter == [0, RTO] jitter = rndval % rto; // to_ticks == RTO/2 to_ticks >>= 1; // Haven't calculated how this if statement could end up. if (jitter < (UINT32_MAX - to_ticks)) { // to_ticks == [RTO/2, 3*RTO/2] to_ticks += jitter; } else { to_ticks = UINT32_MAX; } } // Haven't calculated how this if statement could end up. if (net->heart_beat_delay < (UINT32_MAX - to_ticks)) { to_ticks += net->heart_beat_delay; } else { to_ticks = UINT32_MAX; } } ... |
Fix computation of jitter.
sys/netinet/sctputil.c | ||
---|---|---|
2292–2293 | Path Verification contains: In each RTO, a probe MAY be sent on an active UNCONFIRMED path in an attempt to move it to the CONFIRMED state. If during this probing the path becomes inactive, this rate is lowered to the normal HEARTBEAT rate. I think this is captured exactly with: if (!((net->dest_state & SCTP_ADDR_UNCONFIRMED) && (net->dest_state & SCTP_ADDR_REACHABLE)) && ((net->dest_state & SCTP_ADDR_PF) == 0)) { | |
2295–2304 | You are correct. Fixed in the latest patch. |