Getting Started with NDNts Web Application using webpack

This article shows how to get started with NDNts, Named Data Networking (NDN) libraries for the modern web. In particular, it demonstrates how to write a consumer-only web application that connects to the NDN testbed, transmits a few Interests, and gets responses. This application uses JavaScript programming language and webpack module bundler.

Code samples in this article were last updated on 2021-09-20 to reflect latest changes.

Prepare the System

To use NDNts, you must have Node.js. As of this writing, NDNts works best with Node.js 16.x, and you should install that version. The easiest way to install Node.js is through Node Version Manager (nvm) or Node Version Manager (nvm) for Windows.

On Ubuntu 20.04, you can install nvm and Node.js with the following commands:

Install Debian 10 on Netgate SG-2220 via Serial Port with iSCSI Disk

I get my hands on a Netgate SG-2220 network computer. It comes preinstalled with either pfSense firewall software, or CentOS in the case of DPDK-in-a-box edition. However, I'm more familiar with Debian based operating systems. Can I install Debian on the Netgate SG-2220?

The Console Port

Hardware specification of the Netgate SG-2220 includes:

  • Intel Atom C2338 processor, dual core at 1.7 GHz
  • 2GB RAM
  • 4GB eMMC storage
  • one USB 2.0 port
  • two 1 Gbps Ethernet adapters

Notably missing is a VGA or HDMI port to connect to a monitor. Instead, this computer offers a mini-USB "console port". It is a UART serial port with a USB-UART bridge chip already included, unlike the C.H.I.P $9 computer that only provides serial over pin headers.

NDNts Nightly Build

NDNts nightly build is a set of NPM-compatible tarballs compiled automatically from the development branch of NDNts, Named Data Networking (NDN) libraries for the modern web. They are built by the Continuous Integration (CI) system and uploaded to the NDNts nightly build website: ndnts-nightly.ndn.today. Homepage of that website displays a list of URIs of available tarballs.

How to install NDNts nightly build

You can find available tarballs on NDNts nightly build website: ndnts-nightly.ndn.today.

To install a tarball as a local dependency within the current project, you can execute something like:

$ npm install https://ndnts-nightly.ndn.today/packet.tgz
+ @ndn/packet@0.0.20200822-nightly.a471902
added 5 packages from 3 contributors and audited 5 packages in 1.612s
found 0 vulnerabilities

I Earned $100 with One Tweet

Apple Card is a new credit card product offered by Apple. In February, Apple Card ran an ad campaign on Twitter:

Apple Card has no fees.

Not Apple Card has every possible fee.

So if your credit card is not Apple Card, maybe it should be.

Upon seeing this advertisement, I thought: Apple Card is not the only credit card that has no fees; my oldest credit card, Discover Card, also does not charge fees. Moreover, Discover Card has higher rewards in certain categories than Apple Card. Thus, I tweeted a reply under their ad, mimicking their grammar:

Apple Card has no fees and measly 2% rewards unless you buy from Apple. Discover Card has no fees and up to 5% rewards in rotating category, which is grocery stores this quarter. So if your credit card is not Discover Card, maybe it should be.

Twitterverse thinks I'm hilarious. They liked and retweeted my reply, so that it quickly became the top reply under the Apple Card ad, and everyone who expands the ad would see it.

Wandering in Los Angeles

This week, I virtually travel to Los Angeles, California, a city that I visited many times.

The Airport

Los Angeles International Airport (LAX) is one of the busiest airports in the United States. At a distance of 90 minutes flight time, LAX is the nearest major international airport from Tucson where I attended grad school. Therefore, I often find myself transiting in LAX.

LAX sign, 2019-03-06

Since I entered United States for the first time nine year ago, I transited through LAX 10 times, including 8 flights to/from China and 2 flights to/from Honolulu, Hawaii. Occasionally I have a long connection time. During that time,

Wandering in San Diego

I have wanderlust but the Coronavirus lockdown is preventing me from traveling this year. It would be fun to dig out old photos and look back on my past travels. Let me start with one of my favorite cities: San Diego, California.

December 2011

My first time in San Diego was a road trip with a few Chinese students I met during my first days in Tucson. We visited SeaWord San Diego, where I enjoyed their famous Shamu show, in which I got splashed by the killer whales.

whale performance in SeaWorld San Diego, 2011-12-22

During the same trip, we also visited USS Midway Museum, an aircraft carrier docked in San Diego harbor. I learned how these little planes take off, and more importantly how they can land safely with the help of arresting gear.

NFD nightly packages

NOTICE Instructions in this article are outdated. Please see latest information in NFD nightly usage.

NDN Forwarding Daemon (NFD) is the reference implementation of Named Data Networking (NDN) forwarding plane. The software is continuously developed, but binary releases happen rather infrequently. Recently, I made a workflow to build NFD and related software automatically.

Download page: nfd-nightly.ndn.today

Instructions

Which platform should I choose?

Quarantine Foods

The year 2020 started normal. Every weekday, I go to office. Three times a week, I pump those muscles at the gym. Every four days, I visit the grocery store to pick up a loaf of bread, along with other ingredients. Every Friday evening, I have a video chat with my family.

🕒 12 Timezones Away — 3 Timezones Away — Oops, It's Here

The first sign of problem occurred on Chinese New Year's Day. Traditionally, my mother's extended family would have an annual gathering during the holidays. However, my mother informed me that their gathering has been canceled, because there's a Coronavirus outbreak in parts of China. I thought, well, this doesn't affect me, because I live in Maryland USA, 12 timezones away from China.

The next week, China entered a lock down due to the spreading virus. My father found himself relying more on grocery delivery services. A difference from what I observed in 2017 is that, the gated community is not allowing delivery persons to enter the neighborhood, and my father has to collect his deliveries at the neighborhood entrance. At the same time, I heard on Twitter that the Coronavirus has reached the Chinese community in Seattle, 3 timezones from me.

In early March, the Coronavirus reached Maryland. A week later, public schools are being closed. This is when things started to get serious.

Getting Started with NDNts in Node.js

This article shows how to get started with NDNts, Named Data Networking (NDN) libraries for the modern web. In particular, it demonstrates how to write a producer and a consumer application in Node.js using JavaScript programming language, and transmit a few Interest and Data packets via NFD forwarder on the local machine.

Code samples in this article were last updated on 2021-08-17 to reflect latest changes.

Prepare the System

This guide is written for Ubuntu 20.04 operating system. If you have a Windows PC, you can enable Windows Subsystem for Linux and install Ubuntu 20.04 from the Microsoft Store. If you have a Macbook or a Linux machine other than Ubuntu 20.04, you can install Vagrant, and create a virtual machine using bento/ubuntu-20.04 template. All steps below should be executed inside Ubuntu 20.04 environment.

To use NDNts, you must have Node.js. As of this writing, NDNts works best with Node.js 16.x, and you should install that version. The easiest way to install Node.js is through Node Version Manager (nvm). To install nvm and then install Node.js, type the following commands in Ubuntu 20.04 terminal:

Introducing NDNph and New Version of esp8266ndn

NDNph is my latest Named Data Networking (NDN) client library. This article gives an overview of this library.

History and Motivation

In 2016, I started esp8266ndn. It contains a copy of ndn-cpp-lite, UCLA REMAP's C++ library that does not use dynamic memory allocations. I then added integrations with ESP8266's network stack and crypto functions, making esp8266ndn the first NDN library that works on the ESP8266 microcontroller. Using this library, I built several projects, including a wearable jewelry and a call button. University of Memphis also deployed several sensor nodes using esp8266ndn.

Over the years, esp8266ndn gained many new features, and widened platform support to include ESP32 and nRF52. However, using ndn-cpp-lite as the core is becoming problematic:

  • New protocol features show up slowly, because ndn-cpp-lite author would not add a feature until ndn-cxx has it, and design discussions for ndn-cxx sometimes take several years.
  • There is no generic TLV encoder/decoder, making it difficult to support TLV structures in application layer.
  • ndn-cpp-lite is bloated with obsolete features, due to their backwards compatibility guarantees. Consequently, binary code size is unnecessarily large.
  • Although I can add patches to ndn-cpp-lite during importing into esp8266ndn, it has been difficult to test these patches. This isn't ndn-cpp-lite's fault, but is still an issue.