Transport Draft Comments, mostly about error handling

Martin Duke <martin.h.duke@gmail.com> Fri, 18 August 2017 18:37 UTC

Return-Path: <martin.h.duke@gmail.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 0BF551321A1 for <quic@ietfa.amsl.com>; Fri, 18 Aug 2017 11:37:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 xGfM_m4Eqod7 for <quic@ietfa.amsl.com>; Fri, 18 Aug 2017 11:37:52 -0700 (PDT)
Received: from mail-wr0-x22b.google.com (mail-wr0-x22b.google.com [IPv6:2a00:1450:400c:c0c::22b]) (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 115B4132198 for <quic@ietf.org>; Fri, 18 Aug 2017 11:37:52 -0700 (PDT)
Received: by mail-wr0-x22b.google.com with SMTP id y96so70480529wrc.1 for <quic@ietf.org>; Fri, 18 Aug 2017 11:37:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=uDIjg+oxqCSCzxb5OKVwo1lb295u99LmUW2n6jJLjVU=; b=HfF8C8tiUJDN7Q0w5ANbYuw18sRWN3wQ9mojwvXdGEVd7mA2QGKveiUyugY4LIRkqK tUOqGvVFQBmRDDELjDWidiCPVTDEe+GdPP/r2xPbixDChPdGqV7D13kgznWlrScKTcA5 H13P+WC2sJJPJSey74lGVTS27zEG87T7YbQd6p99xQO3+v/+T+z3RLw07I57RrPY+jXP p6ypfJZLFd3RUWGtwihduU0Vp+LTGSgU5+7P64IJFDOd1zso1vYAeNQ/tUSqhOTR/jo9 4+jN5CElVgXoL8hmLuSbX6eFPfO7UeV2m0Xs8BYUreRuSMi4oTTPzpEWndhgP4e6qIMw 7q5Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=uDIjg+oxqCSCzxb5OKVwo1lb295u99LmUW2n6jJLjVU=; b=XyOe5KStdBlIzkSADkNAHbUEjmr/K50BmRl2yR3lUwi0/CoyM00+IEOGpQhjkWwf8W L72B+H1ITJdJ89jdo1EYu6XIjY3FGrSeWNaLQV0PxhxyhSDuK2DIx7dtTIobKaRnqqTk Fru50wt4CNxtC8D/PzzsSdkMRqGQICeeAwh2h1wGZVYMITjCq0gmIEjFzLJHYziSlwDm DxvwJjLh7itDHW+JjOVJQH8odCyEShbLM5HYXvy5+xjSHXvBoTUjKHQDtrjtmMOLveSo tSEdegOp0kPwZ7cWA+6+TVIt1BGfqd4FvVslWT8nCN4yat9+De1Vo9ifXuiO36anWi7f pG2w==
X-Gm-Message-State: AHYfb5h+sj2VAHUXztkTH+lyeLmd50H5C0VQk2shjiH7ICItvDwkBbUo 7ohY3HxmHpRu4Pu5YaQrSKZdE44ZZfk/
X-Received: by 10.223.133.201 with SMTP id 9mr7201883wru.177.1503081470205; Fri, 18 Aug 2017 11:37:50 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.223.139.17 with HTTP; Fri, 18 Aug 2017 11:37:49 -0700 (PDT)
From: Martin Duke <martin.h.duke@gmail.com>
Date: Fri, 18 Aug 2017 11:37:49 -0700
Message-ID: <CAM4esxSRoeXRcKwS5CCWpUC-MrrSWrDM6VXJ0584Meon_ZfDrg@mail.gmail.com>
Subject: Transport Draft Comments, mostly about error handling
To: IETF QUIC WG <quic@ietf.org>
Content-Type: multipart/alternative; boundary="001a1149221e19a41405570b6d52"
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/UlGRC1fUc4_Y-23MwoiZYtYJo-o>
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: Fri, 18 Aug 2017 18:37:54 -0000

I'm deep into implementing the handler for a stream frame straight from the
-05 spec, and there seem to be a lot of ambiguities in the errors, as well
as things that should probably be prohibited:

(1) Section 8.14. Stream Frames for Stream 1 and above MUST NOT be in
Cleartext packets of any kind.

(2) Section 12.2 Stream Errors: We need to have some sort of special
considerations for handshake, especially cleartext packets. In particular,
any sort of cleartext packet that triggers an error should be dropped
rather than causing RST_STREAM or CONNECTION_CLOSE. Otherwise it is
trivially easy for a man-on-the-side to abort connections.

I believe, by the same logic, that bad 0RTT packets should simply be
dropped rather than reset.

As I see it, there are two possible responses to problems processing the
stream frame, each appropriate to different situations:
  - Internal error that doesn't break the stream (e.g. failure to allocate
memory for the stream reassembly queue element): drop the packet -- make
the peer retransmit and hope it works next time. Also do this for errors in
cleartext.
  - a stream error that still allows the receiver to find the end of the
frame (e.g. STREAM_STATE_ERROR). Send a RST_STREAM for that stream,but keep
processing the packet.

If this analysis is correct, it would be nice to specify it in the draft
explicity.

(4) Section 12. Error Handling: If a peer initiates an odd stream when it's
supposed to be even, or vice versa, what kind of error is that? Is it a
stream error or connection error?

(5) Section 12.3 Error Codes: For a Frame Error on a STREAM or ACK frame,
is the last two bytes of the error code the whole flags byte of the packet,
or just the mask (0xa0, 0xb0) of the frame type?

If I am not way off base on some or all of these points, I am happy to
create issues or PRs.

Martin Duke