Kuro5hin.org: technology and culture, from the trenches
create account | help/FAQ | contact | links | search | IRC | site news
[ Everything | Diaries | Technology | Science | Culture | Politics | Media | News | Internet | Op-Ed | Fiction | Meta | MLP ]
We need your support: buy an ad | premium membership

[P]
Elguapo's Guide to Routing - Part 4, OSPF

By el_guapo in Internet
Mon Jul 05, 2004 at 03:48:56 PM EST
Tags: Internet (all tags)
Internet

Chapter 1 was an introduction. Chapter 2 was RIP. Chapter 3 was BGP. Chapter 5 will be the Interior Gateway Routing Protocol (IGRP). Chapter 6 will be the Enhanced Interior Gateway Routing Protocol (EIGRP). Chapter 7 will be the Intermediate System to Intermediate System protocol.


OSPF - The Open Shortest Path First Protocol

For those that have read the other stories (and if you have NOT, at least go and read Part 1, Elguapo's Guide to Routing), long story short here: OSPF is a Link State Protocol. Part 1 goes into the various differences in the two basic types of dynamic protocols, Link State and Distance Vector. (of course someone has to throw a monkey-wrench in there and hose the standard up; that would be Cisco, with Enhanced Interior Gateway Routing Protocol (EIGRP) - the distance vector that acts like a link-state)

OSPF History

OSPF started as an IETF task force for forming an Interior Gateway Protocol in 1988. They wanted to form a protocol based on the Shortest Past First algorithm (hereinafter SPF) developed by one Dr. Dijkstra for large, heterogeneous environments - this SPF research had started as late as the late 1970's, on the then ARPANET. The first OSPF was described in RFC 1131 in October 1989 and was replaced by OSPF 2, RFC 1247, in July of 1991. Since then, RFCs 1538, 2178, and 2328 have been released, the last being the current, called OSPF version 2, and what most people call OSPF today.

RIP was quickly running out of overhead, and they just wanted something that would interoperate within their AS, as well as something that was open - thus OSPF was open to RFCs, theoretically allowing vendors to interoperate (not that certain vendors have reputations for breaking this interoperability). OSPF has a number of concepts that we either need to introduce or go over again:

Routing Hierarchy: with OSPF, your routing hierarchy really needs to look like your networking hierarchy. It doesn't have to, but, man oh man, will it make your life much easier. I'll go into detail later on how to circumvent this, and when I do, you'll see why you don't want to. Trust me here, unless you just cannot avoid it, make your network topology as close to your routing topology as possible.

SPF and Topology Database: with OSPF, ALL routers in the same area share the same topology database and execute the SPF algorithm on said database - this is where they make themselves the root of a tree, and work themselves up the root of this tree, populating the routing table with the most appropriate route (obviously, each router has it's own location in this "tree", thus coming up with its own solution). If there is more than one route in this topology database (and there often are) there are some metrics (later!) for deciding which route(s) to use. Yes, OSPF can use more than one route per destination, balancing across multiple links (handy, eh?). OSPF only likes equal cost load balancing though (per destination/packet load balancing is outside the scope of this - sorry), so you better have same size pipes - or lie to it and tell it that it does. This is one of those "hidden rope" things - want to tell OSPF that your one hop 56k link is as big as your one hop DS3 link? Go for it, stand by for some serious packet-loss, though.

Go read the BGP article and look at the example where BGP will gladly pick one 56k link over two back to back OCRs, and you'll get an idea. OSPF won't give you this much rope to hang yourself, but it hides that rope much better. :-P

Autonomous System - AS. Just as before, all routers configured as that OSPF AS. The largest OSPF hierarchical grouping. Remember, one of the advantages of AS's is that they "hide" the functioning of that AS to any external AS that you connect to. This allows you to administer your internal network without constantly having to update/inform/whatever those you are connected to. It would obviously be polite to let them know if it is going to somehow affect their traffic pattern, but hey, it IS your AS.

Area - um, no abbreviation :-P. This is a sub hierarchy within an AS. Area numbers can look like either an integer or an IP address. (This very may well depend on the version of Cisco (sorry!) IOS you are running, I have seen both on Cisco boxes, which is what I know.) I prefer the IP address methodology - i.e.: 1.2.3.4. Area 0.0.0.0 (commonly referred to as "Area Zero") is the "Backbone" Area . All areas, somehow, must connect through this area. Two non contiguous areas cannot, without connecting through Area Zero, connect to each other. The exception to this is the "Virtual Link", a VPN-like "tunnel" through another area for the sole purpose of connecting to Area Zero; so that this area can then connect to an area it has no physical connection to (this can even be the area it is transiting, if you can believe such a thing). If I have to go through there anyway, why not design my network to take this into account? IF I ever find myself doing virtual links, I have screwed something up in my design forecasting, IMHO. I have never done one of these "in the wild".

Link State Advertisements - LSAs. These are just that, an advertisement of links that a router shares with all other routers within Areas that router is connected to. Note: An OSPF router can "live" in more than one Area: 1)a router in one non-backbone area is just that, an Internal Router. It will advertise all LSAs to all configured neighbors. 2) A router with an interface connected to area 0.0.0.0 is called a Backbone Router. LSA-wise, same story, it is just moving "backbone" traffic" 3) A router connected to multiple areas (say 0.0.0.0, 0.0.0.1 and 0.0.0.2) is an Area Border Router (ABR), and now we get to LSA "types", and LSA from 0.0.0.1 destined for 0.0.0.2 is "external" to "0.0.0.2". 4) If a router has more than one interface connected to more than one AS, that is an Autonomous System Boundary Router (ASBR).

This brings us to Area Types and LSA types (this is quite Cisco-centric, apologies - read previous articles for background here).

Area Types

  • Backbone Area/Standard/Transit Area. Accepts link updates and route summaries, but only by a single OSPF area. This is the Backbone Area (Duh!), area 0.0.0.0, all other area must either connect to this, or virtual link (blech!) to it. All interarea traffic has to go through this area.
  • Stub-Area - Accepts no routes from other ASs - uses a default route to find its way out of the area instead (a route of 0.0.0.0 on a Cisco box). Will accept LSAs for LSAs within the AS, however.
  • Totally-Stubby-Area - Cisco proprietary. Just like a Stub-Area, however, it will not accept an LSA even from an area from its own AS. Default routes for anything outside of its area.
  • Not-So-Stubby-Area - A special area that only lives on ASBRs, it imports type 7 LSAs at the ASBR and translates them to type 5 LSAs at the ABR. See below for LSA types (Sorry, this is getting long in the tooth, and this seems the most straight forward way of dealing with this little gem)

LSA Types

  • LSA-Type 1 and 2 (respectively) - O-OSPF: this is for router and network link entries, and used within a single area
  • LSA-Type 3 - IA-OSPF: this is for backbone and AB's, and used for interarea routes only.
  • LSA-Type 4 - IA-OSPF: like a type 3, but not sent to Totally Stubby Areas.
  • LSA-Type 5 - AS External Link Entry: not allowed in Stub, Totally Stub, NSSA. Sent by and ASBR to describe external routes.
  • LSA-Type 6 - Multicast OSPF.
  • LSA-Type 7 - AS External Link: only sent by ASBR part of NSSA, then translated to a type 5 at the ABR before continuing on.

Well, there you have it. Besides BGP, probably one of the more widely deployed routing protocols out there. The latest in my series. I hope you enjoyed reading it, or that you learned something, or hopefully, a little of both!

Sponsors

Voxel dot net
o Managed Hosting
o VoxCAST Content Delivery
o Raw Infrastructure

Login

Related Links
o introducti on.
o RIP.
o BGP.
o Also by el_guapo


Display: Sort:
Elguapo's Guide to Routing - Part 4, OSPF | 27 comments (12 topical, 15 editorial, 0 hidden)
I would post articles about my routing protocols.. (none / 0) (#9)
by NoMoreNicksLeft on Sun Jul 04, 2004 at 08:38:23 PM EST

But the IETF would feel cheated. Besides, I don't want Cisco stealing them.

--
Do not look directly into laser with remaining good eye.
You forgot one detail (none / 1) (#23)
by anakata on Tue Jul 06, 2004 at 11:54:52 AM EST

OSPF is often just used to route the loopback addresses for iBGP.
Cogito, ergo infestus sum.
[ Parent ]
how the hell (none / 1) (#17)
by BlackStripe on Mon Jul 05, 2004 at 05:38:48 PM EST

did a story get to the front page with only one commment? I don't care how good it is... it ought to generate some discussion before it gets upvoted. Maybe something's wrong with my display settings?

Isaac

nothing wrong with yer settings (none / 1) (#18)
by el_guapo on Tue Jul 06, 2004 at 02:16:20 AM EST

i was wondering the SAME thing, and it was MY story. maybe since it is part if a series? or it inherited some sort of "+1 FP grandfather" clause (unspoken by readers, obviously) since it was part of a series??. it was WAY too chatty, IMO, but i had hoped the edit queue would fix that. i was at wit's end splitting LSA type and Area type since in numerous instances they end up going hand in hand.
mas cerveza, por favor mirrors, manifestos, etc.
[ Parent ]
just for the record (none / 1) (#24)
by BlackStripe on Tue Jul 06, 2004 at 02:29:49 PM EST

I wanted to make sure you didn't think I was criticizing you or the article at all. I liked it, and have enjoyed the series. I was just genuinely confused. Thanks for the work.

1
Isaac

[ Parent ]

appreciate that (none / 1) (#25)
by el_guapo on Wed Jul 07, 2004 at 12:18:44 AM EST

but i am in total agreement with your parent comment. maybe cuz i posted over the US independance day holiday, i got less less editting help than i had hoped, maybe? DEFINITELY the worst in the series, IMO, but i was REALLY counting on the edit queue this time, since it is pretty obvious where i got bogged down in this one, eh?
mas cerveza, por favor mirrors, manifestos, etc.
[ Parent ]
generate discussion after (none / 0) (#19)
by dimaq on Tue Jul 06, 2004 at 07:22:05 AM EST

for all those who don't bother read stories that didn't get posted and those who don't have an account, a story should generate discussion after it gets approved.

[ Parent ]
-1, NOT GOTH ENOUGH (1.00 / 13) (#20)
by suicidal ideation on Tue Jul 06, 2004 at 08:24:06 AM EST

Please edit accordingly.

"Repetitive guitar growing increasingly louder followed by pause." -- Trent Reznor
Yes. (2.33 / 6) (#21)
by bakuretsu on Tue Jul 06, 2004 at 11:29:13 AM EST

I appreciate that you're a network administrator of some kind, and therefore cannot be bothered to pay much attention to the intricacies of the English language, but I think you used "it's" where it should have been "its" about five times and I cringed with each.

I don't mean this to be an insult to you, as this article clearly made it through the queue without having these errors properly attended to. As such, I am embarrassed at the level of attention the queue seems to be granting to articles of a technical nature, and I hope that I am around when Chapter 5 hits the queue so I can be a part of that.

-- Airborne
    aka Bakuretsu
    The Bailiwick -- DESIGNHUB 2004

Er. (2.50 / 6) (#22)
by bakuretsu on Tue Jul 06, 2004 at 11:31:33 AM EST

Yeah, nevermind, it's the same in every chapter in this series and therefore I believe it is hopeless.

Its = posessive.
It's = it is.

If you don't mean "it is", then "its" is what you want.

-- Airborne
    aka Bakuretsu
    The Bailiwick -- DESIGNHUB 2004
[ Parent ]

Editorial: For the next time (none / 0) (#26)
by Psychopath on Sun Jul 11, 2004 at 10:05:24 AM EST

Don't use that many emphasized words/phrases (either bold or italics). In my opinion it is rather distracting if used too often.
Thanks for the continuation of the series nevertheless.
Regards,
Psychopath
--
The only antidote to mental suffering is physical pain. -- Karl Marx
Some corrections (none / 1) (#27)
by Paul Jakma on Thu Jul 22, 2004 at 07:05:24 PM EST

The exception to this is the "Virtual Link", a VPN-like "tunnel" through another area for the sole purpose of connecting to Area Zero; so that this area can then connect to an area it has no physical connection to (this can even be the area it is transiting, if you can believe such a thing). If I have to go through there anyway, why not design my network to take this into account? IF I ever find myself doing virtual links, I have screwed something up in my design forecasting, IMHO. I have never done one of these "in the wild".

There is one very good reason to use VL's, the case where you have two ABRs providing connectivity from the backbone to one area, each ABR with one interface to area 0. Without a virtual-link, if one of the ABRs loses or has a problem with its Area-0 connection, it will drop any packets it receives that must be routed toward backbone or beyond - even though the router will *know* that the other ABR has perfectly good connectivity to the backbone.

By installing a virtual-link between the two ABRs, one can guard against this. The other alternative, implemented by some vendors, is to relax the rules a little bit and allow an ABR to consider using intra-area paths for inter-area destinations IFF no backbone route is present.

If a router has more than one interface connected to more than one AS, that is an Autonomous System Boundary Router (ASBR)

Well, any OSPF router which injects external-to-OSPF routes into OSPF is an ASBR. Ie redistributing static routes into OSPF makes that router an ASBR. (the static routes are outside the OSPF domain, aka AS. Note that OSPF AS != BGP AS.).

Totally-Stubby-Area - Cisco proprietary.

This is hardly Cisco proprietary. It's just a form of a stub area.

Not-So-Stubby-Area - A special area that only lives on ASBRs

No.. An NSSA area can contain ASBRs, ABRs and plain OSPF routers. ABRs in an NSSA area can be translating, or non-translating, translating type-7 nssa-as-external LSAs generated by NSSA ASBRs into type-5 as-external for use in rest of OSPF domain/AS).



Elguapo's Guide to Routing - Part 4, OSPF | 27 comments (12 topical, 15 editorial, 0 hidden)
Display: Sort:

kuro5hin.org

[XML]
All trademarks and copyrights on this page are owned by their respective companies. The Rest 2000 - Present Kuro5hin.org Inc.
See our legalese page for copyright policies. Please also read our Privacy Policy.
Kuro5hin.org is powered by Free Software, including Apache, Perl, and Linux, The Scoop Engine that runs this site is freely available, under the terms of the GPL.
Need some help? Email help@kuro5hin.org.
My heart's the long stairs.

Powered by Scoop create account | help/FAQ | mission | links | search | IRC | YOU choose the stories!