Re: [quicwg/base-drafts] QUIC header format/demultiplexing (#426)
Colin Perkins <notifications@github.com> Thu, 07 December 2017 22:24 UTC
Return-Path: <bounces+848413-a050-quic-issues=ietf.org@sgmail.github.com>
X-Original-To: quic-issues@ietfa.amsl.com
Delivered-To: quic-issues@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4CC031294EC for <quic-issues@ietfa.amsl.com>; Thu, 7 Dec 2017 14:24:50 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.799
X-Spam-Level:
X-Spam-Status: No, score=-4.799 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H2=-2.8, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=github.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 W3qsJI3YwWiD for <quic-issues@ietfa.amsl.com>; Thu, 7 Dec 2017 14:24:48 -0800 (PST)
Received: from o5.sgmail.github.com (o5.sgmail.github.com [192.254.113.10]) (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 280DB12717E for <quic-issues@ietf.org>; Thu, 7 Dec 2017 14:24:48 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=github.com; h=from:reply-to:to:cc:in-reply-to:references:subject:mime-version:content-type:content-transfer-encoding:list-id:list-archive:list-post:list-unsubscribe; s=s20150108; bh=XAUwDaoaYNuqRxy+MrD0yqf44aE=; b=pgfPc6pTx3VVep15 jgEFcRTCoSuKTLvLySZmp61KpNKBfthdqFucg+1dtvhWgoFMqnXRje1QziQoVwc/ /1uqeoke1sOwqpYpADW3571SaaUq1FraED6UVeJl+f8VU3MUIrjtKiN0Rf4vt1tr Wdy+GLVZTff+MAzDUwBhhvAl9ZI=
Received: by filter0007p1iad2.sendgrid.net with SMTP id filter0007p1iad2-3086-5A29BFAF-4 2017-12-07 22:24:47.203719278 +0000 UTC
Received: from github-smtp2b-ext-cp1-prd.iad.github.net (github-smtp2b-ext-cp1-prd.iad.github.net [192.30.253.17]) by ismtpd0007p1iad1.sendgrid.net (SG) with ESMTP id kvOkxpmARiytg1lQrcXCJA for <quic-issues@ietf.org>; Thu, 07 Dec 2017 22:24:47.116 +0000 (UTC)
Date: Thu, 07 Dec 2017 22:24:47 +0000
From: Colin Perkins <notifications@github.com>
Reply-To: quicwg/base-drafts <reply+0166e4abddc9f9ca858e02088a508bdc52ae8119dcad314a92cf00000001164181ae92a169ce0d018204@reply.github.com>
To: quicwg/base-drafts <base-drafts@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Message-ID: <quicwg/base-drafts/issues/426/350113232@github.com>
In-Reply-To: <quicwg/base-drafts/issues/426@github.com>
References: <quicwg/base-drafts/issues/426@github.com>
Subject: Re: [quicwg/base-drafts] QUIC header format/demultiplexing (#426)
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="--==_mimepart_5a29bfaef3091_14ae3f9be8252f382218c5"; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Precedence: list
X-GitHub-Sender: csperkins
X-GitHub-Recipient: quic-issues
X-GitHub-Reason: subscribed
X-Auto-Response-Suppress: All
X-GitHub-Recipient-Address: quic-issues@ietf.org
X-SG-EID: l64QuQ2uJCcEyUykJbxN122A6QRmEpucztpreh3Pak3O4yKb5RM021ALLflL/vgqxzOJ6XiKCBSFU+ Ei2vkwfDmZcxoBMzY8/4CnpgnMf1AgyazsW1bx26x/5+VeXZhmZO2+Nf/HlfvxY9FJU8XhMcwO8IwC Tj6DDFdgJNf3wQq2o13jRP7rJk5HAyDGTz2IY5amr02Mg1/aZA73B7f/LnJULhXR+EAffZmip0k7TE g=
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic-issues/ZImxvHlb0PFm8sNIqGy5eKYlk5g>
X-BeenThere: quic-issues@ietf.org
X-Mailman-Version: 2.1.22
List-Id: Notification list for GitHub issues related to the QUIC WG <quic-issues.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic-issues>, <mailto:quic-issues-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic-issues/>
List-Post: <mailto:quic-issues@ietf.org>
List-Help: <mailto:quic-issues-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic-issues>, <mailto:quic-issues-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 07 Dec 2017 22:24:50 -0000
I was misreading the packet formats, which perhaps wasn't helping... But, to summarise, a STUN packet header is formatted as:
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 0| STUN Message Type | Message Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Magic Cookie = 0x2112A442 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| Transaction ID (96 bits) |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
This is straight-forward to demux with QUIC long header packets, since they have the initial bit set to 1 and STUN has it set to zero.
QUIC short header packets are:
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 | [Connection ID (64)] |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| [Connection ID (64)] |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |X X X X X X X X X X X X X X X X X X X X X X X X
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
I assume the common case is that the Connection ID is not present. If we define C=1 to mean that the Connection ID is not present, then the first two bits of the QUIC short header packet will be 01. This is straight-forward to demux from STUN, since those bits are 00 in STUN packets.
If the Connection ID is present, then the QUIC short header packet will have C=0 and so start with the first two bits equal to 00, which matches the first two bits of a STUN packet. We also see that the 64-bit QUIC Connection ID occupies the same space as the last 8 bits of the STUN Message Type, the 16-bit Message Length, the Magic Cookie, and the first 8-bits of the Transaction ID. To demultiplex such a QUIC packet from STUN, we need to either (1) use the STUN FINGERPRINT; (2) redefine the QUIC Connection ID to be 63-bit value that encoded into a 64 bits for both long- and short-header packets, with the encoding chosen so that one of the middle bits is set to avoid collisions with the STUN magic cookie when sent in short header packets; or (3) choose the QUIC short header type values to avoid conflicts with STUN message types (which is what #956 does). None of these are pleasant, but I tend to think (3) is best, since it also allows demux of WebRTC traffic.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/issues/426#issuecomment-350113232
- [quicwg/base-drafts] QUIC header format/demultipl… Lars Eggert
- Re: [quicwg/base-drafts] QUIC header format/demul… Martin Thomson
- Re: [quicwg/base-drafts] QUIC header format/demul… Colin Perkins
- Re: [quicwg/base-drafts] QUIC header format/demul… Colin Perkins
- Re: [quicwg/base-drafts] QUIC header format/demul… janaiyengar
- Re: [quicwg/base-drafts] QUIC header format/demul… Mark Nottingham
- Re: [quicwg/base-drafts] QUIC header format/demul… Mark Nottingham
- Re: [quicwg/base-drafts] QUIC header format/demul… janaiyengar
- Re: [quicwg/base-drafts] QUIC header format/demul… janaiyengar
- Re: [quicwg/base-drafts] QUIC header format/demul… ianswett
- Re: [quicwg/base-drafts] QUIC header format/demul… Martin Thomson
- Re: [quicwg/base-drafts] QUIC header format/demul… janaiyengar
- Re: [quicwg/base-drafts] QUIC header format/demul… Marten Seemann
- Re: [quicwg/base-drafts] QUIC header format/demul… ianswett
- Re: [quicwg/base-drafts] QUIC header format/demul… janaiyengar
- Re: [quicwg/base-drafts] QUIC header format/demul… janaiyengar
- Re: [quicwg/base-drafts] QUIC header format/demul… Colin Perkins
- Re: [quicwg/base-drafts] QUIC header format/demul… Martin Thomson
- Re: [quicwg/base-drafts] QUIC header format/demul… ianswett
- Re: [quicwg/base-drafts] QUIC header format/demul… janaiyengar
- Re: [quicwg/base-drafts] QUIC header format/demul… Colin Perkins
- Re: [quicwg/base-drafts] QUIC header format/demul… janaiyengar
- Re: [quicwg/base-drafts] QUIC header format/demul… Colin Perkins
- Re: [quicwg/base-drafts] QUIC header format/demul… janaiyengar
- Re: [quicwg/base-drafts] QUIC header format/demul… Roni Even
- Re: [quicwg/base-drafts] QUIC header format/demul… Colin Perkins
- Re: [quicwg/base-drafts] QUIC header format/demul… Marten Seemann
- Re: [quicwg/base-drafts] QUIC header format/demul… Colin Perkins
- Re: [quicwg/base-drafts] QUIC header format/demul… ianswett
- Re: [quicwg/base-drafts] QUIC header format/demul… Colin Perkins
- Re: [quicwg/base-drafts] QUIC header format/demul… janaiyengar
- Re: [quicwg/base-drafts] QUIC header format/demul… Martin Thomson
- Re: [quicwg/base-drafts] QUIC header format/demul… Martin Thomson