Differentiate between GQUIC and QUIC packets

Dmitri Tikhonov <dtikhonov@litespeedtech.com> Tue, 01 August 2017 03:25 UTC

Return-Path: <dtikhonov@litespeedtech.com>
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 2CFF0127ABE for <quic@ietfa.amsl.com>; Mon, 31 Jul 2017 20:25:14 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.89
X-Spam-Level:
X-Spam-Status: No, score=-1.89 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, T_SPF_PERMERROR=0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=litespeedtech-com.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 FyUaeFoVZPFd for <quic@ietfa.amsl.com>; Mon, 31 Jul 2017 20:25:12 -0700 (PDT)
Received: from mail-qt0-x22c.google.com (mail-qt0-x22c.google.com [IPv6:2607:f8b0:400d:c0d::22c]) (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 AF320131CE3 for <quic@ietf.org>; Mon, 31 Jul 2017 20:25:12 -0700 (PDT)
Received: by mail-qt0-x22c.google.com with SMTP id p3so2363778qtg.2 for <quic@ietf.org>; Mon, 31 Jul 2017 20:25:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=litespeedtech-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=as4kom+tWH6igHeA5AE4SxrxQRq8bwIKN+OHCP5z12s=; b=nvu7yztofyRTYLvNFcJZqRSzUgKMviFeVCmJnGzvd/Q2dEX7YlGxzx5pROC8bESRaP tUplVdIzY3xXE2tE4RdHry6vnLl4YEl06yCiF3vuchXOVXyY+s+eKnFMrnUIklm9bmUJ SALd/3BhVu/4H/TgviwOMTIF1CbHh++t0mAl07mHimCk4D8GLBtp1ltVRDJcMy+lXNHI /tYAv2PZQW6/2Lj/XLiZoojoR3Fktipf5t+fXphrN8LTW58FK3+yjfw73E34CsDZn16I WWhaPoKIK2zl7jlPY+Ep024Pd4TqXCLCvo+96/OvSh5YuMs1RGfvVlsBfXErfj4hyLNd JGWw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=as4kom+tWH6igHeA5AE4SxrxQRq8bwIKN+OHCP5z12s=; b=EBW4G7stK8zZAOMKIhRqy7Aq9rp4yAnLFS+JQ9ncPvTXEkSb2t+I4i0oelyyiN+a1D HDkJe8fLF11R3GsGx4vBCT6Mqnzjf1lqam4OP+oQs8BuAJq2uJr6n0VxrlVGjl5KgNCe lTt4dNVslOZcKE4ItumeY5K0ihUg7k1kAq3CpO92WP8YsYhChQ+eHJK3PNf++YEOjYhH Jaenn08upvdsLG1t3UcgCkOtIBRB83luQxfg4VryVvWtWoYPDm445u8UF+UgnmGG2bsh 8ITA4TZ2fDKAFug890pF/ylnLnRH4gcSo9tLZdI8+hleCdmgcax2Rx4kqqjxvHBO08Ux KWTg==
X-Gm-Message-State: AIVw1133rysRm9F370bPxKyewhVAj5DUXgKM7WMciO2rQy6RDujEB+Ny t3l6g7yMo21Fmf6xZIA=
X-Received: by 10.237.60.57 with SMTP id t54mr26596938qte.281.1501557911594; Mon, 31 Jul 2017 20:25:11 -0700 (PDT)
Received: from ubuntu-dmitri (ool-45715890.dyn.optonline.net. [69.113.88.144]) by smtp.gmail.com with ESMTPSA id 94sm17164267qte.55.2017.07.31.20.25.09 for <quic@ietf.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Jul 2017 20:25:10 -0700 (PDT)
Date: Mon, 31 Jul 2017 23:25:02 -0400
From: Dmitri Tikhonov <dtikhonov@litespeedtech.com>
To: quic@ietf.org
Subject: Differentiate between GQUIC and QUIC packets
Message-ID: <20170801032502.GA28788@ubuntu-dmitri>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.24 (2015-08-30)
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/rQxPrkRmWV7yjwwEImp8pJ9kUk4>
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: Tue, 01 Aug 2017 03:25:14 -0000

Hello,

I wonder whether supporting both GQUIC and QUIC on the same host and
port has been discussed.  I searched on GitHub and this mailing list,
but could not find anything.

Suppose an implementation wants to serve both GQUIC and QUIC.  How is
it to differentiate between GQUIC and QUIC packets?  There are two
cases to consider:

1) GQUIC vs QUIC long-header format packet

    This is straightforward: the first byte in GQUIC must be zero,
    whereas in QUIC's long-header format packet it is set to one.

2) GQUIC vs QUIC short-header format packet

    Now it gets more involved.  From [draft-ietf-quic-transport]:

 "  0                   1                   2                   3
 "  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 " +-+-+-+-+-+-+-+-+
 " |0|C|K| Type (5)|
 " +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 " |                                                               |
 " +                     [Connection ID (64)]                      +
 " |                                                               |
 " +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 " |                      Packet Number (8/16/32)                ...
 " +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 " |                     Protected Payload (*)                   ...
 " +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 "
 "                     Figure 2: Short Header Format

	and

 " The packet type in a short header currently determines only the size
 " of the packet number field.  Additional types can be used to signal
 " the presence of other fields.
 "
 "                     +------+--------------------+
 "                     | Type | Packet Number Size |
 "                     +------+--------------------+
 "                     | 0x01 | 1 octet            |
 "                     |      |                    |
 "                     | 0x02 | 2 octets           |
 "                     |      |                    |
 "                     | 0x03 | 4 octets           |
 "                     +------+--------------------+
 "
 "                  Table 2: Short Header Packet Types

GQUIC's interpretation of the first byte is:

  0x80  unused, must be set to 0
  0x40  reserved for multipath use
  0x30  packet number size
  0x08  connection ID
  0x04  diversification nonce
  0x02  public reset
  0x01  version

Here is an ambguity:

  First     QUIC                    GQUIC
  byte      meaning                 meaning

  0x01      No connection ID,       No connection ID,
            1-byte packet           1-byte packet number,
            number.                 version bit set.

(A variation: OR 0x20 for Key Phrase Bit / 4-byte packet number
confusion).

One could use logic like this: "it does not make sense for a packet
to have a version bit set and not have a connection ID: therefore,
it must not be GQUIC."  Is this the recommended approach?  Note that
the ambiguities may get worse if QUIC decides to start using bits 0x1B
for its short-header format first byte.

  - Dmitri.