Subject: [Roll] sequence number increment and wrap

From: Michael Richardson <[email-masked]>
Date: Sun, 31 Jan 2010 21:03:12 -0500

Are there any security implications in the sequence number?

(I realize that the security architecture is not complete. 
I assume that there will be some kind of per-message authenticator (MAC)
How this is keyed is really the hard part of the architectured)

Typically, there is some concern if there is a replay of a lower
sequence number.  Such an event causes the network to return to some
earlier state.  The concern is that an attacker can record a previously
authenticated set of messages and then play them back, intentionally
causing such a time travel.  

One question is: is this a threat?

The usual defense against that is that the sequence number must be
monotonically increasing.   If a nodes has been out of communication for
a period of time, it may see a abrupt jump in sequence number, but
that's okay --- if the authentication checks out, it advances.

The problem is that we have an 8-bit field, and it isn't clear how much
it may advance --- advances of 254 for instance, look like going
backwards 1, and may be disallowed.

The text in -05 is:

   Sequence Number:  8-bit unsigned integer set by the DODAG root,
         incremented according to a policy provisioned at the DODAG
         root, and propagated with no change down the DODAG.  Each
         increment SHOULD have a value of 1 and may cause a wrap back to
         zero.

It is good that the text tells what the DODAG should do, but we need to
know what happens if there is an increment of more than 1, and how to
know when there is an increment of more than 1, when it is a wrap.

My first suggestion is that increments of up to 127 should be acceptable, as
can unambiguously be understood to be increments (with possible
wraps).  Further, any increment which does not cause a wrap can be
accepted as well.

What I think would decide this is to understand under what conditions
the sequence number can and should be incremented? 

- From my understanding, it's a DAG Iteration, and I think that this will
happen somewhat often --- not as often as once a second, but certainly
more often than once an hour.   

It is also my understanding that many DIO messages will be sent with the
same sequence number --- it is not incremented each time the DIO is
sent.

I therefore suggest renaming this field to "DIO Iteration Number".

- -- 
]       He who is tired of Weird Al is tired of life!           |  firewalls  [
]   Michael Richardson, Sandelman Software Works, Ottawa, ON    |net architect[
] [email-masked] http://www.sandelman.ottawa.on.ca/ |device driver[
   Kyoto Plus: watch the video <http://www.youtube.com/watch?v=kzx1ycLXQSE>
	               then sign the petition.