Subject: [dtn-interest] DTN2 - issues with discovery and ProPHET protocol

From: "I-Rajagopalan, Vijayasarathy" <[email-masked]>
Date: Mon, 5 Dec 2016 09:30:24 +0000

Hi all,
I am currently experimenting with the DTN2 implementation for analyzing various routing protocols which can be configured with DTN2. I have certain issues with the DTN2 implementation.
I am emulating a simple 2-node network to analyse opportunistic contact and use of various routing protocols between them (the ultimate goal is to run a multi-node emulation of mobile nodes with multiple routes between them). The emulation is done on the Common Open Research Emulator (CORE), which will let nodes to be moved in a canvas to emulate in-contact/out-of-contact scenarios for radio communication. I am having issues with two aspects of DTN2 - discovery and prophet protocol at the moment, as explained below:
a) I am running a simple discovery between the two nodes. The nodes are out-of-contact at the beginning, and one node is manually moved to the other node's proximity for them to become in-contact. The configuration file is same for both nodes (except for the discovery IP), and is the following (removed comments and blank lines for convenience):
 ---------------------------------------------------------------------------------
log /dtnd info "dtnd parsing configuration..."
console set stdio true
set shorthostname [lindex [split [info hostname] .] 0]
console set prompt "$shorthostname dtn% "
storage set type berkeleydb
storage set server_port 62345
storage set schema /etc/DS.xsd
append dbdir $::env(SESSION_DIR) "/" [info hostname] ".conf/dtn2/"
if {$dbdir == ""} {
    puts stderr "Must create /var/dtn or /var/tmp/dtn storage directory"
    exit 1
}
append local_payloaddir $dbdir "/bundles"
append local_dbdir $dbdir "/db"
storage set payloaddir $local_payloaddir
storage set dbname     DTN
storage set dbdir      $local_dbdir
route local_eid "dtn://[info hostname].dtn"
interface add udp0 udp
discovery add udp0d ip port=9556
discovery announce udp0 udp0d udp interval=4 cl_addr=10.0.0.2
log /dtnd info "dtnd configuration parsing complete"

When DTN2 is started on the two nodes, and the nodes are moved nearer to become in-contact, I see that the link state goes from UNAVAILABLE to OPENING, and remains in the OPENING state forever. The nodes do not seem to be dtnpinging each other. A link dump on one of the nodes results in the following:
 -------------------------------------------------------------------------
n2 dtn% link dump
Active links:
link-0 [10.0.0.1:4556 dtn://n1.dtn OPPORTUNISTIC udp state=OPENING]

Previously active links:

-------------------------------------------------------------------------

However, a link stats on link-0 gives the following statistic:

-------------------------------------------------------------------------
n2 dtn% link stats link-0
1 contact_attempts -- 0 contacts -- 0 bundles_transmitted -- 0 bytes_transmitted -- 0 bundles_queued -- 0 bytes_queued -- 0 bundles_inflight -- 0 bytes_inflight -- 0 bundles_cancelled -- 187 uptime -- 0 throughput_bps -- 0 bundles_deferred
-------------------------------------------------------------------------

We can see that the bundles_cancelled number keeps increasing.
 However, when the nodes start in-contact, the link automatically goes to the OPEN state, and the nodes are able to dtnping each other, and bundles get queued when they are moved farther away as expected.
b) I am running ProPHET routing protocol over UDP CL discovery in the same network as above. The configuration for both the nodes is as follows:
 ----------------------------------------------------------------------------
log /dtnd info "dtnd parsing configuration..."
console set stdio true
set shorthostname [lindex [split [info hostname] .] 0]
console set prompt "$shorthostname dtn% "
storage set type berkeleydb
storage set server_port 62345
storage set schema /etc/DS.xsd
append dbdir $::env(SESSION_DIR) "/" [info hostname] ".conf/dtn2/"
if {$dbdir == ""} {
    puts stderr "Must create /var/dtn or /var/tmp/dtn storage directory"
    exit 1
}
append local_payloaddir $dbdir "/bundles"
append local_dbdir $dbdir "/db"
storage set payloaddir $local_payloaddir
storage set dbname     DTN
storage set dbdir      $local_dbdir
route local_eid "dtn://[info hostname].dtn"
route set type prophet
interface add udp0 udp
discovery add udp0d ip port=9556
discovery announce udp0 udp0d udp interval=4 cl_addr=10.0.0.2
log /dtnd info "dtnd configuration parsing complete"
----------------------------------------------------------------------------
 Since ProPHET relies on the underlying discovery, the following is seen:
               1. When nodes start from out-of-contact and move closer to each other, ProPHET does not seem to begin because of discovery failure.
               2. When nodes start from in-contact, discovery succeeds as mentioned above, and hence one of the nodes initiates a HELLO tlv (as mentioned in ProPHET I-D). However, the node which receives the HELLO tlv crashes with an assert failure, with the below message:
 -------------------------------------------------------------------------
n2 dtn% ASSERTION FAILED (e->link_ != NULL) at routing/ProphetRouter.cc:190
STACK TRACE: 0x6414a3 0x4d70b5 0x44d06d 0x4d678b 0x43d1a5 0x43d13a 0x43e420 0x66bd77 0x66bc26 0x7f2a72152184 0x7f2a7165f37d
./setdtn2dirs: line 12:    99 Aborted                 (core dumped) dtnd -c dtn2/conf/${HOSTNAME}.conf -l debug -o dtn2/log/${HOSTNAME}.log -t
-------------------------------------------------------------------------
 I am attaching a zip file with this email, which contains the following documents:
 a) Folder by the name "discovery_issues", which contains the configuration of one of the nodes and the DTN2 log for the node.
b) Folder by the name "prophet_issues", which contains the configuration of both nodes (in folders n1 and n2), and their respective logs.

Any assistance on the above is much appreciated.

Thanks and regards,
Vijayasarathy (Vijay)