Monday, March 7, 2022

Building NASA's JPL ION on a Raspberry Pi

 In my previous article you learned about the DTN-IPN R&D Lab project I’m working on, here I will start sharing how to build yourself a DTN node running NASA’s JPL Interplanetary Overlay Network (ION) protocol stack on a Raspberry Pi.

What do you need

  • Raspberry Pi single board computer, I’d recommend at least a version 3B or better 3B+, if you have a Raspberry Pi 4 it will also work. On my prototype lab project, I have several ION DTN nodes running on the new Raspberry Pi Zero W2 which is about five times faster than the Zero W. I did build ION on a Zero W and it worked just slower.

  • A microSD card of at least 16GB and decent speed with the Raspi OS image. I did use one of the latest stable versions for this project, the 2021-05-07-raspios-buster-armhf.img, no need for the full version since it will take more space on the SD card.
    You can download this version from the link above and prepare the micro SD card using Win32 Disk Imager on a Windows machine.


  • Obviously for the initial setup you will need a keyboard and a monitor, and a mouse if you will keep working directly on the Raspberry Pi. I normally after the initial setup and with a network connection I access it remotely via VNC or SSH, not necessarily but I usually change the default username “pi”.

Here are the steps to obtain and build the ION version 4.1.1 code on your Raspberry Pi:

1- After you have your board up and running make sure that you do to have the latest packages installed in your system
    sudo apt-get update
    sudo apt-get upgrade

2- It will be most probably already installed but just in case also do
    sudo apt-get install build-essential

3- And automake to build the scripts to compile the source code
    sudo apt-get install automake

4- Obtain the ION 4.1.1 source code tar ball from SOURCEFORGE
We will do this with 
wget on the Raspberry Pi


5 - Extract the ION source code distribution from the tar file.
You will notice that now you have a new directory named ion-open-source-4.1.1, change to that directory. If you are running on Raspi-OS Bullseye, you will have to run first the aclocal command, then run the configure script with./configure


This will check all the dependencies and configure the files to build the ION software, you may see some warnings but the script should end without errors.
 
6- You are now ready to build the code with make


You will see the compilation process step by step going through each directory of the ION source code, be patient, the Raspberry Pi can do the job, but it will take several minutes to complete the building process, it really depends on the speed of your Raspberry Pi and the micro SD card, but even with the slower Raspberry Zero W the code builds without problems.
 
7- After everything is built you should see a screen like this one, now you are ready to install the software, but pay attention for this step you must use sudo make install to perform the installation as the user root


8- You will see some warnings but don’t worry about them

Given that the ION software uses dynamic libraries we must perform one more step as root to run the ldconfig tool to create the necessary links and update the cache of shared libraries.




Now we are ready to run ION 4.1.1 on the Raspberry Pi, but first we need to create the configuration/startup file.

The ION implementation is modular, there are several processes that must be started but the configuration can reside in a single file.

Since for now we have a single DTN node, the first test will be a loopback test sending data bundles to the same node.

Let’s create a directory named dtn and edit a file named localhost.rc, we will use 170 as our node ID.


For the LTP (Licklider Transport Protocol) section instead of an IP address we will use for now 
localhost

For the Bundle Protocol we will declare LTP as the transport protocol, and define the input and output ducts (more about this soon.)

Your localhost.rc should look like this:

    ## begin ionadmin

    1 170 ''
    s
    # Contact plan definitions
    a contact +1 +86400 170 170 100000
    a range +1 +86400 170 170 1

    m production 1000000
    m consumption 1000000
    ## end ionadmin

    ## begin ltpadmin
    1 32
    a span 170 32 32 1400 10000 1 'udplso localhost:1113' 300
    s 'udplsi localhost:1113'

    ## end ltpadmin

    ## begin bpadmin
    1
    a scheme ipn 'ipnfw' 'ipnadminep'
    a endpoint ipn:170.0 q
    a endpoint ipn:170.1 q
    a endpoint ipn:170.2 q

    a protocol ltp 1400 100
    a induct ltp 170 ltpcli
    a outduct ltp 170 ltpclo
    s
    ## end bpadmin

    ## begin ipnadmin
    a plan 170 ltp/170
    ## end ipnadmin

    ## begin ionsecadmin
    1
    ## end ionsecadmin

In a future article I will go more into detail about the options for this file, meanwhile you can look at some additional documentation from Dr. Lara Suzuki.

Now it is time to start the protocol stack with ionstart. It will create a log file named by default ion.log in the directory from where we launch ionstart. Since I want to see the log in action, I will create an empty ion.log file and run tail -f ion.log, and in another terminal window launch ION using ionstart with the -I option to include to config/startup file.

Here you can see both terminals side by side



Like for the Internet Protocol (IP) we have a similar tool to ping, for Bundle Protocol (BP) it is called bping 😊

When using bping we need to follow the naming scheme for DTN, telling the originating and destination nodes and endpoints, which is something like scheme:nodeID.endpoint. I will use my node ID in both cases ipn:170.1, the -v option to make it verbose and -c 5 to send just five bpings, here you go



Yeah you just did your first test running the ION DTN Bundle Protocol stack !!

There are some tools that can help check the status of your DTN stack like ss to see the  active sockets, and ipcs for information on IPC (Inter Process Communication) facilities like  the mutex semaphores created by the Bundle Protocol stack.



You are one step closer to be able to communicate with space objects and other ION nodes.

Like ionstart, there is a ionstop command to stop the ION protocol stack and kill all the associated processes.


In a coming article I will show how to create a Virtual Machine running Ubuntu Linux and build ION on it, then we will have two nodes to start exchanging messages using the Bundle Protocol.

Until then here is some reading material from Scott Burleigh the main author of the ION implementation of the DTN Bundle Protocol.

At the IPNSIG (InterPlanetary Networking Special Interest Group) soon to be Internet’sSociety Interplanetary Chapter, there are plans to have a test network where everybody will be able to participate and help testing DTN at a larger scale.

If you have questions please feel free to leave your comments below. As always, constructive feedback is welcomed.

Stay tuned for future updates, and if you are interested to exchange ideas and learn more you are welcome join the Inter Planetary Facebook Group and join IPNSG !!

Happy Networking and Happy New Year !!

Cheers
J
orge

Originally Published on 12/31/2021 here



No comments: