Re: [tsvwg] Comments on UDP Options -13

Tom Jones <tom@erg.abdn.ac.uk> Fri, 03 September 2021 09:51 UTC

Return-Path: <tom@erg.abdn.ac.uk>
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 E3DE23A16F7 for <tsvwg@ietfa.amsl.com>; Fri, 3 Sep 2021 02:51:24 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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 Za3A0q4SPsZm for <tsvwg@ietfa.amsl.com>; Fri, 3 Sep 2021 02:51:19 -0700 (PDT)
Received: from pegasus.erg.abdn.ac.uk (pegasus.erg.abdn.ac.uk [137.50.19.135]) by ietfa.amsl.com (Postfix) with ESMTP id 81B2A3A16F4 for <tsvwg@ietf.org>; Fri, 3 Sep 2021 02:51:19 -0700 (PDT)
Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com [66.111.4.228]) by pegasus.erg.abdn.ac.uk (Postfix) with ESMTPSA id 1465B1B00158; Fri, 3 Sep 2021 10:51:15 +0100 (BST)
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailauth.nyi.internal (Postfix) with ESMTP id 9BCB227C0054; Fri, 3 Sep 2021 05:51:14 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Fri, 03 Sep 2021 05:51:14 -0400
X-ME-Sender: <xms:EvAxYYLXGJ1dy-LIgykcN0pVEUBWqOcMUDvAuYlWat3KGfUEyqPDGA> <xme:EvAxYYKqAOW_WYXCUzY5PY_6AAsg_TU7MF5ABbR4yy8reKiYSEZZqV7ejV59X-iml GL63Xcf88GgMCqSRQ>
X-ME-Received: <xmr:EvAxYYu9sf3GHPtW5BQ6qsymIBfTfFvrSVbKlTpebexVBxuyrLEH0ui-IxGYU8FLTI8fsoQhqOub4sRrPG6qHTa9dTV4uBUlIA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddruddvjedgudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkfhggtggugfgjsehtke ertddttdejnecuhfhrohhmpefvohhmucflohhnvghsuceothhomhesvghrghdrrggsughn rdgrtgdruhhkqeenucggtffrrghtthgvrhhnpedvfeehleejgffhjeeuhfetkefftdegff eugedtfeffgfekvdelieektdejjeetueenucffohhmrghinhepihgvthhfrdhorhhgpdhs figrshgtrghnrdgtohhmpdgtvghrthdrohhrghenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehsohhmvgdomhgvshhmthhprghuthhhphgvrhhs ohhnrghlihhthidqgeehgeehtddujedtqdduheehgedvgeehkedqthhomheppegvrhhgrd grsggunhdrrggtrdhukhesfhgrshhtmhgrihhlrdgtohhm
X-ME-Proxy: <xmx:EvAxYVYCAECjGhQIjJst1X8iftgrVOVcfGGOzDSXwbQSJbH6N7wjgg> <xmx:EvAxYfYGpjkxSmLbvZieC6f_YaZCJcmrJJ_sTinJ4O1JGYr2Z3e2fw> <xmx:EvAxYRCXoPXcH450ToFJ8eNAujFeFw5n0CZ-bGH4Jb9z8nZACN2-dg> <xmx:EvAxYQDhBvu7JWOEkyMbCpfFs9NlrkQ7uzmHZaAyDgEqkTKKpWuttg>
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 Sep 2021 05:51:13 -0400 (EDT)
Date: Fri, 03 Sep 2021 10:55:44 +0100
From: Tom Jones <tom@erg.abdn.ac.uk>
To: "touch@strayalpha.com" <touch@strayalpha.com>
Cc: tsvwg@ietf.org
Message-ID: <20210903095544.GE54972@tom-desk.erg.abdn.ac.uk>
References: <20210902132237.GA52528@tom-desk.erg.abdn.ac.uk> <3E5102FA-C551-44F6-9E7B-6925DFF4A789@strayalpha.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <3E5102FA-C551-44F6-9E7B-6925DFF4A789@strayalpha.com>
Archived-At: <https://mailarchive.ietf.org/arch/msg/tsvwg/9ComzICikgbAUa0GRCYBABEhW6g>
Subject: Re: [tsvwg] Comments on UDP Options -13
X-BeenThere: tsvwg@ietf.org
X-Mailman-Version: 2.1.29
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: Fri, 03 Sep 2021 09:51:25 -0000

...snipped out where we agree...

> > --
> > 
> > 	This issue is discussed further in Section 17.
> > 	...
> > 	(with the exception of NOPs, which should never need to come in sequences of more than seven in a row)
> > 
> > The text from section 17 doesn't really add a lot, could a sentence be added
> > here too, I think it will help readers a lot.
> > 
> > This padding limit makes UDP Options DPLPMTUD a violation of UDP Options. This
> > seems a weird way to start out.
> > 
> > https://datatracker.ietf.org/doc/html/draft-fairhurst-tsvwg-udp-options-dplpmtud#section-3.2.1
> 
> Gorry can help us understand how that padding works. It could be just that the options end (at EOL), but the remaining zeros (which aren’t NOPs because they’re after EOL) are the padding intended.

Chalk this one up to me failing to page information back in. I think the
current implementation we have of dplpmtud with udp options works this way.

> 
> > -- 
> > 
> > 	>> The OCS MUST be included when the UDP checksum is nonzero and UDP
> > 	   options are present.
> > 
> > What happens when the checksum is non zero and the OCS is missing? The document
> > should be explicit here, maybe:
> > 
> > 	>> The OCS MUST be included when the UDP checksum is nonzero and UDP
> > 	   options are present. If the OCS option is not present and the UDP
> > 	   checksum is nonzero then the OCS calculation implicitly fails and
> > 	   all options MUST be ignored and the surplus area silently discarded.
> 
> This is the thread that Gorry and Mike just commented on today. I think we have a resolution that would update this text.

okay, I'll reply there if I think I need to

> > 
> > 	The OCS covers the UDP option area as formatted for transmission and
> > 	immediately upon reception.
> > 
> > I don't understand what the sentence is for. I understand that the inserting
> > the calculated OCS should be the final modification to the packet before
> > transmission, I don't see what 'immediately upon reception' is trying to say.
> 
> OCS check should be the first step of interpreting the option area at the receiver.
> 

I think there is a language issue between the OCS field (the bytes in
the packet) and the OCS check (the checksum calculation)

I see this too in section 7:

	 if the UDP checksum fails then
               silently drop (per RFC1122)
           if the UDP checksum passes then
               if OCS is present and fails then
                   deliver the UDP payload but ignore all other options
                   (this is required to emulate legacy behavior)
               if OCS is present and passes then
                   deliver the UDP payload after parsing
                   and processing the rest of the options,
                   regardless of whether each is supported or succeeds
                   (again, this is required to emulate legacy behavior)

I think these extra words should be added throughout the document in the
correct places (field and check), like so:

	 if the UDP checksum fails then
               silently drop (per RFC1122)
           if the UDP checksum passes then
               if OCS field is present and the OCS check fails then
                   deliver the UDP payload but ignore all other options
                   (this is required to emulate legacy behavior)
               if OCS field is present and the OCS check passes then
                   deliver the UDP payload after parsing
                   and processing the rest of the options,
                   regardless of whether each is supported or succeeds
                   (again, this is required to emulate legacy behavior)


> > --
> > 
> > 	UDP fragmentation relies on a fragment expiration timer, which can
> > 	be preset or could use a value computed using the UDP Timestamp
> > 	option.
> > 
> > I am not happy suggesting the use of the UDP Timestamp to control fragment
> > lifetime. I think this invites security based implementation issues.
> 
> Can you clarify? UDP isn’t a “secure” protocol per se. It seems reasonable for UDP reassembly to take into account UDP measurements of the RTT, the same way that TCP uses its timestamps for its time-dependent features.
> 

"Using the timestamp option" implies to me that the fragment lifetime
timer can be set by peer controlled data. I can immediately see an
implementer using a peer provided field for the timer and creating a DOS
situation an attacker can use to exhaust fragment space.

If timestamps are to be used for the fragment timer then a warning for
implementers should be included. I think we should highlight the sharp
edges.

> > --
> > 
> > 	   >> UDP fragments MUST NOT overlap.
> > 
> > I think you need to be explicit.
> > 
> > 	>> UDP fragments MUST NOT overlap. On receipt of an overlapping
> > 	   fragment, the fragment and all stored fragments matching the
> > 	   Identification MUST be dropped.
> 
> I favor copying the text from 8200 on this point:
>       o  If any of the fragments being reassembled overlap with any
>          other fragments being reassembled for the same packet,
>          reassembly of that packet must be abandoned and all the
>          fragments that have been received for that packet must be
>          discarded, and no ICMP error messages should be sent.
> 
>          It should be noted that fragments may be duplicated in the
>          network.  Instead of treating these exact duplicate fragments
>          as overlapping fragments, an implementation may choose to
>          detect this case and drop exact duplicate fragments while
>          keeping the other fragments belonging to the same packet.
> 

I like this text

> > --
> > 
> > 	Implementers are advised to limit the space available for UDP
> > 	reassembly.
> > ...
> > 	>> UDP reassembly space SHOULD be limited to reduce the impact of
> > 	DOS attacks on resource use.
> > 
> > The first of these feels redundant. 
> > 
> > I think you should note for implementers. The use of many small fragments,
> > specifically ordered has been used in fragmentation and tcp segmentation
> > attacks in the past to create DOS by increasing processing cost of fragments.
> > 
> > Care should be taken when designing reassembly algorithms and selecting data
> > structures. see:
> > 	https://www.swascan.com/segmentsmack/
> 
> I would prefer a stable reference if one were available.

I was sure there was a paper, but all I can turn up are CVEs

https://www.kb.cert.org/vuls/id/962459



> > --
> > 
> > I think section 5.5 would benefit from a diagram.
> 
> Can you let me know what you’re thinking would help? I.e., do you want to see before/after frag?
> 

I think before and after fragmentation, I am struggling to understand how
options fit in around the fragments from just reading the text.

> > --
> > 
> > Could you suggest some application uses of the TSval and TSecr options? 
> > 
> > It is clear to me how my timestamp (and its reflection) are useful to me for
> > calculating RTT, but that doesn't require the TSval be forward to the
> > application.
> 
> You can always look at the smallest value you get reflected back; the difference between that and your current time is RTT.
> 
> > It is clear not how my peers timestamp is useful at all. I would prefer that
> > the peers timestamp be treated as a monotonically increasing token.
> 
> The peer’s TS is needed because it’s what you return to help them compute RTT.
> 
> > I guess that the values could be used to detect reordering, is this the
> > intention of passing the values to the application?
> 
> Also to let them do things like compute RTT max, RTT std dev, etc.
> 

Okay, I understand. Our implementation only uses options for connected
UDP sockets and so state is stored in the kernel. If you allow
unconnected UDP then his state has to exist in the application.

- Tom