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.

OSPF Path Selection explained - E1 routes are preferred over E2 routes

  • 1.  OSPF Path Selection explained - E1 routes are preferred over E2 routes

    Posted 01-30-2015 14:52

    Hi All,

     

    I have been reading a lot of blogs/pages/docs about this topic since my customer (all the time) is having trouble with external routes...:

    E1 routes are preferred over E2 routes

     

    examples:

    http://blog.ipspace.net/2008/01/e1-and-e2-routes-in-ospf.html

    http://www.cisco.com/c/en/us/support/docs/ip/open-shortest-path-first-ospf/7039-1.html

    ...

     
    But this site took my attention because of the reviews on Juniper documentation... So my question is "can we improve our documentation?". I'm not familiar with any channel/link or email to send such a suggestion for improvement.
     

     

    http://mdm.me/blog/junos-ospf-external-type-1-vs-type-2-explained/

     

    Example: If you saw the output below from the OSPF database on a Junos powered router, what route would you think is going to be installed in the forwarding table, assuming no other routes to the destination exist?

    root@EX-Lab# run show ospf database extensive external
    OSPF AS SCOPE link state database
    Type ID Adv Rtr Seq Age Opt Cksum Len
    Extern 13.1.1.1 11.1.1.1 0x80000a80 811 0x22 0xae4e 36
    mask 255.255.255.255
    Topology default (ID 0)
    Type: 1, Metric: 142, Fwd addr: 0.0.0.0, Tag: 0.0.0.0
    Aging timer 00:46:28
    Installed 00:13:28 ago, expires in 00:46:29, sent 00:13:26 ago
    Last changed 5d 03:52:24 ago, Change count: 3
    Extern 13.1.1.1 12.1.1.1 0x80000a10 1374 0x22 0xf5f7 36
    mask 255.255.255.255
    Topology default (ID 0)
    Type: 2, Metric: 140, Fwd addr: 0.0.0.0, Tag: 0.0.0.0
    Aging timer 00:37:05
    Installed 00:22:51 ago, expires in 00:37:06, sent 00:22:49 ago
    Last changed 12w5d 09:49:45 ago, Change count: 1

    Obviously, based on the basics of Type 1 vs Type 2, you’re going to like the second route.  It’s a Type 2, so no internal cost will be added to it and its external metric is already better than the first route’s external metric.  The Type 1 route is going to have the cost to the ASBR added to it when the path selection is made, so it will certainly have a higher cost calculated in the end.  That’s great and all, but the Type 1 route is going to be selected every time, regardless of cost.

    When you learn OSPF from Juniper, they simplify it a bit, which could get you into trouble down the road.  They teach you about the protocol preference of internal (10) vs external (150) OSPF routes and they teach you about Type 1 vs Type 2 Externals.  The one thing they leave out, is path-type preference – and I’m not sure why.  I have plenty of Advanced Junos Routing training materials and I can’t seem to find any clear references regarding path-type preference.  Also, as seen below, when they explain Type 1 vs Type 2 in their documentation, they are pretty vague.

    OSPF External Metrics Overview

    The content from the link posted above is re-hashed in the documentation for every Juniper product line.  The only thing there that hints of the  Type 1 over Type 2 preference is the following line:

    Type 2 external metrics are greater than the cost of any path internal to the AS.

    Juniper typically has amazing documentation that goes beyond the detail required to explain most concepts, but this is hardly enough information to really understand what we need to know here.  Luckily, if you dig into the RFC for OSPFv2, you find a much clearer explanation:

    Both Type 1 and Type 2 external metrics can be present in the AS at the same time.  In that event, Type 1 external metrics always take precedence.

    This nugget of information is based on the Path-type Preference for OSPF Routes:

    Path-type
    There are four possible types of paths used to route traffic to
    the destination, listed here in decreasing order of preference:
    intra-area, inter-area, type 1 external or type 2 external.
    Intra-area paths indicate destinations belonging to one of the
    router’s attached areas. Inter-area paths are paths to
    destinations in other OSPF areas. These are discovered through
    the examination of received summary-LSAs. AS external paths are
    paths to destinations external to the AS. These are detected
    through the examination of received AS-external-LSAs.

    Read more here: http://www.ietf.org/rfc/rfc2328.txt