Routing

last person joined: 3 days ago 

Ask questions and share experiences about ACX Series, CTP Series, MX Series, PTX Series, SSR Series, JRR Series, and all things routing, including portfolios and protocols.
  • 1.  med value in ibgp

    Posted 11-09-2012 04:47

    r1----ebgp----r2------ibgp---------r3

     

    if both r1 and r3 advertise 0/0 to r2 and I use policy to make  both of them have same AS path,r2 will conside 0/0 from r1 as best route because of - Interior > Exterior > Exterior via Interior

     

    If I set med as 10 when r1 advertise 0/0 to r2,r2 will consider 0/0 from r3 as best route because by default med is 0 from r3

     

     

    it seems even in IBGP,med will also be considered as a condition to select path

     

    I thouoght only ebgp will consider this!!

     

     

     



  • 2.  RE: med value in ibgp

    Posted 11-09-2012 09:48

    See step 7 in bgp best-path selection for Junos.  By default. As long as the peer asn is the same, the path with the lowest MED is preferred, regardless of ibgp/ebgp.

     

    http://www.juniper.net/techpubs/en_US/junos/topics/reference/general/routing-ptotocols-address-representation.html

     

     

     

     

     



  • 3.  RE: med value in ibgp

     
    Posted 11-11-2012 16:54

    Hi Rob,

     

    By default, when the AS PATH is same in both the received routes (from R1 and R3), then MED is evaluated to select a route with the lowest one. This is irrespective of eBGP/iBGP route.

     

    http://www.juniper.net/techpubs/en_US/junos12.2/topics/reference/configuration-statement/path-selection-edit-protocols-bgp.html

     

    I am using one of the best example that is demonstrated in JNCIS:

     

    If we receive a route from 3 different paths as below:

     

     Path 1—via EBGP; AS Path of 65000; MED of 200
     Path 2—via IBGP; AS Path of 65020; MED of 150; IGP cost of 5
     Path 3—via IBGP; AS Path of 65000; MED of 100; IGP cost of 10

     

    then

     

    Default:

    [1] First Path-1 and Path-3 are grouped as both contains same AS PATH and evaluated. In this, Path-3 would be selected based on lowest MED value

    [2] Next Path-3 and Path-2 would be then compared with other attributes to choose between one of the them. Based on IGP metric, Path 2 would be installed as active in routing-table

     

    With always-compare-med option:

    [1] In this case, irrespective of AS PATH, all routes coming upto MED evalution, are compared with MED value. Hence Path-3 would be installed as active since it has the lowest MED value.

     

    With cisco-non-deterministic:

    [1] Route would be selected based on the order they are received.

     

    Regrads

    Surya



  • 4.  RE: med value in ibgp

    Posted 11-11-2012 17:35

    Hi,Surya by default,it requires as path are the same,not only the latest ASn,right?

     

    in benb's comment:

    By default. As long as the peer asn is the same

     

     

    suppose there 2 paths

     

    path1: via EBGP; AS Path of 65000,20000; MED of 200

    path2:via EBGP; AS Path of 65000,10000; MED of 100

     

    whether it will compare med?they all come from 65000,but the whole AS is not euqal



  • 5.  RE: med value in ibgp
    Best Answer

     
    Posted 11-11-2012 18:33

    Hi Rob,

     

    As you see in my previous post for "Default", the second step would choose Path 2 over Path 3 though Path-3's MED value was lower.

     

    However in your case, we have 2 AS in AS_PATH, then the left most would be considered for MED comparison.

     

    path1: via EBGP; AS Path of 65000,20000; MED of 200

    path2: via EBGP; AS Path of 65000,10000; MED of 100.

     

    Path 2 would choosen because of lowest MED value.

     

    I wouldn't call it as peer AS number, as the local administrator can always overrule this. Just like as below:

     

    Prefix : 200/24

    path1: via eBGP; Nbr: 172.168.1.2; Peer AS : 500; MED 10

    path1: via eBGP; Nbr: 3.3.3.3; Peer AS : 200; MED 0

     

    With above data, we can say MED wouldn't be compared, but look at below:

     

    show bgp neighbor | match Peer:
    Peer: 3.3.3.3+58155 AS 200     Local: 1.1.1.1+179 AS 100  
      NLRI for restart configured on peer: inet-unicast
      NLRI advertised by peer: inet-unicast
    Peer: 172.168.1.2+63071 AS 500 Local: 172.168.1.1+179 AS 100  
      NLRI for restart configured on peer: inet-unicast
      NLRI advertised by peer: inet-unicast

     

    inet.0: 50 destinations, 51 routes (49 active, 0 holddown, 1 hidden)
    200.0.0.0/24 (2 entries, 1 announced)
            *BGP    Preference: 170/-101
                    Next hop type: Indirect
                    Address: 0x944d8b4
                    Next-hop reference count: 3
                    Source: 3.3.3.3
                    Next hop type: Router, Next hop index: 605
                    Next hop: 10.0.1.2 via ge-2/1/6.0, selected
                    Session Id: 0x252
                    Protocol next hop: 3.3.3.3
                    Indirect next hop: 9504000 2097150 INH Session ID: 0x255
                    State: <Active Ext>
                    Local AS:   100 Peer AS:   200
                    Age: 2:10       Metric2: 0
                    Validation State: unverified
                    Task: BGP_200.3.3.3.3+58155
                    Announcement bits (3): 0-KRT 2-BGP_RT_Background 5-Resolve tree 1
                    AS path: 4000 200 I
                    Accepted
                    Localpref: 100
                    Router ID: 3.3.3.3
             BGP    Preference: 170/-101
                    Next hop type: Router, Next hop index: 606
                    Address: 0x944c8f8
                    Next-hop reference count: 1
                    Source: 172.168.1.2
                    Next hop: 172.168.1.2 via ge-3/0/0.0, selected
                    Session Id: 0x253
                    State: <NotBest Ext>
                    Inactive reason: Not Best in its group - Route Metric or MED comparison
                    Local AS:   100 Peer AS:   500
                    Age: 2:21       Metric: 10
                    Validation State: unverified
                    Task: BGP_500.172.168.1.2+63071
                    AS path: 4000 500 I
                    Accepted
                    Localpref: 100
                    Router ID: 10.255.178.58

     

    Regards

    Surya

     

     

     



  • 6.  RE: med value in ibgp

    Posted 11-11-2012 18:58

    thx,Surya

    it is a very good example

     

    yes,network admin can prepend AS to the orginal path and make the left most ASs equal.



  • 7.  RE: med value in ibgp

    Posted 11-12-2012 10:13

    By peer asn, I meant he leftmost asn in the as_path sequence.  As others pointed out, this could be changed by policy/config, to something other than the actual bgp neighbors peer asn number.