RE: Juniper vs. Cisco Med

From: Huan Pham (huan.pham@valuenet.com.au)
Date: Mon Mar 10 2008 - 02:44:51 ARST


Hi Keegan,

The sort answer to your question is Cisco use non-deteministic MED by
default, whereas Juniper use deterministic MED.

My understanding is that admin distance is used to make route selection from
DIFFERENT routing protocols. It is not used within a single routing
protocol. For BGP, the way that a route is learnt (ether via eBGP or iBGP)
is one of the criteria used in the route selection. It is not the admin
distance (20/200 by default) associated with it.

More on your question, by default Cisco use non-deterministic MED.

*MY* interpretation of this is that,

- Router does not compare MED for routes from different AS.
- Router may skip MED comparison (for route from same AS) if there is route
leant from different AS.
- Router does not run BGP route-selection process again if one of the BGP
entries (which is not the best path) goes away

These behaviors (which may exclude MED comparison depending on the order BGP
routes are learnt) may result in different route selection outcome.

My interpretation of "non-deterministic MED" might be wrong, and I would
like to hear feedback on this.

On the other hand, Juniper automatically groups advertisements from the same
AS together to compare their MED values. The best value from each group is
then compared with each other using other route attributes.

So by default, Juniper implementation is different from Cisco. The Juniper
implementation is the same as if we add "bgp deterministic-med" command
under BGP.

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

"Enabling bgp deterministic-med removes any temporal dependency of MED-based
best path decisions. It ensures that an accurate MED comparison is made
across all routes received from the same autonomous system (AS).

If you disable bgp deterministic-med, the order in which routes are received
may impact MED-based best path decisions. This can occur when the same route
is received from multiple ASs or confederation sub-ASs, with exactly the
same path length, but different MEDs."

BTW, I happen to see another difference in the way Cisco and Juniper
implement BGP:

Cisco: Origin (IGP, EGP, Incomplete) is checked before AS path.
Juniper: AS path is checked before Origin.

Here' the way BGP route selection process takes place in Cisco vs Juniper

CISCO:
------

http://www.cisco.com/warp/public/459/25.shtml

JUNIPER:
--------

The BGP route selection algorithm in the JUNOS software uses a deterministic
set of steps
to select the active route for the routing table. This means that given the
same set of route
attributes, the algorithm makes the same selection every time. The steps of
the algorithm are
as follows:

1. The router first verifies that a current route exists in the inet.0
routing table that provides
reachability to the address specified by the Next Hop attribute. Should a
valid route not
exist, the path advertisement is not usable by the router and the route is
marked as hidden
in the routing table.

2. The router checks the Local Preference value and prefers all
advertisements with the highest
value. This is the only step in the algorithm that prefers a higher value
over a lower value.

3. The router evaluates the length of the AS Path attribute. A shorter path
length is preferred
over a longer path length. When the attribute contains an AS Set segment,
designated by the
{ and } braces, this set of values is considered to have a length of 1. For
example, the AS
Path of 65010 {65020 65030 65040} has a path length of 2.

4. The router checks the value in the Origin attribute. A lower Origin value
is preferred over
a higher value.

5. The router checks the value of the MED attribute for routes advertised
from the same
neighboring AS. A lower MED value is preferred over a higher MED value.

6. The router checks the type of BGP peer the path advertisement was learned
from. Advertisements
from EBGP peers are preferred over advertisements from IBGP peers.

7. The router determines the IGP metric cost to each BGP peer it received a
path advertisement
from. Advertisements from the peer with the lowest IGP cost are preferred.
For all
IBGP advertisements, the router also selects a physical next hop (or
multiple next hops)
for the advertisements from the lowest-cost peer. These physical next hops
are selected
using the following criteria:
a. The router examines both the inet.0 and the inet.3 routing tables for the
address of
the BGP Next Hop. The physical next hop(s) associated with the lowest JUNOS
software
route preference is preferred. This often means that the router uses the
inet.3 version of
the next hop-a Multiprotocol Label Switching (MPLS)-label switched path.
b. Should the preference values in the inet.0 and the inet.3 routing tables
be equal, the
router uses the physical next hop(s) of the instance in inet.3.
c. Should the preference values be identical and the routes be in the same
routing table,
inet.0 for example, the router evaluates the number of equal-cost paths of
each route
instance. The instance with the larger number of paths is preferred and its
physical next
hops are installed. This situation might occur when the default preference
values are modified
and the traffic-engineering bgp-igp MPLS configuration command is used.

8. The router determines the length of the Cluster List attribute. A shorter
list length is preferred
over a longer list length.

9. The router determines the router ID for each peer that advertised a path
to the route destination.
A lower router ID value is preferred over a higher router ID value.

10. The router determines the peer ID for each peer that advertised a path
to the router destination.
A lower peer ID value is preferred over a higher peer ID value. The peer ID
is the
IP address of the established BGP peering session.

Cheers,
 
Huan
-----Original Message-----
From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On Behalf Of
Keegan.Holley@sungard.com
Sent: Monday, 10 March 2008 10:35 AM
To: 'Cisco certification'
Subject: Juniper vs. Cisco Med

Hello all,

On page 336 - 337 of the JNCIS study guide it describes the portion of the
BGP route selection process pertaining to MED and then attempts to
describe the behavior of a cisco systems router in making the same
decision. The examples used are a little confusing. They use the same
three routes in both examples two coming from the same AS with differing
MED values and another coming from a different AS. With the Juniper method
the router choose the iBGP route with a lower MED. With the cisco method
the router chooses the eBGP route because eBGP is preferred. However, the
eBGP route is only preferred by the cisco router because of administrative
distance. The next decision in the path selection process of both vendors
is eBGP over iBGP, so Juniper router would have chosen the eBGP route as
well. My question is what is the difference between the cisco and juniper
treatment of MED?



This archive was generated by hypermail 2.1.4 : Tue Apr 01 2008 - 07:53:53 ART