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

Discuss Application-Limited Sending #1637

Merged
merged 13 commits into from Jan 29, 2019
Merged

Discuss Application-Limited Sending #1637

merged 13 commits into from Jan 29, 2019

Conversation

ianswett
Copy link
Contributor

@ianswett ianswett commented Aug 7, 2018

Fixes #1619

@janaiyengar
Copy link
Contributor

Both app-limited sending and also receiver-window limited sending should be incorporated in the text here.

not fully utilized, the congestion window should not be increased in slow start
or congestion avoidance. Senders should consider themselves application limited
if bytes in flight when receiving an ACK frame are more than a max datgram size
less than the congestion window.
Copy link
Contributor

Choose a reason for hiding this comment

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

This last sentence is a run-on and unnecessarily detailed. I would simply say something like "if the congestion window is not fully utilized." The detail of kMaxDatagramSize is a rounding thing, which is probably too much detail in this descriptive text.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In that case, I think I should just remove that sentence?


OnPacketAckedCC(acked_packet):
// Remove from bytes_in_flight.
bytes_in_flight -= acked_packet.bytes
if (InRecovery(acked_packet.packet_number)):
// Do not increase congestion window in recovery period.
return
if (IsAppLimited())
// Do not increase congestion_window if application limited.
return
Copy link
Member

Choose a reason for hiding this comment

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

This gets into implementation specifics a bit, but I don't think the pseudocode can be as trivial as this.

Naively, if this function is called for two different packets in a row, without a corresponding send operation being performed between them, then only the first OnPacketAckedCC ever actually increases congestion_window because the previous call just decremented bytes_in_flight and incremented congestion_window guaranteeing that IsAppLimited() will always return false for future packets.

In a slightly more intelligent interpretation of this, where you actually preform this logic for all the bytes acknowledged in a whole ACK frame in a single call, you can still have the same problem if you end up processing two ACK frames back to back before you end up doing a send. I have some ideas on how to solve that (at least for my implementation) but I was wondering if this should be mentioned (if not pseudocoded) here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, getting this right is complex. I am going to not define the IsAppLimited() method, but document what it's intent is.

Copy link
Contributor

@MikeBishop MikeBishop left a comment

Choose a reason for hiding this comment

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

Given that it's a compound adjective, wouldn't it be "application-limited" throughout?

@@ -1115,13 +1119,19 @@ acked_packet from sent_packets.
~~~
InRecovery(packet_number):
return packet_number <= end_of_recovery

IsAppLimited():
bytes_in_flight >= congestion_window - kMaximumDatagramSize
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this backward? Bytes in flight can't be greater than the congestion window, but if the bytes in flight are within one datagram of the window, you're clearly not limited.

Copy link
Member

Choose a reason for hiding this comment

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

It reads backwards to me as well. And is it the right test? @nibanks' comments suggest that there might be other ways to detect the condition of not being limited. For instance, as long as data is enqueued for sending, it might be reasonable to say that the application is waiting on the congestion controller (or pacer) to allow sending.

Copy link
Member

Choose a reason for hiding this comment

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

I agree this is backward. The >= should just be < or <=. But as far as tracking IsAppLimited() or whatever you want to call it, I would just suggest a modification to the code:

Instead of using bytes_in_flight here and the helper function IsAppLimited, introduce a new variable window_full that is only set in OnPacketSent. At the end of each call to that function, if bytes_in_flight is close enough to congestion_window set it to true, otherwise false. Then below, you use that variable to decide if the cwnd should be increased..

Copy link
Member

Choose a reason for hiding this comment

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

That seems better, yes. When you say "close enough", I assume that you mean "so close that you couldn't send anything meaningful", something like headerlen+sizeof(cid)+16+sizeof(STREAM frame overhead), so maybe sizeof(cid)+32 ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm okay with what's in the pseudocode -- so close you couldn't send another full-size datagram.

Copy link
Member

Choose a reason for hiding this comment

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

I was specifically not defining "close enough". I am fine with a single datagram size or something smaller.

@@ -989,6 +988,11 @@ The recovery period limits congestion window reduction to once per round trip.
During recovery, the congestion window remains unchanged irrespective of new
losses or increases in the ECN-CE counter.

## Application Limited Sending

If the sender is sufficiently application limited that the congestion window is
Copy link
Member

Choose a reason for hiding this comment

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

We don't really get a definition of "application limited" from this. The point is that you won't increase the congestion window if the entire congestion window isn't being actively used.

Is there precedent for this sort of capping of the window?

I assume that this includes flow control as the source of the limitation. Which might be worth mentioning.

@@ -1115,13 +1119,19 @@ acked_packet from sent_packets.
~~~
InRecovery(packet_number):
return packet_number <= end_of_recovery

IsAppLimited():
bytes_in_flight >= congestion_window - kMaximumDatagramSize
Copy link
Member

Choose a reason for hiding this comment

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

It reads backwards to me as well. And is it the right test? @nibanks' comments suggest that there might be other ways to detect the condition of not being limited. For instance, as long as data is enqueued for sending, it might be reasonable to say that the application is waiting on the congestion controller (or pacer) to allow sending.

@mirjak
Copy link
Contributor

mirjak commented Aug 9, 2018

Actually as mentioned in #1619 one would need to also reduce the window if application-limited and the send window goes below the congestion window. See https://datatracker.ietf.org/doc/rfc7661/ for TCP.

draft-ietf-quic-recovery.md Outdated Show resolved Hide resolved

When the sender is pacing(see {{pacing}}) packets, the sender may be unable
to use the full congestion window for a period of time after receiving an
ACK, due to pacing. In this case, the sender should not consider themselves
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
ACK, due to pacing. In this case, the sender should not consider themselves
acknowledgment. In this case, the sender should not consider themselves

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I mean ACK, as in the frame?

Copy link
Member

Choose a reason for hiding this comment

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

You need more than an ACK, you need one that contains fresh acknowledgments, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, changed to acknowledgements.

When the sender is pacing(see {{pacing}}) packets, the sender may be unable
to use the full congestion window for a period of time after receiving an
ACK, due to pacing. In this case, the sender should not consider themselves
application limited and should allow the congestion window to increase.
Copy link
Member

Choose a reason for hiding this comment

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

I'm not really following the logic here. I think that you need more words.

The reason that the congestion window is limited in this fashion is that without being exercised, there is no assurance that this much data can be sent. If there is a sudden increase in demand from the application such that the inflated limit is now used, that results in using an untested limit, which might result in severe congestion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

SG, maybe @janaiyengar or @nibanks will have a suggestion?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe it's just a case of too much detail. I think folks should understand that just because a pacing interval has currently been used up, that's not considered application limited? So, maybe, just don't have this at all?

Co-Authored-By: ianswett <ianswett@users.noreply.github.com>
Copy link
Member

@nibanks nibanks left a comment

Choose a reason for hiding this comment

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

Looks fine to me.

draft-ietf-quic-recovery.md Outdated Show resolved Hide resolved
draft-ietf-quic-recovery.md Outdated Show resolved Hide resolved
to use the full congestion window for a period of time after receiving
acknowledgements, due to pacing. In this case, the sender should not consider
themselves application limited and should allow the congestion window to
increase.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested rephrasing: "A sender that uses pacing (see {{pacing}}) might delay sending of packets and might not fully utilize the congestion window due to this delay. A sender should not consider itself application limited if it might have utilized the entire congestion window without pacing delay."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Accepted with minor tweaks.

janaiyengar and others added 4 commits January 28, 2019 21:03
Co-Authored-By: ianswett <ianswett@users.noreply.github.com>
Co-Authored-By: ianswett <ianswett@users.noreply.github.com>
@janaiyengar janaiyengar merged commit d3fc302 into master Jan 29, 2019
@MikeBishop MikeBishop deleted the ianswett-app-limited branch February 6, 2019 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants