The DTLSRRouter uses link state announcements to build a multigraph of routing edges. More...
#include <DTLSRRouter.h>
Classes | |
class | CostWeightFn |
class | DelayWeightFn |
struct | EdgeInfo |
Class used for per-edge state in the graph (the link). More... | |
class | EstimatedDelayWeightFn |
struct | NodeInfo |
Class used for per-node state in the graph. More... | |
class | Reg |
Registration used to grab announcements. More... | |
struct | RouteInfo |
Class used for router-specific state in the routing table. More... | |
class | TransmitLSATimer |
Public Member Functions | |
DTLSRRouter () | |
Constructor. | |
void | initialize () |
Virtual from BundleRouter. | |
void | get_routing_state (oasys::StringBuffer *buf) |
Virtual from BundleRouter. | |
bool | can_delete_bundle (const BundleRef &bundle) |
Virtual from BundleRouter. | |
void | delete_bundle (const BundleRef &bundle) |
Virtual from BundleRouter. | |
void | handle_bundle_received (BundleReceivedEvent *e) |
Event handlers. | |
void | handle_bundle_expired (BundleExpiredEvent *e) |
Event handlers. | |
void | handle_contact_up (ContactUpEvent *e) |
Event handlers. | |
void | handle_contact_down (ContactDownEvent *e) |
Event handlers. | |
void | handle_link_created (LinkCreatedEvent *e) |
Event handlers. | |
void | handle_link_deleted (LinkDeletedEvent *e) |
Event handlers. | |
void | handle_registration_added (RegistrationAddedEvent *event) |
Event handlers. | |
Protected Attributes | |
const char * | announce_tag_ |
Service tag used for routing announcements. | |
EndpointID | announce_eid_ |
Endpoint id used for routing announcements. | |
RoutingGraph | graph_ |
Routing Graph info. | |
RoutingGraph::Node * | local_node_ |
RoutingGraph::WeightFn * | weight_fn_ |
BundleList | current_lsas_ |
Bundle lists used to hold onto the most recent LSA from all other nodes. | |
Reg * | reg_ |
The registration to receive lsa and eida announcements. | |
TransmitLSATimer | periodic_lsa_timer_ |
Timer to periodically rebroadcast LSAs. | |
TransmitLSATimer | delayed_lsa_timer_ |
Timer used for a deferred LSA transmission, waiting for the minimum interval. | |
oasys::Time | last_lsa_transmit_ |
Time of the last LSA transmission. | |
oasys::Time | last_update_ |
Time of the last update of local graph. | |
| |
typedef MultiGraph< NodeInfo, EdgeInfo > | RoutingGraph |
typedef DTLSR::LinkParams | LinkParams |
typedef DTLSR::LinkState | LinkState |
typedef DTLSR::LinkStateVec | LinkStateVec |
typedef DTLSR::LSA | LSA |
class | oasys::InlineFormatter< EdgeInfo > |
| |
const DTLSRConfig * | config () |
Helper functions. | |
void | generate_link_state (LinkState *ls, RoutingGraph::Edge *e, const LinkRef &link) |
Helper functions. | |
bool | update_current_lsa (RoutingGraph::Node *node, Bundle *bundle, u_int32_t seqno) |
Helper functions. | |
void | schedule_lsa () |
Helper functions. | |
void | send_lsa () |
Helper functions. | |
void | handle_lsa (Bundle *bundle, LSA *lsa) |
Helper functions. | |
void | handle_lsa_expired (Bundle *bundle) |
Helper functions. | |
void | drop_all_links (const EndpointID &source) |
Helper functions. | |
void | remove_edge (RoutingGraph::Edge *edge) |
Helper functions. | |
void | adjust_uptime (RoutingGraph::Edge *edge) |
Helper functions. | |
bool | time_to_age_routes () |
Helper functions. | |
void | invalidate_routes () |
Helper functions. | |
void | recompute_routes () |
Helper functions. | |
static bool | is_dynamic_route (RouteEntry *entry) |
Helper functions. |
The DTLSRRouter uses link state announcements to build a multigraph of routing edges.
It uses the RouteTable inherited from TableBasedRouter more as a FIB, installing an entry for the best next-hop(s) for all known endpoints.
Definition at line 37 of file DTLSRRouter.h.
typedef DTLSR::LinkParams dtn::DTLSRRouter::LinkParams [protected] |
Definition at line 67 of file DTLSRRouter.h.
typedef DTLSR::LinkState dtn::DTLSRRouter::LinkState [protected] |
Definition at line 69 of file DTLSRRouter.h.
typedef DTLSR::LinkStateVec dtn::DTLSRRouter::LinkStateVec [protected] |
Definition at line 70 of file DTLSRRouter.h.
typedef DTLSR::LSA dtn::DTLSRRouter::LSA [protected] |
Definition at line 71 of file DTLSRRouter.h.
typedef MultiGraph<NodeInfo, EdgeInfo> dtn::DTLSRRouter::RoutingGraph [protected] |
Definition at line 62 of file DTLSRRouter.h.
dtn::DTLSRRouter::DTLSRRouter | ( | ) |
Constructor.
Definition at line 169 of file DTLSRRouter.cc.
References dtn::BundleRouter::Config::add_nexthop_routes_, and dtn::BundleRouter::config_.
void dtn::DTLSRRouter::adjust_uptime | ( | RoutingGraph::Edge * | edge | ) | [protected] |
Helper functions.
Virtual from BundleRouter.
Reimplemented from dtn::TableBasedRouter.
Definition at line 238 of file DTLSRRouter.cc.
References dtn::TableBasedRouter::can_delete_bundle(), dtn::BundleList::contains(), and current_lsas_.
const DTLSRConfig* dtn::DTLSRRouter::config | ( | ) | [inline, protected] |
Helper functions.
Definition at line 139 of file DTLSRRouter.h.
Referenced by handle_contact_down(), handle_lsa(), initialize(), schedule_lsa(), send_lsa(), and time_to_age_routes().
void dtn::DTLSRRouter::delete_bundle | ( | const BundleRef & | bundle | ) | [virtual] |
Virtual from BundleRouter.
Reimplemented from dtn::TableBasedRouter.
Definition at line 254 of file DTLSRRouter.cc.
References dtn::BundleList::contains(), current_lsas_, and dtn::BundleList::erase().
void dtn::DTLSRRouter::drop_all_links | ( | const EndpointID & | source | ) | [protected] |
Helper functions.
void dtn::DTLSRRouter::generate_link_state | ( | LinkState * | ls, | |
RoutingGraph::Edge * | e, | |||
const LinkRef & | link | |||
) | [protected] |
Helper functions.
Definition at line 847 of file DTLSRRouter.cc.
References dtn::EndpointID::assign(), dtn::DTLSR::LinkState::dest_, dtn::DTLSR::LinkState::elapsed_, dtn::DTLSR::LinkState::id_, dtn::DTLSR::LinkState::params_, dtn::DTLSR::LinkParams::qcount_, and dtn::DTLSR::LinkParams::qsize_.
Referenced by send_lsa().
void dtn::DTLSRRouter::get_routing_state | ( | oasys::StringBuffer * | buf | ) | [virtual] |
Virtual from BundleRouter.
Reimplemented from dtn::TableBasedRouter.
Definition at line 226 of file DTLSRRouter.cc.
References graph_.
void dtn::DTLSRRouter::handle_bundle_expired | ( | BundleExpiredEvent * | e | ) | [virtual] |
Event handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 291 of file DTLSRRouter.cc.
References dtn::BundleExpiredEvent::bundleref_, dtn::EndpointID::c_str(), dtn::BundleList::contains(), current_lsas_, dtn::BundleList::erase(), handle_lsa_expired(), dtn::BundleList::lock(), and dtn::Bundle::source().
void dtn::DTLSRRouter::handle_bundle_received | ( | BundleReceivedEvent * | e | ) | [virtual] |
Event handlers.
Reimplemented from dtn::TableBasedRouter.
Definition at line 280 of file DTLSRRouter.cc.
void dtn::DTLSRRouter::handle_contact_down | ( | ContactDownEvent * | e | ) | [virtual] |
Event handlers.
Reimplemented from dtn::TableBasedRouter.
Definition at line 356 of file DTLSRRouter.cc.
References config(), dtn::ContactDownEvent::contact_, dtn::MultiGraph< _NodeInfo, _EdgeInfo >::find_node(), graph_, invalidate_routes(), dtn::DTLSR::LinkParams::LINK_DOWN, local_node_, recompute_routes(), remove_edge(), and schedule_lsa().
void dtn::DTLSRRouter::handle_contact_up | ( | ContactUpEvent * | e | ) | [virtual] |
Event handlers.
Reimplemented from dtn::TableBasedRouter.
Definition at line 316 of file DTLSRRouter.cc.
References dtn::MultiGraph< _NodeInfo, _EdgeInfo >::add_edge(), dtn::MultiGraph< _NodeInfo, _EdgeInfo >::add_node(), dtn::ContactUpEvent::contact_, dtn::DTLSR::LinkParams::cost_, dtn::MultiGraph< _NodeInfo, _EdgeInfo >::find_edge(), dtn::MultiGraph< _NodeInfo, _EdgeInfo >::find_node(), graph_, invalidate_routes(), dtn::DTLSR::LinkParams::LINK_UP, local_node_, dtn::EndpointID::NULL_EID(), dtn::DTLSRRouter::EdgeInfo::params_, recompute_routes(), and schedule_lsa().
void dtn::DTLSRRouter::handle_link_created | ( | LinkCreatedEvent * | e | ) | [virtual] |
Event handlers.
Reimplemented from dtn::TableBasedRouter.
Definition at line 268 of file DTLSRRouter.cc.
References invalidate_routes(), and recompute_routes().
void dtn::DTLSRRouter::handle_link_deleted | ( | LinkDeletedEvent * | e | ) | [virtual] |
Event handlers.
Reimplemented from dtn::TableBasedRouter.
Definition at line 403 of file DTLSRRouter.cc.
References dtn::LinkDeletedEvent::link_, local_node_, and remove_edge().
Helper functions.
Definition at line 720 of file DTLSRRouter.cc.
References dtn::MultiGraph< _NodeInfo, _EdgeInfo >::add_edge(), dtn::ForwardingLog::add_entry(), dtn::MultiGraph< _NodeInfo, _EdgeInfo >::add_node(), dtn::DTLSRConfig::area_, dtn::EndpointID::c_str(), config(), dtn::Bundle::dest(), dtn::DTLSR::LinkState::dest_, dtn::MultiGraph< _NodeInfo, _EdgeInfo >::find_node(), dtn::ForwardingInfo::FORWARD_ACTION, dtn::Bundle::fwdlog(), dtn::ForwardingLog::get_latest_entry(), graph_, dtn::DTLSR::LinkState::id_, info, dtn::DTLSR::LSA::links_, local_node_, dtn::DTLSR::LinkState::params_, dtn::ForwardingInfo::RECEIVED, recompute_routes(), dtn::ForwardingInfo::remote_eid(), dtn::DTLSR::LSA::seqno_, dtn::Bundle::source(), dtn::EndpointID::str(), dtn::ForwardingInfo::SUPPRESSED, update_current_lsa(), dtn::EndpointID::uri(), and dtn::EndpointIDPattern::WILDCARD_EID().
Referenced by dtn::DTLSRRouter::Reg::deliver_bundle().
void dtn::DTLSRRouter::handle_lsa_expired | ( | Bundle * | bundle | ) | [protected] |
Helper functions.
Definition at line 823 of file DTLSRRouter.cc.
Referenced by handle_bundle_expired().
void dtn::DTLSRRouter::handle_registration_added | ( | RegistrationAddedEvent * | event | ) | [virtual] |
Event handlers.
Reimplemented from dtn::TableBasedRouter.
Definition at line 425 of file DTLSRRouter.cc.
References dtn::MultiGraph< _NodeInfo, _EdgeInfo >::add_edge(), dtn::MultiGraph< _NodeInfo, _EdgeInfo >::add_node(), dtn::DTLSR::LinkParams::bw_, dtn::Session::CUSTODY, dtn::Registration::endpoint(), dtn::MultiGraph< _NodeInfo, _EdgeInfo >::find_edge(), dtn::MultiGraph< _NodeInfo, _EdgeInfo >::find_node(), graph_, dtn::DTLSRRouter::EdgeInfo::id_, dtn::DTLSRRouter::EdgeInfo::is_registration_, local_node_, dtn::DTLSRRouter::EdgeInfo::params_, schedule_lsa(), dtn::Registration::session_flags(), dtn::EndpointID::str(), and dtn::EndpointID::subsume().
void dtn::DTLSRRouter::initialize | ( | ) | [virtual] |
Virtual from BundleRouter.
Reimplemented from dtn::BundleRouter.
Definition at line 183 of file DTLSRRouter.cc.
References dtn::MultiGraph< _NodeInfo, _EdgeInfo >::add_node(), announce_tag_, dtn::EndpointID::append_service_tag(), dtn::EndpointID::c_str(), config(), dtn::DTLSRConfig::COST, dtn::DTLSRConfig::DELAY, dtn::DTLSRConfig::ESTIMATED_DELAY, graph_, local_node_, periodic_lsa_timer_, reg_, dtn::EndpointID::scheme_str(), dtn::DTLSRRouter::TransmitLSATimer::set_interval(), dtn::EndpointID::str(), dtn::DTLSRConfig::weight_fn_, weight_fn_, and dtn::DTLSRConfig::weight_fn_to_str().
void dtn::DTLSRRouter::invalidate_routes | ( | ) | [protected] |
Helper functions.
Definition at line 500 of file DTLSRRouter.cc.
References last_update_.
Referenced by handle_contact_down(), handle_contact_up(), and handle_link_created().
bool dtn::DTLSRRouter::is_dynamic_route | ( | RouteEntry * | entry | ) | [static, protected] |
Helper functions.
Definition at line 508 of file DTLSRRouter.cc.
References info, and dtn::RouteEntry::info().
Referenced by recompute_routes().
void dtn::DTLSRRouter::recompute_routes | ( | ) | [protected, virtual] |
Helper functions.
Reimplemented from dtn::TableBasedRouter.
Definition at line 524 of file DTLSRRouter.cc.
References dtn::RouteTable::add_entry(), ASSERT, dtn::MultiGraph< _NodeInfo, _EdgeInfo >::best_next_hop(), dtn::RouteTable::del_matching_entries(), dtn::ContactManager::find_link(), graph_, dtn::TableBasedRouter::handle_changed_routes(), is_dynamic_route(), last_update_, local_node_, dtn::MultiGraph< _NodeInfo, _EdgeInfo >::nodes(), dtn::TableBasedRouter::route_table_, and weight_fn_.
Referenced by handle_contact_down(), handle_contact_up(), handle_link_created(), and handle_lsa().
void dtn::DTLSRRouter::remove_edge | ( | RoutingGraph::Edge * | edge | ) | [protected] |
Helper functions.
Definition at line 480 of file DTLSRRouter.cc.
References ASSERT, dtn::MultiGraph< _NodeInfo, _EdgeInfo >::del_edge(), graph_, and local_node_.
Referenced by handle_contact_down(), and handle_link_deleted().
void dtn::DTLSRRouter::schedule_lsa | ( | ) | [protected] |
Helper functions.
Definition at line 883 of file DTLSRRouter.cc.
References config(), delayed_lsa_timer_, last_lsa_transmit_, dtn::DTLSRConfig::min_lsa_interval_, and send_lsa().
Referenced by handle_contact_down(), handle_contact_up(), and handle_registration_added().
void dtn::DTLSRRouter::send_lsa | ( | ) | [protected] |
Helper functions.
Definition at line 910 of file DTLSRRouter.cc.
References announce_tag_, ASSERT, config(), dtn::EVENTSRC_ROUTER, dtn::DTLSR::format_lsa_bundle(), generate_link_state(), last_lsa_transmit_, dtn::DTLSR::LSA::links_, local_node_, dtn::EndpointID::NULL_EID(), dtn::BundleDaemon::post_at_head(), dtn::DTLSR::LSA::seqno_, and update_current_lsa().
Referenced by schedule_lsa(), and dtn::DTLSRRouter::TransmitLSATimer::timeout().
bool dtn::DTLSRRouter::time_to_age_routes | ( | ) | [protected] |
Helper functions.
Definition at line 489 of file DTLSRRouter.cc.
References config(), and last_update_.
bool dtn::DTLSRRouter::update_current_lsa | ( | RoutingGraph::Node * | node, | |
Bundle * | bundle, | |||
u_int32_t | seqno | |||
) | [protected] |
Helper functions.
Definition at line 632 of file DTLSRRouter.cc.
References dtn::ForwardingLog::add_entry(), ASSERT, dtn::BundleList::begin(), dtn::Bundle::creation_ts(), current_lsas_, dtn::BundleList::end(), dtn::BundleList::erase(), dtn::ForwardingInfo::FORWARD_ACTION, dtn::Bundle::fwdlog(), info, dtn::BundleList::lock(), dtn::BundleDaemon::post_at_head(), dtn::BundleList::push_back(), dtn::BundleProtocol::REASON_NO_ADDTL_INFO, dtn::BundleTimestamp::seconds_, dtn::ForwardingInfo::SUPPRESSED, and dtn::EndpointIDPattern::WILDCARD_EID().
Referenced by handle_lsa(), and send_lsa().
friend class oasys::InlineFormatter< EdgeInfo > [friend] |
Definition at line 64 of file DTLSRRouter.h.
EndpointID dtn::DTLSRRouter::announce_eid_ [protected] |
Endpoint id used for routing announcements.
Definition at line 165 of file DTLSRRouter.h.
const char* dtn::DTLSRRouter::announce_tag_ [protected] |
Service tag used for routing announcements.
Definition at line 162 of file DTLSRRouter.h.
Referenced by initialize(), and send_lsa().
BundleList dtn::DTLSRRouter::current_lsas_ [protected] |
Bundle lists used to hold onto the most recent LSA from all other nodes.
XXX/demmer this would be better done using a retention constraint :)
Definition at line 177 of file DTLSRRouter.h.
Referenced by can_delete_bundle(), delete_bundle(), handle_bundle_expired(), and update_current_lsa().
TransmitLSATimer dtn::DTLSRRouter::delayed_lsa_timer_ [protected] |
Timer used for a deferred LSA transmission, waiting for the minimum interval.
Definition at line 187 of file DTLSRRouter.h.
Referenced by schedule_lsa().
RoutingGraph dtn::DTLSRRouter::graph_ [protected] |
Routing Graph info.
Definition at line 168 of file DTLSRRouter.h.
Referenced by get_routing_state(), handle_contact_down(), handle_contact_up(), handle_lsa(), handle_registration_added(), initialize(), recompute_routes(), and remove_edge().
oasys::Time dtn::DTLSRRouter::last_lsa_transmit_ [protected] |
Time of the last LSA transmission.
Definition at line 190 of file DTLSRRouter.h.
Referenced by schedule_lsa(), and send_lsa().
oasys::Time dtn::DTLSRRouter::last_update_ [protected] |
Time of the last update of local graph.
Definition at line 193 of file DTLSRRouter.h.
Referenced by invalidate_routes(), recompute_routes(), and time_to_age_routes().
RoutingGraph::Node* dtn::DTLSRRouter::local_node_ [protected] |
Definition at line 169 of file DTLSRRouter.h.
Referenced by handle_contact_down(), handle_contact_up(), handle_link_deleted(), handle_lsa(), handle_registration_added(), initialize(), recompute_routes(), remove_edge(), and send_lsa().
Timer to periodically rebroadcast LSAs.
Definition at line 183 of file DTLSRRouter.h.
Referenced by initialize().
Reg* dtn::DTLSRRouter::reg_ [protected] |
The registration to receive lsa and eida announcements.
Definition at line 180 of file DTLSRRouter.h.
Referenced by initialize().
RoutingGraph::WeightFn* dtn::DTLSRRouter::weight_fn_ [protected] |
Definition at line 170 of file DTLSRRouter.h.
Referenced by initialize(), and recompute_routes().