Latest News
  • 23 Jun 2016 – Channel 6: New Solar System Internet Technology (Interview)
  • 21 Jun 2016 – New Solar System Internet Technology debuts on ISS - DUTH contribution is acknowledged by NASA
  • 28 Sep 2015 – NASA officially thanks SPICE team for its contribution to the Interplanetary Overlay Network (ION) system
  • 03 Jun 2015 – The kick-off meeting of SENSKIN project was successfully held in Athens, Greece.
  • 26 Feb 2015 – The kick-off meeting of UMOBILE project was successfully held in the premises of the Engineering Department, University College of London, UK.

Back to DtnAgent Home

This section gives an overview of the DTN header as well as the classes that constitute the DTN model. The following is a list of the components of the DtnAgent:

  • struct hdr_dtn: Follows the ns-2 rules for defining new protocol headers included in the simulation packets. The struct includes both standard bundle protocol fields (i.e. nSourceAddress_, fTimestamp, nFragmentOffset_) and simulation specific fields (i.e. nSegmentNumber_, bLeadingBytes_).

  • class Bundle: Contains a hdr_dtn struct along with a number of additional pieces of information necessary for bundle management when the bundles are in storage. It contains an upstream connection pointing to the connection this bundle was received from, as well as a downstream connection pointing to the connection that part, or all of the bundle has been forwarded to. It also contains a pointer to the next bundle in the stored bundles list. The bundle class supports functionality for merging, fragmenting, creating custody reports, and querying about several characteristics useful for bundle manipulation (i.e. if it is a complete ADU or fully contains another bundle, etc).

  • class BundleManagerDTN: Implements the storage where the bundles are kept inside the Agent. The manager is a singly linked list providing functions for adding new bundles, retrieving completed ADUs, retrieving expired bundles for retransmission, merging all merge-able bundles, fragmenting all bundles, etc. The manager can also be queried in order to find a bundle corresponding to an original bundle that has been fragmented, to find the earlier Retransmission Time so that the timer can be set accordingly, to check if the original of a fragmented bundle has been fully received or acknowledged etc.

  • class DtnConnection: Contains links to the owner and the peer DtnAgent objects, a TcpDtnAgent for sending data to the specified peer agent and a TcpDtnSink for receiving data from the peer agent. The connection also contains a connection id as well as a pointer to the next connection. Originally a connection has no TcpDtnAgent and TcpDtnSink objects, but creates them on the fly when necessary. Due to the TCP agents being attached to a node in the TCL space, setting up the TCP connections of a DtnConnection object involves invocation of a TCL function. In the future this mechanism could allow for dynamic routing support.

  • class ConnectionManager: Includes two singly linked lists; one containing the downstream and the other containing the upstream connections. It also contains a flag to indicate whether the downstream connections have been setup. Finally, it provides several functions for managing the connections and querying the lists.

  • class DtnAgent : public Agent: This is the main class implementing the core functionality of the model and it subclasses the Agent ns-2 class. It exposes a number of options such as the ones mentioned in the Usage section (i.e. nIsBSNode_, nMaxBundleSize_, fTimeout_), which are bound to the corresponding TCL class variable through the bind function. The class contains a ConnectionManager holding the DTN connections of the agent, and a BundleManagerDTN holding the in-storage bundles. The DtnAgent also contains two timers; one for retransmission of bundles and the other for the RV mechanism. Through the command interface the class exposes to the TCL space the following commands:

    • add-downstream-agent: Adds a downstream DtnConnection.

    • add-upstream-agent: Adds an upstream DtnConnection.

    • attach-down-tcp: Attaches a TcpDtnAgent and a TcpDtnSink to the connection with a certain peer downstream DtnAgent.

    • attach-up-tcp: Attaches a TcpDtnAgent and a TcpDtnSink to the connection with a certain peer upstream DtnAgent.

    • attach-down-udp: Attaches a pair of UdpDtnAgent objects to the connection with a certain peer downstream DtnAgent.

    • attach-up-udp: Attaches a pair of UdpDtnAgent objects to the connection with a certain peer upstream DtnAgent.

    The DtnAgent class overrides the sendmsg() function of the Agent class (invoked by the application layer) so that it first creates the appropriate number of bundles and then passes the new bundles on to the TcpDtnAgent of the desired downstream connection. A ReceiveBundlePayload() funtion is called by an attached TcpDtnSink of receiving UdpDtnAgent object when incoming bytes for a certain bundle arrive. Finally, the DtnAgent exposes a BundleTransmitted() callback function, invoked by an attached TcpDtnAgent class when the final bytes of a certain bundle have been transmitted, so that the DtnAgent can set the appropriate timeout (supported only when the TCP convergence layer is employed). This callback mechanism is necessary because a long delay between queuing up new bundles and actually transmitting them could cause multiple copies of the same bundle to end up in the queue after subsequent timeouts (i.e. the timeout value is short and the network congested).

The final three classes described in the list below are related to the specialized TCP classes employed by the DTN model:

  • class BundleManagerTCP: It is a simplified version of the BundleManagerDTN that stores TCP packets corresponding to certain bundle segments. Among others, the manager provides functions that append and retrieve bundle segments from the list, based on their TCP sequence number. Also, the class provides a function to remove segments belonging to a certain bundle so that bundle transmission cancellation becomes possible.

  • class TcpDtnAgent : public TcpAgent: This class extends the TcpAgent class, which is the default TCP version in ns-2. In order for a different TCP to be used the parent class must be changed to the desired TCP flavor class (i.e. RenoTcpAgent). The agent includes a BundleManagerTCP containing the bundle segments scheduled for transmission. The class exposes the sendBundle() function invoked by the attached DtnAgent in order to add a new bundle to the transmission queue. It also exposes a CancelBundleTransmission() function that cancels the transmission of a certain bundle as well as a BundleInTransit() function that checks if a certain bundle is scheduled for transmission. Overriding the output_helper() function allows for populating the DTN header of the packets, while overriding the recv_newack_helper() allows for removing from the BundleManagerTCP segments that have been acknowledged.

  • class TcpDtnSink : public TcpSink: Includes a BundleManagerTCP where incoming, out-of-sequence bundle segments are stored. When the next in-sequence packet arrives, the bundles up to the next missing sequence number are delivered to the DtnAgent.

  • class UdpDtnAgent : public UdpAgent: Extends the UdpAgent class and exposes the sendBundle() function invoked by the DtnAgent in order to transmit a new bundle. It also overrides the recv() function in order to deliver received bundles encapsulated into UDP packets to the attached DtnAgent. This class is used both as a sender and as a receiver between two communicating DtnAgents.