Project

General

Profile

Actions

Feature #4530

open

More efficient communication between threads

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

Status:
In Progress
Priority:
Normal
Category:
Faces
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
6.00 h

Description

NFD-RIB and management currently connect to forwarding through a Unix stream face (TCP face on Android), so communication involves socket operations and packet encoding.
Since they are in the same process, they can instead communicate through an internal “in-memory face” implemented using a ring buffer or similar technique.


Related issues 1 (1 open0 closed)

Related to NFD - Feature #4528: Management threadIn ProgressDavide Pesavento

Actions
Actions #1

Updated by Junxiao Shi over 6 years ago

Actions #2

Updated by Junxiao Shi over 6 years ago

Caution: when L3 objects such as ndn::Interest are passed via a ring buffer, attached ndn::Tag are passed along and could cause undesired effects. DummyClientFace and TopologyTester both encode the packet into L2 wire format and then decode again.
While it's desirable to avoid encoding-decoding, if side effects are detected, passing around L2 wire format is still faster than going through sockets.

Actions #3

Updated by Davide Pesavento over 6 years ago

  • Status changed from New to In Progress

Junxiao Shi wrote:

Caution: when L3 objects such as ndn::Interest are passed via a ring buffer, attached ndn::Tag are passed along and could cause undesired effects. DummyClientFace and TopologyTester both encode the packet into L2 wire format and then decode again.
While it's desirable to avoid encoding-decoding, if side effects are detected, passing around L2 wire format is still faster than going through sockets.

Can you give an example of a Tag that can cause unwanted effects?

Can't we simply remove all tags from the packet instead of re-encoding?

Actions #4

Updated by Junxiao Shi over 6 years ago

Can you give an example of a Tag that can cause unwanted effects?

It’s more about two NDN entities (nodes or apps) updating tags on the same TagHost. They can conflict.
A specific example:

A-B-C
  |
  D

A’s face 3001 is B, B’s face 3001 is C, B’s FIB entry point to D.

A receives an Interest with NextHopFaceId=3001 so it forwards the Interest to B. B normally should not see NextHopFaceId so it should forward the Interest to D. However, if Interest instance is passed around, B would incorrectly forward the Interest to C.

Can't we simply remove all tags from the packet instead of re-encoding?

No, because the originating node may still need those tags.

I can think about an alternative: copy the L3 packet object, then clear all tags on the copy. This should work because tags are stored on L3 instance, while underlying Block has copy-on-write semantics.

Actions #5

Updated by Davide Pesavento over 6 years ago

Why are you talking about multiple nodes now? Your answer seems completely off-topic.

Actions #6

Updated by Junxiao Shi over 6 years ago

Why are you talking about multiple nodes now?

I cannot speak for InternalFace's use case. The example is from TopologyTester.

Actions #7

Updated by Davide Pesavento about 5 years ago

  • Target version deleted (v0.7)
Actions

Also available in: Atom PDF