Você está na página 1de 7

Introduction

The OSPF routing protocol is playing an increasingly important role in modern networks. It is a multi-
vendor standard. We'll take a look at OSPF asics in this article.
While I and a numer o! people are !ans o! "isco's #I$%P !or its simplicity and ease-o!-use& lately I'm
seeing more use o! OSPF. This may e due to networking sta!!s having increasing levels o!
sophistication. Or it may e that !olks are looking at to the ne't generation o! hardware& and thinking that
OSPF is something you'll !ind in any worthwhile (ayer ) switch *+!ast router+,. -!ter all& who'd want to uy
a !ast (ayer ) switch that only routes using %IP or %IPv.& with their slow convergence/ That's asically
the +it's a standard+ argument -- you do OSPF i! you anticipate using mi'ed vendor e0uipment in your
network& or i! you at least want to maintain that possiility.
%unning OSPF so your routers can e'change in!ormation with 1T servers is proaly not a $ood Thing. I
personally don't want servers sending routing in!ormation to my +o!!icial routing protocol+& since I've seen
too many servers with duplicate IP addresses or other oddities. I! a server administrator goo!s and
duplicates the server !arm sunet on some workgroup server somewhere else& and it advertises it into
your network& you're in !or a serious outage2 I! your group controls the servers& or i! 1T servers are acting
as low-end routers at remote sites& well& then there's a reason to run OSPF. I'll 3ust mention in passing
here that OSPF has an authentication !eature that allows you to easily e'clude any +uno!!icial+ routers
!rom your OSPF -utonomous System *+group o! consenting routers+,.
I don't think I'm revealing any deep dark secret i! I tell you that you need to know OSPF well !or the ""I#
test and !or recerti!ication. The general rule o! thum is& i! it's a ma3or protocol or !eature& used at a lot o!
sites& it's proaly in the test. *There's also minor stu!!& presumaly to see i! you can %ead The Fine
4anual and get it working,.
Pros and Cons of OSPF
The chie! reasons !or using OSPF are !ast convergence and the !act that it's an I#TF standard. It does
minimi5e andwidth consumed y routing in!ormation& using low andwidth wisely& and it does take W-1
link andwidth into account& pre!erring high andwidth paths.
The drawacks are the area structure and design aspects o! OSPF& which we'll look at elow. This means
you have to plan !or how your network is going to grow when doing an OSPF design -- and some people
Page 1 of 7
would say that's a good thing. The protocol is mildly comple'& so there is perhaps a steeper learning
curve than #I$%P. Finally& con!iguring OSPF is a little more work than con!iguring #I$%P.
OSPF Design
6e!ore we can do much else& we need to talk a little it aout OSPF design. OSPF re0uires that you
divide your network up into a logical star o! areas *also sometimes re!erred to as the +daisy+ or +lack-
eyed susan+ model& since it looks somewhat like how children draw !lowers,. -reas are supposed to e
contiguous *all in one connected piece,. 7owever& i! links !ail and render areas other than area 8
discontiguous& OSPF has a mechanism !or handling this. The !ollowing !igure shows this topology& where
an #thernet segment *and perhaps some other network links, constitute area 8.
OSPF must have a ackone area 8. -ny other areas must connect to area 8. -ll tra!!ic etween areas
must go through area 8. Think aout that. That implies that -rea 8 is pretty critical to your network. It had
etter e roust and stale. It should proaly have internal redundancy. -nd it etter have the andwidth
to handle the tra!!ic etween areas.
Page 2 of 7
There are some rules o! thum !or "isco router OSPF designs9
- router should e in at most ) areas *and watch your "P: and %-4,.
-n area should contain ;8 to <88 routers *I've also seen .; in some "isco documents,.
- router should have !ewer than =8 neighors.
These not hard and !ast guidelines& ut they tell you when you're perhaps stretching things a it.
So i! your network has !ewer than ;8 to <88 routers& you may e ale to 3ust have one ig *happy/, area
8.
When you try a real OSPF design& you'll !ind that OSPF area 8 tends to grow on you. I've een calling this
the +vacuum+ e!!ect9 OSPF area 8 almost seems to pull links into it& until you !ind your design is all one ig
area 8& and you have to start over. 4y advice is to keep OSPF area 8 small. I! area 8 is small& it's easy to
keep it roust. I pre!er to put the links connecting to non-ackone areas into those areas& and keep them
out o! area 8 *possile e'ception9 dial ackup links,.
Terminology9 routers within area 8 are backbone routers. The routers connecting area 8 to other areas
are Area Border Routers *-6%'s,. %outers purely within an area are internal routers. -nd routers that
redistriute another protocol into OSPF& or that connect to another routing domain& are Autonomous
System Boundary Routers *-S6%'s,.
The routing pattern in OSPF seems to occasionally surprise people in more comple' designs& so let's
repeat how tra!!ic goes etween areas. Tra!!ic !rom -rea < to -rea . must go through area < until it
reaches an -rea < 6order %outer. It then travels only within the ackone -rea 8 until it reaches an -rea
. 6order %outer. It then travels within -rea . to the destination. Tra!!ic to a destination within the same
area as the source travels purely within that area> it may not normally cross into the ackone.
The reason !or areas is the old computer science trick o! +divide and con0uer+. OSPF routers in an area
share all in!ormation aout routers and link status. This uses %-4& and computing the Shortest Path First
*?i3kstra, algorithm can use "P:. Furthermore& routers in an area share in!ormation via (ink State
-dvertisements *(S-'s,& which are !looded throughout the area. *"hicken and egg prolem9 routers may
not know the other routers in the area or how to get to them& so (S-'s have to slosh -- umm& !lood --
around to make sure every router gets a copy,. 6y dividing the network into areas& the amounts o! %-4&
"P:& and !looding tra!!ic are limited& providing etter scalaility.
Page 3 of 7
We'll also see that we can summari5e routes at -rea 6oundary %outers *-6%'s,& hiding the details o! the
area& and in e!!ect& advertising +this way to the area+. That's good !or staility and scaling o! the network.
%outers within an OSPF area must share the same in!ormation *so as to derive the same map o! the area
and the same routing conclusions,. Thus you cannot !ilter or hide routes within an area.
Confguring OSPF
(et's take a look at how %outer 6 in the middle o! the !igure might e con!igured. 1ote that it connects to
two areas& so it has at least one inter!ace in each area *the drawing doesn't show more& ecause it's
cluttered enough the way it is,.

I've already assigned addresses that might e summari5ale. The design !or this network is to divide
<)<.<8@.8.8 up into <8.A sunets using sunet mask .;;..;;..;;.<B.. Thus the sunets will have some
numer in the third octet& and will have multiples o! =A in the last octet *some companies call this
+0uads+,. *"alculating .;= - <B. C =A& we see we have multiples o! =A in the !ourth octet& ut the third
octet is also part o! the sunet in!ormation.,
The sunets are assigned in locks& as !ollows9
-rea First Sunet (ast Sunet
8 <)<.<8@.8.8 <)<.<8@.)<.<B.
< <)<.<8@.)..8 <)<.<8@.=).<B.
. <)<.<8@.=A.8 <)<.<8@.B;.<B.
) <)<.<8@.B=.8 <)<.<8@.<.D.<B.

-s we may see in a !uture article& this makes them summari5ale locks. I! you're into its and inary& you
can think in terms o! an +area mask+ o! .;;..;;...A.8. -ll the sunets in each lock aove& when logically
-1?ed with this area mask& share the same its. -nother way to think o! this is to calculate .;= - ..A C
).& so with mask .;;..;;...A.8 we're working with multiples o! ). in the third octet *where the ..A was,.
Page 4 of 7
1ote that the #thernet 8 addresses are all drawn !rom a sunet in the lock o! sunets !or area 8. -nd the
serial 8 inter!aces come !rom the !irst sunet in the lock !or their area.
7ere's the relevant router con!iguration9
interface Ethernet 0
ip address 131.108.1.2 255.255.255.192
interface Serial 0
ip address 131.108.64.1 255.255.255.192
router ospf 1
network 131.108.0.0 0.0.31.255 area 0
network 131.108.64.0 0.0.31.255 area 2
area 0 range 131.108.0.0 255.255.224.0
area 2 range 131.108.64.0 255.255.224.0
The inter!ace command show that we assign addresses as usual& using normal sunet masks. *In a real
network& we would proaly do Eariale (ength Sunet 4asks -- E(S4 -- on Serial 8& with a mask o!
.;;..;;..;;..;.& ut I've chosen to keep the e'ample simple,.
The router command speci!ies an OSPF routing process with process id <. This numer is not part o! the
OSPF (S-'s& and hence is purely local to the router. Fou should proaly use < to make it easy to
rememer& unless you have multiple OSPF -S's& in which case you might choose to use the process id to
track which OSPF process goes with which OSPF -S.
The network command !or OSPF does a couple o! things. It tells the router which inter!aces are in which
areas. -nd it causes the router to start sending OSPF hellos on matching inter!aces. The gotcha with the
network command is that it uses a wildcard style mask. In the aove e'ample& the mask indicates that
any inter!aces in the range <)<.<8@.8.8 through <)<.<8@.)<..;; should e in area 8& and inter!aces in the
range <)<.<8@.=A.8 through <)<.<8@.B;..;; should e in area ..
131.108. 0. 0 131.108. 64. 0
0. 0. 31.255 0. 0. 31.255

131.108. 31.255 131.108. 95.255
Page 5 of 7
The nice thing here is that you can actually add the mask to the starting address to !ind the end o! the
range o! addresses covered. This only works i! the lock or starting address is correct !or that mask *I'm
going to e a it vague here& to duck having to do more inary arithmetic in pulic.,
Some people pre!er to Geep It Simple& con!iguring network 131.108.1.2 0.0.0.0 area 0. This
tells the router that precisely the address <)<.<8@.<.. is in area 8. That's certainly simple9 keep the mask
8.8.8.8& and 3ust speci!y each inter!ace address. O! course& it's a unch o! typing on a igger router with
lots o! inter!aces.
6y the way& when you're e'perimenting with OSPF& there can e order sensitivity to the commands. The
prolem seems to e that i! you con!igure network ...& then no network ...& then network Hsomething elseI&
the router may not re-initiali5e OSPF on the relevant inter!ace*s, -- so it doesn't send hellos& and doesn't
!orm ad3acencies. The solution is either to save your con!iguration and reoot the router *drastic,& or use a
mouse to copy the router osp! part o! the con!ig& do +no router ospf 1+ to stop OSPF& then paste the
correct con!ig ack in.
To trouleshoot OSPF& the command to egin with is
show ip ospf neigh!or
The use o! this is simple9 i! the routers aren't !ully ad3acent *neighors,& they're not e'changing
in!ormation. We'll look more at what the show command and deug can tell you& as well as router id's&
ad3acencies& hellos& (S-'s& and how OSPF works& in a !uture article.
OSPF Design, Revisited
Suppose you have an OSPF network& and your company merges or ac0uires or needs to communicate
with another that also runs OSPF. Fou could try to glue the area 8 ackones together& ut 4urphy's (aw
says they'll e situated so as to make that real !un. -nother possiility is to use multiple OSPF
-utonomous Systems *routing domains,& and run some other protocol *6$P/, etween the -utonomous
Systems *-S's,.
This may also e use!ul in a multi-national corporate network. Suppose your company has networks in
the 1orth -merica& #urope& -sia& -ustralia& and perhaps those other continents too. -re they under
common administration/ One suspects not. So controlling growth& addressing& and so on centrally could
Page 6 of 7
e a challenge. Instead& you might consider making each continent a separate OSPF network& using
some other protocol to control the !low o! routes or summary routes etween the continents. The
granularity here doesn't have to e continents& I'm 3ust using them to make the point.
The :.S. Post O!!ice is putting in )@&888 "isco routers. 1ote that i! we use our rules o! thum& )@&888
divided y <88 routers says we'd need )@8 areas. -lternatives include multiple OSPF -S's& and other
protocols *like #I$%P,. I'd very de!initely want healthy route summari5ation in such a network. 1ote that
since OSPF only allows us to summari5e at -6%'s& we can only have one level o! summari5ation. With
)@&888 routers& we might well want to summari5e at the regional& state& and portion o! state levels. That
can't e done with pure OSPF.
Conclusion
We haven't had room to talk ade0uately aout route summari5ation and why you want it in larger
networks. That sounds like a !uture article2 In that article& we'll see that route summari5ation plays a role in
controlling the e!!ects o! a !lapping link. We'll also talk aout stu areas& which are a good way to make
your OSPF designs more stale as well. -nd we'll talk aout some o! the advanced !eatures o! OSPF.
?id I miss a good reason !or running OSPF/ -re 1T server router wannae's a prolem in your network --
or a solution/ Is there something else you'd like to know/ (et me know y email2 -nd while you're at it&
ideas and wishes !or !uture columns are always welcome2
http://www.netcraftsmen.net/resources/archived-artices/434-introducing-ospf.htm
Page 7 of 7

Você também pode gostar