dcsctp: Increase cwnd by serialized chunk size
For symmetry, as the outstanding_bytes is increased/decreased by the serialized chunk size (not just the payload) - which is compared to the congestion window, the congestion window should be increased by the serialized size of chunks acked - not just their payload. Bug: webrtc:12943 Change-Id: I0a06033e8ca0d58433138df6442ca80494918cf2 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228525 Commit-Queue: Victor Boivie <boivie@webrtc.org> Reviewed-by: Florent Castelli <orphis@webrtc.org> Cr-Commit-Position: refs/heads/master@{#34775}
This commit is contained in:

committed by
WebRTC LUCI CQ

parent
a32495005d
commit
be9281b92b
@ -144,10 +144,11 @@ void RetransmissionQueue::AckChunk(
|
||||
AckInfo& ack_info,
|
||||
std::map<UnwrappedTSN, TxData>::iterator iter) {
|
||||
if (!iter->second.is_acked()) {
|
||||
ack_info.bytes_acked += iter->second.data().size();
|
||||
size_t serialized_size = GetSerializedChunkSize(iter->second.data());
|
||||
ack_info.bytes_acked += serialized_size;
|
||||
ack_info.acked_tsns.push_back(iter->first.Wrap());
|
||||
if (iter->second.is_outstanding()) {
|
||||
outstanding_bytes_ -= GetSerializedChunkSize(iter->second.data());
|
||||
outstanding_bytes_ -= serialized_size;
|
||||
--outstanding_items_;
|
||||
}
|
||||
if (iter->second.should_be_retransmitted()) {
|
||||
|
@ -1185,7 +1185,31 @@ TEST_F(RetransmissionQueueTest, AbandonsRtxLimit2WhenNackedNineTimes) {
|
||||
Pair(TSN(19), State::kAcked)));
|
||||
|
||||
EXPECT_TRUE(queue.ShouldSendForwardTsn(now_));
|
||||
} // namespace
|
||||
}
|
||||
|
||||
TEST_F(RetransmissionQueueTest, CwndRecoversWhenAcking) {
|
||||
RetransmissionQueue queue = CreateQueue();
|
||||
static constexpr size_t kCwnd = 1200;
|
||||
queue.set_cwnd(kCwnd);
|
||||
EXPECT_EQ(queue.cwnd(), kCwnd);
|
||||
|
||||
std::vector<uint8_t> payload(1000);
|
||||
EXPECT_CALL(producer_, Produce)
|
||||
.WillOnce([this, payload](TimeMs, size_t) {
|
||||
return SendQueue::DataToSend(gen_.Ordered(payload, "BE"));
|
||||
})
|
||||
.WillRepeatedly([](TimeMs, size_t) { return absl::nullopt; });
|
||||
|
||||
std::vector<std::pair<TSN, Data>> chunks_to_send =
|
||||
queue.GetChunksToSend(now_, 1500);
|
||||
EXPECT_THAT(chunks_to_send, ElementsAre(Pair(TSN(10), _)));
|
||||
size_t serialized_size = payload.size() + DataChunk::kHeaderSize;
|
||||
EXPECT_EQ(queue.outstanding_bytes(), serialized_size);
|
||||
|
||||
queue.HandleSack(now_, SackChunk(TSN(10), kArwnd, {}, {}));
|
||||
|
||||
EXPECT_EQ(queue.cwnd(), kCwnd + serialized_size);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace dcsctp
|
||||
|
Reference in New Issue
Block a user