This page discusses the behavior of BGP dynamic routing about how to advertise routes and show the routes details in the project.
BGP dynamic routing could advertise 3 classes of routes:
When distributed virtual routing (DVR) is enabled on a router, next-hops for floating IP’s and fixed IP’s are not advertised as being at the centralized router. Host routes with the next-hop set to the appropriate compute node are advertised.
+--------+ 1 N +---------------------+
| Router |---------| BgpAdvertisedRoute |
+--------+ +---------------------+
| N
|
| 1
+---------+ N N +------------+ N N +---------+
| BgpPeer |-----------| BgpSpeaker |-----------| Network |
+---------+ +------------+ +---------+
| N
|
| 1
+--------------+
| AddressScope |
+--------------+
Note
A BGP Speaker only supports one address family to speak BGP. A dual-stack IPv4 and IPv6 network needs two BGP Speakers to advertise the routes with BGP, one for IPv4 and the other for IPv6. So A network can have N number of BGP Speakers bound to it.
BgpAdvertisedRoute represents derived data. As the number of BgpAdvertisedRoutes can be quite large, storing in a database table is not feasible. BgpAdvertisedRoute information can be derived by joining data already available in the Neutron database. And now BGP dynamic routing project process the Bgpadvertiseroutes which should be advertised to external Router is basing on the exist Neutron DB tables. Neutron looks on each of the gateway network for any routers with a gateway port on that network. For each router identified, Neutron locates each floating IP and tenant network accessible through the router gateway port. Neutron then advertises each floating IP and tenant network with the IP address of the router gateway port as the next hop.
When BGP Plugin is started, it will register callbacks. All callbacks are used for processing Floating IP, Router Interface and Router Gateway creation or update, this functions listen the events of these resources for calling Dragent to change the advertisement routes.
Now we just focus on the resources which may cause route change, the following callbacks does this work.
It does a complicated db query to generate the list of advertised routes. For more details refer to route advertisement db lookup