Routing-policy: Incorrect route advertised to CN/MX if its modified in more than 1 policy

Bug #1548115 reported by amit surana
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R3.0
Fix Committed
Medium
Prakash Bailkeri
Trunk
Fix Committed
Medium
Prakash Bailkeri

Bug Description

Consider 2 routing-policies:

RP-1:
from prefix 8.0.1.0/24 orlonger then add communities 64512:1111, 64512:2222 local-preference 1111 action next
from prefix 8.0.2.0/24 exact then local-preference 1112 med 500 action next
from Protocol service-chain then local-preference 9999 med 8888 action next
from community 35236:400 then remove communities 35236:401 action accept

RP-2:
from community 35236:500 then remove communities 35236:401 local-preference 3131 action accept
from prefix 9.0.2.0/24 exact then local-preference 1010 action default

Policies are applied in the order [RP-1, RP-2].

Consider route:
9.0.2.0/24, communities: [35236:500, 35236:401]

After processing the above route, the route table looks like this:

BGP: LP 9999, 35236: 500, 35236:401 [route sent via BGP to CN/MX. Has changes made by RP-1 but not RP-2]
SC: LP 3131, 35236:500 [This route is correctly updated]

amit surana (asurana-t)
summary: - Routing-policy: Incorrect route advertised via BGP if its modified in
+ Routing-policy: Incorrect route advertised to CN/MX if its modified in
more than 1 policy
Revision history for this message
Nischal Sheth (nsheth) wrote :

Looks like we didn't update our bgp advertisement when the service
chain route was modified via policy. Root cause is a piece of code in
InetVpnTable::RouteReplicate that notifies the route only iff the
replicated path is the best path.

Fix would be to notify the route if the replicated path was either the
best path earlier or is the new best path now. Or always notify the
route whenever the replicated path changes.

Same change is needed for Inet6VpnTable::RouteReplicate as well.

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/17662
Submitter: Prakash Bailkeri (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/17662
Committed: http://github.org/Juniper/contrail-controller/commit/c8a8805e9236789c8341f7f20f1db5c8eb954cf5
Submitter: Zuul
Branch: master

commit c8a8805e9236789c8341f7f20f1db5c8eb954cf5
Author: Prakash Bailkeri <email address hidden>
Date: Wed Feb 24 00:19:46 2016 +0530

Notify replicated routes

Scenario:

Consider a route with community c1 and c2 and routing instance with policy P1
Policy P1: { from community c1; then local-pref 9999 }
Due to the routing policy the route has local-pref set 9999. The route in
bgp.l3vpn.0 table has two paths (one replicated and other Bgp path) with
local-pref set to 9999.

Now attach routing instance to policy P2
Policy P2: { from community c2; then local-pref 8888 }

Since the route has community c1 and c2, it matches both policy and the end
result is path has local-pref set to 8888.

When the new route is replicated to bgp.l3vpn.0 table, new replicated route
will have lower local-pref(8888) compared to bgp-path from other control-node(9999).
So the replicated path will not be selected and is not inserted on top of the
path list. In this case if the replicated route in bgp.l3vpn.0 table is not
notified, then export code will not send the updated path with new local-pref

Fix:
Notify replicated even when inserted secondary path is not BestPath on the route.

Added test to verify that after the policy update on routing instance, the route
has local-pref as per the policy action update(i.e. in the above example 8888)

Change-Id: I762e001ba97d4739d12daf580109f2b042878ddf
Closes-bug: #1548115

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R3.0

Review in progress for https://review.opencontrail.org/17715
Submitter: Prakash Bailkeri (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/17715
Committed: http://github.org/Juniper/contrail-controller/commit/80fdc0614c258b023050e485298bb68a527ab980
Submitter: Zuul
Branch: R3.0

commit 80fdc0614c258b023050e485298bb68a527ab980
Author: Prakash Bailkeri <email address hidden>
Date: Wed Feb 24 00:19:46 2016 +0530

Notify replicated routes

Scenario:

Consider a route with community c1 and c2 and routing instance with policy P1
Policy P1: { from community c1; then local-pref 9999 }
Due to the routing policy the route has local-pref set 9999. The route in
bgp.l3vpn.0 table has two paths (one replicated and other Bgp path) with
local-pref set to 9999.

Now attach routing instance to policy P2
Policy P2: { from community c2; then local-pref 8888 }

Since the route has community c1 and c2, it matches both policy and the end
result is path has local-pref set to 8888.

When the new route is replicated to bgp.l3vpn.0 table, new replicated route
will have lower local-pref(8888) compared to bgp-path from other control-node(9999).
So the replicated path will not be selected and is not inserted on top of the
path list. In this case if the replicated route in bgp.l3vpn.0 table is not
notified, then export code will not send the updated path with new local-pref

Fix:
Notify replicated even when inserted secondary path is not BestPath on the route.

Added test to verify that after the policy update on routing instance, the route
has local-pref as per the policy action update(i.e. in the above example 8888)

Change-Id: I762e001ba97d4739d12daf580109f2b042878ddf
Closes-bug: #1548115
(cherry picked from commit c8a8805e9236789c8341f7f20f1db5c8eb954cf5)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.