W3C home > Mailing lists > Public > ietf-http-wg@w3.org > October to December 2013

Re: Question on flow control for a single file transfer

From: Michael Sweet <msweet@apple.com>
Date: Mon, 04 Nov 2013 11:45:24 -0500
Cc: "William Chan (陈智昌)" <willchan@chromium.org>, Yoav Nir <ynir@checkpoint.com>, "<ietf-http-wg@w3.org>" <ietf-http-wg@w3.org>, Martin Thomson <martin.thomson@gmail.com>
Message-id: <D10876A8-A85D-42FF-9B58-F44FF29F0DF2@apple.com>
To: Peter Lepeska <bizzbyster@gmail.com>
Peter,

I’m not suggesting that we don’t rely on TCP-based flow control.

I *am* suggesting that we can do better than TCP-based flow control because we know what is happening at the HTTP level (“I’m sending a file”) and can rate-limit to avoid “log jamming” or “turbulence” caused by TCP-based flow control.  A HTTP sender can learn about the bandwidth limits and latency of the receiver by tracking the timing and values in the window updates and adapt to the constraints of the connection and competing traffic. And HTTP also has proxies, even for single file transfers, which have varying capabilities...

There are many real-world examples that can be used to visualize this, but consider rush hour on a busy highway.  In most places in the US and Canada that I’ve lived, driving during rush hour is something you avoid.  Everyone is trying to get home as quickly as possible, and so inevitably you get a traffic jam and stop-and-go traffic.  California, however, uses so-called “metering lights” to limit the rate that new vehicles enter the highway.  This is far from perfect, but in general it does keep traffic creeping along even when there are a million people trying to get home at the same time.  A distance that used to take me multiple hours to get through Washington, DC would take me an hour or less when I lived in the bay area in California.



On Nov 4, 2013, at 11:25 AM, Peter Lepeska <bizzbyster@gmail.com> wrote:

> Hi Michael,
> 
> We have no choice but to rely on TCP-based flow control. The question is whether there is anything to be gained by also relying on HTTP level flow control when there is only one active transfer. As per the emails with Yoav and William, I get it that there are cases where a server operator may decide that the benefits of reduced per connection buffering are worth the loss in performance and in this case HTTP flow control may make sense.
> 
> By default though, it should be no slower than 1.x.
> 
> Peter
> 
> 
> On Mon, Nov 4, 2013 at 8:04 AM, Michael Sweet <msweet@apple.com> wrote:
> Peter,
> 
> On Nov 3, 2013, at 11:04 PM, Peter Lepeska <bizzbyster@gmail.com> wrote:
>> If a receiver cannot absorb any more data, it will not make a buffer available to TCP. 
>> 
>> Don't forget that in HTTP 1.x we don't do flow control. We leave that to the transport layer and this works well. Layering flow control on top of flow control can only result in slower flows. This slowdown is necessary when two or more streams are being sent at once but let's not take this hit in the simple case of one stream.
> 
> The problem with relying on TCP-based flow control is that you are forcing retransmissions and log-jamming all access to the other end.  If instead you send your file in chunks sized to the receiver’s capabilities then you can either a) do other useful work or b) go to sleep until the receiver tells you it can accept more data.  Add a small amount of rate-tracking code on the sending side and you should be able to keep the receiver window near full.
> 
> 
>> 
>> Peter
>> 
>> On Sunday, November 3, 2013, William Chan (陈智昌) wrote:
>> http://en.wikipedia.org/wiki/Flow_control_(data) says "In data communications, flow control is the process of managing the rate of data transmission between two nodes to prevent a fast sender from overwhelming a slow receiver."
>> 
>> Guesstimating BDP is only important if the receiver cares about maximizing throughput. Which hopefully it does, but there's no guarantee. Sometimes due to resource constraints, the receiver cannot accept that much data, and it asserts flow control in this case. And senders *need* to respect that. Otherwise a receiver with any sense, like a highly scalable server, will terminate the connection since the peer is misbehaving.
>> 
>> 
>> On Sun, Nov 3, 2013 at 7:44 PM, Peter Lepeska <bizzbyster@gmail.com> wrote:
>> Sloppiness? I don't get that. The sender's job is to transmit the data as fast as possible, not to respect the receiver's best guesstimate of available bandwidth sent ½ RTT ago. In this case, the sender's job is to keep the TCP buffer full of data so it can send it when it has the opportunity to.
>> 
>> Respecting the peer's receive window in the single file send case is harmless at best and detrimental otherwise.
>> 
>> Peter
>> 
>> On Sunday, November 3, 2013, William Chan (陈智昌) wrote:
>> I don't feel comfortable encouraging such sloppiness, I worry about future interop. Respecting a peer's receive window isn't hard. Just do it :)
>> 
>> And even though wget doesn't support upload (to my knowledge, but I'm not an expert), a command line tool may upload, in which case it should definitely respect the peer's receive window.
>> 
>> On Nov 3, 2013 6:22 PM, "Yoav Nir" <ynir@checkpoint.com> wrote:
>> 
>> On Nov 3, 2013, at 1:25 PM, William Chan (陈智昌) <willchan@chromium.org> wrote:
>> 
>>> It's probably understood already, but just to be clear, this is receiver controlled and directional. Unless you control both endpoints, you must implement flow control in order to respect the peer's receive windows, even if you disable your own receive windows. Cheers.
>>> 
>>> 
>> 
>> This discussion started with tools like WGET. If all you're ever sending is one single request equivalent to "GET xxx", you're likely fine not considering server receive window.
>> 
>> For a single file, the data that the client sends to the server never exceeds the default server receive window.
>> 
>> 
>> 
> 
> ____________________________________________________________
> Michael Sweet, Senior Printing System Engineer, PWG Chair
> 
> 

____________________________________________________________
Michael Sweet, Senior Printing System Engineer, PWG Chair
Received on Monday, 4 November 2013 16:46:17 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 11:11:19 UTC