08-13-2019 09:46 PM
Hi,
I have some questions regarding BGP
1.Can BGP perform load-balancing? If so how?
2.What is AS-PATH attribute in BGP and does it come into picture while doing load balancing.?
Solved! Go to Solution.
08-14-2019 06:04 AM
Hi Giuseppe,
Thanks for the reply.I understood properly but a small doubt remains still.
"In addition to this, the old default way to compare BGP advertisements could lead to non deterministic choices when comparing multiple eBGP routes..
What is a deterministic and non-deterministic choice as per BGP?
The bgp best-path deterministic-med removes this non deterministic behaviour by comparing first all eBGP routes coming from the same peer AS and choicing the one with the lowest MED"
For example if route is being learnt from the same peer AS then the 2 routers will form iBGP neighborship right? since these 2 routers belong to the same AS.
I didnt get the last point.Kindly help me on this
08-14-2019 06:56 AM
Hello Mani3,
I am afraid I have added too many details in my first post.
However . here when I say two eBGP routes coming from same peer AS I mean something like:
10.10.10.0/24 via 172.16.50.1 with AS path attribute :65000 65001 i MED 50
10.10.10.0/24 via 172.16.50.5 with AS path attribute 65000 65001 i MED 100
AS 65000 the leftmost is the peer AS, AS 65001 that originated the prefix is the origin AS.
MED is a parameter that is set by configuration.
By default MED values are considered comparable only if the eBGP routes are arriving from the same peer AS (the leftmost AS number).
By default the two following eBGP routes are not comparable for the MED attribute
10.10.10.0/24 via 172.16.50.1 with AS path attribute :65000 65001 i MED 50
10.10.10.0/24 via 172.17.52.5 with AS path attribute :65102 65001 i MED 500
because the peer AS is different 65000 in first path and 65102 in second path.
The bgp always-compare med allows to make MED comparisons even if the peer AS is different.
The bgp deterministic-med is used to solve a possible issue with choice of best path among multiple eBGP routes.
see the following document that explains the difference between the two commands:
>> For example if route is being learnt from the same peer AS then the 2 routers will form iBGP neighborship right? since these 2 routers belong to the same AS.
No, I am referring to two different eBGP routes like the following example:
10.10.10.0/24 via 172.16.50.1 with AS path attribute :65000 65001 i MED 50
10.10.10.0/24 via 172.16.50.5 with AS path attribute 65000 65001 i MED 100
As explained above the peer AS is the leftmost AS in the AS path.
Hope to help
Giuseppe
08-14-2019 12:17 AM
Hello,
there are numerous ways to perform load balancing in BGP. It all depends on your topology. Have a look at the link below, which has sample configs (also AS Path related) for various topologies...
https://showipbgp.com/sample-cisco-bgp-configuration-by-topology/
08-14-2019 06:05 AM
Hi Goerg,
Thanks a lot for the link.It is really useful
08-14-2019 02:19 AM
Hello Mani3,
first of all, we need to distinguish between eBGP and iBGP
BGP by default does not perform load balancing but it can be configured to use more the one paths.
EBGP (wider support)
router bgp 65000
maximum-paths 4
iBGP (when supported )
router bgp 65000
maximum-paths ibgp 4
However, to be able to use multiple advertisements those advertisements must be comparable on the first criteria of BGP best path selection:
there must be a tie or parity for the attributes:
weight
local preference
AS path length
Origin type (internal better then ?, code e stands for EGP and is never seen in modern networks )
MED (it can be set or not, when not set the default is to consider it zero, this can be changed to consider a missing MED as highest possible value. If this choice is made it must be configured on all routers)
bgp always-compare med and bgp deterministic-med are recommended in modern BGP implementations.
by default MED is compared only for advertisements coming from the same peer AS.
In addition to this, the old default way to compare BGP advertisements could lead to non deterministic choices when comparing multiple eBGP routes. The bgp best-path deterministic-med removes this non deterministic behaviour by comparing first all eBGP routes coming from the same peer AS and choicing the one with the lowest MED
Neighbor type (eBGP is preferred over iBGP)
IGP metric to next-hop (used in iBGP).
The BGP AS path attribute length is a parameter that usually is used to choice the best path the shortest AS path is preferred.
The command bgp best-path as-path ignore can be used to skip this check in best path selection in some specific scenarios. However, this is not recommended.
Hope to help
Giuseppe
08-14-2019 06:04 AM
Hi Giuseppe,
Thanks for the reply.I understood properly but a small doubt remains still.
"In addition to this, the old default way to compare BGP advertisements could lead to non deterministic choices when comparing multiple eBGP routes..
What is a deterministic and non-deterministic choice as per BGP?
The bgp best-path deterministic-med removes this non deterministic behaviour by comparing first all eBGP routes coming from the same peer AS and choicing the one with the lowest MED"
For example if route is being learnt from the same peer AS then the 2 routers will form iBGP neighborship right? since these 2 routers belong to the same AS.
I didnt get the last point.Kindly help me on this
08-14-2019 06:56 AM
Hello Mani3,
I am afraid I have added too many details in my first post.
However . here when I say two eBGP routes coming from same peer AS I mean something like:
10.10.10.0/24 via 172.16.50.1 with AS path attribute :65000 65001 i MED 50
10.10.10.0/24 via 172.16.50.5 with AS path attribute 65000 65001 i MED 100
AS 65000 the leftmost is the peer AS, AS 65001 that originated the prefix is the origin AS.
MED is a parameter that is set by configuration.
By default MED values are considered comparable only if the eBGP routes are arriving from the same peer AS (the leftmost AS number).
By default the two following eBGP routes are not comparable for the MED attribute
10.10.10.0/24 via 172.16.50.1 with AS path attribute :65000 65001 i MED 50
10.10.10.0/24 via 172.17.52.5 with AS path attribute :65102 65001 i MED 500
because the peer AS is different 65000 in first path and 65102 in second path.
The bgp always-compare med allows to make MED comparisons even if the peer AS is different.
The bgp deterministic-med is used to solve a possible issue with choice of best path among multiple eBGP routes.
see the following document that explains the difference between the two commands:
>> For example if route is being learnt from the same peer AS then the 2 routers will form iBGP neighborship right? since these 2 routers belong to the same AS.
No, I am referring to two different eBGP routes like the following example:
10.10.10.0/24 via 172.16.50.1 with AS path attribute :65000 65001 i MED 50
10.10.10.0/24 via 172.16.50.5 with AS path attribute 65000 65001 i MED 100
As explained above the peer AS is the leftmost AS in the AS path.
Hope to help
Giuseppe
08-14-2019 10:40 AM
Hi Giuseppe,
Thank you very much.Really you nailed it. Now i understood clearly the difference between bgp deterministic-med and bgp-always-compare med.
Thanks a lot sir. :)
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide