Skip to content
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

Don't recommend 3 RTTs of credit (and other editorial) #3301

Merged
merged 6 commits into from Feb 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
51 changes: 28 additions & 23 deletions draft-ietf-quic-transport.md
Expand Up @@ -801,33 +801,38 @@ limit is increased.

## Flow Credit Increments {#fc-credit}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about "Managing Flow Control"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems too general. I'm not in love with what we have, but I prefer it because it's more specific.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see that. These flow control sections are a bit too long for my liking, but it's good enough for now.


This document leaves when and how many bytes to advertise in a MAX_STREAM_DATA
or MAX_DATA frame to implementations, but offers a few considerations. These
frames contribute to connection overhead. Therefore frequently sending frames
with small changes is undesirable. At the same time, larger increments to
limits are necessary to avoid blocking if updates are less frequent, requiring
larger resource commitments at the receiver. Thus there is a trade-off between
resource commitment and overhead when determining how large a limit is
advertised.
Implementations decide when and how much credit to advertise in MAX_STREAM_DATA
and MAX_DATA frames, but this section offers a few considerations.

To avoid blocking a sender, a receiver can send a MAX_STREAM_DATA or MAX_DATA
frame multiple times within a round trip or send it early enough to allow for
recovery from loss of the frame.

Control frames contribute to connection overhead. Therefore, frequently sending
MAX_STREAM_DATA and MAX_DATA frames with small changes is undesirable. On the
other hand, if updates are less frequent, larger increments to limits are
necessary to avoid blocking a sender, requiring larger resource commitments at
the receiver. There is a trade-off between resource commitment and overhead
when determining how large a limit is advertised.

A receiver can use an autotuning mechanism to tune the frequency and amount of
advertised additional credit based on a round-trip time estimate and the rate at
which the receiving application consumes data, similar to common TCP
implementations. As an optimization, sending frames related to flow control
only when there are other frames to send or when a peer is blocked ensures that
flow control doesn't cause extra packets to be sent.

If a sender runs out of flow control credit, it will be unable to send new data
and is considered blocked. It is generally considered best to not let the
sender become blocked. To avoid blocking a sender, and to reasonably account
for the possibility of loss, a receiver should send a MAX_DATA or
MAX_STREAM_DATA frame at least two round trips before it expects the sender to
get blocked.

A receiver MUST NOT wait for a STREAM_DATA_BLOCKED or DATA_BLOCKED frame before
sending MAX_STREAM_DATA or MAX_DATA, since doing so will mean that a sender will
be blocked for at least an entire round trip, and potentially for longer if the
peer chooses to not send STREAM_DATA_BLOCKED or DATA_BLOCKED frames.
implementations. As an optimization, an endpoint could send frames related to
flow control only when there are other frames to send or when a peer is blocked,
ensuring that flow control does not cause extra packets to be sent.

A blocked sender is not required to send STREAM_DATA_BLOCKED or DATA_BLOCKED
frames. Therefore, a receiver MUST NOT wait for a STREAM_DATA_BLOCKED or
DATA_BLOCKED frame before sending a MAX_STREAM_DATA or MAX_DATA frame; doing so
could result in the sender being blocked for the rest of the connection. Even if
the sender sends these frames, waiting for them will result in the sender being
blocked for at least an entire round trip.

When a sender receives credit after being blocked, it might be able to send a
large amount of data in response, resulting in short-term congestion; see
Section 6.9 in {{QUIC-RECOVERY}} for a discussion of how a sender can avoid this
congestion.


## Handling Stream Cancellation {#stream-cancellation}
Expand Down