OSPF – LSInfinity != LSInfinity

OSPF – LSInfinity != LSInfinity

LSInfinity has two different values

I have mentioned ‘LSInfinity’ in the max-metric post and in an earlier post on withdrawing OSPF routes.   However if you look closely at each post you’ll see that LSinfinity had a different value in each of those posts .   What gives?  It turns out that the term LSinfinity has been overloaded somewhat in the RFCs and has different values and meanings for different LSAs.

LSInfinity for summary and AS-External LSA

RFC 2328 is the most recent RFC addressing the core functionality of OSPF.  It gives a definition of LSInfinity as follows: 

LSInfinity
  The metric value indicating that the destination described
  by an LSA is unreachable.  Used in summary-LSAs and
  AS-external-LSAs as an alternative to premature aging
  (see Section 14.1). It is defined to be the 24-bit binary
  value of all ones: 0xffffff.

(source: RFC 2328 Page 271)
Okay that’s cool, OSPF 2328 describes the value of LSInfinity for Summary and External LSAs as a 24-bit binary value of all ones.  RFC 2328 also says clearly that LSinfinity means ‘unreachable’.
However RFC 2328 doesn’t mention LSInfinity for Router LSAs at all.  That definition doesn’t come until the ‘Stub Router’ RFC 3137.

LSInfinity for the Router LSA

RFC 3137 indirectly defines LSInfinity:

To address both problems, router X announces its router-LSA to the
neighbors as follows.
  costs of all non-stub links (links of the types other than 3)
  are set to LSInfinity (16-bit value 0xFFFF, rather than 24-bit
  value 0xFFFFFF used in summary and AS-external LSAs).

RFC 3137 says that LSInfinity for a router LSA is a 16-bit value of all-ones, and differentiates from the 24-bit LSInfinity values used for summaries and externals as defined in RFC2328.

LSInfinity has two different meanings

Okay, so now we know that LSInfinity has two different values;

  • 16-bit  ( 65535 ) for Router LSA
  • 24-bit ( 16777215 ) for Summary LSA and External LSA.

However the key point here is that LSInfinity has two different meanings.  For summaries and externals LSInfinity means ‘unreachable’.    We’ve already seen an example of LSInfinite Type-3’s being used to mark a prefix as unreachable. The same behavior holds for a Type-5 LSA.
For router LSAs LSInfinity means ‘least desirable’.   As we saw in the final example of the ‘how max-metric works‘ post, it’s possible to have a valid route via an LSInfinite costed transit link.

Packet Header Limitations

If you’re wondering where these maximum values come from the answer lies in the LSA headers. I recently discovered that the Type-1 LSA header had only 16-bits for metric, whereas the Type-3 and Type-5 headers have a 24-bit field.  Have a look at the ‘metric’ value in the LSA headers below.
Type-1 LSA 16-bit metric

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            LS age             |     Options   |       1       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        Link State ID                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                     Advertising Router                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                     LS sequence number                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         LS checksum           |             length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    0    |V|E|B|        0      |            # links            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                          Link ID                              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                         Link Data                             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     Type      |     # TOS     |            metric             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Type 3 LSA – 24-bit metric

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS age                        |    Options    |    3 or 4     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           Link State ID                       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        Advertising Router                     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        LS sequence number                     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         LS checksum           |            length             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                          Network Mask                         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         0     |                   metric                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|        TOS    |                 TOS metric                    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ...

Wrap up

I hope this post helps clarify the meaning of LSInfinity and the different contexts in which it is used. Let me know in the comments if I’ve missed something or if you’ve got a perspective on this topic. I’d love to hear from you.

5 thoughts on “OSPF – LSInfinity != LSInfinity

  1. Thanks for pointing this, I think I’d have probably skipped this little nuance while skim… uh carefuly reading rfcs:-) so far in studies (CCN CC*P) it has been told that 65535 = maximum = not to be used. The more one gets deeper the more realizes it’s not exactly incorrect just simplified and there are tons of ‘buts’.
    I like your blog, thanks for good reading 🙂

    1. Hi Alex,
      Thanks very much for the feedback on the blog. I’ve had to study this area deeply to test it as part of my job. I definitely didn’t know OSPF as deeply when I was studying for my CCNP, but I think that’s okay.
      If you get caught up on this level of detail on every topic you’d never get your CCNP knocked out. I think okay to acknowledge there’s always more to learn and revisit the topic when you have the time.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.