Project

General

Profile

Feature #4527

Decode v0.3 Interest format and interpret as v0.2

Added by Junxiao Shi over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Base
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
4.50 h

Description

NDN Packet Format v0.3 is introducing a new Interest packet format.
Compared to v0.2.1 packet format, the differences are:

  • Optional CanBePrefix and MustBeFresh elements are added after Name.
  • Nonce becomes optional.
  • ForwardingHint is moved before Nonce and InterestLifetime.
  • Optional HopLimit and Parameters elements are added after InterestLifetime.

This issue changes ndn::Interest class to recognize v0.3 format, and interpret it as v0.2 semantics.
Encoder continues to emit v0.2 format, and remains unchanged under this issue.
As part of Packet03Transition, this is an interim step for a forwarder or application to receive Interest v0.3 without any changes.


Related issues

Blocked by NDN Specifications - Feature #4441: Replace MinSuffixComponents and MaxSuffixComponents with CanBePrefix flagClosed

Blocks NFD - Task #4564: Release 0.6.2Closed2018-05-04

History

#1 Updated by Junxiao Shi over 1 year ago

  • Description updated (diff)
  • Estimated time set to 4.50 h

The superset of Interest v0.2 and v0.3 is:

Interest ::= INTEREST-TYPE TLV-LENGTH
  Name
  CanBePrefix-3?
  MustBeFresh-3?
  Selectors-2?
  Nonce-2?
  InterestLifetime-2?
  ForwardingHint?
  Nonce-3?
  InterestLifetime-3?
  HopLimit-3?
  Parameters-3?

The decoder should parse packet using this structure, but reject the packet if both 2 and 3 elements are present. Note that Nonce and InterestLifetime could be 2 or 3 when other fields are omitted, in this case: "Name Nonce InterestLifetime?" is interpreted as Nonce-2 InterestLifetime-2; "Name InterestLifetime?" is interpreted as InterestLifetime-3.

Interest v0.3 elements are mapped into v0.2 semantics as follows:

  • CanBePrefix: if present, do nothing; if absent and the packet is conclusively identified as v0.3 (contains v0.3 elements/ordering, or Nonce is absent), set Selectors.MaxSuffixComponents to 1.
  • MustBeFresh: set Selectors.MustBeFresh.
  • Nonce: if absent, set to random value.
  • HopLimit: ignore, will not appear when encoded as v0.2.
  • Parameters: ignore, will not appear when encoded as v0.2.

#2 Updated by Junxiao Shi over 1 year ago

  • Blocked by Feature #4441: Replace MinSuffixComponents and MaxSuffixComponents with CanBePrefix flag added

#3 Updated by Junxiao Shi over 1 year ago

  • Subject changed from Decode v0.3 Interest format with backwards compatibility to Decode v0.3 Interest format and interpret as v0.2
  • Description updated (diff)

#4 Updated by Davide Pesavento over 1 year ago

#5 Updated by Junxiao Shi over 1 year ago

  • Status changed from New to In Progress
  • Assignee set to Junxiao Shi
  • % Done changed from 0 to 20

https://gerrit.named-data.net/4647 adds getter/setter for CanBePrefix and MustBeFresh. Accessors are sorted in the order the elements appear in v0.3 Interest. Selector accessors are deprecated.

Decoder changes come next.

#6 Updated by Junxiao Shi over 1 year ago

  • % Done changed from 20 to 50

https://gerrit.named-data.net/4670 declares TLV-TYPE numbers in encoding/tlv.hpp. Constants are sorted in the order they appear in the spec.

https://gerrit.named-data.net/4671 implements the decoding procedures. I decide not to take note-1 approach because it is error-prone. Instead, I have separate decode02 and decode03 functions handling each format. decode02 is made more strict than the old wireDecode so that it would reject v0.3 format and leave it to decode03.

#7 Updated by Junxiao Shi over 1 year ago

  • Status changed from In Progress to Code review
  • % Done changed from 50 to 100

#8 Updated by Davide Pesavento over 1 year ago

  • Status changed from Code review to Closed

#9 Updated by Davide Pesavento about 1 year ago

  • Tags set to Packet03Transition

Also available in: Atom PDF