cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
540
Views
0
Helpful
3
Replies

BGP Path selection

mahesh-gohil
Level 1
Level 1

Dear all,

I am having confusion with two of the BGP path selection algorithm

3---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.

and

5--Prefer the path with the lowest origin type.

Note: IGP is lower than Exterior Gateway Protocol (EGP), and EGP is lower than INCOMPLETE.

It seems same to me. may be anyone can explain me to differentiate this

Please help

Thanks & Regards

Mahesh

1 Accepted Solution

Accepted Solutions

Hi Mahesh,

Not exactly. The step 3 only is applicable, if locally originated routes are present in the BGP table.

First, assume you have two routers R1 and R2 and both insert 10.1.0.0/16 into BGP. Which one will be the best path for R1? According to "3" it will be the locally inserted 10.1/16 and not the one learned from the other router R2.

Note that only the best path is announced to other BGP speakers. So R1 (and R2 for the same reasons) would announce the locally originated 10.1/16 to other BGP speakers.

Second, assume you have one router R1 and someone chooses to include 10.1.0.0/16 locally into the BGP table through a) redistribution, b) network statement and c) aggregate-address ALL at the same time.

Which one will be the best path? Well, the network statement will "win" the comparison.

Hope this helps! Please use the rating system.

Regards, Martin

View solution in original post

3 Replies 3

mheusing
Cisco Employee
Cisco Employee

Hi Mahesh,

3 -- prefer locally originated only applies to networks inserted into the BGP table at the router doing the path selection. This router will also create an origin BGP path attribute for the new BGP table entry.

5--prefer lowest origin type does apply to all BGP routes, as the origin code is a well known mandatory BGP attribute. This means every path entry in a BGP table has an origin code, even if the network was inserted into BGP in another router or even another AS.

The origin code tells about how the route originally came into the BGP table:

i - IGP, through a network command,

e - EGP, through EGP (outdated protocol and not to be seen today)

? - incomplete, through redistribution

Note however that this attribute can be modified with a route-map.

In brief: "3" applies only to those routes/pathes inserted into BGP locally, "5" applies to all the routes/pathes in the BGP table.

Hope this helps! Please use the rating system.

Regards, Martin

I have understood 5th one and for 3rd one

Correct me if I am wrong

You mean to say Suppose My AS is 100 and if I am getting Two routes to same prefix from my own AS(100)

one--Inserted via network command

Two: Inserted via aggregate-address

My Router will prefer the first one

Mahesh

Hi Mahesh,

Not exactly. The step 3 only is applicable, if locally originated routes are present in the BGP table.

First, assume you have two routers R1 and R2 and both insert 10.1.0.0/16 into BGP. Which one will be the best path for R1? According to "3" it will be the locally inserted 10.1/16 and not the one learned from the other router R2.

Note that only the best path is announced to other BGP speakers. So R1 (and R2 for the same reasons) would announce the locally originated 10.1/16 to other BGP speakers.

Second, assume you have one router R1 and someone chooses to include 10.1.0.0/16 locally into the BGP table through a) redistribution, b) network statement and c) aggregate-address ALL at the same time.

Which one will be the best path? Well, the network statement will "win" the comparison.

Hope this helps! Please use the rating system.

Regards, Martin

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: