Subject: Re: [dtn-interest] Re(2): [dtn-dev] discussion draft
From: Scott Burleigh <[email-masked]>
To: dtn interest <[email-masked]>
Date: Fri, 30 Mar 2007 14:18:24 -0700
List-Id: Delay Tolerant Networking Interest List <dtn-interest.mailman.dtnrg.org>

Wesley Eddy wrote:
> On Fri, Mar 30, 2007 at 04:34:09PM -0400, Peter Lovell wrote:
>   
>> SDNVs themselves are limited to 64 bits for reliable operation
>>     
> Did you mean "SDNVs" or "the values within SDNVs"?  I think it should be
> the values within them, which means the encoded SDNVs would be limited
> to 9 bytes.  This is how I've capped them in our code when bignum
> support isn't available or expected to be needed.
You're right, Wes, it's the values that are limited.  Section 3.1 of the 
BP spec says"Implementations of the Bundle Protocol may handle as an 
invalid numeric value any SDNV that encodes an integer that is larger 
than (2^64 -- 1)."

Where not otherwise limited, as by this clause in the BP spec, an SDNV 
can in theory contain any non-negative integer value whatsoever.

[Practically speaking, your 9-byte limit is fine.  Technically, though, 
the limit in the BP spec means "any number that can be encoded in 64 
bits", and in order to encode a 64-bit integer in an SDNV I think you 
actually need 10 bytes.  You can put up to 7 significant bits in each 
octet, which means you can get a 63-bit integer into (63 / 7) = 9 
octets, but for a 64-bit integer you need the low-order bit of one 
additional octet.]

Scott