Re: [hybi] New port and Tunneling?

"Shelby Moore" <shelby@coolpage.com> Tue, 17 August 2010 08:46 UTC

Return-Path: <shelby@coolpage.com>
X-Original-To: hybi@core3.amsl.com
Delivered-To: hybi@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 718FD3A68C5 for <hybi@core3.amsl.com>; Tue, 17 Aug 2010 01:46:41 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.756
X-Spam-Level:
X-Spam-Status: No, score=-1.756 tagged_above=-999 required=5 tests=[AWL=0.843, BAYES_00=-2.599]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NW+rK1Hh2QVL for <hybi@core3.amsl.com>; Tue, 17 Aug 2010 01:46:40 -0700 (PDT)
Received: from www5.webmail.pair.com (www5.webmail.pair.com [66.39.3.83]) by core3.amsl.com (Postfix) with SMTP id 825DC3A6872 for <hybi@ietf.org>; Tue, 17 Aug 2010 01:46:39 -0700 (PDT)
Received: (qmail 22777 invoked by uid 65534); 17 Aug 2010 08:47:14 -0000
Received: from 121.97.54.174 ([121.97.54.174]) (SquirrelMail authenticated user shelby@coolpage.com) by sm.webmail.pair.com with HTTP; Tue, 17 Aug 2010 04:47:14 -0400
Message-ID: <7fab66267551a404c1e9f39db001e355.squirrel@sm.webmail.pair.com>
In-Reply-To: <34697163-B25B-40B3-811D-80F29C18003D@d2dx.com>
References: <7ffabb591b2292c9b81abecfaec3cdb6.squirrel@sm.webmail.pair.com> <2a948416b1f6e4ba90a4af22e1383719.squirrel@sm.webmail.pair.com> <77A8E7C5-ED79-4BBE-AFA9-10F4A21FB66F@d2dx.com> <d0e8fb4ae49f7a63b1436c7e45f7dc33.squirrel@sm.webmail.pair.com> <34697163-B25B-40B3-811D-80F29C18003D@d2dx.com>
Date: Tue, 17 Aug 2010 04:47:14 -0400
From: Shelby Moore <shelby@coolpage.com>
To: Vladimir Katardjiev <vladimir@d2dx.com>
User-Agent: SquirrelMail/1.4.20
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
X-Priority: 3 (Normal)
Importance: Normal
Cc: Hybi <hybi@ietf.org>
Subject: Re: [hybi] New port and Tunneling?
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: shelby@coolpage.com
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/hybi>
List-Post: <mailto:hybi@ietf.org>
List-Help: <mailto:hybi-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 17 Aug 2010 08:46:41 -0000

>
> Just running this explanation (since I know it by heart already); I'll get
> to other points in due time.
>
> On 17 aug 2010, at 08.44, Shelby Moore wrote:
>>> I should also note that TCP doesn't guarantee delivery.
>>
>>
>> Thanks for clarification.  What I meant is that TCP guarantees that we
>> know when something wasn't delivered.
>
> No, it does not. You cannot prove the lack of existence of an event; you
> can only prove the existence of it. In other words, TCP can, in terms of
> the TCP stack itself, realise that a given packet has been delivered. It
> cannot realise that a given packet has been lost (it just assumes it is.
> This is why some packets are delivered twice).


You have just stated that TCP knows when a packet is delivered, combined
with timeout, TCP knows when something MAY have not been delivered.  Thus
TCP is able to guarantee that a packet was delivered (and it knows when it
MAY not have been). That is very different situation from UDP, or in
comparison between a TCP channel without application layer proxies and the
case where I am worried about a proxy silently eating a packet that TCP
thinks it was delivered.


> However, the TCP stack does
> not generally expose this functionality to upper layers.


I am not well versed on this, but I think you are saying that it is
possible (even if not generally done) for upper layers to distinquish
between whether if a TCP packet was delivered or MAYBE not delivered?

In any case, even when the upper layers can not read each TCP packet
deliver status, I think you are clarifying issues which do not apply the
context of the point I made. The point I am making is that TCP is much
more reliable channel (in terms of delivery) than for example UDP. We have
certain expectations/experience about how much more reliable it typically
is, and that is why we use is for data integrity applications such as
HTTP. My point being that if we lose that reliability in some cases due to
silent-data-eating HTTP proxies, then we no longer have the TCP
reliability across the entirety of the end-to-end client and server.


> Namely, it's
> generally not possible for us as an application writer to ascertain that
> any given byte has been delivered. Since this means that even your garden
> variety TCP connection is not a stable transfer option, every application
> needs to assume that messages can and will be lost, and thus will have
> their own ACKs layered on top.


Understood. Does not apply to the context of my point above. Thank you for
sharing your expertise.


>>> This is exactly
>>> the reason why WebSockets needs orderly close as part of the protocol
>>> itself (because otherwise TCP may lose data).
>>
>> I do not understand, because that is not my area of expertise (and my
>> brain is tired and I am in a rush to send this and go do other things).
>> If
>> you are willing to explain, I am willing to read. Maybe most other
>> readers
>> understand what you mean.
>
>
> Simply put, a client wishes to shut down. It needs to send a final piece
> of data to the server, and then close() the WebSocket connection. The
> client writes the bytes to be sent to the TCP output buffer, but then
> what? In the regular case, we can't ascertain when this buffer is empty.
> If we close the socket while the buffer is non-empty, we risk losing the
> data in it, depending on the implementation.
>
> However, let's assume that the implementation will first send the bytes,
> wait for ACKs, then send the FIN to close the connection. Since TCP will
> ACK on /delivered/ and not /read/ bytes, this does not imply the remote
> application received them yet (it may be processing a different request).
> When the remote end receives the TCP FIN, it will close down the socket,
> and elicit EOF on it (because the socket is closed). The remote
> application can now not retrieve the data that was sent.
>
> For this reason, all HTTP servers leave TCP connections open for a certain
> timeout after a successful request has been answered, because otherwise
> the client might not get the entire page delivered. And for this reason
> WebSockets has an orderly close mechanism, to ensure that the data has
> been delivered before the connection is closed.
>
> The reason I bring this up is because when you state that proxies break
> the guarantee of TCP, I state they don't.


Refer to my explanation above.


> TCP never guarantees that data
> will be delivered. TCP guarantees the following:
>
> Each byte read from the remote endpoint's socket will correspond to the
> same byte that was written in the local endpoint's socket. The bytes that
> arrive will arrive in the same order, and with no data corruption.
>
> TCP also provides flow and congestion control, but these are minor in
> comparison.
>
> What you likely refer to when you believe TCP guarantees delivery is the
> TCP retransmission mechanic. While a very good mechanic for a live stream,
> it does not guarantee you'll know where a transmission fails, only that it
> has failed. It's up to the application layer protocol to discover this
> failure and handle it.


Refer to my explanation above.


> With that in mind, I hold that intermediaries can very well provide a
> similar level of service that plain TCP can. History has also shown that
> we're more likely to have intermediaries than not to, so I do not buy the
> argument that we're better off doing our best to
> tunnel/bypass/protect/disrupt them. Is it a compromise? Yes. But I believe
> it is a necessary compromise between those who wish to provide a new type
> of service and those who wish to manage their networks.


So if I understand you correctly, you think that any transport (port+low
level protocol) and high level protocol we use or create will end up
having intermediaries on it, and that it is futile to try to assume that
we won't?

I would not disagree with that (because I believe in free markets), I am
just arguing that the protocol we use should be well formed.  What worries
me so far about WS/HTTP is that using HTTP Upgrade to send bi-directional
data is not well formed with respect to the historic use of HTTP. It is
another form of tunneling through a legacy market installed base. There is
no doubt that specification should allowed it to be well formed, but I am
just worried about the silent failure. Whereas if we start with a new
thing, there won't be that legacy that we are bumping against. And I
worried that we could break somethings that already work in HTTP. Until
further information, I am leaning that I would rather keep it orthogonal.

And note that is not the only benefit I am trying to point out for this
proposed WS/P+T (port+tunnel).

Some of this can be used to argue for WS/TLS as well.


>
> Cheers,
> Vladimir