BGP path selection with 3 & 5th step

Answered Question
Aug 11th, 2009

Dear Experts,

I am trying to understand BGP BEST PATH SELECTION criteria 3 & 5

Selection 3: Prefer the path that was locally generated using Network / redistribute / aggregate command

Selection 5: Prefer the path with Lowest origin type IGP < EGP < INCOMPLETE

In selection 3 REDISTRIBUTE also make the route with SYMBOL (?), selection 5 also states INCOMPLETE (?)

I find difficult to understand the concept. can you please explain with example so that i can understand this better

Thanks in advance

Sairam

I have this problem too.
0 votes
Correct Answer by Istvan_Rabai about 7 years 3 months ago

Hi Sairam,

You should understand this the following way:

Step 3 in the BGP path selection process is executed if there are multiple paths with the same weight and local preference attributes (step 1 and step 2)

Step 5 in the BGP path selection process is executed if there are multiple paths with the same weight, local preference and AS_Path attributes and the paths are not originated by the local router (step 1 through step 4).

So the point is to go over the path selection process step by step until a tie breaker can be found.

Cheers:

Istvan

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (3 ratings)
Loading.
Istvan_Rabai Tue, 08/11/2009 - 22:42

Hi Sathya,

In step 3:

The router will prefer the paths originated by the local router in the following order of preference:

The path was generated by:

1. default-information originate command

2. network command

3. aggregate-address command

4. redistribute command

This means for example that the path generated by the local router using the network command will be preferred over a similar path but generated by the redistribute command.

For example if you have a loopback0 interface 10.1.1.1/32 within the router and you want to advertise it.

Advertising it with the network command:

router bgp 65000

network 10.1.1.1 mask 255.255.255.255

Advertising it with the redistribute command:

route-map CONN

match interface loopback0

router bgp 65000

redistribute connected route-map CONN

The router will prefer the path originated by the network command and will advertise it to its neighbors.

In step 5:

The following origin codes exist:

1. IGP (i), its value in the updates = 0

2. EGP, its value in the updates = 1

3. Incomplete (?), its value in the updates = 2

1. When a path is originated using the default-information originate command, the network command or the aggregate-address command on some router, the path receives an origin code of 0 (presented as ' i ')

2. EGP is not used

3. When routes are originated with the redistribute command (routes are redistributed from another routing protocol e.g. from OSPF, EIGRP, RIP, or the static or connected routes are redistributed), the path receives an origin code of 2 (presented as '?')

Step 5 says:

Prefer the path with the lowest origin code.

This means that paths with origin code 0 (IGP) will be preferred to paths with origin code of 2 (incomplete).

Cheers:

Istvan

snarayanaraju Tue, 08/11/2009 - 22:59

Hi Istvan,

A nice explanation with good efforts. Thanks.

I will summarize my understanding.

STEP 3: More relevant to the Routes originated in the Local router.

STEP 5: More relevant to the Routes that is received from peer neighbor.

Hope I understood it in right way. If it is wrong, sorry I will look into your explanation again

sairam

Correct Answer
Istvan_Rabai Tue, 08/11/2009 - 23:43

Hi Sairam,

You should understand this the following way:

Step 3 in the BGP path selection process is executed if there are multiple paths with the same weight and local preference attributes (step 1 and step 2)

Step 5 in the BGP path selection process is executed if there are multiple paths with the same weight, local preference and AS_Path attributes and the paths are not originated by the local router (step 1 through step 4).

So the point is to go over the path selection process step by step until a tie breaker can be found.

Cheers:

Istvan

esoiba001 Thu, 11/28/2013 - 10:46

Hi Istvan,

Can you please explain the criteria that was used in selection of the best route in the output below?

sho ip bgp  10.0.0.0/8  

BGP routing table entry for 10.0.0.0/8, version 5602427

Paths: (2 available, best #1, table Default-IP-Routing-Table)

  Advertised to update-groups:

     1        

  Local

    172.27.128.4 from 0.0.0.0 (172.21.255.206)

      Origin incomplete, metric 264960, localpref 100, weight 32768, valid, sourced, best

  Local, (aggregated by 65100 172.21.255.206)

    0.0.0.0 from 0.0.0.0 (172.21.255.206)

      Origin IGP, localpref 100, weight 32768, valid, aggregated, local, atomic-aggregate

Both routes are originated locally one by redistribution and the other by aggregation. Based on the order of preference you indicated above, the aggregate routes are prefered over the redistributed routes so I would have expected the second route to be the best.

Weight and local-pref are equal so I'm thinking the tie breaker was Step 3 ?

Even if it went down to Step 5, origin code for IGP should be prefered over  incomplete hence i would still expect the second route to be selected.

Would appreciate your insight.

Thanks,

Gb,

milan.kulik Fri, 11/29/2013 - 00:17

Hi,

read step 3 here:

http://www.cisco.com/en/US/customer/tech/tk365/technologies_tech_note09186a0080094431.shtml

It says:

"Prefer the path that was locally originated via a network or aggregate BGP subcommand or through redistribution from an IGP.

Local paths that are sourced by the network  or redistribute commands are preferred over local aggregates that are sourced by the aggregate-address  command."

Best regards,

Milan

esoiba001 Fri, 11/29/2013 - 07:44

Got it thanks!

I guess Istvan should edit his first post and rearrange the order of preference for locally generated routes. He had put aggregate before redistributed which was misleading

Istvan_Rabai Fri, 11/29/2013 - 08:11

My mistake, sorry.

Thank you for the correction.

The corrected post:

In step 3:

The router will prefer the paths originated by the local router in the following order of preference:

The path was generated by:

1. default-information originate command

2. network command

3. redistribute command

4. aggregate-address command

Regards:

Istvan

Actions

This Discussion