Adds unwrapped sequence number to sent packet info.

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: I6b182246c988dd4a95681c063dcaa779088d0e99
Reviewed-on: https://webrtc-review.googlesource.com/76481
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23356}
This commit is contained in:
Sebastian Jansson 2018-05-22 11:03:12 +02:00 committed by Commit Bot
parent 6e9c3df4d0
commit 72678e11cc
4 changed files with 11 additions and 2 deletions

View File

@ -85,6 +85,10 @@ struct SentPacket {
Timestamp send_time = Timestamp::Infinity();
DataSize size = DataSize::Zero();
PacedPacketInfo pacing_info;
// Transport independent sequence number, any tracked packet should have a
// sequence number that is unique over the whole call and increasing by 1 for
// each packet.
int64_t sequence_number;
};
// Transport level feedback

View File

@ -62,6 +62,7 @@ NetworkControllerTester::NetworkControllerTester(
NetworkControllerFactoryInterface* factory,
NetworkControllerConfig initial_config)
: current_time_(Timestamp::seconds(100000)),
packet_sequence_number_(1),
accumulated_delay_(TimeDelta::ms(0)) {
initial_config.constraints.at_time = current_time_;
controller_ = factory->Create(initial_config);
@ -107,8 +108,9 @@ void NetworkControllerTester::RunSimulation(TimeDelta duration,
}
if (send_packet) {
SentPacket sent_packet =
next_packet(state_, current_time_, packet_interval);
SentPacket sent_packet;
sent_packet = next_packet(state_, current_time_, packet_interval);
sent_packet.sequence_number = packet_sequence_number_++;
Update(&state_, controller_->OnSentPacket(sent_packet));
outstanding_packets_.push_back(SimulateSend(
sent_packet, packet_interval, propagation_delay, actual_bandwidth));

View File

@ -66,6 +66,7 @@ class NetworkControllerTester {
std::unique_ptr<NetworkControllerInterface> controller_;
TimeDelta process_interval_ = TimeDelta::PlusInfinity();
Timestamp current_time_;
int64_t packet_sequence_number_;
TimeDelta accumulated_delay_;
std::deque<PacketResult> outstanding_packets_;
NetworkControlUpdate state_;

View File

@ -61,6 +61,7 @@ PacketResult NetworkPacketFeedbackFromRtpPacketFeedback(
feedback.receive_time = Timestamp::ms(pf.arrival_time_ms);
if (pf.send_time_ms != webrtc::PacketFeedback::kNoSendTime) {
feedback.sent_packet = SentPacket();
feedback.sent_packet->sequence_number = pf.long_sequence_number;
feedback.sent_packet->send_time = Timestamp::ms(pf.send_time_ms);
feedback.sent_packet->size = DataSize::bytes(pf.payload_size);
feedback.sent_packet->pacing_info = pf.pacing_info;
@ -542,6 +543,7 @@ void SendSideCongestionController::OnSentPacket(
SentPacket msg;
msg.size = DataSize::bytes(packet->payload_size);
msg.send_time = Timestamp::ms(packet->send_time_ms);
msg.sequence_number = packet->long_sequence_number;
task_queue_->PostTask([this, msg]() {
RTC_DCHECK_RUN_ON(task_queue_);
if (controller_)