dtn::FloodBundleRouter Class Reference

This is the implementation of a flooding based bundle router. More...

#include <FloodBundleRouter.h>

Inheritance diagram for dtn::FloodBundleRouter:
dtn::TableBasedRouter dtn::BundleRouter dtn::BundleEventHandler

List of all members.

Public Member Functions

 FloodBundleRouter ()
 Constructor.
void initialize ()
 Initializer.
void handle_bundle_received (BundleReceivedEvent *event)
 Event handler for new bundle arrivals.
void handle_link_created (LinkCreatedEvent *event)
 When a link is created, add a new route for it.
void handle_bundle_expired (BundleExpiredEvent *event)
 Default event handler when bundles expire.

Protected Attributes

BundleList all_bundles_
 To ensure bundles aren't deleted by the system just after they are forwarded, we hold them all in this separate list.
EndpointIDPattern all_eids_
 Wildcard pattern to match all bundles.

Detailed Description

This is the implementation of a flooding based bundle router.

The implementation is very simple: The class maintains an internal BundleList in which all bundles are kept until their expiration time. This prevents the main daemon logic from opportunistically deleting bundles when they've been transmitted.

Whenever a new link arrives, we add a wildcard route to the table. Then when a bundle arrives, we can stick it on the all_bundles list and just call the base class route_bundle function. The core base class logic then makes sure that a copy of the bundle is forwarded exactly once to each neighbor.

XXX/demmer This should be extended to avoid forwarding a bundle back to the node from which it arrived. With the upcoming bidirectional link changes, this should be able to be done easily.

Definition at line 42 of file FloodBundleRouter.h.


Constructor & Destructor Documentation

dtn::FloodBundleRouter::FloodBundleRouter (  ) 

Constructor.

Definition at line 26 of file FloodBundleRouter.cc.


Member Function Documentation

void dtn::FloodBundleRouter::handle_bundle_expired ( BundleExpiredEvent event  )  [virtual]

Default event handler when bundles expire.

Reimplemented from dtn::BundleEventHandler.

Definition at line 77 of file FloodBundleRouter.cc.

void dtn::FloodBundleRouter::handle_bundle_received ( BundleReceivedEvent event  )  [virtual]

Event handler for new bundle arrivals.

Queue the bundle on the pending delivery list, and then searches through the route table to find any matching next contacts, filling in the action list with forwarding decisions.

Reimplemented from dtn::TableBasedRouter.

Definition at line 45 of file FloodBundleRouter.cc.

References dtn::BundleRouter::Config::add_nexthop_routes_, dtn::BundleRouter::config_, and initialize().

Referenced by handle_link_created().

void dtn::FloodBundleRouter::handle_link_created ( LinkCreatedEvent event  )  [virtual]

When a link is created, add a new route for it.

Reimplemented from dtn::TableBasedRouter.

Definition at line 56 of file FloodBundleRouter.cc.

References all_bundles_, handle_bundle_received(), and dtn::BundleList::push_back().

void dtn::FloodBundleRouter::initialize (  )  [virtual]

Initializer.

Reimplemented from dtn::BundleRouter.

Definition at line 37 of file FloodBundleRouter.cc.

References ASSERT.

Referenced by handle_bundle_received().


Member Data Documentation

To ensure bundles aren't deleted by the system just after they are forwarded, we hold them all in this separate list.

Definition at line 76 of file FloodBundleRouter.h.

Referenced by handle_link_created().

Wildcard pattern to match all bundles.

Definition at line 79 of file FloodBundleRouter.h.


The documentation for this class was generated from the following files:
Generated on Sun Nov 21 11:41:10 2010 for DTN Reference Implementation by  doxygen 1.6.3