Project

General

Profile

Actions

Bug #3363

closed

Interest with full name is not satisfied with Data packet

Added by Alex Afanasyev over 8 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
High
Assignee:
Category:
Forwarding
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
4.00 h

Description

The problem originally reported by Christian Tschudin: http://www.lists.cs.ucla.edu/pipermail/nfd-dev/2015-December/001445.html

I'm confirming the incorrect behavior. Steps to reproduce:

  • Start NFD

  • Compile a simple app:

#include <ndn-cxx/face.hpp>
#include <ndn-cxx/security/key-chain.hpp>

#include <memory>

int
main()
{
  auto data = std::make_shared<ndn::Data>("/hello/world");
  ndn::KeyChain keyChain;
  keyChain.sign(*data);

  std::cout << data->getFullName() << std::endl;

  ndn::Face face;
  face.setInterestFilter("/hello/world",
                         [&] (const ndn::InterestFilter&, const ndn::Interest& i) {
                           std::cerr << " << i " << i << std::endl;
                           if (i.getName() == data->getFullName()) {
                             face.put(*data);
                           }
                         },
                         nullptr);

  face.processEvents();
}
c++ -std=c++11 `pkg-config --cflags --libs libndn-cxx` test.cpp -lndn-cxx
  • Start the app. It will output the exact name of the data packet being produced. On my machine it is /hello/world/sha256digest=bc6f07c5f4e6e2ec525dc2a6ad95ddc02df2c39140e1bfd791d43c48ef7abf6c

  • Request the data packet using ndnpeek

ndnpeek /hello/world/sha256digest=bc6f07c5f4e6e2ec525dc2a6ad95ddc02df2c39140e1bfd791d43c48ef7abf6c

Expected: Data packet retrieved

Actual: Timeout


If ndnpeek is run again, the data packet is immediately retrieved.


Files

Scanned_20151230-1031.pdf (518 KB) Scanned_20151230-1031.pdf Junxiao Shi, 12/30/2015 09:32 AM

Related issues 1 (0 open1 closed)

Related to NFD - Bug #3608: Pit::erase crash if Interest name contains implicit digestClosedJunxiao Shi04/25/2016

Actions
Actions #1

Updated by Alex Afanasyev over 8 years ago

This patch would fix the issue

diff --git a/daemon/table/pit.cpp b/daemon/table/pit.cpp
index 959593f..79c7431 100644
--- a/daemon/table/pit.cpp
+++ b/daemon/table/pit.cpp
@@ -24,7 +24,6 @@
  */

 #include "pit.hpp"
-#include <type_traits>

 #include <boost/concept/assert.hpp>
 #include <boost/concept_check.hpp>
@@ -94,7 +93,7 @@ Pit::findOrInsert(const Interest& interest, bool allowInsert)
 pit::DataMatchResult
 Pit::findAllDataMatches(const Data& data) const
 {
-  auto&& ntMatches = m_nameTree.findAllMatches(data.getName(),
+  auto&& ntMatches = m_nameTree.findAllMatches(data.getFullName(),
     [] (const name_tree::Entry& entry) { return entry.hasPitEntries(); });

   pit::DataMatchResult matches;

However, there is immediate implication that implicit digest is forced to be compiled for every incoming data packet. This is what we tried to avoid previously.

I think there could be a workaround, though it would require modification of NameTree lookup.

Actions #2

Updated by Alex Afanasyev over 8 years ago

  • Assignee changed from Junxiao Shi to Alex Afanasyev
Actions #3

Updated by Junxiao Shi over 8 years ago

20151215 conference call decides to adopt note-1 solution as the short-term solution, under the condition that NdnCon does not suffer from the performance implication.

Alex will inform NdnCon developers to do a test with the patch.

Actions #4

Updated by Junxiao Shi over 8 years ago

See Scanned_20151230-1031.pdf for my solution that does not involve digest computation on every Data packet.

Estimated time to implement this solution is 3 hours.

Actions #5

Updated by Alex Afanasyev over 8 years ago

  • Assignee changed from Alex Afanasyev to Junxiao Shi
  • Target version changed from v0.4 to v0.5

Jan 5, 2016 call decided to proceed with solution in note-4.

Actions #6

Updated by Junxiao Shi about 8 years ago

  • Status changed from New to In Progress
  • Estimated time set to 4.00 h
Actions #7

Updated by Junxiao Shi about 8 years ago

  • % Done changed from 0 to 10

http://gerrit.named-data.net/2702

patchset1 has test case only.

Actions #8

Updated by Junxiao Shi about 8 years ago

  • % Done changed from 10 to 50

patchset2 has the implementation and existing tests are passing.
However, I haven't updated the shortcut methods so some of them will likely fail.

Actions #9

Updated by Junxiao Shi about 8 years ago

  • % Done changed from 50 to 80

patchset3 adds test cases for FIB/StrategyChoice/Measurements shortcut methods, which are failing as expected.

Actions #10

Updated by Junxiao Shi about 8 years ago

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

patchset4 modifies NameTree::get(pit::Entry&) to accommodate PIT behavior change.

I'm introducing a new parameter missingBehavior to this method, to avoid inserting a new NameTree entry if the calling table does not intend to attach a new entry onto it.

This is used by FIB, but not by Measurements or StrategyChoice.

Actions #11

Updated by Junxiao Shi about 8 years ago

  • Status changed from Code review to Resolved

Code change is merged.

I still need to update devguide "NameTree - shortcuts" section.

Actions #12

Updated by Junxiao Shi about 8 years ago

  • Status changed from Resolved to Closed

NFD devguide "NameTree - shortcuts" section is updated in nfd-docs:commit:74b6084405589af18a3074be5b3815223b07b02f.

Actions #13

Updated by Junxiao Shi almost 8 years ago

  • Related to Bug #3608: Pit::erase crash if Interest name contains implicit digest added
Actions

Also available in: Atom PDF