Sunteți pe pagina 1din 19

2016.06.13.

OSPFImplementation>EstablishingOSPFNeighborRelationships
AccountSignIn

ViewYourCart

Search

Home

Store

CertificationInfo

CiscoNetworkingAcademy

Safari

Authors

Chapters&Articles

Explore

Home>Articles>CiscoCertification>CCNP>OSPFImplementation

YouMayAlsoLike

OSPFImplementation

DesigningandDeployingCiscoUnifiedIMandPresence
ByChrisOlsen
Feb25,2016

ByDianeTeare,RickGraziani,BobVachon.
SampleChapterisprovidedcourtesyofCiscoPress.
Date:Feb3,2015.
Save

Digg

Del.icio.us

Print

Email

ImplementingCiscoIPSwitchedNetworks(SWITCH)
FoundationLearningGuide:CampusNetworkArchitecture
ByRichardFroom,ErumFrahim
Jun4,2015

ChapterInformation

Contents
1.EstablishingOSPFNeighbor
Relationships
2.BuildingtheLinkState
Database
3.OptimizingOSPFBehavior
4.OSPFv3
5.Summary
6.ReviewQuestions

ChapterDescription
ThischapterfromImplementingCiscoIP
Routing(ROUTE)FoundationLearningGuide:
(CCNPROUTE300101)examinestheOpen
ShortestPathFirst(OSPF)Protocol,oneofthe
mostcommonlyusedinteriorgateway
protocolsinIPnetworking.

ImplementingCiscoIPSwitchedNetworks(SWITCH)
FoundationLearningGuide:NetworkDesignFundamentals
ByRichardFroom,ErumFrahim
Jun1,2015
SeeAllRelatedArticles

SearchRelatedSafariBooks

FromtheBook
ImplementingCiscoIPRouting
(ROUTE)FoundationLearning
Guide:(CCNPROUTE300101)

Searchelectronicversionsofover1500technicalbooks:

$60.00(Save20%)

Thischaptercoversthefollowingtopics:

Search

BasicOSPFConfigurationandOSPFAdjacencies
HowOSPFBuildstheRoutingTable
ConfigurationofSummarizationandStubAreasinOSPF
ConfigurationofOSPFv3forIPv6andIPv4
ThischapterexaminestheOpenShortestPathFirst(OSPF)Protocol,oneofthemost
commonlyusedinteriorgatewayprotocolsinIPnetworking.OSPFv2isanopenstandard
protocolthatprovidesroutingforIPv4.OSPFv3offerssomeenhancementsforIPVersion
6(IPv6).OSPFisacomplexprotocolthatismadeupofseveralprotocolhandshakes,
databaseadvertisements,andpackettypes.
OSPFisaninteriorgatewayroutingprotocolthatuseslinkstatesratherthandistance
vectorsforpathselection.OSPFpropagateslinkstateadvertisements(LSAs)ratherthan
routingtableupdates.BecauseonlyLSAsareexchangedinsteadoftheentirerouting
tables,OSPFnetworksconvergeinatimelymanner.
OSPFusesalinkstatealgorithmtobuildandcalculatetheshortestpathtoallknown
destinations.EachrouterinanOSPFareacontainsanidenticallinkstatedatabase,
whichisalistofeachoftherouterusableinterfacesandreachableneighbors.
EstablishingOSPFNeighborRelationships
OSPFisalinkstateprotocolbasedontheopenstandard.Atahighlevel,OSPF
operationconsistsofthreemainelements:neighbordiscovery,linkstateinformation
exchange,andbestpathcalculation.
Tocalculatethebestpath,OSPFusestheshortestpathfirst(SPF)orDijkstrasalgorithm.
TheinputinformationforSPFcalculationislinkstateinformation,whichisexchanged
betweenroutersusingseveraldifferentOSPFmessagetypes.Thesemessagetypeshelp
improveconvergenceandscalabilityinmultiareaOSPFdeployments.
OSPFalsosupportsseveraldifferentnetworktypes,whichenablesyoutoconfigure
OSPFoveravarietyofdifferentunderlyingnetworktechnologies.
Uponcompletionofthissection,youwillbeabletodescribethemainoperational
characteristicsoftheOSPFprotocolandconfigureitsbasicfeatures.Youwillalsobeable
tomeetfollowingobjectives:
ExplainwhywouldyouchooseOSPFoverotherroutingprotocols
Describebasicoperationstepswithlinkstateprotocols
DescribeareaandroutertypesinOSPF
ExplainwhatthedesignlimitationsofOSPFare
ListanddescribeOSPFmessagetypes
DescribeOSPFneighborrelationshipoverpointtopointlink
DescribeOSPFneighborrelationshipbehavioronMPLSVPN
DescribeOSPFneighborrelationshipbehavioroverL2MPLSVPN

http://www.ciscopress.com/articles/article.asp?p=2294214

1/19

2016.06.13.

OSPFImplementation>EstablishingOSPFNeighborRelationships

ListanddescribeOSPFneighborstates
ListanddescribeOSPFnetworktypes
Configurepassiveinterfaces

OSPFFeatures
OSPFwasdevelopedbytheInternetEngineeringTaskForce(IETF)toovercomethe
limitationsofdistancevectorroutingprotocols.OneofthemainreasonswhyOSPFis
largelydeployedintodaysenterprisenetworksisthefactthatitisanopenstandard
OSPFisnotproprietary.Version1oftheprotocolisdescribedintheRFC1131.The
currentversionusedforIPv4,Version2,isspecifiedinRFCs1247and2328.OSPF
Version3,whichisusedinIPv6networks,isspecifiedinRFC5340.
OSPFoffersalargelevelofscalabilityandfastconvergence.Despiteitsrelativelysimple
configurationinsmallandmediumsizenetworks,OSPFimplementationand
troubleshootinginlargescalenetworkscanattimesbechallenging.
ThekeyfeaturesoftheOSPFprotocolareasfollows:
Independenttransport:OSPFworksontopofIPandusesprotocolnumber89.It
doesnotrelyonthefunctionsofthetransportlayerprotocolsTCPorUDP.
Efficientuseofupdates:WhenanOSPFrouterfirstdiscoversanewneighbor,it
sendsafullupdatewithallknownlinkstateinformation.Allrouterswithinan
OSPFareamusthaveidenticalandsynchronizedlinkstateinformationintheir
OSPFlinkstatedatabases.WhenanOSPFnetworkisinaconvergedstateanda
newlinkcomesuporalinkbecomesunavailable,anOSPFroutersendsonlya
partialupdatetoallitsneighbors.ThisupdatewillthenbefloodedtoallOSPF
routerswithinanarea.
Metric:OSPFusesametricthatisbasedonthecumulativecostsofalloutgoing
interfacesfromsourcetodestination.Theinterfacecostisinverselyproportionalto
theinterfacebandwidthandcanbealsosetupexplicitly.
Updatedestinationaddress:OSPFusesmulticastandunicast,ratherthan
broadcast,forsendingmessages.TheIPv4multicastaddressesusedforOSPF
are224.0.0.5tosendinformationtoallOSPFroutersand224.0.0.6tosend
informationtoDR/BDRrouters.TheIPv6multicastaddressesareFF02::5forall
OSPFv3routersandFF02::6forallDR/BDRrouters.Iftheunderlyingnetwork
doesnothavebroadcastcapabilities,youmustestablishOSPFneighbor
relationshipsusingaunicastaddress.ForIPv6,thisaddresswillbealinklocal
IPv6address.
VLSMsupport:OSPFisaclasslessroutingprotocol.Itsupportsvariablelength
subnetmasking(VLSM)anddiscontiguousnetworks.Itcarriessubnetmask
informationintheroutingupdates.
Manualroutesummarization:YoucanmanuallysummarizeOSPFinterarea
routesattheAreaBorderRouter(ABR),andyouhavethepossibilityto
summarizeOSPFexternalroutesattheAutonomousSystemBoundaryRouter
(ASBR).OSPFdoesnotknowtheconceptofautosummarization.
Authentication:OSPFsupportscleartext,MD5,andSHAauthentication.
NOTE
ThetermIPisusedforgenericIPandappliestobothIPv4andIPv6.Otherwise,the
termsIPv4andIPv6areusedforthespecificprotocols.
NOTE
Althoughthereissomereview,thischapterassumesthatyouhavebasicCCNA
knowledgeofOSPF.IfyouneedamorethoroughreviewofOSPForotherrouting
protocols,seetheRoutingProtocolsCompanionGuide(CiscoPress,2014).

OSPFOperationOverview
Tocreateandmaintainroutinginformation,OSPFrouterscompletethefollowinggeneric
linkstateroutingprocess,showninFigure31,toreachastateofconvergence:
1.Establishneighboradjacencies:OSPFenabledroutersmustformadjacencies
withtheirneighborbeforetheycanshareinformationwiththatneighbor.An
OSPFenabledroutersendsHellopacketsoutallOSPFenabledinterfacesto
determinewhetherneighborsarepresentonthoselinks.Ifaneighborispresent,
theOSPFenabledrouterattemptstoestablishaneighboradjacencywiththat
neighbor.
2.Exchangelinkstateadvertisements:Afteradjacenciesareestablished,routers
thenexchangelinkstateadvertisements(LSAs).LSAscontainthestateandcost
ofeachdirectlyconnectedlink.RoutersfloodtheirLSAstoadjacentneighbors.
AdjacentneighborsreceivingtheLSAimmediatelyfloodtheLSAtootherdirectly
connectedneighbors,untilallroutersintheareahaveallLSAs.
3.Buildthetopologytable:AftertheLSAsarereceived,OSPFenabledrouters
buildthetopologytable(LSDB)basedonthereceivedLSAs.Thisdatabase
eventuallyholdsalltheinformationaboutthetopologyofthenetwork.Itis
importantthatallroutersintheareahavethesameinformationintheirLSDBs.
4.ExecutetheSPFalgorithm:RoutersthenexecutetheSPFalgorithm.TheSPF
algorithmcreatestheSPFtree.
5.Buildtheroutingtable:FromtheSPFtree,thebestpathsareinsertedintothe
routingtable.Routingdecisionsaremadebasedontheentriesintherouting
table.

http://www.ciscopress.com/articles/article.asp?p=2294214

2/19

2016.06.13.

OSPFImplementation>EstablishingOSPFNeighborRelationships

Figure31OSPFOperation

HierarchicalStructureofOSPF
IfyourunOSPFinasimplenetwork,thenumberofroutersandlinksarerelativelysmall,
andbestpathstoalldestinationsareeasilydeduced.However,theinformation
necessarytodescribelargernetworkswithmanyroutersandlinkscanbecomequite
complex.SPFcalculationsthatcompareallpossiblepathsforroutescaneasilyturnintoa
complexandtimeconsumingcalculationfortherouter.
Oneofthemainmethodstoreducethiscomplexityandthesizeofthelinkstate
informationdatabaseistopartitiontheOSPFroutingdomainintosmallerunitscalled
areas,showninFigure32.ThisalsoreducesthetimeittakesfortheSPFalgorithmto
execute.AllOSPFrouterswithinanareamusthaveidenticalentrieswithintheir
respectiveLSDBs.Insideanarea,routersexchangedetailedlinkstateinformation.
However,informationtransmittedfromoneareaintoanothercontainsonlysummary
detailsoftheLSDBentriesandnottopologydetailsabouttheoriginatingarea.These
summaryLSAsfromanotherareaareinjecteddirectlyintotheroutingtableandwithout
makingtherouterrerunitsSPFalgorithm.

Figure32OSPFHierarchy
OSPFusesatwolayerareahierarchy:
Backbonearea,transitareaorarea0:Twoprincipalrequirementsforthe
backboneareaarethatitmustconnecttoallothernonbackboneareasandthis
areamustbealwayscontiguousitisnotallowedtohavesplitupthebackbone
area.Generally,endusersarenotfoundwithinabackbonearea.
Nonbackbonearea:Theprimaryfunctionofthisareaistoconnectendusersand
resources.Nonbackboneareasareusuallysetupaccordingtofunctionalor
geographicgroupings.Trafficbetweendifferentnonbackboneareasmustalways
passthroughthebackbonearea.
InthemultiareatopologytherearesomespecialcommonlyusedOSPFterms:
ABR:ArouterthathasinterfacesconnectedtoatleasttwodifferentOSPFareas,
includingthebackbonearea.ABRscontainLSDBinformationforeacharea,
makeroutecalculationforeachareaandadvertiseroutinginformationbetween
areas.
ASBR:ASBRisarouterthathasatleastoneofitsinterfacesconnectedtoan
OSPFareaandatleastoneofitsinterfacesconnectedtoanexternalnonOSPF
domain.
Internalrouter:ArouterthathasallitsinterfacesconnectedtoonlyoneOSPF
area.Thisrouteriscompletelyinternaltothisarea.
Backbonerouter:Arouterthathasatleastoneinterfaceconnectedtothe
backbonearea.
Theoptimalnumberofroutersperareavariesbasedonfactorssuchasnetworkstability,
butingeneralitisrecommendedtohavenomorethan50routerspersinglearea.

DesignRestrictionsofOSPF
OSPFhasspecialrestrictionswhenmultipleareasareconfiguredinanOSPFrouting
domainorAS,asshowninFigure33.Ifmorethanoneareaisconfigured,knownas
multiareaOSPF,oneoftheseareasmustbearea0.Thisiscalledthebackbonearea.
Whendesigningnetworksorstartingwithasinglearea,itisgoodpracticetostartwiththe
corelayer,whichbecomesarea0,andthenexpandintootherareaslater.

http://www.ciscopress.com/articles/article.asp?p=2294214

3/19

2016.06.13.

OSPFImplementation>EstablishingOSPFNeighborRelationships

Figure33MultiAreaOSPF
Thebackbonehastobeatthecenterofallotherareas,andotherareashavetobe
connectedtothebackbone.ThemainreasonisthatOSPFexpectsallareastoinject
routinginformationintothebackbonearea,whichdistributesthatinformationintoother
areas.
Anotherimportantrequirementforthebackboneareaisthatitmustbecontiguous.In
otherwords,splittinguparea0isnotallowed.
However,insomecases,thesetwoconditionscannotbemet.Laterinthischapterinthe
section,OSPFVirtualLinks,youwilllearnabouttheuseofvirtuallinksasasolution.

OSPFMessageTypes
OSPFusesfivetypesofroutingprotocolpackets,whichshareacommonprotocol
header.EveryOSPFpacketisdirectlyencapsulatedintheIPheader.TheIPprotocol
numberforOSPFis89.
Type1:Hellopacket:Hellopacketsareusedtodiscover,build,andmaintain
OSPFneighboradjacencies.Toestablishadjacency,OSPFpeersatbothsidesof
thelinkmustagreeonsomeparameterscontainedintheHellopackettobecome
OSPFneighbors.
Type2:DatabaseDescription(DBD)packet:WhentheOSPFneighbor
adjacencyisalreadyestablished,aDBDpacketisusedtodescribeLSDBsothat
routerscancomparewhetherdatabasesareinsync.
Type3:LinkStateRequest(LSR)packet:Whenthedatabasesynchronization
processisover,theroutermightstillhavealistofLSAsthataremissinginits
database.TherouterwillsendanLSRpackettoinformOSPFneighborstosend
themostrecentversionofthemissingLSAs.
Type4:LinkStateUpdate(LSU)packet:ThereareseveraltypesofLSUs,
knownasLSAs.LSUpacketsareusedforthefloodingofLSAsandsendingLSA
responsestoLSRpackets.Itissentonlytothedirectlyconnectedneighborswho
havepreviouslyrequestedLSAsintheformofLSRpacket.Incaseofflooding,
neighborroutersareresponsibleforreencapsulationofreceivedLSAinformation
innewLSUpackets.
Type5:LinkStateAcknowledgment(LSAck)packet:LSAcksareusedtomake
floodingofLSAsreliable.EachLSAreceivedmustbeexplicitlyacknowledged.
MultipleLSAscanbeacknowledgedinasingleLSAckpacket.

BasicOSPFConfiguration
ThissectionexploreshowtoconfigureandestablishOSPFneighborrelationship.You
willobservetheimpactoftheinterfaceMTUandOSPFhello/deadtimerparameterson
theOSPFneighborrelationshipformation.Inaddition,youwilllearnwhattherolesareof
theDR/BDRroutersandhowtocontroltheDR/BDRelectionprocess.
ThetopologyinFigure34showsfiverouters,R1toR5.R1,R4,andR5arealreadypre
configured,whileR2andR3willbeconfiguredinthissection.

Figure34TopologyforBasicOSPFConfiguration
R1,R4,andR5areconnectedtocommonmultiaccessEthernetsegment.R1andR2are
connectedoverserialFrameRelayinterface,andR1andR3arealsoconnectedover
Ethernetlink.
Example31beginstheconfigurationofOSPFonWANandLANinterfacesonR2and
R3.Usetheprocessnumbers2and3onR2andR3,respectively.
Example31ConfigurationOSPFonR2andR3

http://www.ciscopress.com/articles/article.asp?p=2294214

4/19

2016.06.13.

OSPFImplementation>EstablishingOSPFNeighborRelationships

R2#configureterminal
Enterconfigurationcommands,oneperline.EndwithCNTL/Z.
R2(config)#routerospf2
R2(configrouter)#network172.16.12.00.0.0.3area1
R2(configrouter)#network192.168.2.00.0.0.255area1

R3#configureterminal
Enterconfigurationcommands,oneperline.EndwithCNTL/Z.
R3(config)#routerospf3
R3(configrouter)#network172.16.13.00.0.0.3area2
R3(configrouter)#network192.168.3.00.0.0.255area2

ToenabletheOSPFprocessontherouter,usetherouterospfprocessidcommand.
ProcessIDnumbersbetweenneighborsdonotneedtomatchfortherouterstoestablish
anOSPFadjacency.TheOSPFprocessnumberIDisaninternallyusedidentification
parameterforanOSPFroutingprocessandonlyhaslocalsignificance.However,itis
goodpracticetomaketheprocessIDnumberthesameonallrouters.Ifnecessary,you
canspecifymultipleOSPFroutingprocessesonarouter,butyouneedtoknowthe
implicationsofdoingso.MultipleOSPFprocessesonthesamerouterisnotcommonand
beyondthescopeofthisbook.
TodefinewhichinterfaceswillruntheOSPFprocessandtodefinetheareaIDforthose
interfaces,usenetworkipaddresswildcardmaskareaareaidcommand.Acombination
ofipaddressandwildcardmasktogetherallowsyoutodefineoneormultipleinterfaces
tobeassociatedwithaspecificOSPFareausingasinglecommand.
CiscoIOSSoftwaresequentiallyevaluatestheipaddresswildcardmaskpairspecifiedin
thenetworkcommandforeachinterfaceasfollows:
ItperformsalogicalORoperationbetweenawildcardmaskargumentandthe
interfacesprimaryIPaddress.
ItperformsalogicalORoperationbetweenawildcardmaskargumentandtheip
addressargumentinthenetworkcommand.
Thesoftwarecomparesthetworesultingvalues.Iftheymatch,OSPFisenabled
ontheassociatedinterface,andthisinterfaceisattachedtotheOSPFarea
specified.
ThisareaIDisa32bitnumberthatmayberepresentedinintegerordotteddecimal
format.Whenrepresentedindotteddecimalformat,theareaIDdoesnotrepresentanIP
addressitisonlyawayofwritinganintegervalueindotteddecimalformat.Forexample,
youmayspecifythataninterfacebelongstoarea1usingarea1orarea0.0.0.1notation
inthenetworkcommand.ToestablishOSPFfulladjacency,twoneighborroutersmustbe
inthesamearea.Anyindividualinterfacecanonlybeattachedtoasinglearea.Ifthe
addressrangesspecifiedfordifferentareasoverlap,IOSwilladoptthefirstareainthe
networkcommandlistandignoresubsequentoverlappingportions.Toavoidconflicts,
youmustpayspecialattentiontoensurethataddressrangesdonotoverlap.
InExample32,theOSPFrouterIDsofR2andR3areconfiguredusingtherouterid
command.
Example32ConfigurationofOSPFRouterIDs
R2(configrouter)#routerid2.2.2.2
%OSPF:Reloadoruse"clearipospfprocess"command,forthistotakeeffect

R3(configrouter)#routerid3.3.3.3
%OSPF:Reloadoruse"clearipospfprocess"command,forthistotakeeffect

TheOSPFrouterIDisafundamentalparameterfortheOSPFprocess.FortheOSPF
processtostart,CiscoIOSmustbeabletoidentifyauniqueOSPFrouterID.Similarto
EIGRP,theOSPFrouterIDisa32bitvalueexpressedasanIPv4address.Atleastone
primaryIPv4addressonaninterfaceintheup/upstatemustbeconfiguredforarouterto
beabletochooserouterIDotherwise,anerrormessageislogged,andtheOSPF
processdoesnotstart.
TochoosetheOSPFrouterIDatthetimeofOSPFprocessinitialization,therouteruses
thefollowingcriteria:
1.UsetherouterIDspecifiedintherouteridipaddresscommand.Youcan
configureanarbitraryvalueintheIPv4addressformat,butthisvaluemustbe
unique.IftheIPv4addressspecifiedwiththerouteridcommandoverlapswith
therouterIDofanotheralreadyactiveOSPFprocess,therouteridcommand
fails.
2.UsethehighestIPv4addressofallactiveloopbackinterfacesontherouter.
3.UsethehighestIPv4addressamongallactivenonloopbackinterfaces.
AfterthethreestepOSPFrouterIDselectionprocesshasfinished,andiftherouterisstill
unabletoselectanOSPFrouterID,anerrormessagewillbelogged.AnOSPFprocess
thatfailedtoselectarouterIDretriestheselectionprocesseverytimeanIPv4address
becomesavailable.(Anapplicableinterfacechangesitsstatetoup/uporanIPv4address
isconfiguredonanapplicableinterface.)
InExample33,theOSPFroutingprocessisclearedonR2andR3forthemanually
configuredrouterIDtotakeeffect.

http://www.ciscopress.com/articles/article.asp?p=2294214

5/19

2016.06.13.

OSPFImplementation>EstablishingOSPFNeighborRelationships

Example33ClearingtheOSPFProcessesonR2andR3
R2#clearipospfprocess
ResetALLOSPFprocesses?[no]:yes
R2#
*Nov2408:37:24.679:%OSPF5ADJCHG:Process2,Nbr1.1.1.1onSerial0/0from
FULLtoDOWN,NeighborDown:Interfacedownordetached
R2#
*Nov2408:39:24.734:%OSPF5ADJCHG:Process2,Nbr1.1.1.1onSerial0/0from
LOADINGtoFULL,LoadingDone

R3#clearipospf3process
ResetOSPFprocess3?[no]:yes
R3#
*Nov2409:06:00.275:%OSPF5ADJCHG:Process3,Nbr1.1.1.1onEthernet0/0from
FULLtoDOWN,NeighborDown:Interfacedownordetached
R3#
*Nov2409:06:40.284:%OSPF5ADJCHG:Process3,Nbr1.1.1.1onEthernet0/0from
LOADINGtoFULL,LoadingDone

OnceanOSPFrouterIDisselected,itisnotchangedeveniftheinterfacethatisusedto
selectitchangeditsoperationalstateoritsIPaddress.TochangetheOSPFrouterID,
youmustresettheOSPFprocesswiththeclearipospfprocesscommandorreloadthe
router.
Inproductionnetworks,theOSPFrouterIDcannotbechangedeasily.Changingthe
OSPFrouterIDrequiresresetofallOSPFadjacencies,resultinginatemporaryrouting
outage.TherouteralsohastooriginatenewcopiesofalloriginatingLSAswiththenew
routerID.
YoucaneitherclearthespecificOSPFprocessbyspecifyingtheprocessID,oryoucan
resetallOSPFprocessesbyusingtheclearipospfprocesscommand.
ThenewlyconfiguredOSPFrouterIDisverifiedonR2andR3usingshowipprotocols
commandsinExample34.Largeoutputofthiscommandcanoptionallybefilteredusing
thepipefunction,alsoshowninExample34.
Example34VerifyingtheRouterIDsonR2andR3
R2#showipprotocols
***IPRoutingisNSFaware***
RoutingProtocolis"ospf2"
Outgoingupdatefilterlistforallinterfacesisnotset
Incomingupdatefilterlistforallinterfacesisnotset

RouterID2.2.2.2
Numberofareasinthisrouteris1.1normal0stub0nssa
Maximumpath:4
RoutingforNetworks:
172.16.12.00.0.0.3area1
192.168.2.00.0.0.255area1
RoutingInformationSources:
GatewayDistanceLastUpdate
1.1.1.111000:02:55
Distance:(defaultis110)
R3#showipprotocols|includeID
RouterID3.3.3.3

TheOSPFneighborshiponR2andR3isverifiedinExample35usingtheshowipospf
neighborcommand.
Example35VerifyingOSPFNeighborshipsonR2andR2
R2#showipospfneighbor
NeighborIDPriStateDeadTimeAddressInterface
1.1.1.11FULL/DR00:01:57172.16.12.1Serial0/0

R3#showipospfneighbor
NeighborIDPriStateDeadTimeAddressInterface
1.1.1.11FULL/DR00:00:39172.16.13.1Ethernet0/0

ThecommandshowipospfneighbordisplaysOSPFneighborinformationonaper
interfacebasis.Thesignificantfieldsoftheoutputsareasfollows:
NeighborID:RepresentsneighborrouterID.
Priority:PriorityontheneighborinterfaceusedfortheDR/BDRelection.
State:AFullstaterepresentsthefinalstageofOSPFneighborestablishment
processanddenotesthatthelocalrouterhasestablishedfullneighboradjacency
withtheremoteOSPFneighbor.DRmeansthatDR/BDRelectionprocesshas
beencompletedandthattheremoterouterwiththerouterID1.1.1.1hasbeen
electedasthedesignatedrouter(DR).
DeadTime:Representsvalueofthedeadtimer.Whenthistimerexpires,the
routerterminatestheneighborrelationship.EachtimearouterreceivesanOSPF

http://www.ciscopress.com/articles/article.asp?p=2294214

6/19

2016.06.13.

OSPFImplementation>EstablishingOSPFNeighborRelationships

Hellopacketfromaspecificneighbor,itresetsthedeadtimerbacktoitsfullvalue.
Address:PrimaryIPv4addressoftheneighborrouter.
Interface:LocalinterfaceoverwhichanOSPFneighborrelationshipis
established.
Example36verifiestheOSPFenabledinterfacesonR2andR3usingtheshowipospf
interfacecommand.
Example36VerifyingtheOSPFEnabledInterfacesonR2andR3
R2#showipospfinterface
Loopback0isup,lineprotocolisup
InternetAddress192.168.2.1/24,Area1,AttachedviaNetworkStatement
ProcessID2,RouterID2.2.2.2,NetworkTypeLOOPBACK,Cost:1
<Outputomitted>
Serial0/0isup,lineprotocolisup
InternetAddress172.16.12.2/30,Area1,AttachedviaNetworkStatement
ProcessID2,RouterID2.2.2.2,NetworkTypeNON_BROADCAST,Cost:64
<Outputomitted>

R3#showipospfinterface
Loopback0isup,lineprotocolisup
InternetAddress192.168.3.1/24,Area2,AttachedviaNetworkStatement
ProcessID3,RouterID3.3.3.3,NetworkTypeLOOPBACK,Cost:1
<Outputomitted>
Ethernet0/0isup,lineprotocolisup
InternetAddress172.16.13.2/30,Area2,AttachedviaNetworkStatement
ProcessID3,RouterID3.3.3.3,NetworkTypeBROADCAST,Cost:10
<Outputomitted>

Outputoftheshowipospfinterfacecommandshowsyouallinterfacesenabledinthe
OSPFprocess.Foreachenabledinterface,youcanseedetailedinformationsuchas
OSPFareaID,OSPFprocessID,andhowtheinterfacewasincludedintotheOSPF
process.Intheoutput,youcanseethatbothinterfacesonbothrouterswereincludedvia
thenetworkstatement,configuredwiththenetworkcommand.
InExample37,theOSPFroutesareverifiedintheroutingtableonR5usingtheshowip
routeospfcommand.
Example37VerifyingtheOSPFRoutesonR5
R5#showiprouteospf
Codes:Llocal,Cconnected,Sstatic,RRIP,Mmobile,BBGP
DEIGRP,EXEIGRPexternal,OOSPF,IAOSPFinterarea
N1OSPFNSSAexternaltype1,N2OSPFNSSAexternaltype2
E1OSPFexternaltype1,E2OSPFexternaltype2
iISIS,suISISsummary,L1ISISlevel1,L2ISISlevel2
iaISISinterarea,*candidatedefault,Uperuserstaticroute
oODR,Pperiodicdownloadedstaticroute,HNHRP,lLISP
+replicatedroute,%nexthopoverride
Gatewayoflastresortisnotset
172.16.0.0/16isvariablysubnetted,4subnets,3masks
OIA172.16.12.0/30[110/74]via172.16.145.1,00:39:00,Ethernet0/0
OIA172.16.13.0/30[110/20]via172.16.145.1,00:19:29,Ethernet0/0
192.168.2.0/32issubnetted,1subnets
OIA192.168.2.1[110/75]via172.16.145.1,00:07:27,Ethernet0/0
192.168.3.0/32issubnetted,1subnets
OIA192.168.3.1[110/21]via172.16.145.1,00:08:30,Ethernet0/0
O192.168.4.0/24[110/11]via172.16.145.4,00:39:10,Ethernet0/0

AmongtheroutesoriginatedwithintheOSPFautonomoussystem,OSPFclearly
distinguishestwotypesofroutes:intraarearoutesandinterarearoutes.Intraarearoutes
areroutesthatareoriginatedandlearnedinthesamelocalarea.Codefortheintraarea
routesintheroutingtableisO.Thesecondtypeisinterarearoutes,whichoriginatein
otherareasandareinsertedintothelocalareatowhichyourrouterbelongs.Codeforthe
interarearoutesintheroutingtableisOIA.Interarearoutesareinsertedintootherareas
ontheABR.
Theprefix192.168.4.0/24isanexampleofintraarearoutefromtheR5perspective.It
originatedfromrouterR4,whichispartofthearea0,thesameareaasR5.
PrefixesfromR2andR3,whicharepartofarea1andarea2,areshownintherouting
tableonR5asinterarearoutes.Prefixeswereinsertedintoarea0asinterarearoutesby
R1,whichplaystheroleofABR.
Prefixes192.168.2.0/24and192.168.3.0/24configuredontheloopbackinterfacesofR2
andR3aredisplayedintheR5routingtableashostroutes192.168.2.1/32and
192.168.3.1/32.Bydefault,OSPFwilladvertiseanysubnetconfiguredontheloopback
interfaceas/32hostroute.Tochangethisdefaultbehavior,youcanoptionallychange
OSPFnetworktypeontheloopbackinterfacefromthedefaultloopbacktopointtopoint
usingtheipospfnetworkpointtopointinterfacecommand.
OSPFdatabaseroutesonR5areobservedinExample38usingtheshowipospfroute
command.
Example38OSPFRoutesonR5

http://www.ciscopress.com/articles/article.asp?p=2294214

7/19

2016.06.13.

OSPFImplementation>EstablishingOSPFNeighborRelationships

R5#showipospfroute
OSPFRouterwithID(5.5.5.5)(ProcessID1)
BaseTopology(MTID0)
AreaBACKBONE(0)
IntraareaRouteList
*172.16.145.0/29,Intra,cost10,area0,Connected
via172.16.145.5,Ethernet0/0
*>192.168.4.0/24,Intra,cost11,area0
via172.16.145.4,Ethernet0/0
IntraareaRouterPathList
i1.1.1.1[10]via172.16.145.1,Ethernet0/0,ABR,Area0,SPF2
InterareaRouteList
*>192.168.2.1/32,Inter,cost75,area0
via172.16.145.1,Ethernet0/0
*>192.168.3.1/32,Inter,cost21,area0
via172.16.145.1,Ethernet0/0
*>172.16.12.0/30,Inter,cost74,area0
via172.16.145.1,Ethernet0/0
*>172.16.13.0/30,Inter,cost20,area0
via172.16.145.1,Ethernet0/0

Theshowipospfroutecommandclearlyseparatesthelistsofintraareaandinterarea
routes.Inaddition,outputofthecommanddisplaysessentialinformationaboutABRs,
includingtherouterID,IPv4addressinthecurrentarea,interfacethatadvertisesroutes
intothearea,andtheareaID.
Forinterarearoutes,themetricfortheroute(cost),theareaintowhichtherouteis
distributed,andtheinterfaceoverwhichtherouteisinsertedaredisplayed.
InExample39,theOSPFneighboradjacencyandtheassociatedOSPFpackettypeson
R3areobservedusingthedebugipospfadjandclearipospfprocesscommands.
DisabledebugwhentheOSPFsessionisreestablished.
Example39ObservingFormationofOSPFNeighborAdjacencies
R3#debugipospfadj
OSPFadjacencydebuggingison
R3#clearipospfprocess
ResetALLOSPFprocesses?[no]:yes
*Jan1713:02:37.394:OSPF3ADJLo0:InterfacegoingDown
*Jan1713:02:37.394:OSPF3ADJLo0:3.3.3.3address192.168.3.1isdead,state
DOWN
*Jan1713:02:37.394:OSPF3ADJEt0/0:InterfacegoingDown
*Jan1713:02:37.394:OSPF3ADJEt0/0:1.1.1.1address172.16.13.1isdead,state
DOWN
*Jan1713:02:37.394:%OSPF5ADJCHG:Process3,Nbr1.1.1.1onEthernet0/0from
FULLtoDOWN,NeighborDown:Interfacedownordetached
<Outputomitted>
*Jan1713:02:37.394:OSPF3ADJLo0:InterfacegoingUp
*Jan1713:02:37.394:OSPF3ADJEt0/0:InterfacegoingUp
*Jan1713:02:37.395:OSPF3ADJEt0/0:2WayCommunicationto1.1.1.1,state2WAY
*Jan1713:02:37.396:OSPF3ADJEt0/0:BackupseeneventbeforeWAITtimer
*Jan1713:02:37.396:OSPF3ADJEt0/0:DR/BDRelection
*Jan1713:02:37.396:OSPF3ADJEt0/0:ElectBDR3.3.3.3
*Jan1713:02:37.396:OSPF3ADJEt0/0:ElectDR1.1.1.1
*Jan1713:02:37.396:OSPF3ADJEt0/0:ElectBDR3.3.3.3
*Jan1713:02:37.396:OSPF3ADJEt0/0:ElectDR1.1.1.1
*Jan1713:02:37.396:OSPF3ADJEt0/0:DR:1.1.1.1(Id)BDR:3.3.3.3(Id)
*Jan1713:02:37.396:OSPF3ADJEt0/0:Nbr1.1.1.1:Preparedbaseexchange
*Jan1713:02:37.396:OSPF3ADJEt0/0:SendDBDto1.1.1.1seq0x95Dopt0x52
flag0x7len32
*Jan1713:02:37.397:OSPF3ADJEt0/0:RcvDBDfrom1.1.1.1seq0x691opt0x52
flag0x7len32mtu1500stateEXSTART
*Jan1713:02:37.397:OSPF3ADJEt0/0:FirstDBDandwearenotSLAVE
*Jan1713:02:37.397:OSPF3ADJEt0/0:RcvDBDfrom1.1.1.1seq0x95Dopt0x52
flag0x2len152mtu1500stateEXSTART
*Jan1713:02:37.397:OSPF3ADJEt0/0:NBRNegotiationDone.WearetheMASTER
*Jan1713:02:37.397:OSPF3ADJEt0/0:Nbr1.1.1.1:Summarylistbuilt
*Jan1713:02:37.397:OSPF3ADJEt0/0:SendDBDto1.1.1.1seq0x95Eopt0x52
flag0x1len32
*Jan1713:02:37.398:OSPF3ADJEt0/0:RcvDBDfrom1.1.1.1seq0x95Eopt0x52
flag0x0len32mtu1500stateEXCHANGE
*Jan1713:02:37.398:OSPF3ADJEt0/0:ExchangeDonewith1.1.1.1
*Jan1713:02:37.398:OSPF3ADJEt0/0:SendLSREQto1.1.1.1length96LSAcount
6
*Jan1713:02:37.399:OSPF3ADJEt0/0:RcvLSUPDfrom1.1.1.1length208LSA
count6
*Jan1713:02:37.399:OSPF3ADJEt0/0:Synchronizedwith1.1.1.1,stateFULL
*Jan1713:02:37.399:%OSPF5ADJCHG:Process3,Nbr1.1.1.1onEthernet0/0from
LOADINGtoFULL,LoadingDone
R3#undebugall

AnOSPFadjacencyisestablishedinseveralsteps.Inthefirststep,routersthatintendto
establishfullOSPFneighboradjacencyexchangeOSPFHellopackets.BothOSPF
neighborsareintheDownstate,theinitialstateofaneighborconversationthatindicates
thatnoHelloshavebeenheardfromtheneighbor.WhenarouterreceivesaHellofrom
theneighborbuthasnotyetseenitsownrouterIDintheneighborHellopacket,itwill
transittotheInitstate.Inthisstate,therouterwillrecordallneighborrouterIDsandstart
includingtheminHellossenttotheneighbors.WhentherouterseesitsownrouterIDin
theHellopacketreceivedfromtheneighbor,itwilltransittothe2Waystate.Thismeans
thatbidirectionalcommunicationwiththeneighborhasbeenestablished.
Onbroadcastlinks,OSPFneighborsfirstdeterminethedesignatedrouter(DR)and
backupdesignatedrouter(BDR)roles,whichoptimizetheexchangeofinformationin
broadcastsegments.

http://www.ciscopress.com/articles/article.asp?p=2294214

8/19

2016.06.13.

OSPFImplementation>EstablishingOSPFNeighborRelationships

Inthenextstep,routersstarttoexchangecontentofOSPFdatabases.Thefirstphaseof
thisprocessistodeterminemaster/slaverelationshipandchoosetheinitialsequence
numberforadjacencyformation.Toaccomplishthis,routersexchangeDBDpackets.
WhentherouterreceivestheinitialDBDpacketittransitionsthestateoftheneighbor
fromwhichthispacketisreceivedtoExStartstate,populatesitsDatabaseSummarylist
withtheLSAsthatdescribecontentoftheneighborsdatabase,andsendsitsownempty
DBDpacket.IntheDBDexchangeprocess,therouterwiththehigherrouterIDwill
becomemaster,anditwillbetheonlyrouterthatcanincrementsequencenumbers.
Withmaster/slaveselectioncomplete,databaseexchangecanstart.R3willtransitR1s
neighborstatetoExchange.Inthisstate,R3describesitsdatabasetotheR1bysending
DBDpacketsthatcontaintheheadersofallLSAsintheDatabaseSummarylist.The
DatabaseSummarylistdescribesallLSAsintheroutersdatabase,butnotthefull
contentoftheOSPFdatabase.Todescribethecontentofthedatabase,oneormultiple
DBDpacketsmaybeexchanged.AroutercomparesthecontentofitsownDatabase
Summarylistwiththelistreceivedfromtheneighbor,andiftherearedifferences,itadds
missingLSAstotheLinkStateRequestlist.Atthispoint,routersentertheLoadingstate.
R3sendsanLSRpackettotheneighborrequestingfullcontentofthemissingLSAsfrom
theLSRequestlist.R1replieswiththeLSUpackets,whichcontainfullversionsofthe
missingLSAs.
Finally,whenneighborshaveacompleteversionoftheLSDB,bothneighborstransitto
theFullstate,whichmeansthatdatabasesontheroutersaresynchronizedandthat
neighborsarefullyadjacent.
OptimizingOSPFAdjacencyBehavior
Multiaccessnetworks,eitherbroadcast(suchasEthernet)ornonbroadcast(suchas
FrameRelay),representinterestingissuesforOSPF.Allrouterssharingthecommon
segmentwillbepartofthesameIPsubnet.Whenformingadjacencyonmultiaccess
network,everyrouterwilltrytoestablishfullOSPFadjacencywithallotherroutersonthe
segment.Thismaynotrepresentanissueforthesmallermultiaccessbroadcast
networks,butitmayrepresentanissueforthenonbroadcastmultiaccess(NBMA)
networks,whereinmostcasesyoudonothavefullmeshprivatevirtualcircuit(PVC)
topology.ThisissueinNBMAnetworksmanifestsinaninabilityforneighborsto
synchronizetheirOSPFdatabasesdirectlyamongthemselves.Alogicalsolutioninthis
caseistohaveacentralpointofOSPFadjacencyresponsibleforthedatabase
synchronizationandadvertisementofthesegmenttotheotherrouters,asshownin
Figure35.

Figure35OSPFAdjacenciesonMultiaccessNetworks
Asthenumberofroutersonthesegmentgrows,thenumberofOSPFadjacencies
increasesexponentially.EveryroutermustsynchronizeitsOSPFdatabasewithevery
otherrouter,andinthecaseofalargenumberofrouters,thisleadstoinefficiency.
Anotherissueariseswheneveryrouteronthesegmentadvertisesallitsadjacenciesto
otherroutersinthenetwork.IfyouhavefullmeshOSPFadjacencies,remainingOSPF
routerswillreceivealargeamountofredundantlinkstateinformation.Again,thesolution
forthisproblemistoestablishacentralpointwithwhicheveryotherrouterforms
adjacencyandwhichadvertisesthesegmentasawholetotherestofthenetwork.
Theroutersonthemultiaccesssegmentelectadesignatedrouter(DR)andbackup
designatedrouter(BDR),whichcentralizescommunicationsforallroutersconnectedto
thesegment.TheDRandBDRimprovenetworkfunctioninginthefollowingways:
Reducingroutingupdatetraffic:TheDRandBDRactasacentralpointof
contactforlinkstateinformationexchangeonamultiaccessnetworktherefore,
eachroutermustestablishafulladjacencywiththeDRandtheBDRonly.Each
router,ratherthanexchanginglinkstateinformationwitheveryotherrouteronthe
segment,sendsthelinkstateinformationtotheDRandBDRonly,byusinga
dedicatedIPv4multicastaddress224.0.0.6orFF00::6forIPv6.TheDRrepresents
themultiaccessnetworkinthesensethatitsendslinkstateinformationfromeach
routertoallotherroutersinthenetwork.Thisfloodingprocesssignificantly
reducestherouterrelatedtrafficonthesegment.
Managinglinkstatesynchronization:TheDRandBDRensurethattheother
routersonthenetworkhavethesamelinkstateinformationaboutthecommon
segment.Inthisway,theDRandBDRreducethenumberofroutingerrors.
OnlyLSAsaresenttotheDR/BDR.Thenormalroutingofpacketsonthesegmentwillgo
tothebestnexthoprouter.
WhentheDRisoperating,theBDRdoesnotperformanyDRfunctions.Instead,theBDR
receivesalltheinformation,buttheDRperformstheLSAforwardingandLSDB
synchronizationtasks.TheBDRperformstheDRtasksonlyiftheDRfails.WhentheDR
fails,theBDRautomaticallybecomesthenewDR,andanewBDRelectionoccurs.
InExample310,theDR/BDRstatusonR1,R4,andR5areobservedusingtheshowip
ospfneighborcommand.RoutersR1,R4,andR5areallconnectedtothesameshared
networksegment,whereOSPFwillautomaticallyattemptstooptimizeadjacencies.
Example310NeighborStatusofR1,R4,andR5

http://www.ciscopress.com/articles/article.asp?p=2294214

9/19

2016.06.13.

OSPFImplementation>EstablishingOSPFNeighborRelationships

R1#showipospfneighbor
NeighborIDPriStateDeadTimeAddressInterface
4.4.4.41FULL/BDR00:00:37172.16.145.4Ethernet0/1
5.5.5.51FULL/DR00:00:39172.16.145.5Ethernet0/1
2.2.2.21FULL/DR00:01:53172.16.12.2Serial2/0
3.3.3.31FULL/DR00:00:35172.16.13.2Ethernet0/0

R4#showipospfneighbor
NeighborIDPriStateDeadTimeAddressInterface
1.1.1.11FULL/DROTHER00:00:39172.16.145.1Ethernet0/0
5.5.5.51FULL/DR00:00:39172.16.145.5Ethernet0/0

R5#showipospfneighbor
NeighborIDPriStateDeadTimeAddressInterface
1.1.1.11FULL/DROTHER00:00:39172.16.145.1Ethernet0/0
4.4.4.41FULL/BDR00:00:35172.16.145.4Ethernet0/0

WhenR1,R4,andR5startestablishingOSPFneighboradjacency,theyfirstsendOSPF
HellopacketstodiscoverwhichOSPFneighborsareactiveonthecommonEthernet
segment.Afterthebidirectionalcommunicationbetweenroutersisestablishedandthey
areallintheOSPFneighbor2Waystate,theDR/BDRelectionprocessbegins.The
OSPFHellopacketcontainsthreespecificfieldsusedfortheDR/BDRelection:
DesignatedRouter,BackupDesignatedRouter,andRouterPriority.
TheDesignatedRouterandBackupDesignateRouterfieldsarepopulatedwithalistof
routersclaimingtobeDRandBDR.Fromallrouterslisted,therouterwiththehighest
prioritybecomestheDR,andtheonewiththenexthighestprioritybecomestheBDR.If
thepriorityvaluesareequal,therouterwiththehighestOSPFrouterIDbecomestheDR,
andtheonewiththenexthighestOSPFrouterIDbecomestheBDR.
TheDR/BDRelectionprocesstakesplaceonbroadcastandNBMAnetworks.Themain
differencebetweenthetwoisthetypeofIPaddressusedintheHellopacket.Onthe
multiaccessbroadcastnetworks,routersusemulticastdestinationIPv4address224.0.0.6
tocommunicatewiththeDR(calledAllDRRouters),andtheDRusesmulticast
destinationIPv4address224.0.0.5tocommunicatewithallothernonDRrouters(called
AllSPFRouters).OnNBMAnetworks,theDRandadjacentrouterscommunicateusing
unicastaddresses.
TheDR/BDRelectionprocessnotonlyoccurswhenthenetworkfirstbecomesactivebut
alsowhentheDRbecomesunavailable.Inthiscase,theBDRwillimmediatelybecome
theDR,andtheelectionofthenewBDRstarts.
Inthetopology,R5hasbeenelectedastheDRandR4astheBDRduetohavingthe
highestrouterIDvaluesonthesegment.R1becameaDROTHER.Onthemultiaccess
segment,itisnormalbehaviorthattherouterinDROTHERstatusisfullyadjacentwith
DR/BDRandin2WAYstatewithallotherDROTHERrouterspresentonthesegment.
InExample311,theinterfaceonR5isshutdowntowardR1andR4.Now,reexamine
theDR/BDRstatusonR1andR4.Aftertheshutdownontheinterface,waituntilneighbor
adjacenciesexpirebeforereexaminingtheDR/BDRstate.
Example311R5sEthernet0/0InterfaceShutdown
R5(config)#interfaceethernet0/0
R5(configif)#shutdown
*Dec816:20:25.080:%OSPF5ADJCHG:Process1,Nbr1.1.1.1onEthernet0/0from
FULLtoDOWN,NeighborDown:Interfacedownordetached
*Dec816:20:25.080:%OSPF5ADJCHG:Process1,Nbr4.4.4.4onEthernet0/0from
FULLtoDOWN,NeighborDown:Interfacedownordetached

R1#showipospfneighbor
NeighborIDPriStateDeadTimeAddressInterface
4.4.4.41FULL/DR00:00:32172.16.145.4Ethernet0/1
2.2.2.21FULL/DR00:01:36172.16.12.2Serial2/0
3.3.3.31FULL/DR00:00:39172.16.13.2Ethernet0/0

R4#showipospfneighbor
NeighborIDPriStateDeadTimeAddressInterface
1.1.1.11FULL/BDR00:00:33172.16.145.1Ethernet0/0

WhenR5sEthernet0/0interfaceisshutdown,theDRrouteronthesegmentbecomes
immediatelyunavailable.Asaresult,anewDR/BDRelectiontakesplace.Theoutputof
theshowipospfneighborcommandshowsthatR4hasbecometheDRandR1the
BDR.
Next,inExample312,R5sinterfacetowardR1andR4isenabled.Examinethe
DR/BDRstatusonR1,R4,andR5.

http://www.ciscopress.com/articles/article.asp?p=2294214

10/19

2016.06.13.

OSPFImplementation>EstablishingOSPFNeighborRelationships

Example312R1sEthernet0/0InterfaceReenabled
R5(config)#interfaceethernet0/0
R5(configif)#noshutdown
*Dec1008:49:26.491:%OSPF5ADJCHG:Process1,Nbr1.1.1.1onEthernet0/0from
LOADINGtoFULL,LoadingDone
*Dec1008:49:30.987:%OSPF5ADJCHG:Process1,Nbr4.4.4.4onEthernet0/0from
LOADINGtoFULL,LoadingDone

R1#showipospfneighbor
NeighborIDPriStateDeadTimeAddressInterface
4.4.4.41FULL/DR00:00:36172.16.145.4Ethernet0/1
5.5.5.51FULL/DROTHER00:00:38172.16.145.5Ethernet0/1
2.2.2.21FULL/DR00:01:52172.16.12.2Serial2/0
3.3.3.31FULL/DR00:00:33172.16.13.2Ethernet0/0

R4#showipospfneighbor
NeighborIDPriStateDeadTimeAddressInterface
1.1.1.11FULL/BDR00:00:30172.16.145.1Ethernet0/0
5.5.5.51FULL/DROTHER00:00:34172.16.145.5Ethernet0/0

R5#showipospfneighbor
NeighborIDPriStateDeadTimeAddressInterface
1.1.1.11FULL/BDR00:00:33172.16.145.1Ethernet0/0
4.4.4.41FULL/DR00:00:37172.16.145.4Ethernet0/0

WhenR5sEthernet0/0interfaceisreenabled,anewDR/BDRelectionprocesswillnot
takeplaceeventhoughR5hasthehighestOSPFrouterIDonthesegment.OnceaDR
andBDRareelected,theyarenotpreempted.Thisrulemakesthemultiaccesssegment
morestablebypreventingtheelectionprocessfromoccurringwheneveranewrouter
becomesactive.ItmeansthatthefirsttwoDReligibleroutersonthelinkwillbeelected
asDRandBDR.Anewelectionwilloccuronlywhenoneofthemfails.
UsingOSPFPriorityintheDR/BDRElection
OneofthefieldsintheOSPFHellopacketusedintheDR/BDRelectionprocessisthe
RouterPriorityfield.EverybroadcastandNBMAOSPFenabledinterfaceisassigneda
priorityvaluebetween0and255.Bydefault,inCiscoIOS,theOSPFinterfacepriority
valueis1andcanbemanuallychangedbyusingtheipospfpriorityinterfacecommand.
WhenelectingaDRandBDR,theroutersviewtheOSPFpriorityvalueofotherrouters
duringtheHellopacketexchangeprocess,andthenusethefollowingconditionsto
determinewhichroutertoselect:
TherouterwiththehighestpriorityvalueiselectedastheDR.
TherouterwiththesecondhighestpriorityvalueistheBDR.
Incaseofatiewheretworoutershavethesamepriorityvalue,routerIDisused
asthetiebreaker.TherouterwiththehighestrouterIDbecomestheDR.The
routerwiththesecondhighestrouterIDbecomestheBDR.
Arouterwithaprioritythatissetto0cannotbecometheDRorBDR.Arouterthat
isnottheDRorBDRiscalledaDROTHER.
TheOSPFpriorityisconfiguredonR1usingtheipospfpriorityinterfacecommand,
showninExample313.TheOSPFprocessisclearedonR4toreinitiatetheDR/BDR
electionprocess.SettingtheOSPFinterfaceprioritytoavaluehigherthan1willinfluence
theDB/BDRelectioninfavorofR1.
Example313ConfiguringtheOSPFPriorityonanInterface
R1(config)#interfaceethernet0/1
R1(configif)#ipospfpriority100

R4#clearipospfprocess
ResetALLOSPFprocesses?[no]:yes
*Dec1013:08:48.610:%OSPF5ADJCHG:Process1,Nbr1.1.1.1onEthernet0/0from
FULLtoDOWN,NeighborDown:Interfacedownordetached
*Dec1013:08:48.610:%OSPF5ADJCHG:Process1,Nbr5.5.5.5onEthernet0/0from
FULLtoDOWN,NeighborDown:Interfacedownordetached
*Dec1013:09:01.294:%OSPF5ADJCHG:Process1,Nbr1.1.1.1onEthernet0/0from
LOADINGtoFULL,LoadingDone
*Dec1013:09:04.159:%OSPF5ADJCHG:Process1,Nbr5.5.5.5onEthernet0/0from
LOADINGtoFULL,LoadingDone

Inthisexample,theOSPFinterfacepriorityvalueisconfiguredto100.Thisinfluencesthe
DR/BDRelection,sothattheR1routerwillbecomeDRaftertheOSPFprocessiscleared
onthecurrentDR,R4.
InExample314,theshowipospfinterfaceEthernet0/1commandonR1verifiesthatit
hasbeenelectedasanewDR.
Example314R1IstheNewDR

http://www.ciscopress.com/articles/article.asp?p=2294214

11/19

2016.06.13.

OSPFImplementation>EstablishingOSPFNeighborRelationships

R1#showipospfinterfaceethernet0/1
Ethernet0/1isup,lineprotocolisup
InternetAddress172.16.145.1/29,Area0,AttachedviaNetworkStatement
ProcessID1,RouterID1.1.1.1,NetworkTypeBROADCAST,Cost:10
TopologyMTIDCostDisabledShutdownTopologyName
010nonoBase
TransmitDelayis1sec,StateDR,Priority100
DesignatedRouter(ID)1.1.1.1,Interfaceaddress172.16.145.1
BackupDesignatedrouter(ID)5.5.5.5,Interfaceaddress172.16.145.5
Timerintervalsconfigured,Hello10,Dead40,Wait40,Retransmit5
oobresynctimeout40
Helloduein00:00:06
SupportsLinklocalSignaling(LLS)
CiscoNSFhelpersupportenabled
IETFNSFhelpersupportenabled
Index1/3,floodqueuelength0
Next0x0(0)/0x0(0)
Lastfloodscanlengthis1,maximumis5
Lastfloodscantimeis0msec,maximumis1msec
NeighborCountis2,Adjacentneighborcountis2
Adjacentwithneighbor4.4.4.4
Adjacentwithneighbor5.5.5.5(BackupDesignatedRouter)
Suppresshellofor0neighbor(s)

TheEthernet0/1interfaceonR1hasbeenassignedtheOSPFpriorityvalueof100,too,
andwhenthenewDR/BDRelectionprocesstookplace,thestateoftheR1hasbecome
DR.TheshowipospfinterfacecommandonR1showsthatR1iselectedastheDRand
thatR5iselectedastheBDR.R1isfullyadjacentwithtwoneighbors:R4andR5.
OSPFBehaviorinNBMAHubandSpokeTopology
SpecialissuesmayarisewhentryingtointerconnectmultipleOSPFsitesoveranNBMA
network.Forexample,iftheNBMAtopologyisnotfullymeshed,abroadcastormulticast
thatissentbyonerouterwillnotreachalltheotherrouters.FrameRelayandATMare
twoexamplesofNBMAnetworks.OSPFtreatsNBMAenvironmentslikeanyother
broadcastmediaenvironment,suchasEthernethowever,NBMAcloudsareusuallybuilt
ashubandspoketopologiesusingprivatevirtualcircuits(PVCs)orswitchedvirtual
circuits(SVCs).ThehubandspoketopologyshowninFigure36meansthattheNBMA
networkisonlyapartialmesh.Inthesecases,thephysicaltopologydoesnotprovide
multiaccesscapability,onwhichOSPFrelies.InahubandspokeNBMAenvironment,
youwillneedtohavethehubrouteractingastheDRandspokeroutersactingasthe
DROTHERrouters.Onthespokerouterinterfaces,youwanttoconfigureanOSPFpriority
valueof0sothatthespokeroutersneverparticipateintheDRelection.

Figure36HubandSpokeTopology
Inaddition,OSPFisnotabletoautomaticallydiscoverOSPFneighborsoveranNBMA
networklikeFrameRelay.Neighborsmustbestaticallyconfiguredonatleastonerouter
byusingtheneighborip_addressconfigurationcommandintherouterconfiguration
mode.
Example315showssettingtheOSPFpriorityonR4sandR5sEthernet0/0interfacesto
0usingtheipospfpriorityinterfacecommand.SettingtheOSPFinterfacepriorityto0
preventstherouterfrombeingacandidatefortheDR/BDRrole.
Example315SettingtheOSPFPriorityto0onR4andR5
R4(config)#interfaceethernet0/0
R4(configif)#ipospfpriority0

R5(config)#interfaceethernet0/0
R5(configif)#ipospfpriority0

SettingtheOSPFpriorityvalueto0ontheEthernet0/0interfacesforR4andR5means
thatthesetworouterswillnotparticipateintheDR/BDRelectionandwillnotbeeligibleto
becometheDR/BDR.TheserouterswillbeDROTHERrouters.
ThestateoftheDR/BDRstatusonR1,R4,andR5isshowninExample316.
Example316DR/BDRStatesonR1,R4,andR5
R1#showipospfneighbor

http://www.ciscopress.com/articles/article.asp?p=2294214

12/19

2016.06.13.

OSPFImplementation>EstablishingOSPFNeighborRelationships

NeighborIDPriStateDeadTimeAddressInterface
4.4.4.40FULL/DROTHER00:00:36172.16.145.4Ethernet0/1
5.5.5.50FULL/DROTHER00:00:34172.16.145.5Ethernet0/1
2.2.2.21FULL/DR00:01:33172.16.12.2Serial2/0
3.3.3.31FULL/DR00:00:30172.16.13.2Ethernet0/0

R4#showipospfneighbor
NeighborIDPriStateDeadTimeAddressInterface
1.1.1.1100FULL/DR00:00:37172.16.145.1Ethernet0/0
5.5.5.502WAY/DROTHER00:00:37172.16.145.5Ethernet0/0

R5#showipospfneighbor
NeighborIDPriStateDeadTimeAddressInterface
1.1.1.1100FULL/DR00:00:32172.16.145.1Ethernet0/0
4.4.4.402WAY/DROTHER00:00:37172.16.145.4Ethernet0/0

TheoutputoftheshowipospfneighborcommandsonR1showsthatR1isfullyadjacent
withR4andR5andthatR4andR5haveDROTHERfunctions.R4isfullyadjacentwith
theDRrouterR1,butitmaintainsa2WaystatewithitspeerDROTHERrouterR5.
Similarly,R5isfullyadjacentwithDRR1andmaintainsa2Waystatewiththe
DROTHERrouterR4.A2WaystatebetweennonDR/BDRroutersonthesegmentis
normalbehaviortheydonotsynchronizeLSDBsdirectly,butoverDR/BDR.By
maintaining2Waystate,DROTHERrouterskeepotherDROTHERpeersinformedabout
theirpresenceonthenetwork.
TheImportanceofMTU
TheIPMTUparameterdeterminesthemaximumsizeofanIPv4packetthatcanbe
forwardedouttheinterfacewithoutfragmentation.IfapacketwithanIPv4MTUlarger
thanthemaximumarrivesattherouterinterface,itwillbeeitherdiscarded,iftheDFbitin
thepacketheaderisset,oritwillbefragmented.OSPFforIPv4packetscompletelyrelies
onIPv4forthepossiblefragmentation.AlthoughRFC2328doesnotrecommendOSPF
packetfragmentation,insomesituationsthesizeoftheOSPFpackethasgreatervalue
thantheinterfaceIPv4MTU.IfMTUsaremismatchedbetweentwoneighbors,thiscould
introduceissueswithexchangeoflinkstatepackets,resultingincontinuous
retransmissions.
NOTE
TheinterfacecommandforsettingtheIPv6MTUparameterisipv6mtu.AnIPv6
routerdoesnotfragmentanIPv6packetunlessitisthesourceofthepacket.
Topreventsuchissues,OSPFrequiresthatthesameIPv4MTUbeconfiguredonboth
sidesofthelink.IfneighborshaveamismatchedIPv4MTUconfigured,theywillnotbe
abletoformfullOSPFadjacency.TheywillbestuckintheExStartadjacencystate.
InExample317,theIPv4MTUsizeontheR3Ethernet0/0interfaceischangedto1400.
Example317ConfigurationoftheIPv4MTUonR3sEthernet0/0Interface
R3(config)#interfaceethernet0/0
R3(configif)#ipmtu1400

AftertheIPv4MTUsizeischangedonR3sEthernet0/0interface,thiscreatesa
mismatchbetweenIPv4MTUsizesonthelinkbetweenR3andR1.Thismismatchwill
resultinR3andR1notbeingabletosynchronizetheirOSPFdatabases,andanewfull
adjacencybetweenthemwillnotbeestablished.ThisisobservedinExample318using
thedebugipospfadjcommandonR3.TheOSPFprocessisclearedtoresetadjacency,
anddebugisdisabledwhentheOSPFsessionisreestablished.
Example318ObservingaMismatchedMTU
R3#debugipospfadj
R3#clearipospfprocess
ResetALLOSPFprocesses?[no]:yes
*Jan1917:37:05.969:OSPF3ADJEt0/0:InterfacegoingUp
*Jan1917:37:05.969:OSPF3ADJEt0/0:2WayCommunicationto1.1.1.1,state2WAY
*Jan1917:37:05.969:OSPF3ADJEt0/0:BackupseeneventbeforeWAITtimer
*Jan1917:37:05.969:OSPF3ADJEt0/0:DR/BDRelection
*Jan1917:37:05.969:OSPF3ADJEt0/0:ElectBDR3.3.3.3
*Jan1917:37:05.969:OSPF3ADJEt0/0:ElectDR1.1.1.1
*Jan1917:37:05.969:OSPF3ADJEt0/0:ElectBDR3.3.3.3
*Jan1917:37:05.969:OSPF3ADJEt0/0:ElectDR1.1.1.1
*Jan1917:37:05.969:OSPF3ADJEt0/0:DR:1.1.1.1(Id)BDR:3.3.3.3(Id)
*Jan1917:37:05.970:OSPF3ADJEt0/0:Nbr1.1.1.1:Preparedbaseexchange
*Jan1917:37:05.970:OSPF3ADJEt0/0:SendDBDto1.1.1.1seq0x21D6opt0x52
flag0x7len32
*Jan1917:37:05.970:OSPF3ADJEt0/0:RcvDBDfrom1.1.1.1seq0x968opt0x52
flag0x7len32mtu1500stateEXSTART
*Jan1917:37:05.970:OSPF3ADJEt0/0:Nbr1.1.1.1haslargerinterfaceMTU
*Jan1917:37:05.970:OSPF3ADJEt0/0:RcvDBDfrom1.1.1.1seq0x21D6opt0x52
flag0x2len112mtu1500stateEXSTART
*Jan1917:37:05.970:OSPF3ADJEt0/0:Nbr1.1.1.1haslargerinterfaceMTU
R1#nodebugipospfadj

http://www.ciscopress.com/articles/article.asp?p=2294214

13/19

2016.06.13.

OSPFImplementation>EstablishingOSPFNeighborRelationships

TheDBDpacketcarriesinformationaboutlargestnonfragmentedpacketthatcanbesent
fromtheneighbor.Inthissituation,theIPv4MTUvaluesondifferentsidesofthelinkare
notequal.R3willreceivetheDBDpacketwithanIPv4MTUsizeof1500,whichisgreater
thanitsownMTUsizeof1400.ThiswillresultintheinabilityofbothR3andR1to
establishfullneighboradjacency,andtheoutputofthedebugcommandwilldisplaythat
NbrhasalargerinterfaceMTUmessage.MismatchedneighborswillstayinExStartstate.
ToformfullOSPFadjacency,theIPv4MTUneedstomatchonbothsidesofthelink.
NOTE
Bydefault,theIPv6MTUmustalsomatchbetweenOSPFv3neighbors.However,
youcanoverridethisbyusingtheospfv3mtuignoreinterfacecommand.
InExample319,theOSPFneighborstateisverifiedonR3andR1.
Example319VerifyingtheOSPFNeighborStates
R3#showipospfneighbor
NeighborIDPriStateDeadTimeAddressInterface
1.1.1.11EXSTART/BDR00:00:38172.16.13.1Ethernet0/0

R1#showipospfneighbor
NeighborIDPriStateDeadTimeAddressInterface
4.4.4.40FULL/DROTHER00:00:39172.16.145.4Ethernet0/1
5.5.5.50FULL/DROTHER00:00:38172.16.145.5Ethernet0/1
2.2.2.21FULL/DR00:01:55172.16.12.2Serial2/0
3.3.3.31EXCHANGE/DR00:00:36172.16.13.2Ethernet0/0
R1#showipospfneighbor
NeighborIDPriStateDeadTimeAddressInterface
4.4.4.40FULL/DROTHER00:00:38172.16.145.4Ethernet0/1
5.5.5.50FULL/DROTHER00:00:31172.16.145.5Ethernet0/1
2.2.2.21FULL/DR00:01:31172.16.12.2Serial2/0
3.3.3.31INIT/DROTHER00:00:33172.16.13.2Ethernet0/0

MismatchinginterfaceIPv4MTUsizesonoppositesidesoftheOSPFlinkresultsinthe
inabilitytoformfulladjacency.R3,whichdetectedthatR1hashigherMTU,keepsthe
neighboradjacencyinExStartstate.R1continuestoretransmitinitialBDBpackettoR3,
butR3cannotacknowledgethembecauseoftheunequalIPv4MTU.OnR1,youcan
observehowtheOSPFneighborrelationshipstatewithR3isunstable.Adjacencygetsto
theExchangestate,butisthenterminated,startingagainfromtheInitstateuptothe
Exchangestate.
TherecommendedwaytosolvesuchissuesistomakesurethattheIPv4MTUmatches
betweenOSPFneighbors.
ManipulatingOSPFTimers
SimilartoEIGRP,OSPFusestwotimerstocheckneighborreachability:thehelloand
deadintervals.ThevaluesofhelloanddeadintervalsarecarriedinOSPFHellopackets
andserveasakeepalivemessage,withthepurposeofacknowledgingthepresenceof
therouteronthesegment.ThehellointervalspecifiesthefrequencyofsendingOSPF
Hellopacketsinseconds.TheOSPFdeadtimerspecifieshowlongarouterwaitsto
receiveaHellopacketbeforeitdeclaresaneighborrouterasdown.
OSPFrequiresthatbothhelloanddeadtimersbeidenticalforallroutersonthesegment
tobecomeOSPFneighbors.ThedefaultvalueoftheOSPFhellotimeronmultiaccess
broadcastandpointtopointlinksis10seconds,andis30secondsonallothernetwork
types,includingNBMA.Whenyouconfigurethehellointerval,thedefaultvalueofthe
deadintervalisautomaticallyadjustedtofourtimesthehellointerval.Forbroadcastand
pointtopointlinks,itis40seconds,andforallotherOSPFnetworktypes,itis120
seconds.
Todetectfastertopologicalchanges,youcanlowerthevalueofOSPFhellointerval,with
thedownsideofhavingmoreroutingtrafficonthelink.Thedebugipospfhellocommand
enablesyoutoinvestigatehellotimermismatch.
InExample320,R1,thedifferenthello/deadtimervaluesonEthernet0/1,andFrame
RelaySerial2/0interfacesareobservedusingtheshowipospfinterfacecommand.
Example320ExaminingtheHello/DeadTimersonR1Interfaces
R1#showipospfinterfaceethernet0/1
Ethernet0/1isup,lineprotocolisup
InternetAddress172.16.145.1/29,Area0,AttachedviaNetworkStatement
ProcessID1,RouterID1.1.1.1,NetworkTypeBROADCAST,Cost:10
TopologyMTIDCostDisabledShutdownTopologyName
010nonoBase
TransmitDelayis1sec,StateDROTHER,Priority1
DesignatedRouter(ID)5.5.5.5,Interfaceaddress172.16.145.5
BackupDesignatedrouter(ID)4.4.4.4,Interfaceaddress172.16.145.4
Timerintervalsconfigured,Hello10,Dead40,Wait40,Retransmit5
<Outputomitted>
R1#showipospfinterfaceserial2/0
Serial2/0isup,lineprotocolisup
InternetAddress172.16.12.1/30,Area1,AttachedviaNetworkStatement
ProcessID1,RouterID1.1.1.1,NetworkTypeNON_BROADCAST,Cost:64

http://www.ciscopress.com/articles/article.asp?p=2294214

14/19

2016.06.13.

OSPFImplementation>EstablishingOSPFNeighborRelationships

TopologyMTIDCostDisabledShutdownTopologyName
064nonoBase
TransmitDelayis1sec,StateBDR,Priority1
DesignatedRouter(ID)2.2.2.2,Interfaceaddress172.16.12.2
BackupDesignatedrouter(ID)1.1.1.1,Interfaceaddress172.16.12.1
Timerintervalsconfigured,Hello30,Dead120,Wait120,Retransmit5
<Outputomitted>

ThedefaultvalueoftheOSPFhellointervalonbroadcastmultiaccess(Ethernet)and
pointtopointlinksis10seconds,andthedefaultvalueofthedeadintervalisfourtimes
hello(40seconds).DefaultvaluesoftheOSPFhelloanddeadtimersonallotherOSPF
networktypes,includingnonbroadcast(NBMA)likeFrameRelayontheSerial2/0
interface,are30secondsand120seconds,respectively.
Onlowspeedlinks,youmightwanttoalterdefaultOSPFtimervaluestoachievefaster
convergence.ThenegativeaspectofloweringtheOSPFhellointervalistheoverheadof
morefrequentroutingupdatescausinghigherrouterutilizationandmoretrafficonthe
link.
InExample321,thedefaultOSPFhelloanddeadintervalsonR1sFrameRelaySerial
2/0interfacearemodified.YoucanchangetheOSPFbyusingtheipospfhellointerval
andipospfdeadintervalinterfacecommands.
Example321ModifyingtheHelloandDeadIntervalsonR1sSerialInterface
R1(config)#interfaceserial2/0
R1(configif)#ipospfhellointerval8
R1(configif)#ipospfdeadinterval30
*Jan2013:17:34.441:%OSPF5ADJCHG:Process1,Nbr2.2.2.2onSerial2/0from
FULLtoDOWN,NeighborDown:Deadtimerexpired

OncethedefaultOSPFhelloanddeadintervalvaluesontheFrameRelaylinkare
changed,bothrouterswilldetecthellotimermismatch.Asaresult,thedeadtimerwillnot
berefreshed,soitwillexpire,declaringtheOSPFneighborrelationshipasdown.
NOTE
WhenyouarechangingonlytheOSPFhellointerval,OSPFautomaticallychanges
thedeadintervaltofourtimesthehellointerval.
InExample322,R2sdefaultOSPFhelloanddeadtimersontheFrameRelaySerial0/0
interfacearechangedsothattheymatchrespectivevaluesconfiguredonR1.
Example322ModifyingtheHelloandDeadIntervalsonR2sSerialInterface
R2(config)#interfaceserial0/0
R2(configif)#ipospfhellointerval8
R2(configif)#ipospfdeadinterval30
*Jan2013:38:58.976:%OSPF5ADJCHG:Process2,Nbr1.1.1.1onSerial0/0
LOADINGtoFULL,LoadingDone

WhenyouarechangingOSPFhelloanddeadtimersonR2sothattheymatchthetimers
onR1,bothroutersonthelinkwillbeabletoestablishadjacencyandelecttheDR/BDR
ontheNBMAsegment.RouterswillthenexchangeandsynchronizeLSDBsandformfull
neighboradjacency.
OnR2,theOSPFneighborstateisverifiedbyusingtheshowipospfneighbordetail
command,asdemonstratedinExample323.
Example323VerifyingtheOSPFNeighborStatesonR2
R2#showipospfneighbordetail
Neighbor1.1.1.1,interfaceaddress172.16.12.1
Inthearea1viainterfaceSerial0/0
Neighborpriorityis1,StateisFULL,6statechanges
DRis172.16.12.2BDRis172.16.12.1
Pollinterval120
Optionsis0x12inHello(Ebit,Lbit)
Optionsis0x52inDBD(Ebit,Lbit,Obit)
LLSOptionsis0x1(LR)
Deadtimerduein00:00:26
Neighborisupfor00:14:57
Index1/1,retransmissionqueuelength0,numberofretransmission0
First0x0(0)/0x0(0)Next0x0(0)/0x0(0)
Lastretransmissionscanlengthis0,maximumis0
Lastretransmissionscantimeis0msec,maximumis0msec

TheoutputoftheshowipospfneighbordetailcommandconfirmsthatfullOSPF
adjacencywithR1isestablished.Theoutputalsoshowsadditionalinformationabout
neighborrouterID,DR/BDRroles,andhowlongtheneighborsessionhasbeen
established.

OSPFNeighborRelationshipoverPointtoPointLinks
Figure37showsapointtopointnetworkjoiningasinglepairofrouters.AT1serialline
thatisconfiguredwithadatalinklayerprotocolsuchasPPPorHighLevelDataLink

http://www.ciscopress.com/articles/article.asp?p=2294214

15/19

2016.06.13.

OSPFImplementation>EstablishingOSPFNeighborRelationships

Control(HDLC)isanexampleofapointtopointnetwork.

Figure37PointtoPointlink
Onthesetypesofnetworks,therouterdynamicallydetectsitsneighboringroutersby
multicastingitsHellopacketstoallOSPFrouters,usingthe224.0.0.5address.Onpoint
topointnetworks,neighboringroutersbecomeadjacentwhenevertheycan
communicatedirectly.NoDRorBDRelectionisperformedtherecanbeonlytworouters
onapointtopointlink,sothereisnoneedforaDRorBDR.
ThedefaultOSPFhelloanddeadtimersonpointtopointlinksare10secondsand40
seconds,respectively.

OSPFNeighborRelationshipoverLayer3MPLSVPN
Figure38showsaLayer3MPLSVPNarchitecture,wheretheISPprovidesapeerto
peerVPNarchitecture.Inthisarchitecture,provideredge(PE)routersparticipatein
customerrouting,guaranteeingoptimumroutingbetweencustomersites.Therefore,the
PErouterscarryaseparatesetofroutesforeachcustomer,resultinginperfectisolation
betweencustomers.

Figure38Layer3MPLSVPN
ThefollowingappliestoLayer3MPLSVPNtechnology,evenwhenrunningOSPFasa
provideredgecustomeredge(PECE)routingprotocol:
ThecustomerroutersshouldnotbeawareofMPLSVPNtheyshouldrun
standardIProutingsoftware.
ThecoreroutersintheprovidernetworkbetweenthetwoPEroutersareknownas
theProuters(notshowninthediagram).TheProutersdonotcarrycustomerVPN
routesfortheMPLSVPNsolutiontobescalable.
ThePEroutersmustsupportMPLSVPNservicesandtraditionalInternetservices.
ToOSPF,theLayer3MPLSVPNbackbonelookslikeastandardcorporatebackbone
thatrunsstandardIProutingsoftware.Routingupdatesareexchangedbetweenthe
customerroutersandthePEroutersthatappearasnormalroutersinthecustomer
network.OSPFisenabledonproperinterfacesbyusingthenetworkcommand.The
standarddesignrulesthatareusedforenterpriseLayer3MPLSVPNbackbonescanbe
appliedtothedesignofthecustomernetwork.Theserviceproviderroutersarehidden
fromthecustomerview,andCEroutersareunawareofMPLSVPN.Therefore,the
internaltopologyoftheLayer3MPLSbackboneistotallytransparenttothecustomer.
ThePEroutersreceiveIPv4routingupdatesfromtheCEroutersandinstalltheminthe
appropriatevirtualroutingandforwarding(VRF)table.Thispartoftheconfiguration,and
operation,istheresponsibilityofaserviceprovider.
ThePECEcanhaveanyOSPFnetworktype:pointtopoint,broadcast,oreven
nonbroadcastmultiaccess.
TheonlydifferencebetweenaPECEdesignandaregularOSPFdesignisthatthe
customerhastoagreewiththeserviceproviderabouttheOSPFparameters(areaID,
authenticationpassword,andsoon)usually,theseparametersaregovernedbythe
serviceprovider.

OSPFNeighborRelationshipoverLayer2MPLSVPN
Figure39showsaLayer2MPLSVPN.TheMPLSbackboneoftheserviceprovideris
usedtoenableLayer2EthernetconnectivitybetweenthecustomerroutersR1andR2,
whetheranEthernetoverMPLS(EoMPLS)orLayer2MPLSVPNEthernetserviceis
used.

Figure39Layer2MPLSVPN
R1andR2thusexchangeEthernetframes.PErouterPE1takestheEthernetframesthat
arereceivedfromR1onthelinktoPE1,encapsulatesthemintoMPLSpackets,and
forwardsthemacrossthebackbonetorouterPE2.PE2decapsulatestheMPLSpackets
andreproducestheEthernetframesonthelinktowardR2.EoMPLSandLayer2MPLS
VPNtypicallydonotparticipateinShortestTreeProtocol(STP)andbridgeprotocoldata
unit(BPDU)exchanges,soEoMPLSandLayer2MPLSVPNsaretransparenttothe
customerrouters.

http://www.ciscopress.com/articles/article.asp?p=2294214

16/19

2016.06.13.

OSPFImplementation>EstablishingOSPFNeighborRelationships

TheEthernetframesaretransparentlyexchangedacrosstheMPLSbackbone.Keepin
mindthatcustomerrouterscanbeconnectedeitherinaporttoportfashion,inwhichPE
routerstakewhateverEthernetframeisreceivedandforwardtheframesacrosstheLayer
2MPLSVPNbackbone,orinaVLANsubinterfacefashioninwhichframesfora
particularVLANidentifiedwithsubinterfaceinconfigurationareencapsulatedand
sentacrosstheLayer2MPLSVPNbackbone.
WhendeployingOSPFoverEoMPLS,therearenochangestotheexistingOSPF
configurationfromthecustomerperspective.
OSPFneedstobeenabled,andnetworkcommandsmustincludetheinterfacesthatare
requiredbytherelevantOSPFareatostarttheOSPFproperly.
R1andR2formaneighborrelationshipwitheachotherovertheLayer2MPLSVPN
backbone.FromanOSPFperspective,theLayer2MPLSVPNbackbone,PE1,andPE2
areallinvisible.
AneighborrelationshipisestablishedbetweenR1andR2directly,anditbehavesinthe
samewayasonaregularEthernetbroadcastnetwork.

OSPFNeighborStates
OSPFneighborsgothroughmultipleneighborstatesbeforeformingfullOSPFadjacency,
asillustratedinFigure310.

Figure310OSPFStates
Thefollowingisabriefsummaryofthestatesthataninterfacepassesthroughbefore
becomingadjacenttoanotherrouter:
Down:Noinformationhasbeenreceivedonthesegment.
Init:TheinterfacehasdetectedaHellopacketcomingfromaneighbor,but
bidirectionalcommunicationhasnotyetbeenestablished.
2Way:Thereisbidirectionalcommunicationwithaneighbor.Therouterhasseen
itselfintheHellopacketscomingfromaneighbor.Attheendofthisstage,theDR
andBDRelectionwouldhavebeendoneifnecessary.Whenroutersareinthe2
Waystate,theymustdecidewhethertoproceedinbuildinganadjacency.The
decisionisbasedonwhetheroneoftheroutersisaDRorBDRorthelinkisa
pointtopointoravirtuallink.
ExStart:Routersaretryingtoestablishtheinitialsequencenumberthatisgoing
tobeusedintheinformationexchangepackets.Thesequencenumberensures
thatroutersalwaysgetthemostrecentinformation.Onerouterwillbecomethe
masterandtheotherwillbecometheslave.Theprimaryrouterwillpollthe
secondaryforinformation.
Exchange:RouterswilldescribetheirentireLSDBbysendingdatabase
description(DBD)packets.ADBDincludesinformationabouttheLSAentry
headerthatappearsintheroutersLSDB.Theentriescanbeaboutalinkorabout
anetwork.EachLSAentryheaderincludesinformationaboutthelinkstatetype,
theaddressoftheadvertisingrouter,thelinkscost,andthesequencenumber.
Therouterusesthesequencenumbertodeterminethenewnessofthereceived
linkstateinformation.
Loading:Inthisstate,routersarefinalizingtheinformationexchange.Routers
havebuiltalinkstaterequestlistandalinkstateretransmissionlist.Any
informationthatlooksincompleteoroutdatedwillbeputontherequestlist.Any
updatethatissentwillbeputontheretransmissionlistuntilitgetsacknowledged.

http://www.ciscopress.com/articles/article.asp?p=2294214

17/19

2016.06.13.

OSPFImplementation>EstablishingOSPFNeighborRelationships

Full:Inthisstate,adjacencyiscomplete.Theneighboringroutersarefully
adjacent.AdjacentrouterswillhavesimilarLSDBs.

OSPFNetworkTypes
OSPFdefinesdistincttypesofnetworksbasedontheirphysicallinktypes,asshownin
Table31.OSPFoperationoneachtypeisdifferent,includinghowadjacenciesare
establishedandwhichconfigurationisrequired.
Table31OSPFNetworkTypes

OSPFNetwork
Type

Uses
DefaultHello
DR/BDR Interval(sec)

Dynamic
Neighbor
Discovery

MorethanTwoRouters
AllowedinSubnet

Pointtopoint

No

10

Yes

No

Broadcast

Yes

10

Yes

Yes

Nonbroadcast

Yes

30

No

Yes

Pointtomultipoint No
nonbroadcast

30

No

Yes

Looback

No

No

ThesearethemostcommonnetworktypesthataredefinedbyOSPF:
Pointtopoint:Routersusemulticasttodynamicallydiscoverneighbors.Thereis
noDR/BDRelectionbecauseonlytworouterscanbeconnectedonasingle
pointtopointsegment.ItisadefaultOSPFnetworktypeforseriallinksandpoint
topointFrameRelaysubinterfaces.
Broadcast:Multicastisusedtodynamicallydiscoverneighbors.TheDRand
BDRareelectedtooptimizetheexchangeofinformation.ItisadefaultOSPF
networktypeforEthernetlinks.
Nonbroadcast:Usedonnetworksthatinterconnectmorethantworoutersbut
withoutbroadcastcapability.FrameRelayandATMareexamplesofNBMA
networks.Neighborsmustbestaticallyconfigured,followedbyDR/BDRelection.
Thisnetworktypeisthedefaultforallphysicalinterfacesandmultipoint
subinterfacesusingFrameRelayencapsulation.
Pointtomultipoint:OSPFtreatsthisnetworktypeasalogicalcollectionofpoint
topointlinkseventhoughallinterfacesbelongtothecommonIPsubnet.Every
interfaceIPaddresswillappearintheroutingtableoftheneighborsasahost/32
route.Neighborsarediscovereddynamicallyusingmulticast.NoDR/BDR
electionoccurs.
Pointtomultipointnonbroadcast:Ciscoextensionthathasthesame
characteristicsaspointtomultipointtypeexceptforthefactthatneighborsarenot
discovereddynamically.Neighborsmustbestaticallydefined,andunicastisused
forcommunication.Canbeusefulinpointtomultipointscenarioswheremulticast
andbroadcastarenotsupported.
Loopback:Defaultnetworktypeonloopbackinterfaces.
YoucanchangeOSPFnetworktypebyusingtheinterfaceconfigurationmodecommand
ipospfnetworknetwork_type.

ConfiguringPassiveInterfaces
Passiveinterfaceconfigurationisacommonmethodforhardeningroutingprotocolsand
reducingtheuseofresources.ThepassiveinterfaceissupportedbyOSPF,andasample
configurationisshowninExample324.
Example324PassiveInterfaceConfigurationforOSPF
Router(config)#routerospf1
Router(configif)#passiveinterfacedefault
Router(configif)#nopassiveinterfaceserial1/0

WhenyouconfigureapassiveinterfaceundertheOSPFprocess,therouterstops
sendingandreceivingOSPFHellopacketsontheselectedinterface.Thepassive
interfaceshouldbeusedonlyoninterfaceswheretherouterisnotexpectedtoformany
OSPFneighboradjacency.Aspecificinterfacecanbeconfiguredaspassive,orpassive
interfacecanbeconfiguredasthedefault.Ifthedefaultoptionisused,anyinterfacesthat
needtoformaneighboradjacencymustbeexemptedwiththenopassiveinterface
configurationcommand.
2.BuildingtheLinkStateDatabase|Next
Section

http://www.ciscopress.com/articles/article.asp?p=2294214

18/19

2016.06.13.
About

Affiliates

OSPFImplementation>EstablishingOSPFNeighborRelationships
CiscoSystems,Inc.

ContactUs

FAQ

Jobs

LegalNotice

PrivacyPolicy

SiteHelp

SiteMap

WriteforUs

2016PearsonEducation,CiscoPress.Allrightsreserved.
800East96thStreet,Indianapolis,Indiana46240

http://www.ciscopress.com/articles/article.asp?p=2294214

19/19

S-ar putea să vă placă și