From 25b5e080949fec7ed902484feec07250a20dd83e Mon Sep 17 00:00:00 2001 From: Victor Boivie Date: Thu, 16 Sep 2021 21:22:09 +0200 Subject: [PATCH] dcsctp: implement congestion control errata When re-reading through the errata for RFC4960 in RFC8540, it was found that two erratas were not applied to dcSCTP: https://datatracker.ietf.org/doc/html/rfc8540#section-3.11 https://datatracker.ietf.org/doc/html/rfc8540#section-3.12 They are now applied. Re-running throughput tests show no difference. Bug: webrtc:12943 Change-Id: I9d73d0d257eab8442954924dc414d8efa2c41e8b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232221 Reviewed-by: Harald Alvestrand Commit-Queue: Victor Boivie Cr-Commit-Position: refs/heads/main@{#35024} --- net/dcsctp/tx/retransmission_queue.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/dcsctp/tx/retransmission_queue.cc b/net/dcsctp/tx/retransmission_queue.cc index b1b9afbf8c..57154b30db 100644 --- a/net/dcsctp/tx/retransmission_queue.cc +++ b/net/dcsctp/tx/retransmission_queue.cc @@ -274,8 +274,10 @@ void RetransmissionQueue::HandleIncreasedCumulativeTsnAck( // data outstanding (i.e., before arrival of the SACK, flightsize was // greater than or equal to cwnd), increase cwnd by MTU, and reset // partial_bytes_acked to (partial_bytes_acked - cwnd)." - cwnd_ += options_.mtu; + + // Errata: https://datatracker.ietf.org/doc/html/rfc8540#section-3.12 partial_bytes_acked_ -= cwnd_; + cwnd_ += options_.mtu; RTC_DLOG(LS_VERBOSE) << log_prefix_ << "CA increase cwnd=" << cwnd_ << " (" << old_cwnd << ") ssthresh=" << ssthresh_ << ", pba=" << partial_bytes_acked_ << " (" @@ -488,6 +490,8 @@ void RetransmissionQueue::HandleT3RtxTimerExpiry() { // its ssthresh with rules defined in Section 7.2.3 and set the cwnd <- MTU." ssthresh_ = std::max(cwnd_ / 2, 4 * options_.mtu); cwnd_ = 1 * options_.mtu; + // Errata: https://datatracker.ietf.org/doc/html/rfc8540#section-3.11 + partial_bytes_acked_ = 0; // https://tools.ietf.org/html/rfc4960#section-6.3.3 // "For the destination address for which the timer expires, set RTO