Feature #4530
openMore efficient communication between threads
0%
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.
Updated by Junxiao Shi over 6 years ago
- Related to Feature #4528: Management thread added
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.
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, attachedndn::Tag
are passed along and could cause undesired effects.DummyClientFace
andTopologyTester
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?
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.
Updated by Davide Pesavento over 6 years ago
Why are you talking about multiple nodes now? Your answer seems completely off-topic.
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
.