Friday, December 31, 2021

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

  • A 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 and 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

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 ''
    # 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
    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
    ## end bpadmin

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

    ## begin ionsecadmin
    ## 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 !!


Sunday, December 5, 2021

DTN-IPN R&D Lab Prototype Intro

Image Courtesy of NASA

Since my early days tinkering with electronics, I always believed that one of the best ways of learning is by doing, getting your hands busy. My Mom (RIP) probably didn’t appreciate me taking appliances apart but over my long career in electronics, computer science and networking, I learned a lot by doing, and of course, reading any related materials, and during the past few years taking online classes.

I’m a byproduct of the Apollo era, I grew up fascinated with the space program, and my eyes were glued to our black and white TV when in 1969 Neil Armstrong set foot on the Moon. Yes, I dreamed about becoming an astronaut someday, but more than that, it cemented my inspiration to have a career in technology.

But this article is not about me, you can find more about me here.

Being a Pioneer Member of Internet Society (ISOC,) and my interest in learning more about space communications, during 2021 I joined ISOC’s Inter Planetary Networking Special Interest Group (IPNSIG.) 

After some exchanges with Vint Cerf, watching his TEDx presentation from 10 years ago about his vision and work on an Interplanetary Internet, participating in several remote conferences and webinars, reading a lot about it, and researching the evolution of new technologies for Delay-Tolerant Networking (DTN – RFC4838) and Bundle Protocols (RFC5050,) it got me thinking:

What can I do to learn more and share what I learn about these new evolving technologies?” … 

I came up with:

How about a low cost platform where we can tinker, experiment and do some development about objects communicating using DTN?” … 

One interesting fact about DTN is that it not only provides a way for networking in space, there are other applications that can take advantage of it, like IoT, battlefield communications, and many other scenarios where communications could be disrupted or delayed for various reasons .

While this is something that have been on the works for some time, it is still nascent technology, with lots of space for learning and experimenting, huge commercial and STEM educational opportunities, etc. NASA is already using it on an experimental basis for its Interplanetary Overlay Network (ION.)

Based on my previous experience developing embedded systems with microcontrollers and single board computers (SBC,) and inspired by NASA’s Artemis Mission to get back to the Moon, I started putting together what I call the IPN DTN Lab Protoype.

IPN DTN R&D Lab Prototype

The IPN DTN Lab is a collection of various SBCs (Raspberry Pi Zero W2) and ESP32-S2 Dev Kits, combined with different type of displays, a couple low power LoRa transceivers, a simple GPS receiver, etc. The idea is that the platform can be used also to learn how to interface different type of devices to each of the boards, and how to use DTN and Bundle protocols to exchange data between them.

This is very much work in progress, I just finished to put together the first complete version of the hardware with some basic code running on each of the boards, which for now are all communicating via WiFi with TCP/IP, few of them include a LoRa transceiver module for low rate and long range wireless communication.

As said before, the design is inspired on the Artemis Mission, then there are three sections, one includes various nodes representing different facilities on Earth, such as NASA’s Mission Control Center (MCC,) NASA’s Deep Space Network (DSN,) NASA’s Tracking and Data Relay Satellite network (TDRS,) etc. Also, ESA’s European Space Operations Center (ESOC,) and SpaceX CORE (Crew Operations and Resource Engineering.)

IPN DTN Lab - Earth Section

The second section represents various object that will be in Moon’s Orbit, like NASA’s multi-purpose orbital outpost Gateway, ESA’s I-Hab expansion module for Gateway, NASA’s Orion Capsule, etc.

IPN DTN Lab - Moon Orbit Section

And the third section represents various objects that will be in the Moon’s surface, such as NASA’s Lunar Ground Station (LGS,) SpaceX’s Starship Moon Lander, and JAXA’s pressurized Lunar rover being developed with Toyota aka Cruiser.

IPN DTN Lab - Moon Surface Section

All the nodes feature a small 128x32 pixels OLED display, some of them include also a pair of four-digit alphanumeric LED display, and at least one RGB LED (NeoPixel.) On this version, five of the nodes are implemented with Raspberry Pi Zero W2 boards, three of them include a low power LoRa transceiver for long distance wireless communications. One of the Raspberry Pi Zero W2 boards is interfaced with a small GPS receiver module with the option for an external antenna for better reception.

The role of each node can be changed just by software. For example, this is one of the Raspberry Pi’s getting GPS data from another node via the network.

IPN DTN Lab - MCC node screen capture

The design is completely scalable, and more nodes can be added to expand the network.

As said before this is very much work in progress. Being now the hardware development phase stable, I will be focusing on the software, bringing up the Bundle Protocols for communication, some demonstrations and documentation. 

When people ask when it will be all ready, I always use the classic response from Elon’s Musk … “Two Weeks” 😊

I’m in the process of putting together several presentations and classes, a summary paper, various videos, etc.

I will be providing more details, and regular reports how the project progresses in future posts, stay tuned.

If you are interested to learn more about this, feel free to contact me, if you have ideas or constructive feedback feel free to leave a comment.

If you are interested in providing funding for projects like this, definitely contact me !!

Signing off for now from planet Earth