Community discussions

MikroTik App
 
omago
just joined
Topic Author
Posts: 5
Joined: Mon Mar 11, 2013 1:30 pm

BGP MED Attribute and IBGP

Mon Mar 11, 2013 2:00 pm

I am a little bit confused with Mikrotik's BGP MED attribute implementation.
Two observations from the LAB (tested both v5.24 and v6.0rc11):

1) MED works ok for EBGP sessions. But when propagating external routes to internal BGP (IBGP) neighbors, MED attributes are deleted.

2) When a Mikrotik router receives the same route from an EBGP neighbor and from an IBGP neighbor ( Cisco, by example, propagates MED attr. over IBGP sessions), MED values are not evaluated as part of the BGP best route selection process.


Are these observations correct ?
Is this the way MED is implemented in RouterOS's BGP ?
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7053
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: BGP MED Attribute and IBGP

Mon Mar 11, 2013 2:08 pm

From the manual:
http://wiki.mikrotik.com/wiki/Manual:BG ... _Algorithm

The router compare MED attribute only for paths that have the same neighboring (leftmost) AS. Paths without explicit MED value are treated as with MED of 0
 
omago
just joined
Topic Author
Posts: 5
Joined: Mon Mar 11, 2013 1:30 pm

Re: BGP MED Attribute and IBGP

Mon Mar 11, 2013 5:36 pm

Thank you for your quick response but let me explain my question with more detail.
Imagine this scenario with 2 routers (R1 & R2) in AS65001 and another 2 (R3 & R4) in AS65002:

R1[AS65001] ------- R3[AS65002]------R4[AS65002]---------R2[AS65001]

R1 announces a route to 10.10.12.0/24 to R3 with MED=101
R2 announces same route to R4 with MED=102


1) If R4 is a Mikrotik router it receives the route correctly form R2 with MED=102
but when propagating it to it's IBGP peer R3 it sends it with MED=0
[admin@R4] > /routing bgp advertisements print R3 detail 

 peer="R3" prefix=10.10.12.0/24 nexthop=10.10.34.4 as-path="65001" 
   origin=incomplete local-pref=100 
2) And if R3 is a router that propagates MED to IBGP peers (as Cisco or Juniper do) at R4 we have 2 routes to 10.10.12.0/24
both with the same:

- Weight
- Local Pref
- AS Path
- Origin


 
[admin@R4] > /ip route print detail 
Flags: X - disabled, A - active, D - dynamic, 
C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, 
B - blackhole, U - unreachable, P - prohibit 
0 ADb  dst-address=10.10.12.0/24 gateway=10.10.24.2 
        gateway-status=10.10.24.2 reachable via  ether2 distance=20 scope=40 
        target-scope=10 bgp-as-path="65001" bgp-med=102 bgp-origin=incomplete 
        received-from=R2 

 1  Db  dst-address=10.10.12.0/24 gateway=10.10.34.3 
        gateway-status=10.10.34.3 reachable via  ether3 distance=200 scope=40 
        target-scope=30 bgp-as-path="65001" bgp-local-pref=100 bgp-med=101 
        bgp-origin=incomplete received-from=R3 

Then, according to http://wiki.mikrotik.com/wiki/Manual:BG ... _Algorithm, MED should be compared and route 1 with MED=101 selected as best. But our LAB shows thar route 0 with MED=102 is the active route.

From 1) and 2) it looks like MED in Mikrotik is used only in EBGP: It is not propagated to IBGP peers and it's value is ignored when a route from an IBGP peer is one of the candidates.


I'd like to know if this is a design decision in RouterOS or a bug.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7053
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: BGP MED Attribute and IBGP

Mon Mar 11, 2013 5:43 pm

MED will not be used for routes received from iBGP peer.
 
omago
just joined
Topic Author
Posts: 5
Joined: Mon Mar 11, 2013 1:30 pm

Re: BGP MED Attribute and IBGP

Mon Mar 11, 2013 5:53 pm

OK. Not a bug then.

RFC4451 writes only a "MAY" on that but it will be great if MED could be propagated and used also in iBGP.

Thank you.
Best Regards.

Who is online

Users browsing this forum: No registered users and 19 guests