OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
VxlanRoutingManager Class Reference

This class manages routes leaking between bridge VRF instances and the routing VRF instance. Routes are leaking is bi-directional: a) first, during the forward stage interface routes with LOCAL_VM_PORT_PEER are copied from each bridge VRF inet table into the routing VRF inet and EVPN tables; b) second, routes from the routing VRF are redistributed amongst bridge VRF tables durging the backward stage. The class extensively uses events notifications to trigger routes leaking. More...

#include <vxlan_routing_manager.h>

Collaboration diagram for VxlanRoutingManager:

Public Member Functions

 VxlanRoutingManager (Agent *agent)
 Constructs instance of the class and links to the Agent class instance. Since only one agent class instance works per system process, this implies that only one instance of VxlanRoutingManager exists. More...
 
virtual ~VxlanRoutingManager ()
 Destroys the VxlanRoutingManager instance. More...
 
void Register ()
 Registers handlers for events associated with changes in virtual networks (VnTable class) and VRF instances (VrfTable class). More...
 
void Shutdown ()
 Unregisters handlers for events associated with changes in virtual networks (VnTable class) and VRF instances (VrfTable class). More...
 
void VnNotify (DBTablePartBase *partition, DBEntryBase *e)
 A handler for changes (new/update/delete) in a virtual network (VnEntry class). More...
 
void BridgeVnNotify (const VnEntry *vn, VxlanRoutingVnState *vn_state)
 A handler for changes (new/update/delete) in the virtual network from a bridge VRF. More...
 
void RoutingVnNotify (const VnEntry *vn, VxlanRoutingVnState *vn_state)
 A handler for changes (new/update/delete) in the virtual network from a routing VRF. More...
 
void VrfNotify (DBTablePartBase *partition, DBEntryBase *e)
 A handler for changes (new/update/delete) in a VRF instance (VrfEntry class). More...
 
void VmiNotify (DBTablePartBase *partition, DBEntryBase *e)
 Handler for changes (new/update/delete) in a VMI (VmInterface class). More...
 
bool RouteNotify (DBTablePartBase *partition, DBEntryBase *e)
 Handler for changes (new/update/delete) in a route (EVPN or Inet). Main entry point for routes leaking. More...
 
bool WithdrawEvpnRouteFromRoutingVrf (const VrfEntry *routing_vrf, DBTablePartBase *partition, DBEntryBase *e)
 Deletes a given EVPN route from EVPN table of the routing VRF instance. More...
 
bool LeakRoutesIntoBridgeTables (DBTablePartBase *partition, DBEntryBase *e, const boost::uuids::uuid &uuid, const VnEntry *vn, bool update=false)
 Performs advertisement and deletion of routing routes (with VrfNH) in bridge VRF instances. External tunnels and routes with a prefix that is not present in bridge VRF instance are selected for leaking. More...
 
void HandleSubnetRoute (const VrfEntry *vrf, bool bridge_vrf=false)
 Handles routing routes (with VrfNH) update in the routing VRF instance. More...
 
void FillSandeshInfo (VxlanRoutingResp *resp)
 Updates Sandesh response. More...
 
DBTable::ListenerId vn_listener_id () const
 Returns the ID of the listener to changes in the VnTable. More...
 
DBTable::ListenerId vrf_listener_id () const
 Returns the ID of the listener to changes in the VrfTable. More...
 
DBTable::ListenerId vmi_listener_id () const
 Returns the ID of the listener to changes in the InterfaceTable. More...
 
const VxlanRoutingVrfMappervrf_mapper () const
 Returns the map between LR uuids and associated bridge and routing VRF instances. More...
 
AgentRouteWalkerwalker ()
 Returns a pointer to the AgentRouteWalkerPtr object. More...
 
 DISALLOW_COPY_AND_ASSIGN (VxlanRoutingManager)
 

Static Public Member Functions

static void PrintEvpnTable (const VrfEntry *const_vrf)
 Prints EVPN table of the given VRF instance. More...
 
static void PrintInetTable (const VrfEntry *const_vrf)
 Prints IPv4 Inet table of the given VRF instance. More...
 
static void ListAttachedVns ()
 Prints all virtual networks attached to logical routers. More...
 

Private Member Functions

bool InetRouteNotify (DBTablePartBase *partition, DBEntryBase *e)
 Routes leaking functions. More...
 
bool EvpnRouteNotify (DBTablePartBase *partition, DBEntryBase *e)
 Performs routes leaking between the EVPN table of the routing VRF instance and the Inet table of the routing VRF instance. More...
 
void ClearRedundantVrfPath (DBEntryBase *e)
 Removes redundant VrfNH path from a given route. These routes might arise with small chance in a bridge VRF inet tables when tunnels in the routing VRF instance arrive later then in the bridge VRF instance. More...
 
void WhenBridgeInetIntfWasDeleted (const InetUnicastRouteEntry *inet_rt, const VrfEntry *routing_vrf)
 Handles deletion of a route in the EVPN table of the routing VRF instance. More...
 
void WhenRoutingEvpnRouteWasDeleted (const EvpnRouteEntry *routing_evpn_rt, const Peer *delete_from_peer)
 Handles deletion of a route in the Inet table of the routing VRF instance. More...
 
void RoutingVrfDeleteAllRoutes (VrfEntry *rt_vrf)
 deletes all routes in EVPN table of routing VRF More...
 
void DeleteSubnetRoute (const VrfEntry *vrf)
 Deletes subnet routes (actually, paths with VrfNH) in the given bridge VRF. This function is demanded at vn.c:618. More...
 
void DeleteSubnetRoute (const VnEntry *vn, const std::string &vrf_name)
 Deletes subnet routes from a specified virtual network (VirtualNetwork) More...
 
void DeleteIpamRoutes (const VnEntry *vn, const std::string &vrf_name, const IpAddress &ipam_prefix, const uint32_t plen)
 Delete routes to IPAM, specified by IP prefix and prefix length. More...
 
void UpdateSubnetRoute (const VrfEntry *vrf, const VrfEntry *routing_vrf)
 Updates subnet routes (actually, paths with VrfNH) in the given bridge VRF. More...
 
std::string GetOriginVn (const VrfEntry *routing_vrf, const IpAddress &ip_addr, const uint8_t &plen)
 Finds first occurence of a route with the given prefix (IP address and length) in Inet tables of bridge VRF instances connected to the given routing VRF instance (LR). More...
 
bool IsHostRouteFromLocalSubnet (const EvpnRouteEntry *rt)
 Determines whether the given EVPN route is a host one and belongs to a subnet of a local bridge VRF. During the search all subnets in all bridge VRF instances connected to the LR are traversed. More...
 
bool IsVrfLocalRoute (EvpnRouteEntry *routing_evpn_rt, VrfEntry *bridge_vrf)
 Determines if the given EVPN route has an interface NH or a composite of interfaces NH that belongs to the given bridge VRF instance. More...
 
bool IsLocalRoute (EvpnRouteEntry *routing_evpn_rt, VrfEntry *bridge_vrf)
 Determines if the given EVPN route is already present in the given VRF. More...
 
bool HasBgpPeerPath (EvpnRouteEntry *evpn_rt)
 Determines whether the given EVPN route has at least one path originating from BGP/XMPP (has Peer type BGP_PATH) More...
 
const AgentPathFindBGPaaSPath (const InetUnicastRouteEntry *rt)
 Finds in the given route the path that was announced using BGPaaS. It is expected that this path has BGP_PEER peer type and the interface or composite nexthop. More...
 
void AdvertiseBGPaaSRoute (const IpAddress &prefix_ip, uint32_t prefix_len, const AgentPath *path, EvpnAgentRouteTable *evpn_table)
 Advertises BGPaaS interface path in the routing VRF instance by selecting corresponding path components in a path from the bridge VRF instance. More...
 
TunnelNHKeyAllocateTunnelNextHopKey (const IpAddress &dip, const MacAddress &dmac) const
 XMPP Advertising functions. More...
 
void XmppAdvertiseEvpnRoute (const IpAddress &prefix_ip, const int prefix_len, uint32_t vxlan_id, const std::string vrf_name, const RouteParameters &params, const Peer *bgp_peer)
 Advertises an EVPN route received using XMPP channel. More...
 
void XmppAdvertiseInetRoute (const IpAddress &prefix_ip, const int prefix_len, uint32_t vxlan_id, const std::string vrf_name, const RouteParameters &params, const Peer *bgp_peer)
 Advertises an Inet route received using XMPP channel. More...
 
void XmppAdvertiseInetRoute (const IpAddress &prefix_ip, const int prefix_len, const std::string vrf_name, const AgentPath *)
 Advertises an Inet route received from EVPN table. More...
 
void XmppAdvertiseEvpnTunnel (EvpnAgentRouteTable *inet_table, const IpAddress &prefix_ip, const int prefix_len, uint32_t vxlan_id, const std::string vrf_name, const RouteParameters &params, const Peer *bgp_peer)
 Advertises in the EVPN table a tunnel route that arrived via XMPP channel. Must be called only from XmppAdvertiseInetRoute. More...
 
void XmppAdvertiseEvpnInterface (EvpnAgentRouteTable *inet_table, const IpAddress &prefix_ip, const int prefix_len, uint32_t vxlan_id, const std::string vrf_name, const RouteParameters &params, const Peer *bgp_peer)
 Advertises in the EVPN table an interface route that arrived via XMPP channel. Must be called only from XmppAdvertiseInetRoute. More...
 
void XmppAdvertiseInetTunnel (InetUnicastAgentRouteTable *inet_table, const IpAddress &prefix_ip, const int prefix_len, uint32_t vxlan_id, const std::string vrf_name, const RouteParameters &params, const Peer *bgp_peer)
 Advertises in the Inet table a tunnel route that arrived via XMPP channel. Must be called only from XmppAdvertiseInetRoute. More...
 
void XmppAdvertiseInetTunnel (InetUnicastAgentRouteTable *inet_table, const IpAddress &prefix_ip, const int prefix_len, const std::string vrf_name, const AgentPath *path)
 Advertises in the Inet table a tunnel route that arrived via XMPP channel. Must be called only from XmppAdvertiseInetRoute. More...
 
void XmppAdvertiseInetInterfaceOrComposite (InetUnicastAgentRouteTable *inet_table, const IpAddress &prefix_ip, const int prefix_len, const std::string vrf_name, const AgentPath *path)
 Advertises in the Inet table an interface route that arrived via XMPP channel. Must be called only from XmppAdvertiseInetRoute. More...
 
void CopyPathToInetTable (const AgentPath *path, const IpAddress &prefix_ip, const uint32_t plen, const Peer *peer, const RouteParameters &params, InetUnicastAgentRouteTable *inet_table)
 Copies the path to the prefix address into the EVPN table with the given Peer. The function is used during routes leaking between routing VRF EVPN and Inet tables. More...
 

Static Private Member Functions

static uint32_t GetNewLocalSequence (const AgentPath *)
 Auxilliary functions. More...
 
static bool is_ipv4_string (const std::string &prefix_str)
 Determines whether the address string contains an IPv4 address as substring or not. More...
 
static bool is_ipv6_string (const std::string &prefix_str)
 Determines whether the address string contains an IPv6 address as substring or not. More...
 
static uint32_t ipv4_prefix_len (const std::string &prefix_str)
 Extracts length of IPv4 subnet address from the prefix string. More...
 
static std::string ipv4_prefix (const std::string &prefix_str)
 Extracts an IPv4 address string from the prefix string. More...
 
static uint32_t ipv6_prefix_len (const std::string &prefix_str)
 Extracts length of IPv6 subnet address from the prefix string. More...
 
static std::string ipv6_prefix (const std::string &prefix_str)
 Extracts an IPv6 address string from the prefix string. More...
 
static bool IsVxlanAvailable (const Agent *agent)
 Checks whether VxLAN routing manager is enabled or not. More...
 
static bool RoutePrefixIsEqualTo (const EvpnRouteEntry *route, const IpAddress &prefix_ip, const uint32_t prefix_len)
 Determines whether route prefix in the EVPN route is equal to the given pair of prefix IP address and length. More...
 
static bool RoutePrefixIsEqualTo (const InetUnicastRouteEntry *route, const IpAddress &prefix_ip, const uint32_t prefix_len)
 Determines whether route prefix of the Inet route is equal to the given pair of prefix IP address and length. More...
 
static bool IsHostRoute (const IpAddress &prefix_ip, uint32_t prefix_len)
 Determines whether the prefix address and the prefix length point to a host route (/32 for IPv4, /128 for IPv6) or to a subnet route. More...
 
static bool IsHostRoute (const EvpnRouteEntry *rt)
 Determines whether the given EVPN route points to a host or a subnet. More...
 
static bool HasVrfNexthop (const AgentRoute *rt)
 Determines whether the given route has the path with a VRF nexthop (VrfNH) More...
 
static bool IsRoutingVrf (const VrfEntry *vrf)
 Determines whether the pointer to the VRF instance is of routing type. More...
 
static bool IsBridgeVrf (const VrfEntry *vrf)
 Determines whether the pointer to the VRF instance is of bridge type. More...
 
static bool IsRoutingVrf (const std::string vrf_name, const Agent *agent)
 Checks whether the VRF instance with the given name is routing or not. More...
 
static const AgentPathFindPathWithGivenPeer (const AgentRoute *inet_rt, const Peer::Type peer_type)
 Finds in the given route the path with a specified Peer type. More...
 
static const AgentPathFindPathWithGivenPeerAndNexthop (const AgentRoute *inet_rt, const Peer::Type peer_type, const NextHop::Type nh_type, bool strict_match=true)
 Finds in the given route the path with a specified Peer type and a specified nexthop type. More...
 
static const AgentPathFindInterfacePathWithGivenPeer (const AgentRoute *inet_rt, const Peer::Type peer_type, bool strict_match=true)
 Finds in the given route the path with the given Peer type and interface nexthop (InterfaceNH). More...
 
static const AgentPathFindInterfacePathWithBgpPeer (const AgentRoute *inet_rt, bool strict_match=true)
 Finds in the given route the path which has the BGP_PEER Peer type and the Interface nexthop type. Such path presumably points to BGPaaS advertised route. More...
 
static const AgentPathFindInterfacePathWithLocalVmPeer (const AgentRoute *inet_rt, bool strict_match=true)
 Finds in the given route the path which has the LOCAL_VM_PEER peer type and the Interface nexthop type. More...
 
static MacAddress NbComputeMac (const Ip4Address &compute_ip, const Agent *agent)
 Returns the MAC address for the IP of a given neighbouring compute. More...
 
template<class ItType >
static std::vector< IpAddressItemNexthopsToVector (ItType *item)
 Templates. More...
 
template<typename NhType >
static void AddInterfaceComponentToList (const std::string &prefix_str, const std::string &vrf_name, const NhType &nh_item, ComponentNHKeyList &comp_nh_list)
 Adds an interface or a composite of interfaces nexthops to the list of components NH keys needed for construction of the a mixed composite. More...
 
static AgentRouteFindEvpnOrInetRoute (const Agent *agent, const std::string &vrf_name, const IpAddress &ip_addr, uint32_t prefix_len, const autogen::EnetNextHopType &nh_item)
 Finds a route with the given prefix address and len in the EVPN table. More...
 
static AgentRouteFindEvpnOrInetRoute (const Agent *agent, const std::string &vrf_name, const IpAddress &ip_addr, uint32_t prefix_len, const autogen::NextHopType &nh_item)
 Finds a route with the given prefix address and len in the Inet table. More...
 
static void DeleteOldInterfacePath (const IpAddress &prefix_ip, const uint32_t plen, const Peer *peer, EvpnAgentRouteTable *evpn_table)
 Routes copying functions. More...
 
static void CopyInterfacePathToEvpnTable (const AgentPath *path, const IpAddress &prefix_ip, const uint32_t plen, const Peer *peer, const RouteParameters &params, EvpnAgentRouteTable *evpn_table)
 Copies the path to the prefix address into the EVPN table with the given Peer. The function is used during routes leaking between bridge VRF Inet and routing EVPN tables. More...
 
static void DeleteOldInterfacePath (const IpAddress &prefix_ip, const uint32_t plen, const Peer *peer, InetUnicastAgentRouteTable *inet_table)
 

Private Attributes

Agentagent_
 A pointer to the Agent instance. More...
 
AgentRouteWalkerPtr walker_
 A pointer to the walker to loop over INET tables in bridge VRF instances. More...
 
DBTable::ListenerId vn_listener_id_
 An ID of the listener to changes in VnTable. More...
 
DBTable::ListenerId vrf_listener_id_
 An ID of the listener to changes in VrfTable. More...
 
DBTable::ListenerId vmi_listener_id_
 An ID of the listener to changes in InterfaceTable. More...
 
VxlanRoutingVrfMapper vrf_mapper_
 A map between LR uuids and associated bridge and routing VRF instances. More...
 

Static Private Attributes

static const Peerrouting_vrf_interface_peer_ = NULL
 Internal data of this class. More...
 
static const Peerrouting_vrf_vxlan_bgp_peer_ = NULL
 A pointer to the Peer where all BGP routes are stored. More...
 
static uint32_t loc_sequence_ = 0
 An always increasing counter for new paths (used to signal controoler about new routes). More...
 
static tbb::mutex mutex_
 

Friends

class VxlanRoutingRouteWalker
 Friends declarations. More...
 
class ControllerEcmpRoute
 Allows ControllerEcmpRoute to use private members of this class. More...
 
class AgentXmppChannel
 Allows AgentXmppChannel to use private members of this class. More...
 
class AgentXmppChannelVxlanInterface
 Allows access to Xmpp advertisement functions via external class. More...
 
class VxlanRoutingVrfMapper
 Allows VxlanRoutingVrfMapper to use private members of this class. More...
 
class MetadataProxy
 Allows MetadataProxy to use private members of this class. More...
 

Detailed Description

This class manages routes leaking between bridge VRF instances and the routing VRF instance. Routes are leaking is bi-directional: a) first, during the forward stage interface routes with LOCAL_VM_PORT_PEER are copied from each bridge VRF inet table into the routing VRF inet and EVPN tables; b) second, routes from the routing VRF are redistributed amongst bridge VRF tables durging the backward stage. The class extensively uses events notifications to trigger routes leaking.

Definition at line 423 of file vxlan_routing_manager.h.

Constructor & Destructor Documentation

VxlanRoutingManager::VxlanRoutingManager ( Agent agent)

Constructs instance of the class and links to the Agent class instance. Since only one agent class instance works per system process, this implies that only one instance of VxlanRoutingManager exists.

VxlanRoutingManager

Definition at line 335 of file vxlan_routing_manager.cc.

Here is the call graph for this function:

VxlanRoutingManager::~VxlanRoutingManager ( )
virtual

Destroys the VxlanRoutingManager instance.

Definition at line 343 of file vxlan_routing_manager.cc.

Member Function Documentation

template<typename NhType >
void VxlanRoutingManager::AddInterfaceComponentToList ( const std::string &  prefix_str,
const std::string &  vrf_name,
const NhType &  nh_item,
ComponentNHKeyList comp_nh_list 
)
staticprivate

Adds an interface or a composite of interfaces nexthops to the list of components NH keys needed for construction of the a mixed composite.

Definition at line 15 of file vxlan_templates.cc.

Here is the call graph for this function:

void VxlanRoutingManager::AdvertiseBGPaaSRoute ( const IpAddress prefix_ip,
uint32_t  prefix_len,
const AgentPath path,
EvpnAgentRouteTable evpn_table 
)
private

Advertises BGPaaS interface path in the routing VRF instance by selecting corresponding path components in a path from the bridge VRF instance.

Definition at line 488 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

TunnelNHKey * VxlanRoutingManager::AllocateTunnelNextHopKey ( const IpAddress dip,
const MacAddress dmac 
) const
private

XMPP Advertising functions.

Allocates and returns a new key for the VxLAN tunnel to the given router

Definition at line 18 of file vxlan_xmpp_routes.cc.

Here is the call graph for this function:

void VxlanRoutingManager::BridgeVnNotify ( const VnEntry vn,
VxlanRoutingVnState vn_state 
)

A handler for changes (new/update/delete) in the virtual network from a bridge VRF.

Definition at line 451 of file vxlan_routing_manager.cc.

Here is the call graph for this function:

void VxlanRoutingManager::ClearRedundantVrfPath ( DBEntryBase e)
private

Removes redundant VrfNH path from a given route. These routes might arise with small chance in a bridge VRF inet tables when tunnels in the routing VRF instance arrive later then in the bridge VRF instance.

Definition at line 215 of file vxlan_routes_leaking.cc.

Here is the call graph for this function:

void VxlanRoutingManager::CopyInterfacePathToEvpnTable ( const AgentPath path,
const IpAddress prefix_ip,
const uint32_t  plen,
const Peer peer,
const RouteParameters params,
EvpnAgentRouteTable evpn_table 
)
staticprivate

Copies the path to the prefix address into the EVPN table with the given Peer. The function is used during routes leaking between bridge VRF Inet and routing EVPN tables.

Definition at line 869 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

void VxlanRoutingManager::CopyPathToInetTable ( const AgentPath path,
const IpAddress prefix_ip,
const uint32_t  plen,
const Peer peer,
const RouteParameters params,
InetUnicastAgentRouteTable inet_table 
)
private

Copies the path to the prefix address into the EVPN table with the given Peer. The function is used during routes leaking between routing VRF EVPN and Inet tables.

Definition at line 922 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

void VxlanRoutingManager::DeleteIpamRoutes ( const VnEntry vn,
const std::string &  vrf_name,
const IpAddress ipam_prefix,
const uint32_t  plen 
)
private

Delete routes to IPAM, specified by IP prefix and prefix length.

Definition at line 765 of file vxlan_routing_manager.cc.

Here is the call graph for this function:

void VxlanRoutingManager::DeleteOldInterfacePath ( const IpAddress prefix_ip,
const uint32_t  plen,
const Peer peer,
EvpnAgentRouteTable evpn_table 
)
staticprivate

Routes copying functions.

Deletes interface path specified with IP prefix, prefix length and Peer from the EVPN table.

Definition at line 848 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

void VxlanRoutingManager::DeleteOldInterfacePath ( const IpAddress prefix_ip,
const uint32_t  plen,
const Peer peer,
InetUnicastAgentRouteTable inet_table 
)
staticprivate

Definition at line 901 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

void VxlanRoutingManager::DeleteSubnetRoute ( const VrfEntry vrf)
private

Deletes subnet routes (actually, paths with VrfNH) in the given bridge VRF. This function is demanded at vn.c:618.

Definition at line 850 of file vxlan_routing_manager.cc.

Here is the call graph for this function:

void VxlanRoutingManager::DeleteSubnetRoute ( const VnEntry vn,
const std::string &  vrf_name 
)
private

Deletes subnet routes from a specified virtual network (VirtualNetwork)

Definition at line 799 of file vxlan_routing_manager.cc.

Here is the call graph for this function:

VxlanRoutingManager::DISALLOW_COPY_AND_ASSIGN ( VxlanRoutingManager  )
bool VxlanRoutingManager::EvpnRouteNotify ( DBTablePartBase partition,
DBEntryBase e 
)
private

Performs routes leaking between the EVPN table of the routing VRF instance and the Inet table of the routing VRF instance.

Definition at line 146 of file vxlan_routes_leaking.cc.

Here is the call graph for this function:

void VxlanRoutingManager::FillSandeshInfo ( VxlanRoutingResp *  resp)

Updates Sandesh response.

sandesh request

Definition at line 931 of file vxlan_routing_manager.cc.

Here is the call graph for this function:

const AgentPath * VxlanRoutingManager::FindBGPaaSPath ( const InetUnicastRouteEntry rt)
private

Finds in the given route the path that was announced using BGPaaS. It is expected that this path has BGP_PEER peer type and the interface or composite nexthop.

Definition at line 455 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

static AgentRoute* VxlanRoutingManager::FindEvpnOrInetRoute ( const Agent agent,
const std::string &  vrf_name,
const IpAddress ip_addr,
uint32_t  prefix_len,
const autogen::EnetNextHopType &  nh_item 
)
staticprivate

Finds a route with the given prefix address and len in the EVPN table.

static AgentRoute* VxlanRoutingManager::FindEvpnOrInetRoute ( const Agent agent,
const std::string &  vrf_name,
const IpAddress ip_addr,
uint32_t  prefix_len,
const autogen::NextHopType &  nh_item 
)
staticprivate

Finds a route with the given prefix address and len in the Inet table.

const AgentPath * VxlanRoutingManager::FindInterfacePathWithBgpPeer ( const AgentRoute inet_rt,
bool  strict_match = true 
)
staticprivate

Finds in the given route the path which has the BGP_PEER Peer type and the Interface nexthop type. Such path presumably points to BGPaaS advertised route.

Definition at line 440 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

const AgentPath * VxlanRoutingManager::FindInterfacePathWithGivenPeer ( const AgentRoute inet_rt,
const Peer::Type  peer_type,
bool  strict_match = true 
)
staticprivate

Finds in the given route the path with the given Peer type and interface nexthop (InterfaceNH).

Definition at line 432 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

const AgentPath * VxlanRoutingManager::FindInterfacePathWithLocalVmPeer ( const AgentRoute inet_rt,
bool  strict_match = true 
)
staticprivate

Finds in the given route the path which has the LOCAL_VM_PEER peer type and the Interface nexthop type.

Definition at line 447 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

const AgentPath * VxlanRoutingManager::FindPathWithGivenPeer ( const AgentRoute inet_rt,
const Peer::Type  peer_type 
)
staticprivate

Finds in the given route the path with a specified Peer type.

Definition at line 382 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

const AgentPath * VxlanRoutingManager::FindPathWithGivenPeerAndNexthop ( const AgentRoute inet_rt,
const Peer::Type  peer_type,
const NextHop::Type  nh_type,
bool  strict_match = true 
)
staticprivate

Finds in the given route the path with a specified Peer type and a specified nexthop type.

Definition at line 402 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

uint32_t VxlanRoutingManager::GetNewLocalSequence ( const AgentPath path)
staticprivate

Auxilliary functions.

Returns new value of a local sequence. Thread safe version

Definition at line 94 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

std::string VxlanRoutingManager::GetOriginVn ( const VrfEntry routing_vrf,
const IpAddress ip_addr,
const uint8_t &  plen 
)
private

Finds first occurence of a route with the given prefix (IP address and length) in Inet tables of bridge VRF instances connected to the given routing VRF instance (LR).

Definition at line 186 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

void VxlanRoutingManager::HandleSubnetRoute ( const VrfEntry vrf,
bool  bridge_vrf = false 
)

Handles routing routes (with VrfNH) update in the routing VRF instance.

Definition at line 748 of file vxlan_routing_manager.cc.

Here is the call graph for this function:

bool VxlanRoutingManager::HasBgpPeerPath ( EvpnRouteEntry evpn_rt)
private

Determines whether the given EVPN route has at least one path originating from BGP/XMPP (has Peer type BGP_PATH)

Definition at line 322 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

bool VxlanRoutingManager::HasVrfNexthop ( const AgentRoute rt)
staticprivate

Determines whether the given route has the path with a VRF nexthop (VrfNH)

Definition at line 306 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

bool VxlanRoutingManager::InetRouteNotify ( DBTablePartBase partition,
DBEntryBase e 
)
private

Routes leaking functions.

Performs routes leaking between the Inet table of a bridge VRF instance and the EVPN table of the routing VRF instance.

Definition at line 72 of file vxlan_routes_leaking.cc.

Here is the call graph for this function:

std::string VxlanRoutingManager::ipv4_prefix ( const std::string &  prefix_str)
staticprivate

Extracts an IPv4 address string from the prefix string.

Definition at line 124 of file vxlan_auxilliary.cc.

uint32_t VxlanRoutingManager::ipv4_prefix_len ( const std::string &  prefix_str)
staticprivate

Extracts length of IPv4 subnet address from the prefix string.

Definition at line 113 of file vxlan_auxilliary.cc.

std::string VxlanRoutingManager::ipv6_prefix ( const std::string &  prefix_str)
staticprivate

Extracts an IPv6 address string from the prefix string.

Definition at line 156 of file vxlan_auxilliary.cc.

uint32_t VxlanRoutingManager::ipv6_prefix_len ( const std::string &  prefix_str)
staticprivate

Extracts length of IPv6 subnet address from the prefix string.

Definition at line 145 of file vxlan_auxilliary.cc.

bool VxlanRoutingManager::is_ipv4_string ( const std::string &  prefix_str)
staticprivate

Determines whether the address string contains an IPv4 address as substring or not.

Definition at line 104 of file vxlan_auxilliary.cc.

bool VxlanRoutingManager::is_ipv6_string ( const std::string &  prefix_str)
staticprivate

Determines whether the address string contains an IPv6 address as substring or not.

Definition at line 108 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

bool VxlanRoutingManager::IsBridgeVrf ( const VrfEntry vrf)
staticprivate

Determines whether the pointer to the VRF instance is of bridge type.

Returns
true if it is routing, otherwise return value is false.

Definition at line 358 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

bool VxlanRoutingManager::IsHostRoute ( const IpAddress prefix_ip,
uint32_t  prefix_len 
)
staticprivate

Determines whether the prefix address and the prefix length point to a host route (/32 for IPv4, /128 for IPv6) or to a subnet route.

Definition at line 233 of file vxlan_auxilliary.cc.

bool VxlanRoutingManager::IsHostRoute ( const EvpnRouteEntry rt)
staticprivate

Determines whether the given EVPN route points to a host or a subnet.

Definition at line 241 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

bool VxlanRoutingManager::IsHostRouteFromLocalSubnet ( const EvpnRouteEntry rt)
private

Determines whether the given EVPN route is a host one and belongs to a subnet of a local bridge VRF. During the search all subnets in all bridge VRF instances connected to the LR are traversed.

Definition at line 248 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

bool VxlanRoutingManager::IsLocalRoute ( EvpnRouteEntry routing_evpn_rt,
VrfEntry bridge_vrf 
)
private

Determines if the given EVPN route is already present in the given VRF.

bool VxlanRoutingManager::IsRoutingVrf ( const VrfEntry vrf)
staticprivate

Determines whether the pointer to the VRF instance is of routing type.

Returns
true if it is routing, otherwise return value is false.

Definition at line 337 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

bool VxlanRoutingManager::IsRoutingVrf ( const std::string  vrf_name,
const Agent agent 
)
staticprivate

Checks whether the VRF instance with the given name is routing or not.

Returns
true if this VRF is routing, otherwise return value is false.

Definition at line 364 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

bool VxlanRoutingManager::IsVrfLocalRoute ( EvpnRouteEntry routing_evpn_rt,
VrfEntry bridge_vrf 
)
private

Determines if the given EVPN route has an interface NH or a composite of interfaces NH that belongs to the given bridge VRF instance.

Definition at line 286 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

bool VxlanRoutingManager::IsVxlanAvailable ( const Agent agent)
staticprivate

Checks whether VxLAN routing manager is enabled or not.

Definition at line 175 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

template<class ItType >
std::vector< IpAddress > VxlanRoutingManager::ItemNexthopsToVector ( ItType *  item)
staticprivate

Templates.

Converts item's (EnetItemType for EVPN / ItemType for Inet) nexthops into the list of IP addresses (IpAddress)

Definition at line 2 of file vxlan_templates.cc.

bool VxlanRoutingManager::LeakRoutesIntoBridgeTables ( DBTablePartBase partition,
DBEntryBase e,
const boost::uuids::uuid uuid,
const VnEntry vn,
bool  update = false 
)

Performs advertisement and deletion of routing routes (with VrfNH) in bridge VRF instances. External tunnels and routes with a prefix that is not present in bridge VRF instance are selected for leaking.

Definition at line 364 of file vxlan_routes_leaking.cc.

Here is the call graph for this function:

void VxlanRoutingManager::ListAttachedVns ( )
static

Prints all virtual networks attached to logical routers.

Definition at line 1063 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

MacAddress VxlanRoutingManager::NbComputeMac ( const Ip4Address compute_ip,
const Agent agent 
)
staticprivate

Returns the MAC address for the IP of a given neighbouring compute.

Definition at line 587 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

void VxlanRoutingManager::PrintEvpnTable ( const VrfEntry const_vrf)
static

Prints EVPN table of the given VRF instance.

Definition at line 950 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

void VxlanRoutingManager::PrintInetTable ( const VrfEntry const_vrf)
static

Prints IPv4 Inet table of the given VRF instance.

Definition at line 1008 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

void VxlanRoutingManager::Register ( )

Registers handlers for events associated with changes in virtual networks (VnTable class) and VRF instances (VrfTable class).

Definition at line 346 of file vxlan_routing_manager.cc.

Here is the call graph for this function:

bool VxlanRoutingManager::RouteNotify ( DBTablePartBase partition,
DBEntryBase e 
)

Handler for changes (new/update/delete) in a route (EVPN or Inet). Main entry point for routes leaking.

Definition at line 29 of file vxlan_routes_leaking.cc.

Here is the call graph for this function:

bool VxlanRoutingManager::RoutePrefixIsEqualTo ( const EvpnRouteEntry route,
const IpAddress prefix_ip,
const uint32_t  prefix_len 
)
staticprivate

Determines whether route prefix in the EVPN route is equal to the given pair of prefix IP address and length.

Definition at line 211 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

bool VxlanRoutingManager::RoutePrefixIsEqualTo ( const InetUnicastRouteEntry route,
const IpAddress prefix_ip,
const uint32_t  prefix_len 
)
staticprivate

Determines whether route prefix of the Inet route is equal to the given pair of prefix IP address and length.

Definition at line 222 of file vxlan_auxilliary.cc.

Here is the call graph for this function:

void VxlanRoutingManager::RoutingVnNotify ( const VnEntry vn,
VxlanRoutingVnState vn_state 
)

A handler for changes (new/update/delete) in the virtual network from a routing VRF.

Definition at line 596 of file vxlan_routing_manager.cc.

Here is the call graph for this function:

void VxlanRoutingManager::RoutingVrfDeleteAllRoutes ( VrfEntry rt_vrf)
private

deletes all routes in EVPN table of routing VRF

Definition at line 542 of file vxlan_routing_manager.cc.

Here is the call graph for this function:

void VxlanRoutingManager::Shutdown ( )

Unregisters handlers for events associated with changes in virtual networks (VnTable class) and VRF instances (VrfTable class).

Definition at line 363 of file vxlan_routing_manager.cc.

Here is the call graph for this function:

void VxlanRoutingManager::UpdateSubnetRoute ( const VrfEntry vrf,
const VrfEntry routing_vrf 
)
private

Updates subnet routes (actually, paths with VrfNH) in the given bridge VRF.

Definition at line 856 of file vxlan_routing_manager.cc.

Here is the call graph for this function:

DBTable::ListenerId VxlanRoutingManager::vmi_listener_id ( ) const
inline

Returns the ID of the listener to changes in the InterfaceTable.

Definition at line 557 of file vxlan_routing_manager.h.

void VxlanRoutingManager::VmiNotify ( DBTablePartBase partition,
DBEntryBase e 
)

Handler for changes (new/update/delete) in a VMI (VmInterface class).

Definition at line 689 of file vxlan_routing_manager.cc.

Here is the call graph for this function:

DBTable::ListenerId VxlanRoutingManager::vn_listener_id ( ) const
inline

Returns the ID of the listener to changes in the VnTable.

Definition at line 547 of file vxlan_routing_manager.h.

void VxlanRoutingManager::VnNotify ( DBTablePartBase partition,
DBEntryBase e 
)

A handler for changes (new/update/delete) in a virtual network (VnEntry class).

VNNotify Handles routing vrf i.e. VRF meant for doing evpn routing. Addition or deletion of same add/withdraws route imported from bridge vrf in routing vrf. Walk is issued for the routes of bridge vrf's evpn table.

For bridge VRF, only delete of VN is handled here. Add has no operation as add of VN does not give any info on LR/Routing VRF to use. When delete is seen withdraw from the list of bridge list.

Definition at line 383 of file vxlan_routing_manager.cc.

Here is the call graph for this function:

DBTable::ListenerId VxlanRoutingManager::vrf_listener_id ( ) const
inline

Returns the ID of the listener to changes in the VrfTable.

Definition at line 552 of file vxlan_routing_manager.h.

const VxlanRoutingVrfMapper& VxlanRoutingManager::vrf_mapper ( ) const
inline

Returns the map between LR uuids and associated bridge and routing VRF instances.

Definition at line 563 of file vxlan_routing_manager.h.

void VxlanRoutingManager::VrfNotify ( DBTablePartBase partition,
DBEntryBase e 
)

A handler for changes (new/update/delete) in a VRF instance (VrfEntry class).

Updates (sets or deletes) VxlanRoutingState for the given modified VrfEntry

Definition at line 662 of file vxlan_routing_manager.cc.

Here is the call graph for this function:

AgentRouteWalker* VxlanRoutingManager::walker ( )
inline

Returns a pointer to the AgentRouteWalkerPtr object.

Definition at line 568 of file vxlan_routing_manager.h.

void VxlanRoutingManager::WhenBridgeInetIntfWasDeleted ( const InetUnicastRouteEntry inet_rt,
const VrfEntry routing_vrf 
)
private

Handles deletion of a route in the EVPN table of the routing VRF instance.

Definition at line 238 of file vxlan_routes_leaking.cc.

Here is the call graph for this function:

void VxlanRoutingManager::WhenRoutingEvpnRouteWasDeleted ( const EvpnRouteEntry routing_evpn_rt,
const Peer delete_from_peer 
)
private

Handles deletion of a route in the Inet table of the routing VRF instance.

Definition at line 291 of file vxlan_routes_leaking.cc.

Here is the call graph for this function:

bool VxlanRoutingManager::WithdrawEvpnRouteFromRoutingVrf ( const VrfEntry routing_vrf,
DBTablePartBase partition,
DBEntryBase e 
)

Deletes a given EVPN route from EVPN table of the routing VRF instance.

Definition at line 335 of file vxlan_routes_leaking.cc.

Here is the call graph for this function:

void VxlanRoutingManager::XmppAdvertiseEvpnInterface ( EvpnAgentRouteTable inet_table,
const IpAddress prefix_ip,
const int  prefix_len,
uint32_t  vxlan_id,
const std::string  vrf_name,
const RouteParameters params,
const Peer bgp_peer 
)
private

Advertises in the EVPN table an interface route that arrived via XMPP channel. Must be called only from XmppAdvertiseInetRoute.

Definition at line 125 of file vxlan_xmpp_routes.cc.

Here is the call graph for this function:

void VxlanRoutingManager::XmppAdvertiseEvpnRoute ( const IpAddress prefix_ip,
const int  prefix_len,
uint32_t  vxlan_id,
const std::string  vrf_name,
const RouteParameters params,
const Peer bgp_peer 
)
private

Advertises an EVPN route received using XMPP channel.

Definition at line 42 of file vxlan_xmpp_routes.cc.

Here is the call graph for this function:

void VxlanRoutingManager::XmppAdvertiseEvpnTunnel ( EvpnAgentRouteTable inet_table,
const IpAddress prefix_ip,
const int  prefix_len,
uint32_t  vxlan_id,
const std::string  vrf_name,
const RouteParameters params,
const Peer bgp_peer 
)
private

Advertises in the EVPN table a tunnel route that arrived via XMPP channel. Must be called only from XmppAdvertiseInetRoute.

Definition at line 87 of file vxlan_xmpp_routes.cc.

Here is the call graph for this function:

void VxlanRoutingManager::XmppAdvertiseInetInterfaceOrComposite ( InetUnicastAgentRouteTable inet_table,
const IpAddress prefix_ip,
const int  prefix_len,
const std::string  vrf_name,
const AgentPath path 
)
private

Advertises in the Inet table an interface route that arrived via XMPP channel. Must be called only from XmppAdvertiseInetRoute.

Definition at line 184 of file vxlan_xmpp_routes.cc.

Here is the call graph for this function:

void VxlanRoutingManager::XmppAdvertiseInetRoute ( const IpAddress prefix_ip,
const int  prefix_len,
uint32_t  vxlan_id,
const std::string  vrf_name,
const RouteParameters params,
const Peer bgp_peer 
)
private

Advertises an Inet route received using XMPP channel.

void VxlanRoutingManager::XmppAdvertiseInetRoute ( const IpAddress prefix_ip,
const int  prefix_len,
const std::string  vrf_name,
const AgentPath path 
)
private

Advertises an Inet route received from EVPN table.

Definition at line 64 of file vxlan_xmpp_routes.cc.

Here is the call graph for this function:

void VxlanRoutingManager::XmppAdvertiseInetTunnel ( InetUnicastAgentRouteTable inet_table,
const IpAddress prefix_ip,
const int  prefix_len,
uint32_t  vxlan_id,
const std::string  vrf_name,
const RouteParameters params,
const Peer bgp_peer 
)
private

Advertises in the Inet table a tunnel route that arrived via XMPP channel. Must be called only from XmppAdvertiseInetRoute.

void VxlanRoutingManager::XmppAdvertiseInetTunnel ( InetUnicastAgentRouteTable inet_table,
const IpAddress prefix_ip,
const int  prefix_len,
const std::string  vrf_name,
const AgentPath path 
)
private

Advertises in the Inet table a tunnel route that arrived via XMPP channel. Must be called only from XmppAdvertiseInetRoute.

Definition at line 154 of file vxlan_xmpp_routes.cc.

Here is the call graph for this function:

Friends And Related Function Documentation

friend class AgentXmppChannel
friend

Allows AgentXmppChannel to use private members of this class.

Definition at line 621 of file vxlan_routing_manager.h.

friend class AgentXmppChannelVxlanInterface
friend

Allows access to Xmpp advertisement functions via external class.

Definition at line 624 of file vxlan_routing_manager.h.

friend class ControllerEcmpRoute
friend

Allows ControllerEcmpRoute to use private members of this class.

Definition at line 618 of file vxlan_routing_manager.h.

friend class MetadataProxy
friend

Allows MetadataProxy to use private members of this class.

Definition at line 631 of file vxlan_routing_manager.h.

friend class VxlanRoutingRouteWalker
friend

Friends declarations.

Allows access to private members for the VxlanRoutingRouteWalker class.

Definition at line 615 of file vxlan_routing_manager.h.

friend class VxlanRoutingVrfMapper
friend

Allows VxlanRoutingVrfMapper to use private members of this class.

Definition at line 628 of file vxlan_routing_manager.h.

Member Data Documentation

Agent* VxlanRoutingManager::agent_
private

A pointer to the Agent instance.

Definition at line 584 of file vxlan_routing_manager.h.

uint32_t VxlanRoutingManager::loc_sequence_ = 0
staticprivate

An always increasing counter for new paths (used to signal controoler about new routes).

Definition at line 605 of file vxlan_routing_manager.h.

tbb::mutex VxlanRoutingManager::mutex_
staticprivate

A mutex object to prevent simultaneous update of local sequence number property.

Definition at line 609 of file vxlan_routing_manager.h.

const Peer * VxlanRoutingManager::routing_vrf_interface_peer_ = NULL
staticprivate

Internal data of this class.

A pointer to the Peer where all interface / composite of interfaces routes in routing VRF are linked to.

Definition at line 578 of file vxlan_routing_manager.h.

const Peer * VxlanRoutingManager::routing_vrf_vxlan_bgp_peer_ = NULL
staticprivate

A pointer to the Peer where all BGP routes are stored.

Definition at line 581 of file vxlan_routing_manager.h.

DBTable::ListenerId VxlanRoutingManager::vmi_listener_id_
private

An ID of the listener to changes in InterfaceTable.

Definition at line 597 of file vxlan_routing_manager.h.

DBTable::ListenerId VxlanRoutingManager::vn_listener_id_
private

An ID of the listener to changes in VnTable.

Definition at line 591 of file vxlan_routing_manager.h.

DBTable::ListenerId VxlanRoutingManager::vrf_listener_id_
private

An ID of the listener to changes in VrfTable.

Definition at line 594 of file vxlan_routing_manager.h.

VxlanRoutingVrfMapper VxlanRoutingManager::vrf_mapper_
private

A map between LR uuids and associated bridge and routing VRF instances.

Definition at line 601 of file vxlan_routing_manager.h.

AgentRouteWalkerPtr VxlanRoutingManager::walker_
private

A pointer to the walker to loop over INET tables in bridge VRF instances.

Definition at line 588 of file vxlan_routing_manager.h.


The documentation for this class was generated from the following files: