Bug #1998

NccStrategy: forward back to sole downstream

Added by Junxiao Shi about 7 years ago. Updated over 6 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
3.00 h



  • Topology: A-B
  • FIB on A: /P toward B
  • FIB on B: /P toward A
  • Strategy on A: NCC
  • Strategy on B: best-route

Steps to reproduce:

  1. run ndndump to observe traffic between A and B
  2. execute on B: ndn-tlv-peek /P/$RANDOM

Actual: ndndump reveals that after A receives Interest from B, it is forwarded back to B

Expected: Interest is not forwarded back to B


Updated by Junxiao Shi about 7 years ago

  • Priority changed from Normal to Low
  • Estimated time set to 3.00 h

This is indeed caused by a TODO item: if top-ranked nexthop in FIB entry points to the sole downstream, NCC would forward the Interest back.


Updated by Junxiao Shi about 7 years ago

Original report from John DeHart:

we have had when we set the InterestLifetime to 0.
We had Node A with a FIB entry to forward a specific prefix (e.g. ndn:/app_prefix) to End Host B. End Host B had a general FIB entry to send ndn:/ to Node A. If the application that was servicing this prefix was not running and hence had not set up a FIB entry in NFD to receive the interests then the nfd on B ended up forwarding this interest back to Node A. And then Node A sent it back to B and it bounced back and forth.

This is the combined effect of #1998 and #1953.
When both A and B are using NCC strategy, they would forward the Interest toward each other.
Loop detection fails with short InterestLifetime due to #1953.
And this causes persistent loop between two nodes.


Updated by Junxiao Shi almost 7 years ago

  • Status changed from New to In Progress

Updated by Junxiao Shi almost 7 years ago

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

Updated by Junxiao Shi over 6 years ago

@Hila observes the following problem with commit bb339cb79431fe425134a960c15231cffb3e2f03:

  1. Topology: A-B
  2. on both hosts, /ndn/test is set to use NCC strategy
  3. on both hosts, /ndn/test has a Route toward the other hosts
  4. use ndndump to observe traffic
  5. on host A, run ndn-tlv-peek /ndn/test; sleep $N; ndn-tlv-peek /ndn/test, where $N ranges from a few seconds to a few minutes

Expected: ndndump observes two Interests transmitted

Actual: ndndump only observes the first Interest; no more Interests are sent from A to B

I tried this scenario with commit 94ec212f5ef4b8fc0f85d03075a0dfcc02b92650 but was unable to reproduce.

With either N=10 or N=2, two Interests are observed by ndndump.


Updated by Hila Ben Abraham over 6 years ago

My scenario is slightly different than what you described. First, my app uses a longer prefix name than what you used in ndn-tlv-peek. The routes are set to /ndn/test, but my app uses /ndn/test/blah. Second, the default interest lifetime of ndn-tlv-peek is 4 seconds and I use 0. I can run it again using ndn-tlv-peek instead of my app, but I will be able to do it only on Friday.


Updated by Junxiao Shi over 6 years ago

I tried note-5 scenario with step 5 changed to ndn-tlv-peek -l $L /ndn/test/blah; sleep 2; ndn-tlv-peek -l $L /ndn/test/blah.

When lifetime ($L) is set to 0ms, ndndump observes zero Interest transmitted;

when lifetime ($L) is set to 1ms, ndndump observes two Interests transmitted.

This behavior does not violate the protocol.

InterestLifetime indicates the (approximate) time remaining before the Interest times out. The timeout is relative to the arrival time of the Interest at the current node.

After an Interest with InterestLifetime=0 arrives, it immediately expires before strategy has a chance to process it.

NCC strategy is not obligated to forward an Interest that is already expired, and therefore has no possibility of being satisfied.


Updated by Hila Ben Abraham over 6 years ago

So can you explain me why best-route would forward this interest while ncc won't?


Updated by Junxiao Shi over 6 years ago

  • Status changed from Code review to Closed

In any case, the behavior described in note-5,6,7 isn't introduced by this patch. NCC is currently correct (by coincidence), but the forwarder and library shall be changed to drop any Interest with zero lifetime.

Also available in: Atom PDF