New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ndn/dpdkmgmt

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ndn/dpdkmgmt

NDNts: NDN-DPDK Management

  • 0.0.20200606
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by300%
Maintainers
1
Weekly downloads
 
Created
Source

@ndn/nfdmgmt

This package is part of NDNts, Named Data Networking libraries for the modern web.

This package enables interaction with NDN-DPDK high-speed forwarder. It can create faces for the NDNts application, and perform prefix registrations.

NDN-DPDK forwarder should be configured as follows:

  • Management listener on TCP.
  • Socket faces enabled.

Currently, there are several limitations using this package:

  • Data plane uses UDP transport, which does not deliver the best performance.
  • Prefix registration replaces a FIB entry, and does not preserve other prefix registrations on the same prefix.
  • If the application crashes, the face would not be closed on NDN-DPDK side.
import { createFace } from "@ndn/dpdkmgmt";

// other imports for examples
import { Endpoint } from "@ndn/endpoint";
import { Forwarder } from "@ndn/fw";
import { Name, Interest, Data } from "@ndn/packet";
import { fromUtf8, toUtf8 } from "@ndn/tlv";
import { strict as assert } from "assert";
(async () => {

const localHost = process.env.DEMO_DPDKMGMT_LOCAL;
const host = process.env.DEMO_DPDKMGMT_FW;
if (!localHost || !host) {
  console.log(`
To run @ndn/dpdkmgmt demo, set the following environment variables:
DEMO_DPDKMGMT_FW= IP address of NDN-DPDK forwarder
DEMO_DPDKMGMT_LOCAL= IP address to reach local host from NDN-DPDK forwarder
`);
  return;
}

// Create two forwarders, one as consumer and one as producer.
const fwC = Forwarder.create();
const fwP = Forwarder.create();

// Connect to NDN-DPDK.
const uplinkC = await createFace({
  fw: fwC,
  localHost,
  host,
});
uplinkC.addRoute(new Name("/"));
const uplinkP = await createFace({
  fw: fwP,
  localHost,
  host,
});
console.log(`uplinkC=${uplinkC}`, `uplinkP=${uplinkP}`);

// Start a producer.
const producer = new Endpoint({ fw: fwP }).produce("/P",
  async () => {
    console.log("producing");
    return new Data("/P", Data.FreshnessPeriod(1000), toUtf8("NDNts + NDN-DPDK"));
  });
await new Promise((r) => setTimeout(r, 500));

// Start a consumer, fetching Data from the producer via NFD.
const data = await new Endpoint({ fw: fwC }).consume(
  new Interest("/P", Interest.MustBeFresh),
);
const payloadText = fromUtf8(data.content);
console.log("received", `${data.name} ${payloadText}`);
assert.equal(payloadText, "NDNts + NDN-DPDK");

// Close faces.
producer.close();
await new Promise((r) => setTimeout(r, 500));
uplinkC.close();
uplinkP.close();
})();

Keywords

FAQs

Package last updated on 06 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc