[Ndn-interest] [EXT] Custom TLV vs library

Varun Patil varunpatil at ucla.edu
Thu Jan 21 02:06:09 PST 2021


Hi Junxiao,

Even if it's an unordered_map<string, int>, you still need to write a
> schema.
> The schema would answer questions like:
>
>    - Is the string a byte string (major type 2) or a text string (major
>    type 3)?
>    - Is it allowable to encode the integer as bignum format?
>
> Ah, I see what you mean.

If you are referring to the version vector
> <https://github.com/JonnyKong/Sync-MANET/blob/388d41f5e5b2626f9d82a06ad7d41c97e490ba5a/svs_helper.hpp#L12-L29>
> :
>
>    - It's more than an unordered_map<string, int>. There are three items
>    in each tuple.
>
> Oh my implementation doesn't have the preference flag yet.

>
>    - It should not be "unordered" because allowing arbitrary order would
>    cause different network nodes to encode this component differently,
>    reducing the effectiveness of Interest aggregation.
>
> Good point. Thanks for pointing this out.

>
>    - If the string is actually a name, you should use its NDN-TLV
>    encoding, not the URI format. Canonical URI is standardized but less
>    compact. Alternate URI is implementation dependent - PSync made the mistake
>    of using alternate URI, so it's not portable.
>
> Yup, not using URIs anywhere.


> Version vector encoded in NDN-TLV would be something like:
> VERSION-VECTOR = *VECTOR-VECTOR-ITEM
> ; items should be sorted by Name in NDN canonical order
>
> VERSION-VECTOR-ITEM = VERSION-VECTOR-ITEM-TYPE TLV-LENGTH
>                       Name
>                       SeqNum
>                       [IsImportant]
>
> SeqNum = SequenceNumNameComponent
>
> IsImportant = IS-IMPORTANT-TYPE
>               TLV-LENGTH ; zero
>
> VERSION-VECTOR-ITEM-TYPE = 0xFD.2F.C1
>
> IS-IMPORTANT-TYPE = 0xFD.2F.C3
>
> ; Name defined in NDN Packet Format v0.3
> ; SequenceNumNameComponent is defined in NDN Naming Conventions rev02
>
> Version vector encoded in CBOR would be something like:
> version-vector = {
>   *name => version-vector-value
> }
>
> name = bstr ; Name TLV-VALUE, as defined in NDN Packet Format
>
> version-vector-value = [
>   uint, ; sequence number
>   bool, ; is important
> ]
> Map item ordering should follow RFC8949 section 4.2, which differs from
> NDN canonical order.
> Also note that the name is encoded as TLV-VALUE only, because the
> "NAME-TYPE TLV-LENGTH" portion is redundant. As mentioned above, you should
> not use the URI format.
>

Thanks again! Going ahead with the NDN-TLV implementation.

Best,
Varun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndn-interest/attachments/20210121/42081068/attachment.html>


More information about the Ndn-interest mailing list