New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reorganize ACK section #2197
Reorganize ACK section #2197
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -2856,24 +2856,26 @@ needing acknowledgement are received. The sender can use the receiver's | |||||
Strategies and implications of the frequency of generating acknowledgments are | ||||||
discussed in more detail in {{QUIC-RECOVERY}}. | ||||||
|
||||||
To limit ACK Blocks to those that have not yet been received by the sender, | ||||||
the receiver SHOULD track which ACK frames have been acknowledged. The | ||||||
receiver SHOULD exclude already acknowledged packets from future ACK frames | ||||||
whenever these packets would unnecessarily contribute to the ACK frame size. | ||||||
To limit the ranges of acknowledged packet numbers to those that have not yet | ||||||
been received by the sender, the receiver SHOULD track which ACK frames have | ||||||
been acknowledged by its peer. The receiver SHOULD exclude already acknowledged | ||||||
packets from future ACK frames whenever these packets would unnecessarily | ||||||
contribute to the ACK frame size. | ||||||
|
||||||
Because ACK frames are not sent in response to ACK-only packets, a receiver that | ||||||
is only sending ACK frames will only receive acknowledgements for its packets if | ||||||
the sender includes them in packets with non-ACK frames. A sender SHOULD bundle | ||||||
ACK frames with other frames when possible. | ||||||
|
||||||
To limit receiver state or the size of ACK frames, a receiver MAY limit the | ||||||
number of ACK Blocks it sends. A receiver can do this even without receiving | ||||||
number of ACK Ranges it sends. A receiver can do this even without receiving | ||||||
acknowledgment of its ACK frames, with the knowledge this could cause the sender | ||||||
to unnecessarily retransmit some data. Standard QUIC {{QUIC-RECOVERY}} | ||||||
algorithms declare packets lost after sufficiently newer packets are | ||||||
acknowledged. Therefore, the receiver SHOULD repeatedly acknowledge newly | ||||||
received packets in preference to packets received in the past. | ||||||
|
||||||
|
||||||
### ACK Frames and Packet Protection | ||||||
|
||||||
ACK frames MUST only be carried in a packet that has the same packet | ||||||
|
@@ -4170,12 +4172,12 @@ prevent the majority of middleboxes from losing state for UDP flows. | |||||
## ACK Frames {#frame-ack} | ||||||
|
||||||
Receivers send ACK frames (types 0x02 and 0x03) to inform senders of packets | ||||||
they have received and processed. The ACK frame contains one or more ACK Blocks. | ||||||
ACK Blocks are ranges of acknowledged packets. If the frame type is 0x03, ACK | ||||||
frames also contain the sum of QUIC packets with associated ECN marks received | ||||||
on the connection up until this point. QUIC implementations MUST properly handle | ||||||
both types and, if they have enabled ECN for packets they send, they SHOULD use | ||||||
the information in the ECN section to manage their congestion state. | ||||||
they have received and processed. The ACK frame contains one or more ACK Ranges. | ||||||
ACK Ranges identify acknowledged packets. If the frame type is 0x03, ACK frames | ||||||
also contain the sum of QUIC packets with associated ECN marks received on the | ||||||
connection up until this point. QUIC implementations MUST properly handle both | ||||||
types and, if they have enabled ECN for packets they send, they SHOULD use the | ||||||
information in the ECN section to manage their congestion state. | ||||||
|
||||||
QUIC acknowledgements are irrevocable. Once acknowledged, a packet remains | ||||||
acknowledged, even if it does not appear in a future ACK frame. This is unlike | ||||||
|
@@ -4200,11 +4202,13 @@ An ACK frame is as follows: | |||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||||
| ACK Delay (i) ... | ||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||||
| ACK Block Count (i) ... | ||||||
| ACK Range Count (i) ... | ||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||||
| First ACK Range (i) ... | ||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||||
| ACK Blocks (*) ... | ||||||
| ACK Ranges (*) ... | ||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||||
| [ECN Section] ... | ||||||
| [ECN Counts] ... | ||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||||
~~~ | ||||||
{: #ack-format title="ACK Frame Format"} | ||||||
|
@@ -4230,112 +4234,121 @@ ACK Delay: | |||||
larger range of values with a shorter encoding at the cost of lower | ||||||
resolution. | ||||||
|
||||||
ACK Block Count: | ||||||
ACK Range Count: | ||||||
|
||||||
: A variable-length integer specifying the number of Additional ACK Block (and | ||||||
Gap) fields after the First ACK Block. | ||||||
: A variable-length integer specifying the number of Gap and ACK Range fields in | ||||||
the frame. | ||||||
|
||||||
ACK Blocks: | ||||||
First ACK Range: | ||||||
|
||||||
: Contains one or more blocks of packet numbers which have been successfully | ||||||
received, see {{ack-block-section}}. | ||||||
: A variable-length integer indicating the number of contiguous packets | ||||||
preceding the Largest Acknowledged that are being acknowledged. The First ACK | ||||||
Range is encoded as an ACK Range (see {{ack-ranges}}) starting from the | ||||||
Largest Acknowledged. That is, the smallest packet number included in the | ||||||
range is determined by subtracting the First ACK Range value from the Largest | ||||||
Acknowledged. | ||||||
|
||||||
ACK Ranges: | ||||||
|
||||||
### ACK Block Section {#ack-block-section} | ||||||
: Contains additional ranges of packet numbers which are alternately not | ||||||
acknowledged (Gap) and acknowledged (ACK Range), see {{ack-ranges}}. | ||||||
|
||||||
The ACK Block Section consists of alternating Gap and ACK Block fields in | ||||||
descending packet number order. A First Ack Block field is followed by a | ||||||
variable number of alternating Gap and Additional ACK Blocks. The number of | ||||||
Gap and Additional ACK Block fields is determined by the ACK Block Count field. | ||||||
ECN Counts: | ||||||
|
||||||
: The three ECN Counts, see {{ack-ecn-counts}}. | ||||||
|
||||||
Gap and ACK Block fields use a relative integer encoding for efficiency. Though | ||||||
each encoded value is positive, the values are subtracted, so that each ACK | ||||||
Block describes progressively lower-numbered packets. As long as contiguous | ||||||
ranges of packets are small, the variable-length integer encoding ensures that | ||||||
each range can be expressed in a small number of bytes. | ||||||
|
||||||
### ACK Ranges {#ack-ranges} | ||||||
|
||||||
The ACK Ranges field consists of alternating Gap and ACK Range values in | ||||||
descending packet number order. The number of Gap and ACK Range values is | ||||||
determined by the ACK Range Count field; one of each value is present for each | ||||||
value in the ACK Range Count field. | ||||||
|
||||||
ACK Ranges are structured as follows: | ||||||
|
||||||
~~~ | ||||||
0 1 2 3 | ||||||
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | ||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||||
| First ACK Block (i) ... | ||||||
| [Gap (i)] ... | ||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||||
| Gap (i) ... | ||||||
| [ACK Range (i)] ... | ||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||||
| Additional ACK Block (i) ... | ||||||
| [Gap (i)] ... | ||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||||
| Gap (i) ... | ||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||||
| Additional ACK Block (i) ... | ||||||
| [ACK Range (i)] ... | ||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||||
... | ||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||||
| Gap (i) ... | ||||||
| [Gap (i)] ... | ||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||||
| Additional ACK Block (i) ... | ||||||
| [ACK Range (i)] ... | ||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||||
~~~ | ||||||
{: #ack-block-format title="ACK Block Section"} | ||||||
{: #ack-range-format title="ACK Ranges"} | ||||||
|
||||||
The fields that form the ACK Ranges are: | ||||||
|
||||||
Gap (repeated): | ||||||
|
||||||
: A variable-length integer indicating the number of contiguous unacknowledged | ||||||
packets preceding the packet number one lower than the smallest in the | ||||||
preceding ACK Range. | ||||||
|
||||||
ACK Range (repeated): | ||||||
|
||||||
: A variable-length integer indicating the number of contiguous acknowledged | ||||||
packets preceding the largest packet number, as determined by the | ||||||
preceding Gap. | ||||||
|
||||||
Gap and ACK Range value use a relative integer encoding for efficiency. Though | ||||||
each encoded value is positive, the values are subtracted, so that each ACK | ||||||
Range describes progressively lower-numbered packets. | ||||||
|
||||||
Each ACK Block acknowledges a contiguous range of packets by indicating the | ||||||
Each ACK Range acknowledges a contiguous range of packets by indicating the | ||||||
number of acknowledged packets that precede the largest packet number in that | ||||||
block. A value of zero indicates that only the largest packet number is | ||||||
acknowledged. Larger ACK Block values indicate a larger range, with | ||||||
range. A value of zero indicates that only the largest packet number is | ||||||
acknowledged. Larger ACK Range values indicate a larger range, with | ||||||
corresponding lower values for the smallest packet number in the range. Thus, | ||||||
given a largest packet number for the ACK, the smallest value is determined by | ||||||
given a largest packet number for the range, the smallest value is determined by | ||||||
the formula: | ||||||
|
||||||
~~~ | ||||||
smallest = largest - ack_block | ||||||
smallest = largest - ack_range | ||||||
~~~ | ||||||
|
||||||
The range of packets that are acknowledged by the ACK Block include the range | ||||||
from the smallest packet number to the largest, inclusive. | ||||||
An ACK Range acknowledges all packet numbers between the smallest packet number | ||||||
and the largest, inclusive. | ||||||
|
||||||
The largest value for the First ACK Block is determined by the Largest | ||||||
Acknowledged field; the largest for Additional ACK Blocks is determined by | ||||||
cumulatively subtracting the size of all preceding ACK Blocks and Gaps. | ||||||
The largest value for an ACK Range is determined by cumulatively subtracting the | ||||||
size of all preceding ACK Ranges and Gaps. | ||||||
|
||||||
Each Gap indicates a range of packets that are not being acknowledged. The | ||||||
number of packets in the gap is one higher than the encoded value of the Gap | ||||||
Field. | ||||||
field. | ||||||
|
||||||
The value of the Gap field establishes the largest packet number value for the | ||||||
ACK Block that follows the gap using the following formula: | ||||||
subsequent ACK Range using the following formula: | ||||||
|
||||||
~~~ | ||||||
largest = previous_smallest - gap - 2 | ||||||
~~~ | ||||||
|
||||||
If the calculated value for largest or smallest packet number for any ACK Block | ||||||
is negative, an endpoint MUST generate a connection error of type | ||||||
FRAME_ENCODING_ERROR indicating an error in an ACK frame. | ||||||
|
||||||
The fields in the ACK Block Section are: | ||||||
|
||||||
First ACK Block: | ||||||
|
||||||
: A variable-length integer indicating the number of contiguous packets | ||||||
preceding the Largest Acknowledged that are being acknowledged. | ||||||
|
||||||
Gap (repeated): | ||||||
|
||||||
: A variable-length integer indicating the number of contiguous unacknowledged | ||||||
packets preceding the packet number one lower than the smallest in the | ||||||
preceding ACK Block. | ||||||
If any computed packet number is negative, an endpoint MUST generate a | ||||||
connection error of type FRAME_ENCODING_ERROR indicating an error in an ACK | ||||||
frame. | ||||||
|
||||||
Additional ACK Block (repeated): | ||||||
|
||||||
: A variable-length integer indicating the number of contiguous acknowledged | ||||||
packets preceding the largest packet number, as determined by the | ||||||
preceding Gap. | ||||||
### ECN Counts {#ack-ecn-counts} | ||||||
|
||||||
|
||||||
### ECN section | ||||||
The ACK frame uses the least significant bit (that is, type 0x03) to indicate | ||||||
ECN feedback and report receipt of QUIC packets with associated ECN codepoints | ||||||
of ECT(0), ECT(1), or CE in the packet's IP header. The ECN section is only | ||||||
present when the ACK frame type is 0x03. | ||||||
|
||||||
The ECN section should only be parsed when the ACK frame type is 0x03. The ECN | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
section consists of 3 ECN counts as shown below. | ||||||
section consists of 3 ECN counts as follows: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. three ECN counts, as follows: |
||||||
|
||||||
~~~ | ||||||
0 1 2 3 | ||||||
|
@@ -4349,6 +4362,8 @@ section consists of 3 ECN counts as shown below. | |||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||||
~~~ | ||||||
|
||||||
The fields that form the ECN Counts are: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
ECT(0) Count: | ||||||
: A variable-length integer representing the total number packets received with | ||||||
the ECT(0) codepoint. | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.