Subject: [dtn-users] ACS and some performance improvement patches uploaded

From: "Zoller, David A. (MSFC-EO60)[HOSC SERVICES CONTRACT]" <[email-masked]>
Date: Thu, 19 Jul 2012 16:33:28 -0500

Greetings all,
I have finally uploaded a set of patches that implement the Aggregate Custody Signals (ACS) and some performance improvements. The upload is to the Tracker/Patches on the Sourceforge site:
https://sourceforge.net/tracker/?func=detail&aid=3546074&group_id=101657&atid=630169

Below is a list of what is included and instructions for downloading and applying the patches. Hopefully I didn't leave anything out but send a message if you run into trouble.

I'll follow up with some performance results and look forward to seeing if y'all get the same results. I do not consider this complete by any means and am continuing with experimenting that I hope will turn into future patches.

Best regards,
DZ

Oasys Patches (all patches are against changeset 2298)

·         oasys_patch1_configuration.patch

o   Fixes oasys.ac so that the oasys source can be installed in a non-standard directory and DTN2 can find it by specifying the location using --with-oasys=<location>

·         oasys_patch2_bug_fixes.patch

o   debug/Log.cc - fixes uninitialized variable per valgrind

o   test/Makefile - removed sqlite-db-test which disappeared

o   test/marshal-test.cc - setting the logpath must have changed

o   test/serialize-test.cc - setting the logpath must have changed

o   thread/SpinLock.cc - bug fix in try_lock() which I don't think is used in DTN2

o   thread/SXLock.h - I recommend deleting this as the exclusive lock is not guaranteed for multiple writers. Timing tests show that the SpinLock is better performing than any SXLock I was able to devise. Results and/or code available if desired.

·         oasys_patch3_timer_reaping.patch

o   thread/Timer - Adds a new TimerReaperThread which periodically removes canceled timers from the queue otherwise it does not happen until after they expire.

§  NOTE: This does not allow them to be safely re-used.

DTN2 Patches (all patches are against changeset 3550 but some are cumulative and must be applied in order)

·         dtn2_patch0_ipn_scheme_updates.patch

o   Combines features from implementations in both the main and apr-port branches and fixes a few bugs.

o   This is the same as the ipn_scheme_updates.patch uploaded to Sourceforge a few weeks ago so do not apply this twice.

o   Patch 3 tweaks a couple of these files so this needs to be applied first.

·         dtn2_patch1_configuration.patch

o   Adds acs.ac for supporting Aggregate Custody Signals:  configure using --with-acs to include it in your build

o   Adds ecos.acs for supporting the Extended Class of Service block: configure using --with-ecos to include it in your build

o   Adds __STDC_FORMAT_MACROS and __STDC_LIMIT_MACROS to the dtn-configuration.h header which are being used more prevalently now

·         dtn2_patch2_aggregate_custody_signals.patch

o   Requires Patch 0 to be applied first

o   WARNING to Age Block users: The Custody Transfer Enhancement block type requires id 0x00a so I had to move the Age block id to 0x00d.

o   Implements Aggregate Custody Signals and the required the Custody Transfer Enhancement block processing

o   Adds a new "acs" command to configure the ACS features and updates the documentation

o   Adds a new persistent store for pending ACSs

o   Implements the ground work for the Extended Class of Service block

§  This is a partial implementation that adds the ECOS block to outgoing custody signals and processes the most likely used features on incoming blocks but does not do anything with it.

o   applib/APIServer - fixed a memory leak in handle_recv() per valgrind

o   Tweaks a couple of files in the IPN Scheme update (Patch 0)

o   servlib/reg/AdminRegistration - marks bundles as delivered after processing

o   servlib/reg/PingRegistration - marks bundles as delivered after processing

o   test/unit-tests/bundle-list-test - updated to take into account the all_bundles_list_

o   BundleDaemon::cancel_custody_timers - releases the bundle reference so the bundles can be deleted sooner

·         dtn2_patch3_bundlelist.patch

o   Requires Patch 2 to be applied first

o   Implements a set of specialized bundle lists so that the best suited for a specific purpose one can be used

§  BundleList - the original std::list<Bundle*>

§  BundleListIntMap - new std::map<uint32, Bundle*>

§  BundleListStrMap - new std::map<string, Bundle*>

§  BundleListStrMultiMap - new std::multimap<string, Bundle*>

§  Added new unit tests

o   servlib/bundling/Bundle

§  incorporated a GbofId object to improve performance with the new bundle list types

o   servlib/bundling/BundleDaemon

§  Added a new dupefinder_bundle_ list for detecting receipt of duplicate bundles faster

·         Thanks to Jacob Green for his insights

o   While using the pending_bundles_ list to pull double duty would not have affected the main event Q itself it got me thinking and I realized that it may change the order bundles were delivered in the case where a registration or link became available after bundles were pending for it.

§  Changed the run() method to use the oasys::TimerThread and the new oasys::TimerReaperThread

o   servlib/bundling/BundlePayload - changed the directory structure used for storage to speed up access

·         dtn2_patch4_experimental_tablebasedrouter.patch

o   servlib/routing/TableBasedRouter

§  Thanks to Elwyn Davies for providing some analysis

§  fwd_to_next_hop() now always puts bundles onto the deferred list to maintain delivery order

§  check_next_hop() now breaks out of its loop after moving 1 bundle from the deferred list to the queue

§  reroute_all_bundles() no longer keeps the pending_bundles_ list locked during all of its processing which should help in the future if/when the BundleDaemon is multi-threaded

§  handle_link_created()no longer calls reroute_all_bundles() twice

Instructions for downloading and applying the patches in Linux

·         Download oasys tarball for changeset 2298:

Ø  http://dtn.hg.sourceforge.net/hgweb/dtn/oasys/rev/2a143c1f5eea

Ø  Click on the "gz" option at the top to start the download: oasys-2a143c1f5eea.tar.gz

·         Download oasys tarball for changeset 3550:

Ø  http://dtn.hg.sourceforge.net/hgweb/dtn/DTN2/rev/14ffb2a3aa16

Ø  Click on the "gz" option at the top to start the download: DTN2-14ffb2a3aa16.tar.gz

·         Download the patches:

Ø  https://sourceforge.net/tracker/?func=detail&aid=3546074&group_id=101657&atid=630169

Ø  Click the "download" option near the bottom of the page to start the download: acs_and_more_patches.zip

·         Move the tarballs and patches file to the directory of your choice and extract the source code:

Ø  tar -xf oasys-2a143c1f5eea.tar.gz

Ø  tar -xf DTN2-14ffb2a3aa16.tar.gz

Ø  unzip acs_and_more_patches.zip

·         If desired, you can rename the created directories to oasys-1.5.0 and dtn-2.8.0 or the names of your choice.

Ø  The following assumes the directories are not renamed and the patches are in the directory one level above the oasys-2a143c1f5eea and DTN2-14ffb2a3aa16 directories

·         Apply the patches to the oasys source code in order:

Ø  Change directory to the oasys directory:

§  cd oasys-2a143c1f5eea

Ø  Apply the configuration patch:

§  patch -p1 -i ../oasys_patch1_configuration.patch

§  The configure script should work as is or you can rebuild it locally on your machine:

·         ./build-configure.sh

Ø  Apply the other two patches:

§  patch -p1 -i ../oasys_patch2_bug_fixes.patch

§  patch -p1 -i ../oasys_patch3_timer_reaping.patch

Ø  Now configure the oasys build environment with options appropriate for you.

§  Run "./configure -h" for a list of options and I recommend disabling debug locking unless you are debugging:

·         ./configure --disable-debug-locking

Ø  And now build the libraries:

§  make

Ø  Finally install the oasys libraries as the root user:

§  make install

·         Apply the patches to the DTN2 source code in order:

Ø  Change directory to the DTN2 directory:

§  cd ../DTN2-14ffb2a3aa16

Ø  Apply the patches which I believe are conformant with the current Bundle Spec implementation

§  patch -p1 -i ../dtn2_patch0_ipn_scheme_updates.patch

§  patch -p1 -i ../dtn2_patch1_configuration.patch

·         The configure script should work as is or you can rebuild it locally on your machine:

o   ./build-configure.sh <path to oasys>

o   For this example it would be "./build-configure.sh ../oasys-2a143c1f5eea"

§  patch -p1 -i ../dtn2_patch2_aggregate_custody_signals.patch

§  patch -p1 -i ../dtn2_patch3_bundlelist.patch

Ø  You can also check out the experimental version of the TableBasedRouter that I am working with:

§  patch -p1 -i ../dtn2_patch4_experimental_tablebasedrouter.patch

·         Now configure the DTN2 build environment with options appropriate for you.

Ø  Run "./configure -h" for a list of options

§  if you used the default directory names then you will need to indicate where oasys is installed "--with-oasys=../oasys-2a143c1f5eea".

§  If you want to enable Aggregate Custody Signals use the "--with-acs" option.

§  This is the configuration I have been using for performance testing:

·         ./configure --disable-ecl --disable-edp --with-oasys=../oasys-2a143c1f5eea

·         And now build DTN2 programs:

Ø  make

·         Finally install the DTN2 programs as the root user:

Ø  make install

David Zoller
COLSA Corporation
Marshall Space Flight Center