Re: AD Evaluation: draft-ietf-6man-predictable-fragment-id

Fernando Gont <fgont@si6networks.com> Tue, 25 August 2015 14:34 UTC

Return-Path: <fgont@si6networks.com>
X-Original-To: ipv6@ietfa.amsl.com
Delivered-To: ipv6@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2C2CD1B2CC5; Tue, 25 Aug 2015 07:34:38 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.502
X-Spam-Level:
X-Spam-Status: No, score=-0.502 tagged_above=-999 required=5 tests=[BAYES_05=-0.5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham
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 PWpxE7M4RWEW; Tue, 25 Aug 2015 07:34:36 -0700 (PDT)
Received: from web01.jbserver.net (web01.jbserver.net [37.72.100.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 0FC2D1B2A55; Tue, 25 Aug 2015 07:34:34 -0700 (PDT)
Received: from [186.137.82.224] (helo=[192.168.3.107]) by web01.jbserver.net with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.85) (envelope-from <fgont@si6networks.com>) id 1ZUFHt-0000DZ-Tg; Tue, 25 Aug 2015 16:33:23 +0200
Message-ID: <55DC7CA4.2060502@si6networks.com>
Date: Tue, 25 Aug 2015 11:33:08 -0300
From: Fernando Gont <fgont@si6networks.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0
MIME-Version: 1.0
To: Brian Haberman <brian@innovationslab.net>, draft-ietf-6man-predictable-fragment-id@ietf.org, "ipv6@ietf.org" <ipv6@ietf.org>
Subject: Re: AD Evaluation: draft-ietf-6man-predictable-fragment-id
References: <55D76AFD.2070000@innovationslab.net> <55D7D577.3010301@si6networks.com> <55DB0B87.5030200@innovationslab.net> <55DB1172.9030901@si6networks.com> <55DB155C.5020500@innovationslab.net> <55DB1DBF.5060909@si6networks.com> <55DB225E.9070907@innovationslab.net>
In-Reply-To: <55DB225E.9070907@innovationslab.net>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Archived-At: <http://mailarchive.ietf.org/arch/msg/ipv6/cFRBQW8SXxEAHFPju0xIqZ1VaDw>
X-BeenThere: ipv6@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "IPv6 Maintenance Working Group \(6man\)" <ipv6.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ipv6>, <mailto:ipv6-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ipv6/>
List-Post: <mailto:ipv6@ietf.org>
List-Help: <mailto:ipv6-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ipv6>, <mailto:ipv6-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 25 Aug 2015 14:34:38 -0000

Hi, Brian,

On 08/24/2015 10:55 AM, Brian Haberman wrote:
>>> As I noted in my last comment, it seems like the Fragment ID is
>>> re-generated any time a Fragment Header is needed.  Is there any reason
>>> why secret1 couldn't/shouldn't be changed each time a Fragment Header is
>>> needed?
>>
>> Frag ID is generated ("Identification" recomputed) for each fragmented
>> packet. for any given (src, dst), F() will be constant.
>>
>> So the idea is that F() provides a radom number/offset, which will
>> remain constant for each pair (src, dst). Since "counter" is a "line",
>> "Identification" is esentially:
> 
> As with secret1, where does it say that counter[] is a line?

I will clarify this in the next rev.


> Wouldn't
> it make more sense to initialize counter[] to random values?  That makes
> things even less guessable.

mmm..not really, since the randomness really comes from F(). But it
wouldn't hurt, either.


>> ID = m x + b = counter + F()
>>
>> i.e. a line with a random offeset.
>>
> 
> I think there is a lot of missing explanatory text.  The above argues
> that secret2 is also constant given your above statement.  And your
> statement about counter[] being a "line" is no where in the draft.  When
> I look at this:
> 
> ID = F(Src IP, Dst IP, secret1) + counter[G(src IP, Dst Pref, secret2)]
> 
> I can see a number of ways that an implementation could completely
> randomize the ID selected so that no one could guess it.  For example,
> secret1 or secret2 (or both) could be randomized (e.g., TOD).

I will clarify this. And also note that this algorithm is designed after
RFC1948.



>> The reason for using this algorithm is that it results in a sequence
>> that is not predictable by an off-path attacker. However, since
>> sbsequent identifications are simply monotonically-increasing numbers
>> (as a result of counter), the frag id collision rate will be wayyyy
>> lower than that of simply randmizing the IDs (the collission rate is the
>> same as that of a global counter).
> 
> Various research papers have talked about the number of packets
> typically involved in a "flow" between a single pair of devices.  The
> math would indicate that randomizing the Fragment ID selection across a
> 32-bit space given the number of packets in a flow provides a very low
> probability of collision.

Given the considerations regarding translators, such math should be done
for 16-bit long Frag IDs, rather than 32-bit long Frag IDs (otherwise
you could get a much worse IPv4 frag id when you're dealing with
translators). Besides, while talking with Linux developers at the time,
a completely random() Frag ID wasn't sensible for them. And IIRC, the
same applies to OpenBSD.



> The destination clearly does not need to be able to guess what the next
> Fragment ID would be, so there is no functional reason for the IDs to be
> sequential.

The only reason for the Frag IDs being sequential is that such approach
minimizes the frag id reuse frequency.



> My suggestion would be to state the assumptions you are making (e.g.,
> secretX is constant, counter[] is a line), why you are making those
> assumptions (e.g., ease of implementation), and the performance
> tradeoffs you are making.

Will do.

Thanks so much!

Best regards,
-- 
Fernando Gont
SI6 Networks
e-mail: fgont@si6networks.com
PGP Fingerprint: 6666 31C6 D484 63B2 8FB1 E3C4 AE25 0D55 1D4E 7492