Re: [HTTP/3]Sending reserved frame before SETTINGS

Ryan Hamilton <ryan@optimism.cc> Sat, 01 February 2020 16:15 UTC

Return-Path: <ryan@optimism.us>
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 8010F120852 for <quic@ietfa.amsl.com>; Sat, 1 Feb 2020 08:15:18 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.649
X-Spam-Level:
X-Spam-Status: No, score=-1.649 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=optimism-cc.20150623.gappssmtp.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 8QQpo0dFZ9qT for <quic@ietfa.amsl.com>; Sat, 1 Feb 2020 08:15:17 -0800 (PST)
Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 024851201DC for <quic@ietf.org>; Sat, 1 Feb 2020 08:15:16 -0800 (PST)
Received: by mail-ed1-x52b.google.com with SMTP id p23so11236611edr.5 for <quic@ietf.org>; Sat, 01 Feb 2020 08:15:16 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=optimism-cc.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NQzskgKOl1FjNVBMBQBhgL1paFLcJi513/lKTbKFS7I=; b=wc7TWV/AS8F3X2/MpN0mIYmWK2qCIfdOFTpLW6a2CpTh7enxKMdxL5R9DbUAr0pRE2 whxfdwHZ8QDmsPyfgLfhwj7X4uBF0EGQiKqR6X3FlmjSIpKy6FyG0dG464CTrFU2xwme yghIwKv4/a3IlDSWsChvt2SFwonODoMk2MpeI0nq5lWOuw3/B9Gch8EIcTXlYryZZCu0 PlowR2NwWxSBV1TzUoLBO2EfZPCYUt0Ok5RvnMwHJGdgSUCGpZgYon4N4ZI2Onhhu27N ayX/cdPUfHqJ+tO8IOZgqCj7fkRbM0psim+gKmb01/4rfAIr9ReWd9u2Nf+IblKI3yjh ztVw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NQzskgKOl1FjNVBMBQBhgL1paFLcJi513/lKTbKFS7I=; b=XW9XyhxLohhR5Lqr6MXnMV8EXfXaoRh/hDyHkj9whjb5WcFWuuS0Z/4xQvJDgjWmBH cz0+EFnNjQXRDzLEuNd5F3pmGbUyx0XyLG770wnQrJufZhL2Y0hzYyntEXfugwmXoOXU c82XJzxawFCcLhJK2dj7eX14uNDKnAV4oezbPuNoC/sfBsmd8wfD9yWpZSjIUlu50esM 2rD7LYjdywlhHhdfVo/w255C/JuwmG7OSlJiGa2mDRPsjf7sI118iSXtxNBfrLl+SmHB 7fjep1lZb0RyUuduZO/sHmbZ/qYKEp+98KWZXi7PRbExF8p00yHgta2f5hvNcbPDjLJN eKlg==
X-Gm-Message-State: APjAAAV4ZZweUF07R66QiiTyboSGgW03I+t3FjyqqhzXLwprJNdoviDQ ayVxlIkIgWRJvLEuCZtBVjRtDD81nSw32ldFa7msrdTtfu+vYw==
X-Google-Smtp-Source: APXvYqyr14Fc9zQ/+OPzLGcohY16SPIeD/7CCcr8/m6OwMBy61Bc0Gea3mQolDMagfKf/dsfPq+4Fr7gZV0K1FzwJUA=
X-Received: by 2002:a50:9e63:: with SMTP id z90mr5360994ede.306.1580573715285; Sat, 01 Feb 2020 08:15:15 -0800 (PST)
MIME-Version: 1.0
References: <CAPOFeyhp5YE+Y2nSUfEwGUHamp19vL_XT1kJZ-krOm00i915Eg@mail.gmail.com>
In-Reply-To: <CAPOFeyhp5YE+Y2nSUfEwGUHamp19vL_XT1kJZ-krOm00i915Eg@mail.gmail.com>
From: Ryan Hamilton <ryan@optimism.cc>
Date: Sat, 01 Feb 2020 08:15:04 -0800
Message-ID: <CAKDhxQocLR9sotSRWFtM7Kup4zXk2dTP-bxehoYjxuJHFtXuRA@mail.gmail.com>
Subject: Re: [HTTP/3]Sending reserved frame before SETTINGS
To: Renjie Tang <renjietang=40google.com@dmarc.ietf.org>
Cc: quic@ietf.org
Content-Type: multipart/alternative; boundary="000000000000d75c23059d85fee0"
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/JMnQPaKsP0-y4w5lFPzozx0dFc4>
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: Sat, 01 Feb 2020 16:25:04 -0000

Wow, interesting question!

6.2.1 requires the SETTINGS frame to be first on the control frame:

   If the first frame of the control stream is any other frame
   type, this MUST be treated as a connection error of type
   H3_MISSING_SETTINGS.


Whereas 7.2.9 says reserved frames have no semantic meaning:

   Frame types of the format "0x1f * N + 0x21" for integer values of N
   are reserved to exercise the requirement that unknown types be
   ignored (Section 9
<https://tools.ietf.org/html/draft-ietf-quic-http-25#section-9>).
These frames have no semantics, and can be sent
   on any open stream when application-layer padding is desired.


This sounds like a conflict since something that has no semantics seems
like it should not cause errors! However, looking Section 9 I think we find
the resolution:

   Implementations MUST ignore unknown or unsupported values in all
   extensible protocol elements.  Implementations MUST discard frames
   and unidirectional streams that have unknown or unsupported types.
   This means that any of these extension points can be safely used by
   extensions without prior arrangement or negotiation.  However, where
   a known frame type is required to be in a specific location, such as
   the SETTINGS frame as the first frame of the control stream (see
   Section 6.2.1
<https://tools.ietf.org/html/draft-ietf-quic-http-25#section-6.2.1>),
an unknown frame type does not satisfy that
   requirement and SHOULD be treated as an error.


So it seems that it's illegal to send a GREASED frame before the
SETTINGS frame. Does that sound right to you?


Cheers,


Ryan


On Fri, Jan 31, 2020 at 11:10 PM Renjie Tang <renjietang=
40google.com@dmarc.ietf.org> wrote:

> Hi all,
>
> When I was implementing greasing for HTTP/3 frames, I came across a
> potential confusion.
>
> Presumably, if a non-reserved unknown frame is received before SETTINGS on
> a control stream, the connection should be closed.
>
> But if a reserved frame is received before SETTINGS frame on a control
> stream, does it count as an error and close the connection? Or should
> it simply be ignored because it has no semantic meaning?
>
> Thanks!
> Renjie
>