Re: Deadlocking in the transport

Christian Huitema <huitema@huitema.net> Wed, 10 January 2018 21:07 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 1680B12DA4C for <quic@ietfa.amsl.com>; Wed, 10 Jan 2018 13:07:04 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 2.399
X-Spam-Level: **
X-Spam-Status: No, score=2.399 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, GB_SUMOF=5, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=no 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 kiQG1HcxWz5x for <quic@ietfa.amsl.com>; Wed, 10 Jan 2018 13:07:02 -0800 (PST)
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 45E8812D950 for <quic@ietf.org>; Wed, 10 Jan 2018 13:07:02 -0800 (PST)
Received: from xsmtp06.mail2web.com ([168.144.250.232]) by mx12.antispamcloud.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.89) (envelope-from <huitema@huitema.net>) id 1eZNaN-0004so-J7 for quic@ietf.org; Wed, 10 Jan 2018 22:07:00 +0100
Received: from [10.5.2.12] (helo=xmail02.myhosting.com) by xsmtp06.mail2web.com with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from <huitema@huitema.net>) id 1eZNaK-0006mX-De for quic@ietf.org; Wed, 10 Jan 2018 16:06:57 -0500
Received: (qmail 6764 invoked from network); 10 Jan 2018 21:06:54 -0000
Received: from unknown (HELO [192.168.200.68]) (Authenticated-user:_huitema@huitema.net@[72.235.171.77]) (envelope-sender <huitema@huitema.net>) by xmail02.myhosting.com (qmail-ldap-1.03) with ESMTPA for <quic@ietf.org>; 10 Jan 2018 21:06:54 -0000
To: quic@ietf.org
References: <CABkgnnUSMYRvYNUwzuJk4TQ28qb-sEHmgXhxpjKOBON43_rWCg@mail.gmail.com> <CAGD1bZYV7iHg_YarUMqUSnpbAB2q8dwEWO=dHE2wbw8Oea_zfA@mail.gmail.com> <CAD-iZUY-Y-MO_T74JmP6B9XVj=91eVovfcWnE=9s9kd0Ji+CnA@mail.gmail.com> <CAGD1bZa7ugOTT11qOKfCm4NFdi+t-pdrXnscWHgg0bO5tgUqmg@mail.gmail.com> <20180110194716.GA30573@ubuntu-dmitri> <CAGD1bZYiDOakLYNppMBr=99JreX3Xr2zkS7O2DRNfvr_o0NUbg@mail.gmail.com> <20180110200646.GB30573@ubuntu-dmitri> <CAGD1bZa-ZOw5J6oSWBYdk3uYHOpGvak+vwGp0XsZB44zbLvRrw@mail.gmail.com> <20180110202357.GC30573@ubuntu-dmitri> <CAGD1bZbPM3wnatLLN5938wGPo3e1qmxnGzobSTym6XX3W8FNJQ@mail.gmail.com> <20180110205006.GA3434@ubuntu-dmitri>
From: Christian Huitema <huitema@huitema.net>
Message-ID: <0a2778b8-f740-cf9f-656d-445ebfbb6f2b@huitema.net>
Date: Wed, 10 Jan 2018 11:06:52 -1000
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <20180110205006.GA3434@ubuntu-dmitri>
Content-Type: text/plain; charset="windows-1252"
Content-Transfer-Encoding: quoted-printable
Subject: Re: Deadlocking in the transport
X-Originating-IP: 168.144.250.232
X-AntiSpamCloud-Domain: xsmtpout.mail2web.com
X-AntiSpamCloud-Username: 168.144.250.0/24
Authentication-Results: antispamcloud.com; auth=pass smtp.auth=168.144.250.0/24@xsmtpout.mail2web.com
X-AntiSpamCloud-Outgoing-Class: unsure
X-AntiSpamCloud-Outgoing-Evidence: Combined (0.26)
X-Recommended-Action: accept
X-Filter-ID: EX5BVjFpneJeBchSMxfU5n0uRzd+4d1AZ+3tPm16Fg8Xv9krsgRhBn0ayn6qsUc7A2kcKDr1fzRm ksYYe0sWHrgNzB/4Jkrw1eDLcif59fsSG0P9vnFDCsUxeHeTNBAJB98yDTitFWvbHwz9vKZpm4b3 Kv7PcFSfRyFbnU/eNYd851TaRAUkTN+SrghOjOYzZsQEbaxxISMHgJxrdMdSS4B6hVJPXxgisa+g wkHvC+PVG1YjIrFRKhESMT/tU1Dx+IHaAZrg1ulFniksjLYqZxdG5bOwa1rOgT+89+/XFrGt2tce crpXRY6fm8RXptyzavERpop5LF7RavHozgbn9XzprFRbpFQTOcEGeQOY3IcDlgJpEbxunV7tCPNi PQvHQpVRoYcix47lJTuKsG8TgnDHFRDF834rtLc6Wv9Yj+vBPX9bzGJi0ycLbiOUDEySIK/1NH5T HMtlYvyHAYGOGheVSH7cGoIH3Vd41lbD31Vm3SIdO3BpR97t9bfBi5FxwJWxe4AVanuu6Qx5p47D RY6xvCTKpexH9NiU0GFJBW3GvVLPSj+Hlyh2mculO/W8NktFVcl6hrIDm43UklXgo0rGkb5OztVl OoF8rUUHwR1JLObs/ksVBOHvEAgSr8kATyzYT8K6rd4RA3UMT6Em/UONoJfh+XjGSeeT90H/uIHI a5J8n3XNAXVqVUtf9Gu/ZOooRjA8u8TuHX6ZkKPotGbjO41FyBEqIaDudcVplPEfgkCmu0AbpCDt lYGBUhlW/a7J4lI9dq2HBFg+iT3zKvfFcHV2tQAVqGdj/zM7G/H0fgN5y0tqqfuQuS1mj2Wr5ft9 Iz0WDtXlRni5HCCJM9Qvlo9UV7vdWttsewtXKowaEO652uo+6xHVEn43gl09gN9PtOEBx/RKpFEr HkJ0VfjEzm1SsR8v3aJbN/NZfa/pGyl0Yc/hSh4fhbFqiL7w
X-Report-Abuse-To: spam@quarantine5.antispamcloud.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/oAjhCDjpKtvxNUK7Amko8OcgIP0>
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, 10 Jan 2018 21:07:04 -0000

On 1/10/2018 10:50 AM, Dmitri Tikhonov wrote:

> Let's make sure that we are talking about the same idea.  It seems that
> what you are suggesting is either:
>
>     A. The transport layer not allow the application to read from
>        a stream if a higher-priority stream data is available for
>        reading; or
>
>     B. If the application wants to read from a lower-priority stream
>        first, the transport layer will pretend that the higher-stream
>        data has been read.  In other words, the high-stream data will
>        be set aside somehow, giving the peer flow control credits for
>        sending more.
>
> Both seem suboptimal to me -- did you have something else in mind?

The problem arise because of over commitment of resource. Specifically,
it arises if the MAX DATA limit is lower the sum of the MAX STREAM DATA
limits. If MAX DATA was defined implicitly as the sum of MAX STREAM
DATA, we could have a very simple API between application and transport.
The application gives credits on the stream that it is ready to accept
data, and the transport just follows that.

I understand that from a resource point of view it is sub-optimal. The
smaller MAX DATA can be tied to a buffer pool not yet allocated to
specific streams, and there is some possibility to get the application
going with less than 2 bandwidth*delay products of buffers. But then,
this optimization is precisely what leads to deadlock conditions when
the transport does not quite get the priorities of the application, or
when the sender does not quite get the priorities of the receiver.

So we have two alternatives. One is to make the API more "expressive" so
the application can tell the transport exactly which order and
priorities can be applied. The other is to make the API less complex by
just mandating that MAX DATA be large than the sum of MAX STREAM DATA.
Or possibly removing MAX DATA altogether.

-- Christian Huitema