Thursday, November 1, 2012

OSPF External LSA: Type 5

Welcome to the OSPF Type 5 LSA!

The Type 5 LSA is used to advertise routes that are external to the OSPF domain within the OSPF domain (hence the External moniker). There are two types of Type 5 LSA’s: Type 1 and Type 2 (seriously?).  We’ll be looking at both here.

Let’s get at it shall we?  Here’s examples of both types of Type 5 LSA’s:

  Routing Bit Set on this LSA
  LS age: 21
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 10.1.1.3 (External Network Number )
  Advertising Router: 3.3.3.3
  LS Seq Number: 80000001
  Checksum: 0x52B3
  Length: 36
  Network Mask: /32
    Metric Type: 1 (Comparable directly to link state metric)
    TOS: 0
    Metric: 20
    Forward Address: 0.0.0.0
    External Route Tag: 0

  Routing Bit Set on this LSA
  LS age: 21
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 10.2.2.3 (External Network Number )
  Advertising Router: 3.3.3.3
  LS Seq Number: 80000001
  Checksum: 0xBEC4
  Length: 36
  Network Mask: /32
    Metric Type: 2 (Larger than any link state path)
    TOS: 0
    Metric: 20
    Forward Address: 0.0.0.0
    External Route Tag: 0
I’ll break down the Type 1, and look at the differences between the two as we go.
  Routing Bit Set on this LSA
  LS age: 21
  Options: (No TOS-capability, DC)
The usual nonsense.
  LS Type: AS External Link
Good.  We expected this.
  Link State ID: 10.1.1.3 (External Network Number )
The LSID in a Type 5 LSA is, as it says, the network number that is being redistributed into OSPF. This is identical in function to the LSID of a Type 3 LSA.
  Advertising Router: 3.3.3.3
Again, nothing new here.  The RID of the router that’s generating the Type 5.  This may be either an ASBR or an ABR (or both).  The case where it is only an ABR is in relation to NSSA areas.
  LS Seq Number: 80000001
  Checksum: 0x52B3
  Length: 36
More of the usual suspects.
  Network Mask: /32
There’s the other half of the info we need for the network.  We now have both the prefix and the length.
    Metric Type: 1 (Comparable directly to link state metric)
This field is where the the LSA is defined as being either a Type 1 or a Type 2 External LSA.  The main difference is in how the metric is calculated by a router receiving the LSA.  A Type 1 External route will have the metric that’s advertised in the LSA added to the metric of the path to the router specified in the Forwarding Address whereas a Type 2 External route will simply just use the metric specified in the LSA.

You can easily see what this looks like in the Type 2 LSA example above.
    TOS: 0
    Metric: 20
TOS is again unused.  The Metric is the OSPF Cost.  For Cisco routes the default metric used when redistributing into OSPF is always 20.  This can be changed in a number of ways.
    Forward Address: 0.0.0.0
The Forward Address is the address of the router that packets destined for the external network should be forwarded to.  Generally this is also the router that is advertised the LSA and therefore a forwarding address of all zeros is used to specify that packets should be forwarded to the advertising router.
    External Route Tag: 0
The last field is used to specify any Route Tags that are attached to the route.  Route tags are arbitrary numeric values that can be attached to routes and used elsewhere in the network to apply policy.  In the CCIE R&S one of the most common uses is to identify routes that are redistributed for filtering at points where a loop may occur. 

And that’s the Type 5 LSA.  There’s nothing too bad in here, but things can get a little more interesting when the topology is a little more complex.  I used some basics examples, but what happens when we change it up a bit.

Can anyone guess what I did to make the above LSA’s appear like the following?
  Routing Bit Set on this LSA
  LS age: 594
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 10.1.1.3 (External Network Number )
  Advertising Router: 2.2.2.2
  LS Seq Number: 80000001
  Checksum: 0x35B0
  Length: 36
  Network Mask: /32
    Metric Type: 1 (Comparable directly to link state metric)
    TOS: 0
    Metric: 20
    Forward Address: 10.0.23.3
    External Route Tag: 0

  Routing Bit Set on this LSA
  LS age: 594
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 10.2.2.3 (External Network Number )
  Advertising Router: 2.2.2.2
  LS Seq Number: 80000001
  Checksum: 0xA1C1
  Length: 36
  Network Mask: /32
    Metric Type: 2 (Larger than any link state path)
    TOS: 0
    Metric: 20
    Forward Address: 10.0.23.3
    External Route Tag: 0
Respond in the comments if you know what happened!

The complete list of OSPF LSA breakdowns:

http://blog.brokennetwork.ca/2012/10/ospf-router-lsa-type-1.html
http://blog.brokennetwork.ca/2012/10/ospf-network-lsa-type-2.html
http://blog.brokennetwork.ca/2012/10/ospf-summary-lsas-type-3-4.html
http://blog.brokennetwork.ca/2012/11/ospf-external-lsa-type-5.html
http://blog.brokennetwork.ca/2012/11/ospf-nssa-external-lsa-type-7.html

4 comments:

  1. Either you redistributed from a NSSA area or you redistributed a route where you were running OSPF on the nexthop towards the route and it was non passive, advertised under the routing process and it was not P2P or P2MP :)

    ReplyDelete
  2. Anyone else? We can't let ddib walk away with this one can we?

    :)

    ReplyDelete
  3. Replies
    1. Hi Alexandra. No, the metric type is the same. They're still both the same external types they were before. Lostintransit up there actually did get it right with one of his guesses... But which one?

      Delete