Re: [tsvwg] Regarding DTLS and UDP options

Joe Touch <touch@isi.edu> Tue, 18 April 2017 17:07 UTC

Return-Path: <touch@isi.edu>
X-Original-To: tsvwg@ietfa.amsl.com
Delivered-To: tsvwg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 33F0712706D for <tsvwg@ietfa.amsl.com>; Tue, 18 Apr 2017 10:07:08 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.901
X-Spam-Level:
X-Spam-Status: No, score=-6.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-0.001] autolearn=ham autolearn_force=no
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 tf4GTh-FoGAm for <tsvwg@ietfa.amsl.com>; Tue, 18 Apr 2017 10:07:06 -0700 (PDT)
Received: from vapor.isi.edu (vapor.isi.edu [128.9.64.64]) (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 A5388128BB6 for <tsvwg@ietf.org>; Tue, 18 Apr 2017 10:07:06 -0700 (PDT)
Received: from [128.9.160.211] (mul.isi.edu [128.9.160.211]) (authenticated bits=0) by vapor.isi.edu (8.13.8/8.13.8) with ESMTP id v3IH65RA023251 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 18 Apr 2017 10:06:06 -0700 (PDT)
To: Tom Herbert <tom@herbertland.com>, "gorry@erg.abdn.ac.uk" <gorry@erg.abdn.ac.uk>
References: <CACL_3VFeJs7KzG9Bchh15bfZ3CmaOPWcfisEreNoGYK5CsEJ+g@mail.gmail.com> <CACL_3VFkr3mGe-yTbvHrTZcKVCpEv3FeSOyoShUxCK5+9Tdqqg@mail.gmail.com> <c79fe3d0-8567-ea7d-72fc-bd33732df60e@isi.edu> <CACL_3VHmoCSo23OWqQFq7upw749CqMK7iazXrBKZARzwbzY5mw@mail.gmail.com> <f97f08d4-0070-437a-e22a-8782497c76eb@isi.edu> <4e36af95-84c3-bc7e-b18a-614f8bfab662@isi.edu> <58F48403.8080302@erg.abdn.ac.uk> <a0f656e8-e847-db54-6046-2078364d428b@isi.edu> <CALx6S36HYHdbGoJHNb+mVY6reu9RLikLxDJqrPgwO9tF1EfSgQ@mail.gmail.com> <8b1829ba-4e8d-5ee1-e24c-f42962f47dde@isi.edu> <CALx6S36=7KbTtv9QNUBTg6gPYQQighsPD_+mWNc=wUQTX70VBQ@mail.gmail.com> <8378ae17-c023-25a2-76e7-07b858916849@isi.edu> <CALx6S35chiqMtqKa+zahfZnLZrQzfYUF7D9m0QGbkwFVpRwHag@mail.gmail.com> <bfc36611-6817-fbf9-a9c7-5bdde179b665@isi.edu> <CALx6S34qAh0mXGi8nuRtTiorf_1TE4V0NQ1QhqCcW0hmxOgc-Q@mail.gmail.com> <58F5C07C.4000707@erg.abdn.ac.uk> <CALx6S35N5WYvPHzTNo+trUecGgFPWv+xyXu4uampijc2w=DoSw@mail.gmail.com>
Cc: tsvwg <tsvwg@ietf.org>
From: Joe Touch <touch@isi.edu>
Message-ID: <cf24acdf-002c-f6ed-de20-d1193ea229a3@isi.edu>
Date: Tue, 18 Apr 2017 10:06:05 -0700
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <CALx6S35N5WYvPHzTNo+trUecGgFPWv+xyXu4uampijc2w=DoSw@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
X-ISI-4-43-8-MailScanner: Found to be clean
X-MailScanner-From: touch@isi.edu
Archived-At: <https://mailarchive.ietf.org/arch/msg/tsvwg/1BRL-cMAnMM7SldVYbldITjyzNg>
Subject: Re: [tsvwg] Regarding DTLS and UDP options
X-BeenThere: tsvwg@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Transport Area Working Group <tsvwg.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tsvwg>, <mailto:tsvwg-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tsvwg/>
List-Post: <mailto:tsvwg@ietf.org>
List-Help: <mailto:tsvwg-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tsvwg>, <mailto:tsvwg-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 18 Apr 2017 17:07:08 -0000

Tom,


On 4/18/2017 9:37 AM, Tom Herbert wrote:
> ...
> Gorry,
>
> UDP is a connectionless and unreliable protocol, so if the stack were
> to on its own accord add an MSS to a packet how and no response was
> seen how would it know the difference between a one way communication
> and the packet was dropped because some intermediate device enforces
> IP len == UDP len?
IP len is the whole packet; UDP len is the length of the UDP segment,
typically the IPlen - IPhdrsize.

RFC768 permits UDP len to be smaller than IPlen - IPhdrsize, so the
first point is that such an intermediate device isn't "enforcing"
anything other than its own peculiar idea of what it expects, rather
than what the protocol allows. It's no different than a device that
drops  TCP segments with unknown options - both are bugs.

UDP has a large number of ways of silently failing, including this.
Others include sending packets too large for the PMTU with DF=1 (or just
using IPv6) or sending to the wrong port - where ICMPs might not be
received in response. (note that there's no ICMP that justifies the
intermediate device "enforcing" the length match either).

Applications already account for this behavior by trying variations when
communication fails - that includes resending, changing packet sizes,
and (in this case) changing which options are used.
> My concern with retrofitting UDP is that I don't think it can be done
> so that all ambiguities are eliminated and hence it will never be
> completely robust. 
I see that as a thread in your responses.

The logical conclusion is that we all should use IPv4, TCP with no
options, and UDP. Oh, and no new services - ever.

Because *any* new capability, even within the bounds of existing
extensions, can be deemed "incompletely robust" if you accept
intermediate devices that block such valid services as legitimate.

So if that's your conclusion, can we also conclude that you're also
withdrawing your proposal in NVO3 for GUE and releasing port 6080?

> For instance, in TCP any part of the TCP header
> after the first twenty bytes must be TCP options-- there is no other
> possible interpretation of these bits allowed by the protocol. But,
> correct interpretation of UDP options in the surplus space is
> inherently probabilistic. 
That's true for all new uses of any existing values - even GUE's use of
port 6080 is inherently probabilistic because you don't know that
someone isn't now squatting on that port for a different service (or
won't in the future).

> Even if we put in checksums and magic
> numbers and get the probability of misinterpretation very low it will
> not be zero. If some existing device happens to be adding random bits
> beyond the UDP header (as the draft points out it was never a
> requirement that lengths need to match) and this is subsequently
> misinterpreted as UDP options causing insidious effects, even if this
> happens just once, it is a problem with the protocol not the
> implementation.
There are no currently defined uses for that space, even though it is
not prohibited. The issues you have here apply to any use of any
undefined field, e.g., any reserved bits, new options, etc. There's
always the risk of a squatter using the space other than as specified by
a protocol.

For that matter, you have exactly the same risk if a user decides to
issue IP packets with protocol 17 and happens to not use the UDP format.
Ultimately, protocols either follow specs or they do not. The UDP spec
*allows* for use of this space *but does not define that use*. All
current uses are identical to squatting, just like any other code space.

Any new assignment or definition of that space runs the risk of running
into squatters who use that value in other ways.

> I think ambiguity is manageable if it is only the communicating hosts
> that process the options and the use of options is expressly enabled
> for both transmit and receive. 
That's already noted in the doc in Section 10.

> If some intermediate device wereto
> start parsing and possibly modifying options on its own accord this
> would be exceedingly dangerous in my opinion. Such a problem would
> potentially be a nightmare to debug in real networks since we don't
> even have tools that can would analyze trailers. Fortunately, trailers
> are unlikely to be considered by intermediate devices so this problem
> is unlikely today. Nevertheless, I think the draft should say up from
> that intermediate devices MUST NOT process, examine, or modify UDP
> options.
Everything you say about modifying UDP options is true for UDP headers,
TCP headers, and TCP options too, but we already have devices that
process, examine, and modify them.

As long as we understand that these are headers for UDP - not for other
protocols, e.g., IP - we know who should and should not be modifying
them already and the associated risks.

As to the issue of tools - we don't have tools to analyze port 6080
either. Again, your argument there would prevent any new feature from
being deployed.

> A related concern I have is around security and whether ambiguity can
> be exploited. For instance, someone could easily forge a UDP fragment
> using the UDP option. If a device supports UDP options they will
> interpret this as fragment, if they don't they will see this as plain
> UDP packet. This are very different interpretations of the same bits
> however both devices could claim protocol conformance-- that's a
> potential problem. This becomes a real problem if the ambiguity can be
> somehow exploited to bypass security.
UDP packets and TCP packets can already be forged.

If that's your concern, you need to use true transport-layer or network
layer security.

And endpoints can claim conformance all they want; forged packets are
already noncompliant. No protocol is robust to forged packets except
those that support authentication or encryption.

> The draft should probably include some more consideration for use with
> NAT. For instance:
>
> "A host SHOULD indicate FRAG support by transmitting an unfragmented
> datagram using the Fragmentation option"
>
> If the host lives behind a NAT this would effectively indicate support
> for FRAG for all the hosts sitting behind the NAT. I doubt that's the
> intent! FRAG should probably be based on UDP 4-tuple, but even packets
> on that flow might not always be going to the same host (an IP anycast
> destination for example).
Section 10 already addresses this - the assumption is that discovery is
done on a socketpair basis. I can mention socketpair as the assumed
level of soft-state sharing earlier in that section if useful.

> Also, the draft should mention multicast and whether or not UDP
> options are allowed with that.

Yes, that's a good point and I'll add that in the next rev.

Joe