xorp

DecisionTable< A > Class Template Reference

BGPRouteTable which receives routes from all peers and decided which routes win. More...

#include <route_table_decision.hh>

Inheritance diagram for DecisionTable< A >:
BGPRouteTable< A > DummyDecisionTable< A >

List of all members.

Public Member Functions

 DecisionTable (string tablename, Safi safi, NextHopResolver< A > &next_hop_resolver)
int add_parent (BGPRouteTable< A > *parent, PeerHandler *peer_handler, uint32_t genid)
int remove_parent (BGPRouteTable< A > *parent)
int add_route (InternalMessage< A > &rtmsg, BGPRouteTable< A > *caller)
int replace_route (InternalMessage< A > &old_rtmsg, InternalMessage< A > &new_rtmsg, BGPRouteTable< A > *caller)
int delete_route (InternalMessage< A > &rtmsg, BGPRouteTable< A > *caller)
int route_dump (InternalMessage< A > &rtmsg, BGPRouteTable< A > *caller, const PeerHandler *peer)
int push (BGPRouteTable< A > *caller)
const SubnetRoute< A > * lookup_route (const IPNet< A > &net, uint32_t &genid, FPAListRef &pa_list) const
BGPRouteTable< A > * parent ()
RouteTableType type () const
string str () const
bool get_next_message (BGPRouteTable< A > *)
bool dump_next_route (DumpIterator< A > &dump_iter)
virtual void igp_nexthop_changed (const A &bgp_nexthop)
 Notification that the status of this next hop has changed.
void peering_went_down (const PeerHandler *peer, uint32_t genid, BGPRouteTable< A > *caller)
void peering_down_complete (const PeerHandler *peer, uint32_t genid, BGPRouteTable< A > *caller)
void peering_came_up (const PeerHandler *peer, uint32_t genid, BGPRouteTable< A > *caller)

Private Member Functions

const SubnetRoute< A > * lookup_route (const BGPRouteTable< A > *ignore_parent, const IPNet< A > &net, const PeerHandler *&best_routes_peer, BGPRouteTable< A > *&best_routes_parent) const
 This version of lookup_route finds the previous winner if there was one, else it finds the best alternative.
RouteData< A > * find_alternative_routes (const BGPRouteTable< A > *caller, const IPNet< A > &net, list< RouteData< A > > &alternatives) const
uint32_t local_pref (const FPAListRef &pa_list) const
uint32_t med (const FPAListRef &pa_list) const
bool resolvable (const A) const
uint32_t igp_distance (const A) const
RouteData< A > * find_winner (list< RouteData< A > > &alternatives) const

Private Attributes

map< BGPRouteTable< A >
*, PeerTableInfo< A > * > 
_parents
map< uint32_t, PeerTableInfo
< A > * > 
_sorted_parents
NextHopResolver< A > & _next_hop_resolver

Detailed Description

template<class A>
class DecisionTable< A >

BGPRouteTable which receives routes from all peers and decided which routes win.

The XORP BGP is internally implemented as a set of pipelines consisting of a series of BGPRouteTables. Each pipeline receives routes from a BGP peer, stores them, and applies filters to them to modify the routes. Then the pipelines converge on a single decision process, which decides which route wins amongst possible alternative routes.

DecisionTable is a BGPRouteTable which performs this decision process. It has many upstream BGPRouteTables and a single downstream BGPRouteTable. Only the winning routes according to the BGP decision process are propagated downstream.

When a new route reaches DecisionTable from one peer, we must lookup that route in all the other upstream branches to see if this route wins, or even if it doesn't win, if it causes a change of winning route. Similarly for route deletions coming from a peer, etc.


Member Function Documentation

template<class A>
void DecisionTable< A >::igp_nexthop_changed ( const A &  bgp_nexthop) [virtual]

Notification that the status of this next hop has changed.

Parameters:
bgp_nexthopThe next hop that has changed.

Reimplemented from BGPRouteTable< A >.

Reimplemented in DummyDecisionTable< A >.

template<class A>
const SubnetRoute< A > * DecisionTable< A >::lookup_route ( const BGPRouteTable< A > *  ignore_parent,
const IPNet< A > &  net,
const PeerHandler *&  best_routes_peer,
BGPRouteTable< A > *&  best_routes_parent 
) const [private]

This version of lookup_route finds the previous winner if there was one, else it finds the best alternative.

Note that the previous winner might not actually be the best current winner, but in this context we need to be consistent - if it won before, then it still wins until a delete_route or replace_route arrives to update our idea of the winner


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations