RE: flow control and DATAGRAM

Mike Bishop <mbishop@evequefou.be> Thu, 01 November 2018 04:08 UTC

Return-Path: <mbishop@evequefou.be>
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 D8F44130E96 for <quic@ietfa.amsl.com>; Wed, 31 Oct 2018 21:08:32 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.088
X-Spam-Level:
X-Spam-Status: No, score=0.088 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, HTTPS_HTTP_MISMATCH=1.989, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=evequefou.onmicrosoft.com
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 p0X645ap1WK6 for <quic@ietfa.amsl.com>; Wed, 31 Oct 2018 21:08:28 -0700 (PDT)
Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0090.outbound.protection.outlook.com [104.47.41.90]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E5ED5130E43 for <quic@ietf.org>; Wed, 31 Oct 2018 21:08:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=evequefou.onmicrosoft.com; s=selector1-evequefou-be; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AXo2sK3PWK4deu3F7Q33NPUuvWw5vwHMkPYd9V3IbXM=; b=AN5FA9gmR8M0QhPBW+HTJfvsDck94JFRzr56KijdnDFdE6I+LSlZ7i5hbbjfxJgV3PSAx72HyyNWiFeaUQzdLEmQy2K2/XSa89DKMNDqxrQRCodL6TpxDGSG2e5N/ObpxaIta82+F6jAfE56b2Bjp8yOkjZUA+nkGTYR73797KA=
Received: from CY4PR22MB0983.namprd22.prod.outlook.com (10.171.171.20) by CY4PR22MB0677.namprd22.prod.outlook.com (10.172.135.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.20; Thu, 1 Nov 2018 04:08:24 +0000
Received: from CY4PR22MB0983.namprd22.prod.outlook.com ([fe80::706e:6d82:cc25:531f]) by CY4PR22MB0983.namprd22.prod.outlook.com ([fe80::706e:6d82:cc25:531f%10]) with mapi id 15.20.1294.021; Thu, 1 Nov 2018 04:08:24 +0000
From: Mike Bishop <mbishop@evequefou.be>
To: "Lubashev, Igor" <ilubashe@akamai.com>, Tommy Pauly <tpauly@apple.com>, Jana Iyengar <jri.ietf@gmail.com>
CC: Ian Swett <ianswett@google.com>, QUIC WG <quic@ietf.org>, Martin Thomson <martin.thomson@gmail.com>
Subject: RE: flow control and DATAGRAM
Thread-Topic: flow control and DATAGRAM
Thread-Index: AQHUb0aWdW462xFfTkmRJjY3hrxEz6U2KFYAgAAvQoCAAEeKAIAABpeAgAAYeICAA5H68A==
Date: Thu, 1 Nov 2018 04:08:24 +0000
Message-ID: <CY4PR22MB098366E6A90123689A855766DACE0@CY4PR22MB0983.namprd22.prod.outlook.com>
References: <CABkgnnU26aYD=TybuD0FZGYtfEa6np-Sk3Jo6t7LRp0wzKh3Lg@mail.gmail.com> <CAKcm_gMDOyJC0AwOo2knN6AMxVbySjGsrLvjcC9A8UA9xcvcWw@mail.gmail.com> <19D3595B-8845-45B6-A60D-9E934DD49FAC@apple.com> <CACpbDcfk+GXb3aL5LG0wQM87thRGO5Y4Q+9cbXf5YuW1=jWCig@mail.gmail.com> <B7BE2454-2A4D-4323-B0A5-0D73BD4B819F@apple.com> <344a8a30b95441af988b675c2f887965@usma1ex-dag1mb6.msg.corp.akamai.com>
In-Reply-To: <344a8a30b95441af988b675c2f887965@usma1ex-dag1mb6.msg.corp.akamai.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=mbishop@evequefou.be;
x-originating-ip: [24.197.53.86]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; CY4PR22MB0677; 6:slA53Jrxam/f/e2dVQgacmbyqYjjtWUkJu/jM+fWWVwu0SnFwZospnXK13oL6XXOX1r6aTnvC0cp6AvrkmB6vsMaXbXWzwHKMpjYJi/3OTxkV8Ubr/hojJy3qfSOHrScxJc1VLWukfCY9/wHIXhDccTFKhvdMKOyz3DQLzuoDA0Q13EjWnAvYXNDapvtoV7r+i+eq3Flmh6W6MrWmd+1GHzSLH5xMsLHyKoKYfBvchTFO/lEsC4mZxyLgD/quWna4kxnwCqkt6oW84D2Cn7xtxpwe5Ow0tnilU+QyHUuL3hQMAo+88mpVoPdYy2s2GG2u+0e7seOcbiJf7D0/pq4T84itMAuHEbRCkUn1+FCnzBSa8fLfPuvIBHKC8NJNZSxzZWUFAuvGvUAbSkurDAFm72BqRXsMTPab6nwsQnmNbz0SlJCp/B7vvbF5rJ3oa8dCEJWE1ewvoNWdtes3ux69w==; 5:Yv/ssuN6SnLc+KrEbdL/VYpjIN9BhFwrSTl7v3EXHzXsnSRryNcJoMVwMF6EUbK4eSg7Cg3YHARLiP7Vy67+udce2bbl6Exz22jL06LtM4u02DT4DNFU1OxUVCWnp8RwIqdjY2yUiIYDJQdYzfJ1UVCJhDI+bg2IBgq0JLLlASA=; 7:EseifHtI1F4a564EzC32y7tBk6v3ytKYxr/gW/WAly0t1pN2TmURbs0ih50zRwyviWm5ssdOcNo2u0z8B3iwsijHLoEC7gCGOPocUAXMWRxjOie3Tb9Q1BWryPlL7K9HHKoSQHpef+0Kpvutn7j5xA==
x-ms-exchange-antispam-srfa-diagnostics: SOS;
x-ms-office365-filtering-correlation-id: 9d3662ec-fe1a-4afe-60f4-08d63fafab37
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(7021145)(8989299)(4534185)(7022145)(4603075)(4627221)(201702281549075)(8990200)(7048125)(7024125)(7027125)(7023125)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:CY4PR22MB0677;
x-ms-traffictypediagnostic: CY4PR22MB0677:
x-microsoft-antispam-prvs: <CY4PR22MB0677CCAB8D576C4E0EAD53D1DACE0@CY4PR22MB0677.namprd22.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(31960201722614)(80524489315369)(85827821059158)(211936372134217)(153496737603132)(166708455590820)(278428928389397)(21748063052155)(28532068793085)(190501279198761);
x-ms-exchange-senderadcheck: 1
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231382)(944501410)(52105095)(148016)(149066)(150057)(6041310)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(2016111802025)(6043046)(201708071742011)(7699051)(76991095); SRVR:CY4PR22MB0677; BCL:0; PCL:0; RULEID:; SRVR:CY4PR22MB0677;
x-forefront-prvs: 0843C17679
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39830400003)(396003)(366004)(376002)(346002)(136003)(199004)(189003)(7736002)(6506007)(99286004)(26005)(76176011)(74316002)(256004)(7696005)(97736004)(53546011)(25786009)(102836004)(14444005)(508600001)(5660300001)(790700001)(110136005)(6116002)(33656002)(2900100001)(229853002)(5250100002)(6246003)(3846002)(54906003)(68736007)(316002)(11346002)(81156014)(14454004)(8676002)(105586002)(4326008)(486006)(39060400002)(71200400001)(71190400001)(81166006)(8936002)(186003)(236005)(106356001)(966005)(606006)(3480700004)(55016002)(6436002)(476003)(2906002)(86362001)(53936002)(54896002)(6306002)(9686003)(66066001)(446003)(93886005)(74482002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR22MB0677; H:CY4PR22MB0983.namprd22.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1;
received-spf: None (protection.outlook.com: evequefou.be does not designate permitted sender hosts)
x-microsoft-antispam-message-info: yuJZhFTJlZ06CwY4IG6rhVMf806XzbRklqxvavMlZFa8vdZLaYCjDldj926J+Z8bZCawhJzqmtQDvIBL0D1UnZR9fbPYuoIYp268AyP6SU6goqlLG6/ewRtp1yJI9OmbCNrN/pwG77hUAolBTWeFCZE4QBsFcFuHzGd6l1rVasH+Y2uE/1/7N4m/c84hBk9ZfI7O5Ugo0foX6diBD52mLG7N53poSIFbzjCN+HFBgJfnMeuGTYogL2adjSFD6YWu3Q77KMiRsdn1MNbLekIfBNTC1wdzm09UrXKI1jZTUnpTEGUXof+b90LvZeHP0j5dyhcQNazsrI0y8Ta3xKoPDJusPjLs7XXN+7GV1WoBVWA=
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: multipart/alternative; boundary="_000_CY4PR22MB098366E6A90123689A855766DACE0CY4PR22MB0983namp_"
MIME-Version: 1.0
X-OriginatorOrg: evequefou.be
X-MS-Exchange-CrossTenant-Network-Message-Id: 9d3662ec-fe1a-4afe-60f4-08d63fafab37
X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2018 04:08:24.1631 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 41eaf50b-882d-47eb-8c4c-0b5b76a9da8f
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR22MB0677
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/XoB81OyKlO_sszQWstMXfIoRPoo>
X-BeenThere: quic@ietf.org
X-Mailman-Version: 2.1.29
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: Thu, 01 Nov 2018 04:08:38 -0000

Technically, an implementation could choose not to ACK without ignoring all frames in the packet.  Our design for frames says that they can be sent/received multiple times without error, so a spuriously-retransmitted reliable frame from that packet is wasted data, but not an error.  However, it might not be totally clear to application designers that, while ACKs can tell you which datagrams definitely did arrive, they can never tell you which ones definitely didn’t.

But it sounds like where this is going is the realization that you have to have flow control if you’re going to prohibit the remote implementation from dropping datagrams after ACKing them; but if you do allow the implementation to do that, then ACKs tell you nothing concrete about DATAGRAMs that might have been in those packets.

From: QUIC <quic-bounces@ietf.org>; On Behalf Of Lubashev, Igor
Sent: Monday, October 29, 2018 4:29 PM
To: Tommy Pauly <tpauly@apple.com>;; Jana Iyengar <jri.ietf@gmail.com>;
Cc: Ian Swett <ianswett@google.com>;; QUIC WG <quic@ietf.org>;; Martin Thomson <martin.thomson@gmail.com>;
Subject: RE: flow control and DATAGRAM

> ACK to a packet containing a DATAGRAM frame means:
> - The packet made it across the network to the QUIC endpoint on the other side
> - The QUIC implementation will deliver the DATAGRAM frame to application (it won't drop it locally)
>
> Does that make sense?

This only makes sense, if there is an effective flow control for DATAGRAMs.  The spec should be implementable by poll/read QUIC implementations as well as by callback-on-network-receive-thread implementations.  Unless there is an effective flow control, a buffering QUIC implementation must be able to discard DATAGRAMs, if the receiver app is not catching up.  The receiver would then have to ignore all non-DATAGRAM frames in that packet, since it would be unable to ACK the packet.  If the receiver is processing DATAGRAMs and STREAMs at different speeds, deliberate discards of packets containing DATAGRAMs would interfere with the congestion control, effectively HOL blocking STREAMs.

An effective flow control requires sender and receiver to synchronize their view of the flow control counter (MAX_DATA for connection flow control).  Relying on ACKs is very hard, since the receiver cannot know how much data the sender has sent (unless the sender is explicit about it).

If flow control for DATAGRAMs is desired, you can use mechanics such as in https://tools.ietf.org/html/draft-lubashev-quic-partial-reliability-02 or https://tools.ietf.org/html/draft-lubashev-quic-partial-reliability-03 (https://github.com/igorlord/draft-lubashev-quic-partial-reliability).  (This would be treating DATAGRAMs as belonging to a partially reliable stream, or streams.  Except you would not need to ensure ordering of DATAGRAMs in that stream.)


  *   Igor


From: Tommy Pauly <tpauly@apple.com<mailto:tpauly@apple.com>>
Sent: Monday, October 29, 2018 4:01 PM
To: Jana Iyengar <jri.ietf@gmail.com<mailto:jri.ietf@gmail.com>>
Cc: Ian Swett <ianswett@google.com<mailto:ianswett@google.com>>; QUIC WG <quic@ietf.org<mailto:quic@ietf.org>>; Martin Thomson <martin.thomson@gmail.com<mailto:martin.thomson@gmail.com>>
Subject: Re: flow control and DATAGRAM

Hi Jana,

I'm not suggesting any changes to when the packet gets ack'ed—specifically, I was responding to Martin's hypothetical of having an ACK to a DATAGRAM frame meaning that the application had processed the frame. My impression is that the ACK to a packet containing a DATAGRAM frame means:
- The packet made it across the network to the QUIC endpoint on the other side
- The QUIC implementation will deliver the DATAGRAM frame to application (it won't drop it locally)

Does that make sense?

Having a separate outstanding data limit for the DATAGRAM "stream" is an interesting solution to the space. It would then have the nice property of not looking like traditional flow control. It could even be measured in number of frames, rather than bytes (depending on what the limiting factors are).

Thanks,
Tommy

On Oct 29, 2018, at 12:37 PM, Jana Iyengar <jri.ietf@gmail.com<mailto:jri.ietf@gmail.com>> wrote:

Tommy,

Changing the semantics of an acknowledgment to include delivery up to the application is a fundamental change to the QUIC machinery, and it doesn't work. First, an ACK frame acknowledges packets, and you can't have different semantics of an acknowledgment for different frames that are carried in the same packet. Second, it interferes with RTT measurement, and it conflates flow control with congestion control, which gets messy. (This conflation is an interesting problem to consider theoretically, but not one for us at this time IMO.)

I am wondering if applying a stream-level flow control for DATAGRAMs makes sense instead. Meaning that you treat DATAGRAMs as a separate stream for flow control purposes. You might benefit from having an offset in the DATAGRAM frame for this purpose.

- jana

On Mon, Oct 29, 2018 at 8:21 AM Tommy Pauly <tpauly@apple.com<mailto:tpauly@apple.com>> wrote:
Hi Martin, Ian,

Yes, very good points!

My tendency would be to prefer what Ian's implementation does of passing these DATAGRAM frames up immediately to the application. I don't think that the acknowledgment needs to indicate that the frame was processed by the application, but merely that it has been delivered to the application (that is, the application doesn't get to do anything with the frame that can influence the acknowledgment).

The current draft indicates that the content of the DATAGRAM frames contributes to the limit used for MAX_DATA, and that if that amount is reached, the frames are blocked along with STREAM data. I think this works fine for the sender, while the receiver gets into the discussion you present. On the sender side, reaching MAX_DATA could mean dropping the DATAGRAM frames when unable to send more (and sending BLOCKED instead). Since the frames are unreliable, they can be dropped in this situation without violating the API contract.

On the receiver side, I agree that queuing the DATAGRAM frames to let the application drive flow control in the way it does for STREAM frames adds complexity and diminishes the utility of the frame and ACKs.. However, I can imagine taking a fairly simplistic approach in which the data limit is automatically increased upon reception of the frame (and the frame is immediately passed to the application). This allows the initial_max_data to put a cap on the amount of data in a given flight of DATAGRAMS, and allow the size of a flight of DATAGRAM frames to be limited by the amount of room left over from STREAM data that may be consuming the connection-wide flow control.

Perhaps this approach needs a clearer name other than "flow control", since it has a somewhat different meaning in effect.

As for ACKs, if we never discard on the receiver side, the ACK is pretty useful for detecting if there was network-based packet loss.

Thanks,
Tommy

On Oct 29, 2018, at 5:32 AM, Ian Swett <ianswett@google.com<mailto:ianswett@google.com>> wrote:

Good catch Martin, I missed that in the draft as well, and I also think it's impossibly with the proposed design.

And yes, I think Martin's proposed solution is likely the only practical one.  In my implementation, the frame is passed up to the application immediately, so technically QUIC processed it, and it's the application's job to decide what to do with it.

On Mon, Oct 29, 2018 at 1:16 AM Martin Thomson <martin.thomson@gmail.com<mailto:martin.thomson@gmail.com>> wrote:
Hi Tommy,

Your slides - <https://github.com/quicwg/wg-materials/blob/master/ietf103/IETF103-QUIC-Datagram.pdf<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_quicwg_wg-2Dmaterials_blob_master_ietf103_IETF103-2DQUIC-2DDatagram.pdf&d=DwMFaQ&c=96ZbZZcaMF4w0F4jpN6LZg&r=Djn3bQ5uNJDPM_2skfL3rW1tzcIxyjUZdn_m55KPmlo&m=-JAVyKK4LrDFUn-TzI96ZFlrFZYozg4GFVttnjIjGdg&s=tqUQZW-hP0GwZ7x1otPkSYpA3axGVizYu0a4JlLou6Q&e=>>
- say that DATAGRAM frames respect connection-level flow control.  I
missed that in the draft, and I don't know how they can do that in the
face of packet loss, especially when you don't necessarily retransmit
lost DATAGRAM frames.

For that to work, you would need a bunch more machinery to make the
connection-level flow control sync between endpoints in the case that
packets are lost.  A disagreement about how much flow control is used
causes things to break down badly.  Ian and I discussed this point at
the last meeting and quickly agreed that while it might be nice to
have flow control for this stuff, the increase in complexity is
considerable and (at the time) we thought it wouldn't be worth it.

The problem that introduces is that you could end up having too many
DATAGRAM frames arrive.  The receiver has to drop something at the
point that it can't handle them.  And we say that when you acknowledge
something, you processed it.  That's tricky.

It might be easier to say that a QUIC acknowledgment for a DATAGRAM
frame doesn't mean that it was received and processed by an
application.  An endpoint might discard these frames before passing
them on to applications if it doesn't have space.  In other words,
acknowledgment of DATAGRAM means that QUIC got it, not that the
application got it.  Sadly, that means that the QUIC acknowledgment
machinery doesn't help the application that uses DATAGRAM all that
much.  Also, the lower bound on reliability is 0, which isn't the best
thing ever.

Hard choices, I know.  I don't have a good design for maintaining
connection-level flow control (or any back pressure mechanism with
equivalent properties) that doesn't add both complexity and overhead.

Cheers,
Martin