From 02c65869c3bae25567eb2681ec78bb1f6d2322c9 Mon Sep 17 00:00:00 2001 From: Sebastian Jansson Date: Tue, 22 May 2018 11:03:04 +0200 Subject: [PATCH] Adds unwrapped sequence number to feedback info. The Quic BBR implementation uses packet sequence numbers to keep track of the time slots used for calculation of send receive rates. To avoid protocol dependence the port were initially written to use send times instead. As there are issues with running BBR in WebRTC, it makes sense to use an identical implementation as in Quic to ensure that there aren't implementation issues causing bad behavior. This requires providing sequence numbers. This prepares for making the BBR implementation more identical to the implementation in Quic, this is to ensure that results are comparable. Bug: webrtc:8415 Change-Id: I2cd96bc6ffb88042bb2b91421bfe6cbf7c1ff8ac Reviewed-on: https://webrtc-review.googlesource.com/76583 Reviewed-by: Stefan Holmer Commit-Queue: Sebastian Jansson Cr-Commit-Position: refs/heads/master@{#23353} --- modules/congestion_controller/rtp/send_time_history.cc | 4 +++- modules/rtp_rtcp/include/rtp_rtcp_defines.h | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/congestion_controller/rtp/send_time_history.cc b/modules/congestion_controller/rtp/send_time_history.cc index b0619a2595..d4a088ea13 100644 --- a/modules/congestion_controller/rtp/send_time_history.cc +++ b/modules/congestion_controller/rtp/send_time_history.cc @@ -38,7 +38,9 @@ void SendTimeHistory::AddAndRemoveOld(const PacketFeedback& packet) { // Add new. int64_t unwrapped_seq_num = seq_num_unwrapper_.Unwrap(packet.sequence_number); - history_.insert(std::make_pair(unwrapped_seq_num, packet)); + PacketFeedback packet_copy = packet; + packet_copy.long_sequence_number = unwrapped_seq_num; + history_.insert(std::make_pair(unwrapped_seq_num, packet_copy)); } bool SendTimeHistory::OnSentPacket(uint16_t sequence_number, diff --git a/modules/rtp_rtcp/include/rtp_rtcp_defines.h b/modules/rtp_rtcp/include/rtp_rtcp_defines.h index 28ee47b5b5..6df3def472 100644 --- a/modules/rtp_rtcp/include/rtp_rtcp_defines.h +++ b/modules/rtp_rtcp/include/rtp_rtcp_defines.h @@ -370,6 +370,9 @@ struct PacketFeedback { // Packet identifier, incremented with 1 for every packet generated by the // sender. uint16_t sequence_number; + // Session unique packet identifier, incremented with 1 for every packet + // generated by the sender. + int64_t long_sequence_number; // Size of the packet excluding RTP headers. size_t payload_size; // The network route ids that this packet is associated with.