Forwarding hint: represented as name only
Interest type so that forwarding hint is represented as delegation names only, instead of full Link object.
Change forwarding pipelines accordingly.
#6 Updated by Junxiao Shi almost 2 years ago
- % Done changed from 20 to 30
DelegationList can be unsorted,
Link::getDelegationFromWire and similar methods are now deprecated. They won't be needed anyway after
Interest has been converted from carrying
Link to carrying forwarding hint.
#7 Updated by Junxiao Shi almost 2 years ago
There's an unexpected behavior change: if an Interest contains invalid Link object and valid SelectedDelegation field,
Interest::wireDecode will throw. Previously, only
Interest::getLink throws because (now deprecated)
Link::countDelegationsFromWire only performs a partial parsing of the Link object and happens to accept the invalid Link objects used in the test cases.
This detail is unimportant because SelectedDelegation will be deprecated under this issue.
https://gerrit.named-data.net/3972 patchset2 deletes SelectedDelegation field in affected test cases.
#8 Updated by Junxiao Shi almost 2 years ago
- % Done changed from 30 to 40
https://gerrit.named-data.net/3993 adds ForwardingHint field to Interest.
Previously, the Link object in Interest was stored as a
Block, and decoded only when requested. The reasons were:
Linkconstructor always sorts the delegations, which can make SelectedDelegation field point to wrong delegation.
- Not every node needs to see the delegations, so Link can be decoded lazily.
DelegationList can be constructed as unsorted, so the first reason no longer applies.
It's true that not every node needs to see the delegations. An Interest with a Link object or forwarding hint traverses consumer region, the backbone and then producer region. Only backbone nodes (including edge routers of consumer region and producer region) need to see the delegations.
But in reality, NFD implementation always decodes the Link object, because it's a lot worse to find the Interest to be malformed in the middle of processing, than wasting some processing power to decode the field. The waste is only in consumer region, because Link object is stripped when entering producer region as of #3893.
Therefore, I choose to always decode ForwardingHint field.
#9 Updated by Junxiao Shi almost 2 years ago
interest.cpp code and deletes duplicate tests for malformed Link objects.
https://gerrit.named-data.net/3993 encodes and decodes ForwardingHint field in Interest.
Interest::modifyForwardingHint method which allows a callback to modify ForwardingHint field in-place without copying.
#10 Updated by Junxiao Shi almost 2 years ago
Upcoming plan for this issue:
Change NFD forwarding to use ForwardingHint only. Link and SelectedDelegation are ignored but do not cause errors.
hasLinkalways returns false.
setLinkstores the delegations as ForwardingHint.
unsetLinkclears the ForwardingHint.
Interest::*SelectedDelegation as it's only used by NFD.
Interest::wireEncode no longer emits Link and SelectedDelegation fields.
Interest::wireDecode interprets Link and SelectedDelegation fields as ForwardingHint. If SelectedDelegation is omitted, all delegations are stored as ForwardingHint. If SelectedDelegation is present, the selected delegation is stored as ForwardingHint. A packet with both Link and ForwardingHint fields is considered malformed.
#11 Updated by Junxiao Shi almost 2 years ago
- % Done changed from 40 to 60
https://gerrit.named-data.net/4024 has all NFD changes. NFD now completely ignores
Interest::getLink and only processes forwarding hint.
bool DelegationList::empty() which would simplify NFD code, because
!interest.getForwardingHint().empty() looks better than
interest.getForwardingHint().size() > 0. I'll update Change 4024 once this is merged.
#13 Updated by Junxiao Shi almost 2 years ago
- % Done changed from 60 to 80
Interest::getSelectedDelegation and similar methods.
Although I proposed a non-breaking change path in note-10, I feel it unnecessary given the infrequent use of Link object in existing code, thus I decide to make a breaking change instead.
ndnpeek program to interpret
--link-file as ForwardingHint, similar to note-10 approach.
It will be replaced with a command line argument for forwarding hint in #4207.
Remaining work is to update NFD devguide.