Play NDN on Raspberry Pi updated by philoliang@email.arizona.edu July 20, 2017

This page gives instructions on how to install NDN libraries and applications on Raspberry Pi 2 or 3 with the various OS versions.

  • Raspberry Pi Image Download and Installation
  • NFD Installation on Pi
  • Testing NFD
  • 1. Raspberry Pi Image Download and Installation

    Here are the links to download OS images with installation instructions on Pi:

    2. NFD Installation on Pi

    Currently, there are two ways to install NFD and NDN libraries on Raspberry Pi 2/3.

    2.1 Using the NDN PPA Repository on Ubuntu Linux

    If the OS is a Ubuntu version, simply use the Ubuntu NDN PPA Repository, and the instructions can be found here .

    2.2 Building from source code

    For a Debian based distribution, there is no Debian NDN PPA for now. You can build NDN libraries and applications directly from source code. However, given only 1GB RAM on Pi 2/3, clang++ should be used as the compiler instead of gcc.
    Basically, the installation involves two steps. First install all prerequisities that NDN libraries or tools depend on. Second, download each NDN code repository and build it one by one. Here gives three examples, ndn-cxx, NFD and ndn-tools.

    Install prerequisites

    apt-get update
    apt-get install build-essential clang dpkg-dev git libboost-all-dev libcrypto++-dev libpcap-dev libssl-dev libsqlite3-dev pkg-config
    

    Install ndn-cxx (takes 17 minutes on RPi 2 with Raspbian)

    git clone --recursive https://github.com/named-data/ndn-cxx.git
    cd ndn-cxx
    CXX=clang++ ./waf configure --boost-libs=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)
    ./waf
    sudo ./waf install
    ldconfig
    

    Install NFD (takes 19 minutes on RPi 2 with Raspbian)

    git clone --recursive https://github.com/named-data/NFD.git
    cd NFD
    CXX=clang++ ./waf configure --boost-libs=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)
    ./waf
    sudo ./waf install
    

    Install ndn-tools (takes 5 minutes on RPi 2 with Raspbian)

    git clone --recursive https://github.com/named-data/ndn-tools.git
    cd ndn-tools
    CXX=clang++ ./waf configure --boost-libs=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)
    ./waf
    sudo ./waf install
    

    3. Testing NFD

    If you install NFD from source, you need to create a proper configuration file. If the default location for ./waf configure was used, this can be accomplished by simply copying the sample configuration file:

    sudo cp /usr/local/etc/ndn/nfd.conf.sample /usr/local/etc/ndn/nfd.conf
    

    Now, it is time to run NFD:

    nfd-start
    

    Check NFD status using nfdc command, e.g., nfdc status.
    Then we can test NFD using ndn-autoconfig command, which will automatically find and connect to the closest NFD on the testbed.

    ndn-autoconfig
    
    After the command succeeds, you can check the FIB information by running nfdc fib, and it will give you a FIB entry for /localhop/nfd.
    Finally, you are able to ndnping any node on the testbed.
    ndnping /ndn/edu/arizona