Standard Operating Procedure Handbook for the Interplanetary Overlay Network (ION) Bundle Protocol Suite
Date: 2024-06-26
Version: 0
Revision History
Version | Date | Applicable ION Version | Change Description |
---|---|---|---|
0 | 6/26/2024 | 4.1.3 | Initial draft |
Contributors
- Sky DeBaun (JPL/Caltech)
- Jay Gao (JPL/Caltech)
- Patricia Lindner (Ohio University)
- Shawn Osterman (Ohio University)
- Nate Richards (JPL/Caltech)
- Leigh Torgerson (JPL/Caltech)
Table of Content
- Standard Operating Procedure Handbook for the Interplanetary Overlay Network (ION) Bundle Protocol Suite
- Revision History
- Contributors
- Table of Content
- Introduction
- Document Scope
- ION Online Documentations and Source Repositories
- Basic Use Case: Single User, Admin \& Developer
- Dependencies [^1]
- Pre-installation Check
- Installation
- Pre-Launch
- Launch ION
- Establish a shell session to interact with an ION instance
- Real-time Commanding/Configuration
- Shutdown ION
- Remove ION Installation
- Check for running ION instance(s)
- Method 1: Check ION daemons
- Method 2: Check IPC status
- Case 2: Multi-User, shared host/VM
- Appendix
Introduction
In this document, we provide a detailed SOP on how to deploy ION for system administrators, software developers/testers, and ION network operators.
Document Scope
The initial draft of this document will focus on Linux
, Solaris
, and
MacOS
using the ION open-source codebase released through Github.
We will address single-user and multi-user cases.
Future versions of this document will expand the SOP to include the ION Core package.
During versions of this document, we intend to address specific considerations for adopting the SOP to other platforms/OS such as:
- Windows Operating System
- Cloud Computing
- Embedded System
ION Online Documentations and Source Repositories
- ION Open Source Online Documentation: https://nasa-jpl.github.io/ION-DTN/
- ION Open Source Git Repository: https://github.com/nasa-jpl/ION-DTN
- ION Core: https://github.com/nasa-jpl/ion-core
Basic Use Case: Single User, Admin & Developer
We start with the simplest configuration where a single user has full control over a host or a VM within a secured envrionment within which ION will execute. The host and VM have no other purpose other than the development and testing of ION.
Dependencies 1
gcc
make
automake
autoconf
libtool
bash
- (optional) Many scripts are written for bash shell; having bash installed in the system will ensure these scripts execute predictably.python3
- (optional) Python is used for some BPSec regression tests but is not strictly required to build and run ION.sudo
- (optional) While sudo privilege is required during the last step of a nominal installation on Linux to execute the shared library update. However, it is not strictly required to use ION if it is installed in a directory owned by the user with a properly updated library and execution paths.net-tools
- (optional) useful for checking network connectivity and performance for ION troubleshooting.
Pre-installation Check
If the user plans to install only one version of ION, then the user should:
- Check for running ION instances and shutdown ION.
- Check for an existing installation of ION and remove ION.
If the user plans to install multiple versions of ION in different directories, then the user should:
- Determine the location of any existing installation of ION.
- Select a different prefix (directory) for the installation.
Installation
-
Download the ION release from GitHub and verify the checksum of the tarfile.
-
Extract ION into the source directory of your choice.
-
In a shell environment, change to ION source code's root directory:
- Verify the ION version by checking the content of the
release_notes.txt
file in ION's root directory. The release version will be stated in the first line of the file. - Check for the presence of the
configure
script in the ION root directory - if not present, runautoreconf -fi
to generate theconfigure
script. - Check the execution path in your system, e.g.,
echo $PATH
and make a note whether/usr/local/bin
or your intended installation directory is part of it.
- Verify the ION version by checking the content of the
-
Run
./configure
to build the Makefile:- If the Makefile already reflects the configuration you wanted, say from a previous
./configure
run, you don't need to do it again. Skip to the next step. - Run
./configure --help
to see a list of options. - For Solaris OS, it is recommended to add the argument
MAKE=gmake
. - If you want to install bundle protocol version 6 (BPv6) instead of the most current BPv7 implementation, then include the
--enable-bpv6
option. - Check the execution path to make sure where you intend to install ION is in the
PATH
variable or will be added later. - To install ION to a directory other than the default of
/usr/local
, use the--prefix
option.
- If the Makefile already reflects the configuration you wanted, say from a previous
-
Build ION:
- Run
make
to build ION.- If you know ION was built before, either under a different set of configuration options, or just want to ensure everything is rebuilt correctly, run
make clean
first. - If using Solaris, you could use
gmake
instead.
- If you know ION was built before, either under a different set of configuration options, or just want to ensure everything is rebuilt correctly, run
- Run
-
Install ION:
- Run
sudo make install
ormake install
to install ION. Whethersudo
is needed will depend on the permissions required to write to the installation directory. Using the default installation location of/usr/local
requires sudo privilege.- If you noticed prior installations of ION were not removed, run
sudo make uninstall
ormake uninstall
(depending on where you are installing the executables and the libraries). This assumes that the prior installation is using essentially the same ION version and the same installation directory. If the situation is more complicated, you should try the remove ION installation procedure. - If using Solaris, you could use
gmake
instead.
- If you noticed prior installations of ION were not removed, run
- Run
-
Run
sudo ldconfig
:- At the end of the installation, you may need to run this command to update the shared library management in the operating system.
- For Solaris and MacOS,
ldconfig
is not required. - If you install ION in a directory owned by the user,
ldconfig
is not useful because it manages only system-wide shared libraries. In that case, you need to update the shared library separately in the shell environment in which you plan to execute ION:
- For Solaris and MacOS,
- At the end of the installation, you may need to run this command to update the shared library management in the operating system.
-
(Optional) Run tests:
- Run
make test
to execute the C code-based regression tests in ION.- Verify that the
bping
test at the end passed.
- Verify that the
- Run
-
Verify ION installation location:
- Run
which bpversion
; the path shown should be either/usr/local/bin
or the bin directory under the prefix you specified. - Verify installed Bundle Protocol version by running
bpversion
. - Verify ION version by running
ionadmin
, then followed by thev
command at the prompt. Typeq
to quit. - Verify ION operation by running the basic
bping
test. You can skip this if you ranmake test
earlier, which would automatically trigger thebping
test.
- Run
Pre-Launch
- Check for running instances of ION by following these steps.
- If you find ION instances running in the system that are not part of a multi-ION configuration you are participating in, or if you intend to launch a single-instance ION configuration in this host, follow the Shutdown procedure to stop all ION instances in the system.
- Load ION configuration files into the predetermined working directory and
cd
into that directory. - Verify all required
.rc
files and the contact graph file (if used) are present in the working directory. - Remove files created by previous ION runs & remove them as necessary:
ion.log
in the current directory.- BSS database files:
*.lst
,*.dat
, and*.tbl
. - Check for temporary files left over from previous failed BP and LTP acquisition processes, typically found in the working directory:
bpacq.<integer>
andltpacq.<integer>
. - Check for leftover
ion.sdrlog
file, typically found in/tmp
. However, it may be located in another directory if a differentpathName
was specified by the previous run'sionconfig
file. See the man page entry forionconfig
for details. - If you know the installed ION will utilize the POSIX Named Semaphore (this is default as of ION 4.1.3), check for any POSIX named semaphore files left in the folder (for Ubuntu)
/dev/shm
. Identify the ION-related semaphores named with this pattern:sem.ion:GLOBAL:<integer>
. If these files are owned by another user, they should be removed so you can launch a new instance of ION.- Typically, with a nominal ION shutdown, these semaphore files are removed automatically. However, due to system crashes or other ungraceful shutdowns, i.e., utilizing
kill -9
or ION's kill script alone, they will be left behind. - The location of the semaphore files can change for different distributions. Always verify the directory you are looking at is the correct location.
- For MacOS, the POSIX-named semaphores are not accessible through the file system, so this step can be skipped.
- Typically, with a nominal ION shutdown, these semaphore files are removed automatically. However, due to system crashes or other ungraceful shutdowns, i.e., utilizing
- TBD.....Check network connection, firewall setting, run tcp/udp or both with the peer's IP address and port. Update firewall settings as necessary.
Launch ION
- TBD
Establish a shell session to interact with an ION instance
- Start a shell session as needed.
- Check & set environment variables:
- If you are interacting with one of multiple ION instances that are running simultaneously on this host, you need to set the following environment variables:
export ION_NODE_LIST_DIR=$PWD
export ION_NODE_WDNAME=<path to the ION WD>
this is needed if you are not currently in the working directory of the ION instance with which you plan to interact.
- If you are interacting with one of multiple ION instances that are running simultaneously on this host, you need to set the following environment variables:
-
Confirm you are now interacting with the correct ION instance by running:
The output will show the configured induct, which will provide you an indirect confirmation of which ION node you are interacting with.
Real-time Commanding/Configuration
- First establish a shell session with the ION instance using these steps.
- TBD...
- TBD...
Shutdown ION
- Determine if you are in a multi-ION instance configuration. First, establish a shell session with the ION instance you want to shut down using these steps.
-
Launch the shutdown script:
- If you know the working directory and a shutdown script is provided, then execute that script.
- If you don't know the working directory but ION appears to be running normally, try to shut it down by executing the admin program associated with the ION daemons. For example, you could run the following commands:
Additional admin programs will need to run to try to shut down the associated services. To determine exactly which services are running, you need to look at the output of the
ps
command to figure that out. -
Use the check ION instance procedure. If the instance you are trying to shut down is still running, then use the installed
ionstop
stop script from the working directory of the ION instance you want to shut down. - Re-verify ION is no longer running using the check ION instance procedure.
Remove ION Installation
-
Determine if you know the source directory of the existing installation:
- If you know this,
cd
to that directory and proceed to next step. - If you don't know, use
bpversion
andionadmin
to get the bundle protocol version and ION release number. This may help you identify the probable ION source on the host. If you can identify the source code directory used to build the existing IONcd
to that directory. - If you can't find the source code or nothing matches the bundle protocol version and ION release:
- Use
which ionadmin
to determine the installation location. - Delete all ION-related daemons (from bin) and libraries (from lib) manually. Remember, other programs and libraries may also be installed under the same prefix. Be careful.
- Execute
sudo ldconfig
to update the shared library cache or update the LD library path. This completes the removal. - Verify by trying to run
ionadmin
.
- Use
- If you know this,
-
From the installation source directory:
- Run
sudo make uninstall
ormake uninstall
. This should remove all ION build artifacts from the system, including all the binaries and libraries installed in the system.- You can also run
make clean
to clear the artifacts of the compilation process from the source directory. However, theMakefile
still retains the options you set via the./configure
command. If you want to build with different options, you need to run./configure
with the new compile options.
- You can also run
- Run
Check for running ION instance(s)
There are multiple ways to check whether one or more ION instances are running.
Method 1: Check ION daemons
- Run
ps -fe
and look for various ION-related daemons. Here is a list.
Method 2: Check IPC status
- Run
ipcs
to make sure there are no ION-related shared memory:- Shared memory area identified by the KEY used to create them.
- ION-related shared memory KEY may not be the default value; this requires some prior knowledge.
- If ION was launched using the default keys, you should see the typical set of default KEY listed here.
Case 2: Multi-User, shared host/VM
TBD
Appendix
ION Shared Memory KEY
ION uses shared memory for storing and passing data between ION service
daemons. When ION is launched, several shared memory segments are
created according to the .ionconfig
file. If no specific key values are
provided by the user, ION will launch using the following default values
as seen when executing the ipcs
command:
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x0000ee02 0 root 666 641024 8
0x0000ff00 1 root 666 1000000 8
0x14770006 2 root 666 4002544 8
0x0000ff01 3 root 666 50000000 8
------ Semaphore Arrays --------
key semid owner perms nsems
0x0000ee01 0 root 666 1
0x14770001 1 root 666 250
Shared Memory Segments
- shmid 0 (0xee02 = 60930) is SM_SEMBASEKEY, this is the shared memory used to track the set of semaphores created and used by ION and its daemons.
- shmid 1 (0xff00 = 65280) is the SDR working memory
sdrwm
. - shmid 2 (0x14770006) is the SDR heap space 500000 * 8 bytes = 4000000 (the extra space is for the SDR catalog at the beginning), and created by process ID hex 1477 (dec 5239).
- shmid 3 (0xff01 = 65281) is the shared memory space allocated to the ION working memory
ionwm
.
SVR4 Semaphores
- semid 0 (0xee01 = 60929) is SM_SEMKEY, the initial semaphore set called
ipcSemaphore
that is used to boostrap ION. - semid 1 (0x14770001) is a set of 250 additional semaphores created by process ID hex 1477 (dec 5239). Key is generated by the function
getUniqueKey()
whereby 1477 is the process ID with addition of a randomized value in the lower 16 bits.
NOTE: you may notice one or multiple shared memory blocks of size 20,000,000 bytes. These are sptrace
working memory created by either the sdrwatch
or the psmwatch
programs.
POSIX Named Semaphores
When ION is running or was improperly shut down due to a crash or kill -9
command, the POSIX named semaphore files will remain in the file system. For Ubuntu, the location of these files is /dev/shm
; for other Linux distributions, the locations can vary. The semaphore files created by ION adopts the following name pattern:
Most operating system restrict semaphore files in such ways that only the owner can remove them, so it is important to make sure that ION is properly shutdown or that these semaphore files are removed after a crash or before launching a new instance of ION.
ION-related Daemons
In the kilim
script provided by ION, there is a list of all ION-related daemons. While ION is running, the set of daemons running depends on the user's configuration and DTN services activated. The presence of any of these daemons could indicate either a nominal state of operation or an imcomplete shutdown, leaving some processes to run in the background.
To determine which state ION is in, you should check the ion.log. If you know the working directory of the ION instance. Any anomaly will likely be reported to the ion.log.
Another indication of anomaly is by examine whether a critical set of daemons are present - for example, rfxclock
, bpclock
, bptransit
, bpclm
, ipnfw
, ipnadminep
are some of the most critical daemons what should be running even for a barebone ION configuration. If any of them are missing while other ION daemons remains in the system, it should indicate an anomaly.
Here is a list of all possible ION daemons:
- acsadmin lt-acsadmin \
- acslist lt-acslist \
- aoslsi lt-aoslsi \
- aoslso lt-aoslso \
- bibeadmin lt-bibeadmin \
- bibeclo lt-bibeclo \
- bpadmin lt-bpadmin \
- bpcancel lt-bpcancel \
- bpchat lt-bpchat \
- bpclm lt-bpclm \
- bpclock lt-bpclock \
- bpcounter lt-bpcounter \
- bpdriver lt-bpdriver \
- bpecho lt-bpecho \
- bping lt-bping \
- bplist lt-bplist \
- bpnmtest lt-bpnmtest \
- bprecvfile lt-bprecvfile \
- bpsecadmin lt-bpsecadmin \
- bpsendfile lt-bpsendfile \
- bpsink lt-bpsink \
- bpsource lt-bpsource \
- bpstats lt-bpstats \
- bpstats2 lt-bpstats2 \
- bptrace lt-bptrace \
- bptransit lt-bptransit \
- brsccla lt-brsccla \
- brsscla lt-brsscla \
- bsscounter lt-bsscounter \
- bssdriver lt-bssdriver \
- bsspadmin lt-bsspadmin \
- bsspcli lt-bsspcli \
- bsspclo lt-bsspclo \
- bsspclock lt-bsspclock \
- bssrecv lt-bssrecv \
- bssStreamingApp lt-bssStreamingApp \
- cgrfetch lt-cgrfetch \
- cpsd lt-cpsd \
- dccpcli lt-dccpcli \
- dccpclo lt-dccpclo
- dccplso lt-dccplso \
- dgr2file lt-dgr2file \
- dgrcli lt-dgrcli \
- dgrclo lt-dgrclo \
- dtka lt-dtka \
- dtkaadmin lt-dtkaadmin \
- dtn2admin lt-dtn2admin \
- dtn2adminep lt-dtn2adminep \
- dtn2fw lt-dtn2fw \
- dtpcadmin lt-dtpcadmin \
- dtpcclock lt-dtpcclock \
- dtpcd lt-dtpcd \
- dtpcreceive lt-dtpcreceive \
- dtpcsend lt-dtpcsend \
- file2dgr lt-file2dgr \
- file2sdr lt-file2sdr \
- file2sm lt-file2sm \
- file2tcp lt-file2tcp \
- file2udp lt-file2udp \
- hmackeys lt-hmackeys \
- imcadmin lt-imcadmin \
- imcadminep lt-imcadminep \
- imcfw lt-imcfw \
- ionadmin lt-ionadmin \
- ionexit lt-ionexit \
- ionrestart lt-ionrestart \
- ionsecadmin lt-ionsecadmin \
- ionunlock lt-ionunlock \
- ionwarn lt-ionwarn \
- ipnadmin lt-ipnadmin \
- ipnadminep lt-ipnadminep \
- ipnd lt-ipnd \
- ipnfw lt-ipnfw \
- lgagent lt-lgagent \
- lgsend lt-lgsend \
- ltpadmin lt-ltpadmin \
- ltpcli lt-ltpcli \
- ltpclo lt-ltpclo \
- ltpclock lt-ltpclock \
- ltpcounter lt-ltpcounter \
- ltpdeliv lt-ltpdeliv \
- ltpdriver lt-ltpdriver \
- ltpmeter lt-ltpmeter \
- ltpsecadmin lt-ltpsecadmin \
- nm_agent lt-nm_agent \
- nm_mgr lt-nm_mgr \
- owltsim lt-owltsim \
- owlttb lt-owlttb \
- psmshell lt-psmshell \
- psmwatch lt-psmwatch \
- ramsgate lt-ramsgate \
- recvfile lt-recvfile \
- rfxclock lt-rfxclock \
- sdatest lt-sdatest \
- sdr2file lt-sdr2file \
- sdrmend lt-sdrmend \
- sdrwatch lt-sdrwatch \
- sendfile lt-sendfile \
- sm2file lt-sm2file \
- smlistsh lt-smlistsh \
- smrbtsh lt-smrbtsh \
- stcpcli lt-stcpcli \
- stcpclo lt-stcpclo \
- tcaadmin lt-tcaadmin\
- tcaboot lt-tcaboot\
- tcacompile lt-tcacompile\
- tcapublish lt-tcapublish\
- tcarecv lt-tcarecv\
- tcc lt-tcc\
- tccadmin lt-tccadmin \
- tcp2file lt-tcp2file \
- tcpbsi lt-tcpbsi \
- tcpbso lt-tcpbso \
- tcpcli lt-tcpcli \
- tcpclo lt-tcpclo \
- udp2file lt-udp2file \
- udpbsi lt-udpbsi \
- udpbso lt-udpbso \
- udpcli lt-udpcli \
- udpclo lt-udpclo \
- udplsi lt-udplsi \
- udplso lt-udplso \
- amsbenchr lt-amsbenchr \
- amsbenchs lt-amsbenchs \
- amsd lt-amsd \
- amshello lt-amshello \
- amslog lt-amslog \
- amslogprt lt-amslogprt \
- amsshell lt-amsshell \
- amsstop lt-amsstop \
- bputa lt-bputa \
- cfdpadmin lt-cfdpadmin \
- cfdpclock lt-cfdpclock \
- cfdptest lt-cfdptest \
- bpcp lt-bpcp\
- bpcpd lt-bpcpd\
Notes
-
In this document, we refer to software packages by name given for the Ubuntu distribution. Equivalent packages for other Linux distributions/OS could be different. ↩
-
At this time, ION's admin program does not provide a command to identify its own "node ID." Short of that, the best way to check for the identity of a running ION node is to either look at the current ion.log for output generated during launch, or by asking bpadmin to report its induct information. ↩
-
It is assumed that you know the working directory associated with the running ION instance you want to interact with. ↩
-
It is assumed that you know the working directory associated with the running ION instance you want to shutdown. ↩