Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding NDN-DPDK Forwarder Support #48

Open
justincpresley opened this issue Mar 30, 2022 · 5 comments
Open

Adding NDN-DPDK Forwarder Support #48

justincpresley opened this issue Mar 30, 2022 · 5 comments
Assignees

Comments

@justincpresley
Copy link

Hey! So I have a use case to support the NDN-DPDK forwarder.
As you may know, ndn-hydra is an distributed repository built using this library. It is soon going to be deployed (and actively used) on a high-performance environment. However, our forwarder is a major bottleneck in initial testing.

I did look into how tightly coupled NFD is with this library and it looks to be extensive. However, if NDN-DPDK becomes supported, I am able to advertise NDN to a broad audience. This also would allow NDN (Hydra) to be actively used to solve problems which would popularize NDN.

Simply said, NDN-DPDK forwarder support would greatly help our application in solving the problem it is trying to solve and as a major user of this library, I would greatly appreciate it if this was included.

@zjkmxy
Copy link
Member

zjkmxy commented Mar 30, 2022

Hello. I think the only problem is PIT token. python-ndn does not memorize incoming Interests so it does not apply PIT token when a data is sent. This is hard to fix.

@zjkmxy zjkmxy added the help wanted Extra attention is needed label Mar 30, 2022
@yoursunny
Copy link
Member

yoursunny commented Apr 18, 2022

For PIT token, it isn't necessary for the library to memorize incoming Interests in a PIT.
Producer handler should be given a reply function, which memorizes the current Interest including its PIT token.

@app.route('/P')
def process_interest(interest: Interest, reply: Callable[[Data|Nack|None], None]):
  # to reply with Data
  reply(data)

  # to reply with Nack
  reply(nack)

  # to not reply i.e. cause a timeout
  reply(None)
  • You probably want to create a new decorator instead of adding more flags to @app.route that is already quite complicated.
  • The reply function can only be called once; otherwise, it triggers assertion failure.
  • For reply(data) and reply(nack), the library checks that the Data/Nack indeed matches the Interest; otherwise, it triggers assertion failure and does not send the packet. This is helpful for catching mistakes like forgetting to set FreshnessPeriod when incoming Interest has MustBeFresh.
  • For reply(nack), if it is known that the uplink does not support Nack (e.g. it's recognized as YaNFD), the library may silently drop the packet instead of sending it.
  • The reply(None) call isn't required, but it makes the intention explicit and prevents calling the reply function again. The application may opt-in a strict mode where every Interest must be reply()-ed, which helps detecting coroutine memory leaks; in this case, reply(None) would be required.
  • The reply function should be called within InterestLifetime; otherwise, the packet is not sent since the downstream node would not accept it, and a warning is logged.

NDNph library has a similar design, but does not have all the features listed above.
https://github.com/yoursunny/NDNph/blob/22e703555503c2d534774064d9bb444ee8011cbf/src/ndnph/app/ping-server.hpp#L36

@zjkmxy
Copy link
Member

zjkmxy commented Apr 18, 2022

Thank you for your idea. Will implement this when I have time.

@yoursunny
Copy link
Member

Proper NDN-DPDK support has 3 ingredients:

  • PIT token
  • memif transport
  • management protocol

For memif transport, build a Python extension based on libmemif C library.
This should be a separate library that is an optional dependency of python-ndn.
I have a Node.js memif library for reference.

For management protocol, NDN-DPDK natively accepts GraphQL commands, but some deployments use Multiverse that uses a different protocol.
NDN-DPDK does not have a listening socket; both face creation and prefix announcement need to go through an out-of-band management protocol.
See NDNts @ndn/dpdkmgmt for reference, but the GraphQL commands may still change.

@zjkmxy
Copy link
Member

zjkmxy commented Apr 24, 2022

This involves multiple changes in NDNApp. I think probably I should refactor the whole class (like NDNAppv2).
Since this takes time and is not of high priority, let me delay this work for now.

@zjkmxy zjkmxy removed the help wanted Extra attention is needed label Apr 24, 2022
@zjkmxy zjkmxy self-assigned this Jul 23, 2022
zjkmxy added a commit to zjkmxy/python-ndn that referenced this issue Jul 26, 2022
Add support for PIT Token.
Add SignedInterest support for NFD mgmt command Interests.

Ref: named-data#48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants