Re: [hybi] Send quota value before receiving AddChannelResponse (was: Re: MUC: channel ID semantics)

John Tamplin <jat@google.com> Tue, 24 April 2012 13:19 UTC

Return-Path: <jat@google.com>
X-Original-To: hybi@ietfa.amsl.com
Delivered-To: hybi@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1D53121F8821 for <hybi@ietfa.amsl.com>; Tue, 24 Apr 2012 06:19:15 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -102.876
X-Spam-Level:
X-Spam-Status: No, score=-102.876 tagged_above=-999 required=5 tests=[AWL=0.100, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-1, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nElKLioomQxW for <hybi@ietfa.amsl.com>; Tue, 24 Apr 2012 06:19:14 -0700 (PDT)
Received: from mail-gy0-f172.google.com (mail-gy0-f172.google.com [209.85.160.172]) by ietfa.amsl.com (Postfix) with ESMTP id 1D6D521F8806 for <hybi@ietf.org>; Tue, 24 Apr 2012 06:19:14 -0700 (PDT)
Received: by ghbg16 with SMTP id g16so368378ghb.31 for <hybi@ietf.org>; Tue, 24 Apr 2012 06:19:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:x-system-of-record; bh=CxrOqrv3E+nS9MWp+zrrHiSPo/aIPdElZBXn3jkefm4=; b=KT9vPPpqW145/qkAZ3MIKyULQ1Vo8MHEHv45Yjoha6Zzr0McNaDg3nQpFLuSxW6J2N VN4Y4n2uLDTbDZs52GENq2mYFXx/oOzlrgI6DwDHEr7LBKDhg4RN0Ca285s0GDLk7T2i xDdT4eMNl+BjIsXAoBwOr3t84fU9GHJSeOzz6SsssG6/FCma7OIGteA0lzWtIn02i0TW E5jWgOZfq4K+zL8Q0UalR0PLaTIsasRk32VoAdqEfy7f9K/C2QlQkvecfxeSNHdOEfRf +QzqdZPYj2HU/p72boIQu403nHRDoQ4c7Y57yOP+MNVUAncfUvIxqhttCZJNceAdFNjQ 9Y3A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:x-system-of-record:x-gm-message-state; bh=CxrOqrv3E+nS9MWp+zrrHiSPo/aIPdElZBXn3jkefm4=; b=QHcWuBwJGc1IJYrz98YvqI9lwW5fV75cXE04mWBZmFTGOC17E3B8bUof0KFqUGd6Aj +/UacfnQnRlLSvVPffgcjAfyixYTAENyB+B2SbXLTwfPBftXXSPHHnIV0JqysTAOMmJu pdfDylHsfH9mLlWjQVTAtdRNJPeMfhfpiSSZXfZS0mucpWx8i6QeXIUgNJprcr3pQB7Y IIWddbNPFlDxYhQ4pXUv4bxTXtsN1A94LhPxnjRjVLwHyIkbOw00+Xen5tDez3TMk+4u X7l9bHucliELJLw7BxbjZ3Iz6EUY2Jf9ul1uyQMtoE+MHgzyNGi/qHzk3iSvm4HTE+eN Q5IQ==
Received: by 10.50.217.164 with SMTP id oz4mr9887636igc.70.1335273553387; Tue, 24 Apr 2012 06:19:13 -0700 (PDT)
Received: by 10.50.217.164 with SMTP id oz4mr9887617igc.70.1335273553251; Tue, 24 Apr 2012 06:19:13 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.64.9.169 with HTTP; Tue, 24 Apr 2012 06:18:52 -0700 (PDT)
In-Reply-To: <000301cd21f2$8ee30fa0$aca92ee0$@noemax.com>
References: <CAH9hSJZP8FhAGANSwPfvdMCQPyfRhG7tqPT68e6VY5ZCAEROTw@mail.gmail.com> <CABLsOLBsHXsj_A2sWa+b8KaFJBEFMHk0W268RyKzh7J0Y+ZxVQ@mail.gmail.com> <CAH9hSJZMrqDLJLr6RNLk84o1B2i3AVezUeGF9mWZ2Yu2Uv-feA@mail.gmail.com> <CA566BAEAD6B3F4E8B5C5C4F61710C1147FA4EA0@TK5EX14MBXW602.wingroup.windeploy.ntdev.microsoft.com> <002501cd1e15$0c8d8480$25a88d80$@noemax.com> <CA566BAEAD6B3F4E8B5C5C4F61710C1147FA9596@TK5EX14MBXW602.wingroup.windeploy.ntdev.microsoft.com> <4F9494FD.5070106@ducksong.com> <CAH_y2NGJFpC500ut00a6jM=syF0Ljf4oSOh=uchqv1LOud7pKg@mail.gmail.com> <000301cd21f2$8ee30fa0$aca92ee0$@noemax.com>
From: John Tamplin <jat@google.com>
Date: Tue, 24 Apr 2012 09:18:52 -0400
Message-ID: <CABLsOLDzVNx247sXx1+wL-c1T8-R67-BebOnhxJ=1+rBjqwJ5w@mail.gmail.com>
To: Arman Djusupov <arman@noemax.com>
Content-Type: multipart/alternative; boundary="14dae934052fd1ccb704be6c9921"
X-System-Of-Record: true
X-Gm-Message-State: ALoCoQnqyLf1dR0VxXgA11mqlSptNkd6xHP4fEVUcwBsjWazuvIOtkLxsQbdgNIWYaEj8ntKQxHEMjE2rJN1Geh0nzNwTp2He3JYLWRcaFPsC1dBXJgKawbQ7TsBbsucaYQoYJZmd6kg
Cc: hybi@ietf.org
Subject: Re: [hybi] Send quota value before receiving AddChannelResponse (was: Re: MUC: channel ID semantics)
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/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, 24 Apr 2012 13:19:15 -0000

On Tue, Apr 24, 2012 at 4:16 AM, Arman Djusupov <arman@noemax.com> wrote:

> The server might refuse the channel due to reaching the maximum number of
> mux logical channels on the same connection. The issue is not only with the
> cases when the channel is refused but also when the server can't allocate a
> new channel fast, which would force the server to buffer frames of pending
> logical channels until they get accepted in order to read from the wire the
> subsequent frames belonging to already established channels. For this
> reason
> the server needs a way to control a default quota. My suggestion was to let
> the server define the default quota for the logical channel during the
> physical channel handshake rather than hardcoding it into the spec.
>

The problem is that you are using up buffer space in the client to buffer
any frames which might need to be re-sent if the logical connection is not
successful.  So, having the server specify that seems backwards to me.
 Since frames can be nearly arbitrarily large, that means that the client
might have to buffer an arbitrarily large amount of data (even if it
refragments it and sends only part of it, it has to hold onto the rest).

So, the only way I think it makes sense to send data with the connection
are when we know it can't fail or when we pass off responsibility for
buffering the data to the client.  Ie, in a hypothetical API where you can
send data with the open, you explicitly say that data will be dropped if
the connection is not successful, so the code calling WebSocket.open is
responsible for re-sending the data on a later connection attempt.


> As I already mentioned in a previous message, according to the current
> specification (a) the client may send data prior to receiving an
> AddChannelResponse, but (b) it doesn't have any flow control quota until an
> AddChannelResponse with or without quota parameter is received. These two
> obviously contradict each other.


No, there is no conflict - a client is always free to send up to its quota,
and the quota is held to zero until you get a connection.  That means there
are fewer special-cases to consider, both in validating the spec and
implementing it


> PS: I totally agree on the evilness of 'RTT', but there has to be a clean
> way to control the amount of data that the client can send before the
> channel is accepted, preferably not just a hardcoded default quota for all
> clients in all cases.
>

Ok, but who decides, and who bears the buffering cost of that decision?

-- 
John A. Tamplin
Software Engineer (GWT), Google