Skip to content

Commit

Permalink
Byte counting at Congestion avoidance
Browse files Browse the repository at this point in the history
There is an issue in current congestion avoidance pseudocode
when `max_datagram_size * acked_packet.sent_bytes < congestion_window`
cwnd increment effectively becomes zero, especially because most
implementations use integer operation to calculate cwnd.

This happens when `acked_packet.sent_bytes` is a small value or
`congestion_window` is very big. It may lead to too conservative
cwnd growth during congestion avoidance.

To fix the issue, I propose to use a TCP ABC style cwnd growth
during congestion avoidance: https://www.rfc-editor.org/rfc/rfc3465.html#section-2.1

Basically it stores accumulated acked bytes in a new
variable `bytes_acked` and increase cwnd by `max_datagram_size` when
`bytes_acked` reaches to cwnd.
  • Loading branch information
Junho Choi committed Jul 19, 2020
1 parent e903869 commit c1c5675
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions draft-ietf-quic-recovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -1483,6 +1483,10 @@ ssthresh:
the mode is slow start and the window grows by the number of bytes
acknowledged.

bytes_acked:
: Records number of bytes acked and used during congestion
avoidance, for incrementing the congestion window.


## Initialization

Expand All @@ -1496,6 +1500,7 @@ variables as follows:
ssthresh = infinite
for pn_space in [ Initial, Handshake, ApplicationData ]:
ecn_ce_counters[pn_space] = 0
bytes_acked = 0
~~~


Expand Down Expand Up @@ -1541,9 +1546,10 @@ newly acked_packets from sent_packets.
congestion_window += acked_packet.sent_bytes
else:
// Congestion avoidance.
congestion_window +=
max_datagram_size * acked_packet.sent_bytes
/ congestion_window
bytes_acked += acked_packet.sent_bytes
if (bytes_acked >= congestion_window):
bytes_acked -= congestion_window
congestion_window += max_datagram_size
~~~


Expand All @@ -1562,6 +1568,7 @@ window.
congestion_window *= kLossReductionFactor
congestion_window = max(congestion_window, kMinimumWindow)
ssthresh = congestion_window
bytes_acked *= kLossReductionFactor
// A packet can be sent to speed up loss recovery.
MaybeSendOnePacket()
~~~
Expand Down Expand Up @@ -1604,6 +1611,7 @@ Invoked when DetectAndRemoveLostPackets deems packets lost.
// Collapse congestion window if persistent congestion
if (InPersistentCongestion(lost_packets)):
congestion_window = kMinimumWindow
bytes_acked = 0
~~~

## Upon dropping Initial or Handshake keys
Expand Down

0 comments on commit c1c5675

Please sign in to comment.