Re: Split error codes in two

Christian Huitema <huitema@huitema.net> Wed, 13 September 2017 04:56 UTC

Return-Path: <huitema@huitema.net>
X-Original-To: quic@ietfa.amsl.com
Delivered-To: quic@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 321041330C1 for <quic@ietfa.amsl.com>; Tue, 12 Sep 2017 21:56:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.598
X-Spam-Level:
X-Spam-Status: No, score=-2.598 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, LOTS_OF_MONEY=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iWyAyL9Q5i4k for <quic@ietfa.amsl.com>; Tue, 12 Sep 2017 21:56:53 -0700 (PDT)
Received: from mx43-out1.antispamcloud.com (mx43-out1.antispamcloud.com [138.201.61.189]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4CE86133056 for <quic@ietf.org>; Tue, 12 Sep 2017 21:56:53 -0700 (PDT)
Received: from xsmtp24.mail2web.com ([168.144.250.190] helo=xsmtp04.mail2web.com) by mx5.antispamcloud.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.89) (envelope-from <huitema@huitema.net>) id 1drzjG-0007XA-39 for quic@ietf.org; Wed, 13 Sep 2017 06:56:51 +0200
Received: from [10.5.2.13] (helo=xmail03.myhosting.com) by xsmtp04.mail2web.com with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from <huitema@huitema.net>) id 1drzjA-0000jB-Jc for quic@ietf.org; Wed, 13 Sep 2017 00:56:48 -0400
Received: (qmail 2212 invoked from network); 13 Sep 2017 04:56:42 -0000
Received: from unknown (HELO [192.168.1.103]) (Authenticated-user:_huitema@huitema.net@[172.56.42.88]) (envelope-sender <huitema@huitema.net>) by xmail03.myhosting.com (qmail-ldap-1.03) with ESMTPA for <quic@ietf.org>; 13 Sep 2017 04:56:41 -0000
To: quic@ietf.org
References: <CABkgnnWwGAyHzkST9o9ueVmBw3_TpJun=dv2X+HL2snXSZJgew@mail.gmail.com> <CACdeXiLS7W8cJbnT=orHkcd9reH=8QqhOzxWnUEpWZmfcdvd2g@mail.gmail.com> <CAGD1bZa-h0ZVh7kUYQtG3r93eH6TqRXnQ6YXAcscCrCQHk8LeA@mail.gmail.com> <CABkgnnXMFUP_c+2r6YeJouJXanHd8tFcqDKgU=C9UF0stPcXOw@mail.gmail.com> <CAGD1bZZZG9L0_d7Tmo8vfdAx+=LU+yi97N42vKFGo82K16Zycw@mail.gmail.com> <05505C10-8737-4C58-BC91-E401D2659AF0@in-panik.de> <MWHPR21MB0141F305CCE2B686F09549F887970@MWHPR21MB0141.namprd21.prod.outlook.com> <CAGD1bZY5xo5Krn=U3SBVUCPU4x2UAOcv2AnvzaRac9qJGM9KBg@mail.gmail.com> <DM5PR15MB14497BB2F1971C5965882875B6940@DM5PR15MB1449.namprd15.prod.outlook.com> <CAGD1bZbnpCxjdaEV_m_5XWEjtjmdxYTGh2VBoS8AgZdhxfsDhw@mail.gmail.com> <CABkgnnWRy17vuFRGhpvLBCKte3WeCdGa1M1feOBygQv+-AB2+A@mail.gmail.com> <CAGD1bZZL-4HzArTQfWrC+CbHYsyB6Wdx4cbz7+0X7YOiuc-+Qg@mail.gmail.com> <BN6PR21MB01302C7E8A43AF9DB7A63335876E0@BN6PR21MB0130.namprd21.prod.outlook.com> <bca00829d58049fb8a644f3787011fca@ustx2ex-dag1mb5.msg.corp.akamai.com>
From: Christian Huitema <huitema@huitema.net>
Message-ID: <d63880bf-7eaa-158b-a3f8-04142f288853@huitema.net>
Date: Tue, 12 Sep 2017 21:56:37 -0700
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0
MIME-Version: 1.0
In-Reply-To: <bca00829d58049fb8a644f3787011fca@ustx2ex-dag1mb5.msg.corp.akamai.com>
Content-Type: multipart/alternative; boundary="------------9250E5E40AEFE73DDE47E969"
Content-Language: en-US
Subject: Re: Split error codes in two
X-Originating-IP: 168.144.250.190
X-SpamExperts-Domain: xsmtpout.mail2web.com
X-SpamExperts-Username: 168.144.250.0/24
Authentication-Results: antispamcloud.com; auth=pass smtp.auth=168.144.250.0/24@xsmtpout.mail2web.com
X-SpamExperts-Outgoing-Class: unsure
X-SpamExperts-Outgoing-Evidence: Combined (0.11)
X-Recommended-Action: accept
X-Filter-ID: PqwsvolAWURa0gwxuN3S5YEa3T7JuZT23fGO2rGt3ZgTCGhDnudOJ80D1c8rffxrus7BTv7Ss8cH d2IQQuvdbtM+m4WpRRDP6YzwkAPgQJYoNzrMVvavOgy+9M5kGys4ND46yZLY9QyX+cRXmooQ3hum JwiT+2brWmQlzkLIcXivpIH4ag6BM/+u9ym+BA231hK1nmLJSW+JmxcpCur4OOoI9GlgXFbGvhvB 71hlmroXtoQEv6Uiwf+T5QEY0pcOYOEkjsX7F8KmpUaZQHV+ScWIfGf9Fu8q9UhMPe0GR5O2G5Pj 7iQJEmtNUzH3idZ6uMF2OhyCCCV83x+RZrKIj0QqMGQOSwmEPwP4wBzM77N8GvkYGGDFjg9NrmGY yNnXsSjdYwfRhjHqxQXDsBKLpKs+iZ7+uSas6Kaz0EAgJQDfPQj1kOyxNFg33kI1TaC7CpXSTy88 yKXT59k+LMPEe6z703c9jXkpRbMJi6lpuxCpb0YnYvmU5PphG8LogcC6a8Mrc8quJ4btPpt/2FLu FENuK6ldck0juAg+FVtv+IOo4y6frMgdTo7c9I9ngwHJYd/jKzjiuDYHz/0WYr1rUy6ggDjF/JYa A95R4z1aC/P2bHd6v+zfW0Hi0zr4G/c3fOag26sJVU91vDlVZmVFHoHOPocIAQXCXdbljHVoU+TL v3Mz7HKrwpxO8UZg9F+1KW+fKrtTAxLYZqy5vzpWhrDjTzGHpE/PwPNFuykVFHR/oyTcdh5JdKk+ pVaIW+GYHZhD39vvlhL3cS0Zw/VNlKqK3hSPsI/yXHuKCW5mW6x7e6X9dJ86M2qPvneWrcSOpMRe 2A8DoXWdiHTPGMwPDlprjQPFk8m4tSTfORUp3ynKX9MPhkd8FwkdJfUs7sHA2/AsuSJe7JniZ6xP S+TFsgXf0EgYJLibecBlpmz3E0I=
X-Report-Abuse-To: spam@quarantine5.antispamcloud.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/lYWfJEvdF3iWI0weiDIVIFEpk0s>
X-BeenThere: quic@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Main mailing list of the IETF QUIC working group <quic.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic>, <mailto:quic-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic/>
List-Post: <mailto:quic@ietf.org>
List-Help: <mailto:quic-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic>, <mailto:quic-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 13 Sep 2017 04:56:56 -0000

There is another abstraction -- streams as messages. Application pushes
a message that is the entire content of the stream, and receives a
message once the entire stream has been received. That's the model used
by DNS over QUIC.


On 9/12/2017 9:23 PM, Lubashev, Igor wrote:
>
> This is a very good idea to decide what we want to model streams on. 
> Starting with well-known, simple abstractions seems like the best path
> to adoption.
>
>  
>
> There are two such abstractions that come to mind:
>
>  
>
>  1. “TCP Stream sockets”.  These only support signaling “orderly”
>     closing of the write direction.  Closing of the read direction can
>     only be done via close(), but that may leave the write direction
>     in an undefined state (writing will complete, unless there was
>     unread data in the read buffer or any data is received after close
>     – see RFC 1122 4.2.2.13 $3).
>
> I think the current spec allows for QUIC API to emulate TCP stream
> socket abstraction.  Current spec  also adds signaling “abort” closing
> of the write direction (RST_STREAM does not require an immediate
> RST_STREAM in the opposite direction), although there was some talk of
> removing this feature.
>
>  
>
>  2. “A POSIX pipe pair”, as Mike is proposing (one pair in each
>     direction).  Connected pipes are very clean (‘symmetric’)
>     abstractions, and they communicate close events (you close the
>     ‘write’ pipe, ‘read’ pipe get EOS; you close the ‘read’ pipe,
>     ‘write’ pipe gets an exception).
>
>  
>
> With read-direction close signaling, however, it is important to not
> to cause often-unnecessary STOP_SENDING frames sent for every
> common-case stream.close(). I think that could be done via one of the
> following ways:
>
>  1. Unidirectional streams. Send STOP_SENDING on close() by the
>     receiver (if the steam is open).
>  2. API convention: “only send STOP_SENDING on
>     stream.inputStream().close()”. On stream.close(), only send
>     STOP_SENDING if there is unread data or new data comes in later.
>  3. Actually signal that read direction is closed in stream.close() by
>     defining STREAM-with-FIN frame as “close both write and read
>     directions” (common case).  Have separate frame types for
>     WRITE_CLOSE, WRITE_ABORT (aka RST_STREAM), and READ_ABORT (aka
>     STOP_SENDING).
>
>  
>
>  
>
> *From:* Mike Bishop [mailto:Michael.Bishop@microsoft.com]
> *Sent:* Tuesday, September 12, 2017 8:04 PM
> *To:* Jana Iyengar <jri@google.com>; Martin Thomson
> <martin.thomson@gmail.com>
> *Cc:* Philipp S. Tiesel <phils@in-panik.de>; Subodh Iyengar
> <subodh@fb.com>; Nick Harper <nharper@google.com>; QUIC WG
> <quic@ietf.org>; Victor Vasiliev <vasilvv@google.com>
> *Subject:* RE: Split error codes in two
>
>  
>
> Jana and I were discussing this today, and part of the difference
> comes down to how you conceive of the API a QUIC implementation will
> expose.  My mental model has been that a stream/stream-pair consists
> of an InputStream and an OutputStream; you can read on one, you can
> write on the other.  For the write stream, you can write your data to
> completion and close the stream, or you can decide to abort writing. 
> The wire expressions of these are FIN and RST_STREAM, respectively. 
> For the read stream, you can read the incoming data to the end or you
> can abort reading and discard the remainder of the stream; the wire
> expression of this would be flow control updates and STOP_SENDING,
> respectively.  On the other side, receipt of a RST_STREAM surfaces as
> a read error and receipt of a STOP_SENDING surfaces as a write error. 
> (Jana commented that in this mental model it might be clearer to call
> the frames WRITE_ABORT and READ_ABORT.)
>
>  
>
> If we take Martin’s proposition that streams only close by application
> action, there would never be a write error surfaced to the application
> unless the underlying transport went away entirely.  Instead, it’s the
> responsibility of the application protocol to communicate (on another
> stream, in this case) that you should abort writing, even if you’ve
> already written to completion, and then to do so.  That implies that
> the application needs the ability to return to streams on which it’s
> done writing, in case it’s later asked to go back and reset them.
>
>  
>
> Much of our discussions around unidirectional streams, stream state
> transitions, etc. including the question of whether STOP_SENDING
> belongs at the transport layer, stem from the fact that we all have
> different implicit mental models of the functional surface QUIC
> exposes.  Perhaps we should take a step back and agree on that first,
> as I believe Christian has suggested in the past?
>
>  
>
> *From:* Jana Iyengar [mailto:jri@google.com]
> *Sent:* Friday, September 8, 2017 5:34 PM
> *To:* Martin Thomson <martin.thomson@gmail.com
> <mailto:martin.thomson@gmail.com>>
> *Cc:* Subodh Iyengar <subodh@fb.com <mailto:subodh@fb.com>>; Mike
> Bishop <Michael.Bishop@microsoft.com
> <mailto:Michael.Bishop@microsoft.com>>; Philipp S. Tiesel
> <phils@in-panik.de <mailto:phils@in-panik.de>>; QUIC WG <quic@ietf.org
> <mailto:quic@ietf.org>>; Nick Harper <nharper@google.com
> <mailto:nharper@google.com>>; Victor Vasiliev <vasilvv@google.com
> <mailto:vasilvv@google.com>>
> *Subject:* Re: Split error codes in two
>
>  
>
> On Thu, Sep 7, 2017 at 7:50 PM, Martin Thomson
> <martin.thomson@gmail.com <mailto:martin.thomson@gmail.com>> wrote:
>
>     On Fri, Sep 8, 2017 at 9:42 AM, Jana Iyengar <jri@google.com
>     <mailto:jri@google.com>> wrote:
>     > I don't think it makes sense to design an app protocol that
>     doesn't send a
>     > RST in response to a RST.
>
>     I've been told not to invoke this particular demon, but you just
>     invoked the Unidirectional streams problem.  I think that we get there
>     because of this meme that says that data in the one direction is
>     somehow necessarily bound to data in the other direction.  That's an
>     entirely constructed notion.  A useful construct at times, certainly,
>     but that's not the point here.
>
>  
>
> I think that's the most common use of a RST -- to close both directions. 
>
>  
>
>     So I disagree.  There are many protocols in which you send messages
>     (== streams) in one direction but not another.  One of the ways you
>     get into a unidirectional state in the current draft is to end one
>     side.  A FIN is only one way to do that, a unidirectional RST can be
>     faster and even superior in other ways.  The HTTP use case clearly
>     illustrates that.
>
>  
>
> FIN is the primary way in which half-close is achieved, which is what
> you're talking about. The HTTP use case is a complete one-off --
> STOP_SENDING is an odd enough use case that I'm always left wondering
> who actually uses it.
>
>  
>
>     Also, as Igor observes, we don't require a reciprocal RST_STREAM in
>     the current draft.
>
>  
>
> Yes, we don't. Recall that the RST_STREAM was, prior to the change
> that doesn't require reciprocity, a bidirectional signal, which was
> simplified to a unidirectional one, with the general expectation that
> apps would close the other side when they receive this signal from
> QUIC. It's surely going to be true of HTTP. It's possible for an app
> to receive a RST and then keep sending, but that is a use case I
> haven't seen in practice.
>
>  
>

-- 
Christian Huitema