Question about bytes_in_flight & prior_bytes_inlight in OnPacketSent & OnCongestionEvent

80 views
Skip to first unread message

李锤子

unread,
Dec 23, 2021, 8:06:11 AM12/23/21
to BBR Development
hello,
    Lastes I'm using bbr code in my project. When watching params in OnPacketSent & OnCongestionEvent, I find sth Puzzled.
First, origin code is:
void OnCongestionEvent(bool rtt_updated, QuicByteCount prior_in_flight, QuicTime event_time,
const AckedPacketVector& acked_packets, const LostPacketVector& lost_packets) override;

void OnPacketSent(QuicTime sent_time, QuicByteCount bytes_in_flight, QuicPacketNumber packet_number,
QuicByteCount bytes, HasRetransmittableData is_retransmittable) override;

As above, we can concluede in OnCongestionEvent, we use prior( before process ack&loss packets). However in OnPacketSent we use just the bytes_flight(already been calc when sending, as in Quic-BBR bbr2_simulation_test.cc file).
But when I see codes in BandwidthSampler::OnPacketSent, I see this "connection_state_map_.Emplace(packet_number, sent_time, bytes,
bytes_in_flight + bytes, *this);
So I get confused, bytes_in_flight in OnPacketSent shouldn't be prior_bytes_inflight, why use (bytes_in_flight + bytes)

Sincerely.
Carlos Li

ians...@google.com

unread,
Dec 28, 2021, 9:40:16 AM12/28/21
to BBR Development
bytes_in_fight in OnPacketSent() is bytes_in_flight prior to the packet being sent.  If you look at QuicSentPacketManager::OnPacketSent(), you'll notice the call to the congestion controller is before the call add the packet to unacked_packets_AddSentPacket.

Ian
Reply all
Reply to author
Forward
0 new messages