Project

General

Profile

Actions

Bug #4262

closed

Interest processing takes long time if name has many components

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

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

100%

Estimated time:
9.00 h

Description

Steps to reproduce:

  1. Use a standalone NFD instance that is not connected to other nodes.
  2. ndnping -c 1 $(python -c "print '/X'*2000")

Expected: ndnping client receives a Nack.
Actual: NFD spends more than 15 seconds to process this packet, and ndnping times out when InterestLifetime expires at 4000ms.
If adding -o 60000 to set a higher InterestLifetime: ndnping receives a Nack as expected.

Since NFD forwarding is single threaded, spending too much time on one packet denies other packets from accessing the forwarding engine, and causes network congestion. NFD should limit the duration of processing each packet, and drop the packet or respond with a Nack if the time limit would be exceeded.

Actions #1

Updated by Junxiao Shi about 7 years ago

As shown in http://www.lists.cs.ucla.edu/pipermail/nfd-dev/2017-August/002693.html, if NFD-RIB thread is trying to execute a FIB command but the forwarding thread is kept busy servicing an Interest with many name components, the FIB command would timeout, causing a (rightful) crash on NFD-RIB side.

Actions #2

Updated by Davide Pesavento about 7 years ago

NFD should limit the duration of processing each packet, and drop the packet or respond with a Nack if the time limit would be exceeded.

An approach based on a timer is, by definition, unfeasible. Given that NFD is single-threaded, the callback associated with the expiring timer wouldn't be executed until the current packet is fully processed, rendering the timeout useless.

Interest packets with an abnormally large number of name components should be dropped before they enter the forwarding pipeline.

Actions #3

Updated by Alex Afanasyev about 7 years ago

I would propose much simpler approach - limit the number of name components that NFD processes by, say, 50 or less.

Actions #4

Updated by Junxiao Shi about 7 years ago

  • Category changed from Forwarding to Tables
  • Status changed from New to In Progress
  • Assignee set to Junxiao Shi
  • Start date deleted (08/27/2017)
  • Estimated time changed from 3.00 h to 9.00 h

20170828 NFD call decides to limit the depth of NameTree to D. Consequently:

An Interest whose name has more than D components can still be accepted.
The resulting PIT entry will be attached to the NameTree node of a name prefix of the first D component.

FIB/StrategyChoice/Measurements entries with more than D name components cannot be created.
Attempts to create FIB/StrategyChoice entries shall be rejected by management.
Measurements::get(const Name&) will return the deepest allowable Meausurements entry.

Actions #5

Updated by Junxiao Shi about 7 years ago

  • % Done changed from 0 to 10

https://gerrit.named-data.net/4165 adds NameTree::getMaxDepth() as an advisory limit of NameTree depth.
I'll then change PIT, StrategyChoice, and FIB to conform to this depth limit, and also update RibManager to also enforce this depth limit so that it would not attempt to create a FIB entry exceeding limit.
Finally, NameTree::getMaxDepth() will become mandatory to simplify NameTree implementation.

Actions #6

Updated by Davide Pesavento about 7 years ago

Have you determined what the bottleneck is?

Actions #7

Updated by Junxiao Shi about 7 years ago

  • % Done changed from 10 to 30

https://gerrit.named-data.net/4174 PIT
With this change, ndnping -c 1 $(python -c "print '/X'*2000") no longer causes long processing time in NFD.

In Pit::lookup, I recognize the opportunity to eliminate nteName variable and replace it with an argument to NameTree::lookup that replaces enforceMaxDepth. This optimization is to be performed when max depth is enforced universally.

Actions #8

Updated by Junxiao Shi about 7 years ago

  • % Done changed from 30 to 40
Actions #9

Updated by Davide Pesavento about 7 years ago

  • Target version changed from v0.6 to v0.7
Actions #10

Updated by Junxiao Shi about 7 years ago

  • % Done changed from 40 to 50

https://gerrit.named-data.net/4359 Measurements
Note that the current implementation of Measurements::get with FIB/PIT entry delegates to Measurements::get(const Name&) that is inefficient. This will be refactored after max depth is enforced universally.

I also notice that NameTree::lookup(const pit::Entry&) contains an incorrect assertion. This will be fixed later in this issue.

Actions #11

Updated by Junxiao Shi almost 7 years ago

FIB/StrategyChoice/Measurements entries with more than D name components cannot be created.
Attempts to create FIB/StrategyChoice entries shall be rejected by management.

FibMgmt rev34 and RibMgmt rev23 and StrategyChoice rev10 define that management shall return code 414 if name prefix is too long.

Actions #12

Updated by Junxiao Shi almost 7 years ago

https://gerrit.named-data.net/4464 implements code 414 for rib/register command.

Actions #13

Updated by Junxiao Shi almost 7 years ago

  • % Done changed from 50 to 60

https://gerrit.named-data.net/4500 StrategyChoiceManager

Actions #14

Updated by Junxiao Shi almost 7 years ago

  • % Done changed from 60 to 70
Actions #15

Updated by Junxiao Shi over 6 years ago

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

https://gerrit.named-data.net/4603 enforces MaxDepth universally and completes this issue.

Actions #16

Updated by Junxiao Shi over 6 years ago

  • Status changed from Code review to Closed
Actions

Also available in: Atom PDF