Sie sind auf Seite 1von 188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

NetworkWorkingGroupJ.Moy
RequestforComments:2328AscendCommunications,Inc.
STD:54April1998
Obsoletes:2178
Category:StandardsTrack
OSPFVersion2
StatusofthisMemo
ThisdocumentspecifiesanInternetstandardstrackprotocolforthe
Internetcommunity,andrequestsdiscussionandsuggestionsfor
improvements.Pleaserefertothecurrenteditionofthe"Internet
OfficialProtocolStandards"(STD1)forthestandardizationstate
andstatusofthisprotocol.Distributionofthismemois
unlimited.
CopyrightNotice
Copyright(C)TheInternetSociety(1998).AllRightsReserved.
Abstract
Thismemodocumentsversion2oftheOSPFprotocol.OSPFisa
linkstateroutingprotocol.Itisdesignedtoberuninternaltoa
singleAutonomousSystem.EachOSPFroutermaintainsanidentical
databasedescribingtheAutonomousSystem'stopology.Fromthis
database,aroutingtableiscalculatedbyconstructingashortest
pathtree.
OSPFrecalculatesroutesquicklyinthefaceoftopologicalchanges,
utilizingaminimumofroutingprotocoltraffic.OSPFprovides
supportforequalcostmultipath.Anarearoutingcapabilityis
provided,enablinganadditionallevelofroutingprotectionanda
reductioninroutingprotocoltraffic.Inaddition,allOSPF
routingprotocolexchangesareauthenticated.
ThedifferencesbetweenthismemoandRFC2178areexplainedin
AppendixG.Alldifferencesarebackwardcompatibleinnature.

MoyStandardsTrack[Page1]
RFC2328OSPFVersion2April1998
ImplementationsofthismemoandofRFCs2178,1583,and1247will
interoperate.
Pleasesendcommentstoospf@gated.cornell.edu.
TableofContents
1Introduction...........................................6
1.1ProtocolOverview......................................6
1.2Definitionsofcommonlyusedterms.....................8
https://www.ietf.org/rfc/rfc2328.txt

1/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

1.3Briefhistoryoflinkstateroutingtechnology........11
1.4Organizationofthisdocument.........................12
1.5Acknowledgments.......................................12
2Thelinkstatedatabase:organizationandcalculations13
2.1Representationofroutersandnetworks................13
2.1.1Representationofnonbroadcastnetworks..............15
2.1.2Anexamplelinkstatedatabase........................18
2.2Theshortestpathtree................................21
2.3Useofexternalroutinginformation...................23
2.4Equalcostmultipath..................................26
3SplittingtheASintoAreas...........................26
3.1ThebackboneoftheAutonomousSystem.................27
3.2Interarearouting....................................27
3.3Classificationofrouters.............................28
3.4Asampleareaconfiguration...........................29
3.5IPsubnettingsupport.................................35
3.6Supportingstubareas.................................37
3.7Partitionsofareas...................................38
4FunctionalSummary....................................40
4.1Interarearouting....................................41
4.2ASexternalroutes....................................41
4.3Routingprotocolpackets..............................42
4.4Basicimplementationrequirements.....................43
4.5OptionalOSPFcapabilities............................46
5Protocoldatastructures..............................47
6TheAreaDataStructure...............................49
7BringingUpAdjacencies...............................52
7.1TheHelloProtocol....................................52
7.2TheSynchronizationofDatabases......................53
7.3TheDesignatedRouter.................................54
7.4TheBackupDesignatedRouter..........................56
7.5Thegraphofadjacencies..............................56

MoyStandardsTrack[Page2]
RFC2328OSPFVersion2April1998
8ProtocolPacketProcessing............................58
8.1Sendingprotocolpackets..............................58
8.2Receivingprotocolpackets............................61
9TheInterfaceDataStructure..........................63
9.1Interfacestates......................................67
9.2Eventscausinginterfacestatechanges................70
9.3TheInterfacestatemachine...........................72
9.4ElectingtheDesignatedRouter........................75
9.5SendingHellopackets.................................77
9.5.1SendingHellopacketsonNBMAnetworks................79
10TheNeighborDataStructure...........................80
10.1Neighborstates.......................................83
10.2Eventscausingneighborstatechanges.................87
10.3TheNeighborstatemachine............................89
10.4Whethertobecomeadjacent............................95
10.5ReceivingHelloPackets...............................96
10.6ReceivingDatabaseDescriptionPackets................99
10.7ReceivingLinkStateRequestPackets.................102
10.8SendingDatabaseDescriptionPackets.................103
10.9SendingLinkStateRequestPackets...................104
10.10AnExample...........................................105
11TheRoutingTableStructure..........................107
11.1Routingtablelookup.................................111
11.2Sampleroutingtable,withoutareas..................111
11.3Sampleroutingtable,withareas.....................112
https://www.ietf.org/rfc/rfc2328.txt

2/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

12LinkStateAdvertisements(LSAs).....................115
12.1TheLSAHeader.......................................116
12.1.1LSage...............................................116
12.1.2Options..............................................117
12.1.3LStype..............................................117
12.1.4LinkStateID........................................117
12.1.5AdvertisingRouter...................................119
12.1.6LSsequencenumber...................................120
12.1.7LSchecksum..........................................121
12.2Thelinkstatedatabase..............................121
12.3RepresentationofTOS................................122
12.4OriginatingLSAs.....................................123
12.4.1RouterLSAs..........................................126
12.4.1.1Describingpointtopointinterfaces.................130
12.4.1.2DescribingbroadcastandNBMAinterfaces.............130
12.4.1.3Describingvirtuallinks.............................131
12.4.1.4DescribingPointtoMultiPointinterfaces............131

MoyStandardsTrack[Page3]
RFC2328OSPFVersion2April1998
12.4.1.5ExamplesofrouterLSAs..............................132
12.4.2NetworkLSAs.........................................133
12.4.2.1ExamplesofnetworkLSAs.............................134
12.4.3SummaryLSAs.........................................135
12.4.3.1OriginatingsummaryLSAsintostubareas.............137
12.4.3.2ExamplesofsummaryLSAs.............................138
12.4.4ASexternalLSAs.....................................139
12.4.4.1ExamplesofASexternalLSAs.........................140
13TheFloodingProcedure...............................143
13.1DeterminingwhichLSAisnewer.......................146
13.2InstallingLSAsinthedatabase......................147
13.3Nextstepinthefloodingprocedure..................148
13.4ReceivingselforiginatedLSAs.......................151
13.5SendingLinkStateAcknowledgmentpackets............152
13.6RetransmittingLSAs..................................154
13.7Receivinglinkstateacknowledgments.................155
14AgingTheLinkStateDatabase........................156
14.1PrematureagingofLSAs..............................157
15VirtualLinks........................................158
16Calculationoftheroutingtable.....................160
16.1Calculatingtheshortestpathtreeforanarea.......161
16.1.1Thenexthopcalculation.............................167
16.2Calculatingtheinterarearoutes....................178
16.3Examiningtransitareas'summaryLSAs................170
16.4CalculatingASexternalroutes.......................173
16.4.1Externalpathpreferences............................175
16.5IncrementalupdatessummaryLSAs..................175
16.6IncrementalupdatesASexternalLSAs..............177
16.7Eventsgeneratedasaresultofroutingtablechanges177
16.8Equalcostmultipath.................................178
Footnotes............................................179
References...........................................183
AOSPFdataformats....................................185
A.1EncapsulationofOSPFpackets........................185
A.2TheOptionsfield....................................187
A.3OSPFPacketFormats..................................189
A.3.1TheOSPFpacketheader...............................190
A.3.2TheHellopacket.....................................193
A.3.3TheDatabaseDescriptionpacket......................195
A.3.4TheLinkStateRequestpacket........................197
https://www.ietf.org/rfc/rfc2328.txt

3/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

A.3.5TheLinkStateUpdatepacket.........................199
A.3.6TheLinkStateAcknowledgmentpacket.................201

MoyStandardsTrack[Page4]
RFC2328OSPFVersion2April1998
A.4LSAformats..........................................203
A.4.1TheLSAheader.......................................204
A.4.2RouterLSAs..........................................206
A.4.3NetworkLSAs.........................................210
A.4.4SummaryLSAs.........................................212
A.4.5ASexternalLSAs.....................................214
BArchitecturalConstants..............................217
CConfigurableConstants...............................219
C.1Globalparameters....................................219
C.2Areaparameters......................................220
C.3Routerinterfaceparameters..........................221
C.4Virtuallinkparameters..............................224
C.5NBMAnetworkparameters..............................224
C.6PointtoMultiPointnetworkparameters...............225
C.7Hostrouteparameters................................226
DAuthentication.......................................227
D.1Nullauthentication..................................227
D.2Simplepasswordauthentication.......................228
D.3Cryptographicauthentication.........................228
D.4Messagegeneration...................................231
D.4.1GeneratingNullauthentication.......................231
D.4.2GeneratingSimplepasswordauthentication............232
D.4.3GeneratingCryptographicauthentication..............232
D.5Messageverification.................................234
D.5.1VerifyingNullauthentication........................234
D.5.2VerifyingSimplepasswordauthentication.............234
D.5.3VerifyingCryptographicauthentication...............235
EAnalgorithmforassigningLinkStateIDs............236
FMultipleinterfacestothesamenetwork/subnet.......239
GDifferencesfromRFC2178............................240
G.1Floodingmodifications...............................240
G.2Changestoexternalpathpreferences.................241
G.3Incompleteresolutionofvirtualnexthops...........241
G.4Routingtablelookup.................................241
SecurityConsiderations..............................243
Author'sAddress.....................................243
FullCopyrightStatement.............................244

MoyStandardsTrack[Page5]
RFC2328OSPFVersion2April1998
1.Introduction
ThisdocumentisaspecificationoftheOpenShortestPathFirst
(OSPF)TCP/IPinternetroutingprotocol.OSPFisclassifiedasan
InteriorGatewayProtocol(IGP).Thismeansthatitdistributes
https://www.ietf.org/rfc/rfc2328.txt

4/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

routinginformationbetweenroutersbelongingtoasingleAutonomous
System.TheOSPFprotocolisbasedonlinkstateorSPFtechnology.
ThisisadeparturefromtheBellmanFordbaseusedbytraditional
TCP/IPinternetroutingprotocols.
TheOSPFprotocolwasdevelopedbytheOSPFworkinggroupofthe
InternetEngineeringTaskForce.Ithasbeendesignedexpresslyfor
theTCP/IPinternetenvironment,includingexplicitsupportforCIDR
andthetaggingofexternallyderivedroutinginformation.OSPF
alsoprovidesfortheauthenticationofroutingupdates,and
utilizesIPmulticastwhensending/receivingtheupdates.In
addition,muchworkhasbeendonetoproduceaprotocolthat
respondsquicklytotopologychanges,yetinvolvessmallamountsof
routingprotocoltraffic.
1.1.Protocoloverview
OSPFroutesIPpacketsbasedsolelyonthedestinationIP
addressfoundintheIPpacketheader.IPpacketsarerouted
"asis"theyarenotencapsulatedinanyfurtherprotocol
headersastheytransittheAutonomousSystem.OSPFisa
dynamicroutingprotocol.Itquicklydetectstopological
changesintheAS(suchasrouterinterfacefailures)and
calculatesnewloopfreeroutesafteraperiodofconvergence.
Thisperiodofconvergenceisshortandinvolvesaminimumof
routingtraffic.
Inalinkstateroutingprotocol,eachroutermaintainsa
databasedescribingtheAutonomousSystem'stopology.This
databaseisreferredtoasthelinkstatedatabase.Each
participatingrouterhasanidenticaldatabase.Eachindividual
pieceofthisdatabaseisaparticularrouter'slocalstate
(e.g.,therouter'susableinterfacesandreachableneighbors).
TherouterdistributesitslocalstatethroughouttheAutonomous
Systembyflooding.

MoyStandardsTrack[Page6]
RFC2328OSPFVersion2April1998
Allroutersruntheexactsamealgorithm,inparallel.Fromthe
linkstatedatabase,eachrouterconstructsatreeofshortest
pathswithitselfasroot.Thisshortestpathtreegivesthe
routetoeachdestinationintheAutonomousSystem.Externally
derivedroutinginformationappearsonthetreeasleaves.
Whenseveralequalcostroutestoadestinationexist,traffic
isdistributedequallyamongthem.Thecostofarouteis
describedbyasingledimensionlessmetric.
OSPFallowssetsofnetworkstobegroupedtogether.Sucha
groupingiscalledanarea.Thetopologyofanareaishidden
fromtherestoftheAutonomousSystem.Thisinformationhiding
enablesasignificantreductioninroutingtraffic.Also,
routingwithintheareaisdeterminedonlybythearea'sown
topology,lendingtheareaprotectionfrombadroutingdata.An
areaisageneralizationofanIPsubnettednetwork.
OSPFenablestheflexibleconfigurationofIPsubnets.Each
routedistributedbyOSPFhasadestinationandmask.Two
https://www.ietf.org/rfc/rfc2328.txt

5/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

differentsubnetsofthesameIPnetworknumbermayhave
differentsizes(i.e.,differentmasks).Thisiscommonly
referredtoasvariablelengthsubnetting.Apacketisrouted
tothebest(i.e.,longestormostspecific)match.Hostroutes
areconsideredtobesubnetswhosemasksare"allones"
(0xffffffff).
AllOSPFprotocolexchangesareauthenticated.Thismeansthat
onlytrustedrouterscanparticipateintheAutonomousSystem's
routing.Avarietyofauthenticationschemescanbeused;in
fact,separateauthenticationschemescanbeconfiguredforeach
IPsubnet.
Externallyderivedroutingdata(e.g.,routeslearnedfroman
ExteriorGatewayProtocolsuchasBGP;see[Ref23])is
advertisedthroughouttheAutonomousSystem.Thisexternally
deriveddataiskeptseparatefromtheOSPFprotocol'slink
statedata.Eachexternalroutecanalsobetaggedbythe
advertisingrouter,enablingthepassingofadditional
informationbetweenroutersontheboundaryoftheAutonomous
System.

MoyStandardsTrack[Page7]
RFC2328OSPFVersion2April1998
1.2.Definitionsofcommonlyusedterms
Thissectionprovidesdefinitionsfortermsthathaveaspecific
meaningtotheOSPFprotocolandthatareusedthroughoutthe
text.ThereaderunfamiliarwiththeInternetProtocolSuiteis
referredto[Ref13]foranintroductiontoIP.
Router
AlevelthreeInternetProtocolpacketswitch.Formerly
calledagatewayinmuchoftheIPliterature.
AutonomousSystem
Agroupofroutersexchangingroutinginformationviaa
commonroutingprotocol.AbbreviatedasAS.
InteriorGatewayProtocol
Theroutingprotocolspokenbytheroutersbelongingtoan
Autonomoussystem.AbbreviatedasIGP.EachAutonomous
SystemhasasingleIGP.SeparateAutonomousSystemsmaybe
runningdifferentIGPs.
RouterID
A32bitnumberassignedtoeachrouterrunningtheOSPF
protocol.Thisnumberuniquelyidentifiestherouterwithin
anAutonomousSystem.
Network
Inthismemo,anIPnetwork/subnet/supernet.Itispossible
foronephysicalnetworktobeassignedmultipleIP
network/subnetnumbers.Weconsiderthesetobeseparate
networks.Pointtopointphysicalnetworksareanexception
theyareconsideredasinglenetworknomatterhowmany
(ifanyatall)IPnetwork/subnetnumbersareassignedto
them.
https://www.ietf.org/rfc/rfc2328.txt

6/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Networkmask
A32bitnumberindicatingtherangeofIPaddresses
residingonasingleIPnetwork/subnet/supernet.This
specificationdisplaysnetworkmasksashexadecimalnumbers.

MoyStandardsTrack[Page8]
RFC2328OSPFVersion2April1998
Forexample,thenetworkmaskforaclassCIPnetworkis
displayedas0xffffff00.Suchamaskisoftendisplayed
elsewhereintheliteratureas255.255.255.0.
Pointtopointnetworks
Anetworkthatjoinsasinglepairofrouters.A56Kb
seriallineisanexampleofapointtopointnetwork.
Broadcastnetworks
Networkssupportingmany(morethantwo)attachedrouters,
togetherwiththecapabilitytoaddressasinglephysical
messagetoalloftheattachedrouters(broadcast).
Neighboringroutersarediscovereddynamicallyonthesenets
usingOSPF'sHelloProtocol.TheHelloProtocolitself
takesadvantageofthebroadcastcapability.TheOSPF
protocolmakesfurtheruseofmulticastcapabilities,if
theyexist.Eachpairofroutersonabroadcastnetworkis
assumedtobeabletocommunicatedirectly.Anethernetis
anexampleofabroadcastnetwork.
Nonbroadcastnetworks
Networkssupportingmany(morethantwo)routers,buthaving
nobroadcastcapability.Neighboringroutersaremaintained
onthesenetsusingOSPF'sHelloProtocol.However,dueto
thelackofbroadcastcapability,someconfiguration
informationmaybenecessarytoaidinthediscoveryof
neighbors.Onnonbroadcastnetworks,OSPFprotocolpackets
thatarenormallymulticastneedtobesenttoeach
neighboringrouter,inturn.AnX.25PublicDataNetwork
(PDN)isanexampleofanonbroadcastnetwork.
OSPFrunsinoneoftwomodesovernonbroadcastnetworks.
Thefirstmode,callednonbroadcastmultiaccessorNBMA,
simulatestheoperationofOSPFonabroadcastnetwork.The
secondmode,calledPointtoMultiPoint,treatsthenon
broadcastnetworkasacollectionofpointtopointlinks.
NonbroadcastnetworksarereferredtoasNBMAnetworksor
PointtoMultiPointnetworks,dependingonOSPF'smodeof
operationoverthenetwork.

MoyStandardsTrack[Page9]
RFC2328OSPFVersion2April1998

https://www.ietf.org/rfc/rfc2328.txt

7/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Interface
Theconnectionbetweenarouterandoneofitsattached
networks.Aninterfacehasstateinformationassociated
withit,whichisobtainedfromtheunderlyinglowerlevel
protocolsandtheroutingprotocolitself.Aninterfaceto
anetworkhasassociatedwithitasingleIPaddressand
mask(unlessthenetworkisanunnumberedpointtopoint
network).Aninterfaceissometimesalsoreferredtoasa
link.
Neighboringrouters
Tworoutersthathaveinterfacestoacommonnetwork.
Neighborrelationshipsaremaintainedby,andusually
dynamicallydiscoveredby,OSPF'sHelloProtocol.
Adjacency
Arelationshipformedbetweenselectedneighboringrouters
forthepurposeofexchangingroutinginformation.Not
everypairofneighboringroutersbecomeadjacent.
Linkstateadvertisement
Unitofdatadescribingthelocalstateofarouteror
network.Forarouter,thisincludesthestateofthe
router'sinterfacesandadjacencies.Eachlinkstate
advertisementisfloodedthroughouttheroutingdomain.The
collectedlinkstateadvertisementsofallroutersand
networksformstheprotocol'slinkstatedatabase.
Throughoutthismemo,linkstateadvertisementis
abbreviatedasLSA.
HelloProtocol
ThepartoftheOSPFprotocolusedtoestablishandmaintain
neighborrelationships.OnbroadcastnetworkstheHello
Protocolcanalsodynamicallydiscoverneighboringrouters.
Flooding
ThepartoftheOSPFprotocolthatdistributesand
synchronizesthelinkstatedatabasebetweenOSPFrouters.
DesignatedRouter
EachbroadcastandNBMAnetworkthathasatleasttwo
attachedroutershasaDesignatedRouter.TheDesignated

MoyStandardsTrack[Page10]
RFC2328OSPFVersion2April1998
RoutergeneratesanLSAforthenetworkandhasother
specialresponsibilitiesintherunningoftheprotocol.
TheDesignatedRouteriselectedbytheHelloProtocol.
TheDesignatedRouterconceptenablesareductioninthe
numberofadjacenciesrequiredonabroadcastorNBMA
network.Thisinturnreducestheamountofrouting
protocoltrafficandthesizeofthelinkstatedatabase.
Lowerlevelprotocols
Theunderlyingnetworkaccessprotocolsthatprovide
servicestotheInternetProtocolandinturntheOSPF
protocol.ExamplesofthesearetheX.25packetandframe
levelsforX.25PDNs,andtheethernetdatalinklayerfor
ethernets.
https://www.ietf.org/rfc/rfc2328.txt

8/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

1.3.Briefhistoryoflinkstateroutingtechnology
OSPFisalinkstateroutingprotocol.Suchprotocolsarealso
referredtointheliteratureasSPFbasedordistributed
databaseprotocols.Thissectiongivesabriefdescriptionof
thedevelopmentsinlinkstatetechnologythathaveinfluenced
theOSPFprotocol.
Thefirstlinkstateroutingprotocolwasdevelopedforusein
theARPANETpacketswitchingnetwork.Thisprotocolis
describedin[Ref3].Ithasformedthestartingpointforall
otherlinkstateprotocols.ThehomogeneousARPANET
environment,i.e.,singlevendorpacketswitchesconnectedby
synchronousseriallines,simplifiedthedesignand
implementationoftheoriginalprotocol.
Modificationstothisprotocolwereproposedin[Ref4].These
modificationsdealtwithincreasingthefaulttoleranceofthe
routingprotocolthrough,amongotherthings,addingachecksum
totheLSAs(therebydetectingdatabasecorruption).Thepaper
alsoincludedmeansforreducingtheroutingtrafficoverheadin
alinkstateprotocol.Thiswasaccomplishedbyintroducing
mechanismswhichenabledtheintervalbetweenLSAoriginations
tobeincreasedbyanorderofmagnitude.

MoyStandardsTrack[Page11]
RFC2328OSPFVersion2April1998
AlinkstatealgorithmhasalsobeenproposedforuseasanISO
ISISroutingprotocol.Thisprotocolisdescribedin[Ref2].
Theprotocolincludesmethodsfordataandroutingtraffic
reductionwhenoperatingoverbroadcastnetworks.Thisis
accomplishedbyelectionofaDesignatedRouterforeach
broadcastnetwork,whichthenoriginatesanLSAforthenetwork.
TheOSPFWorkingGroupoftheIETFhasextendedthisworkin
developingtheOSPFprotocol.TheDesignatedRouterconcepthas
beengreatlyenhancedtofurtherreducetheamountofrouting
trafficrequired.Multicastcapabilitiesareutilizedfor
additionalroutingbandwidthreduction.Anarearoutingscheme
hasbeendevelopedenablinginformation
hiding/protection/reduction.Finally,thealgorithmshavebeen
tailoredforefficientoperationinTCP/IPinternets.
1.4.Organizationofthisdocument
Thefirstthreesectionsofthisspecificationgiveageneral
overviewoftheprotocol'scapabilitiesandfunctions.Sections
416explaintheprotocol'smechanismsindetail.Packet
formats,protocolconstantsandconfigurationitemsare
specifiedintheappendices.
LabelssuchasHelloIntervalencounteredinthetextreferto
protocolconstants.Theymayormaynotbeconfigurable.
ArchitecturalconstantsaresummarizedinAppendixB.
ConfigurableconstantsaresummarizedinAppendixC.
https://www.ietf.org/rfc/rfc2328.txt

9/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Thedetailedspecificationoftheprotocolispresentedinterms
ofdatastructures.Thisisdoneinordertomakethe
explanationmoreprecise.Implementationsoftheprotocolare
requiredtosupportthefunctionalitydescribed,butneednot
usetheprecisedatastructuresthatappearinthismemo.
1.5.Acknowledgments
TheauthorwouldliketothankRanAtkinson,FredBaker,Jeffrey
Burgan,RobColtun,DinoFarinacci,VinceFuller,Phanindra
Jujjavarapu,MiloMedin,TomPusateri,KannanVaradhan,Zhaohui

MoyStandardsTrack[Page12]
RFC2328OSPFVersion2April1998
ZhangandtherestoftheOSPFWorkingGroupfortheideasand
supporttheyhavegiventothisproject.
TheOSPFPointtoMultiPointinterfaceisbasedonworkdoneby
FredBaker.
TheOSPFCryptographicAuthenticationoptionwasdevelopedby
FredBakerandRanAtkinson.
2.TheLinkstateDatabase:organizationandcalculations
ThefollowingsubsectionsdescribetheorganizationofOSPF'slink
statedatabase,andtheroutingcalculationsthatareperformedon
thedatabaseinordertoproducearouter'sroutingtable.
2.1.Representationofroutersandnetworks
TheAutonomousSystem'slinkstatedatabasedescribesadirected
graph.Theverticesofthegraphconsistofroutersand
networks.Agraphedgeconnectstworouterswhentheyare
attachedviaaphysicalpointtopointnetwork.Anedge
connectingaroutertoanetworkindicatesthattherouterhas
aninterfaceonthenetwork.Networkscanbeeithertransitor
stubnetworks.Transitnetworksarethosecapableofcarrying
datatrafficthatisneitherlocallyoriginatednorlocally
destined.Atransitnetworkisrepresentedbyagraphvertex
havingbothincomingandoutgoingedges.Astubnetwork'svertex
hasonlyincomingedges.
Theneighborhoodofeachnetworknodeinthegraphdependson
thenetwork'stype(pointtopoint,broadcast,NBMAorPoint
toMultiPoint)andthenumberofroutershavinganinterfaceto
thenetwork.ThreecasesaredepictedinFigure1a.Rectangles
indicaterouters.Circlesandoblongsindicatenetworks.
RouternamesareprefixedwiththelettersRTandnetworknames
withtheletterN.Routerinterfacenamesareprefixedbythe
letterI.Linesbetweenroutersindicatepointtopoint
networks.Theleftsideofthefigureshowsnetworkswiththeir
connectedrouters,withtheresultinggraphsshownontheright.

https://www.ietf.org/rfc/rfc2328.txt

10/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page13]
RFC2328OSPFVersion2April1998

**FROM**
*|RT1|RT2|
++Ia++*
|RT1||RT2|TRT1||X|
++Ib++ORT2|X||
*Ia||X|
*Ib|X||
Physicalpointtopointnetworks
**FROM**
++*
|RT7|*|RT7|N3|
++T
|ORT7|||
++*N3|X||
N3*
Stubnetworks
**FROM**
++++
|RT3||RT4||RT3|RT4|RT5|RT6|N2|
++++*
|N2|*RT3|||||X|
++TRT4|||||X|
||ORT5|||||X|
++++*RT6|||||X|
|RT5||RT6|*N2|X|X|X|X||
++++
BroadcastorNBMAnetworks

Figure1a:Networkmapcomponents

MoyStandardsTrack[Page14]
RFC2328OSPFVersion2April1998
Networksandroutersarerepresentedbyvertices.
AnedgeconnectsVertexAtoVertexBiffthe
intersectionofColumnAandRowBismarkedwith
anX.

ThetopofFigure1ashowstworoutersconnectedbyapointto
pointlink.Intheresultinglinkstatedatabasegraph,thetwo
routerverticesaredirectlyconnectedbyapairofedges,one
https://www.ietf.org/rfc/rfc2328.txt

11/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

ineachdirection.Interfacestopointtopointnetworksneed
notbeassignedIPaddresses.Wheninterfaceaddressesare
assigned,theyaremodelledasstublinks,witheachrouter
advertisingastubconnectiontotheotherrouter'sinterface
address.Optionally,anIPsubnetcanbeassignedtothepoint
topointnetwork.Inthiscase,bothroutersadvertiseastub
linktotheIPsubnet,insteadofadvertisingeachothers'IP
interfaceaddresses.
ThemiddleofFigure1ashowsanetworkwithonlyoneattached
router(i.e.,astubnetwork).Inthiscase,thenetworkappears
ontheendofastubconnectioninthelinkstatedatabase's
graph.
Whenmultipleroutersareattachedtoabroadcastnetwork,the
linkstatedatabasegraphshowsallroutersbidirectionally
connectedtothenetworkvertex.Thisispicturedatthebottom
ofFigure1a.
Eachnetwork(stubortransit)inthegraphhasanIPaddress
andassociatednetworkmask.Themaskindicatesthenumberof
nodesonthenetwork.Hostsattacheddirectlytorouters
(referredtoashostroutes)appearonthegraphasstub
networks.Thenetworkmaskforahostrouteisalways
0xffffffff,whichindicatesthepresenceofasinglenode.
2.1.1.Representationofnonbroadcastnetworks
Asmentionedpreviously,OSPFcanrunovernonbroadcast
networksinoneoftwomodes:NBMAorPointtoMultiPoint.
ThechoiceofmodedeterminesthewaythattheHello

MoyStandardsTrack[Page15]
RFC2328OSPFVersion2April1998
protocolandfloodingworkoverthenonbroadcastnetwork,
andthewaythatthenetworkisrepresentedinthelink
statedatabase.
InNBMAmode,OSPFemulatesoperationoverabroadcast
network:aDesignatedRouteriselectedfortheNBMA
network,andtheDesignatedRouteroriginatesanLSAforthe
network.Thegraphrepresentationforbroadcastnetworksand
NBMAnetworksisidentical.Thisrepresentationispictured
inthemiddleofFigure1a.
NBMAmodeisthemostefficientwaytorunOSPFovernon
broadcastnetworks,bothintermsoflinkstatedatabase
sizeandintermsoftheamountofroutingprotocoltraffic.
However,ithasonesignificantrestriction:itrequiresall
routersattachedtotheNBMAnetworktobeableto
communicatedirectly.Thisrestrictionmaybemetonsome
nonbroadcastnetworks,suchasanATMsubnetutilizing
SVCs.Butitisoftennotmetonothernonbroadcast
networks,suchasPVConlyFrameRelaynetworks.Onnon
broadcastnetworkswherenotallrouterscancommunicate
directlyyoucanbreakthenonbroadcastnetworkinto
logicalsubnets,withtheroutersoneachsubnetbeingable
tocommunicatedirectly,andthenruneachseparatesubnet
asanNBMAnetwork(see[Ref15]).Thishoweverrequires
https://www.ietf.org/rfc/rfc2328.txt

12/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

quiteabitofadministrativeoverhead,andisproneto
misconfiguration.Itisprobablybettertorunsuchanon
broadcastnetworkinPointtoMultipointmode.
InPointtoMultiPointmode,OSPFtreatsallrouterto
routerconnectionsoverthenonbroadcastnetworkasifthey
werepointtopointlinks.NoDesignatedRouteriselected
forthenetwork,noristhereanLSAgeneratedforthe
network.Infact,avertexforthePointtoMultiPoint
networkdoesnotappearinthegraphofthelinkstate
database.
Figure1billustratesthelinkstatedatabaserepresentation
ofaPointtoMultiPointnetwork.Ontheleftsideofthe
figure,aPointtoMultiPointnetworkispictured.Itis
assumedthatallrouterscancommunicatedirectly,except
forroutersRT4andRT5.I3thoughI6indicatetherouters'

MoyStandardsTrack[Page16]
RFC2328OSPFVersion2April1998
IPinterfaceaddressesonthePointtoMultiPointnetwork.
Inthegraphicalrepresentationofthelinkstatedatabase,
routersthatcancommunicatedirectlyoverthePointto
MultiPointnetworkarejoinedbybidirectionaledges,and
eachrouteralsohasastubconnectiontoitsownIP
interfaceaddress(whichisincontrasttothe
representationofrealpointtopointlinks;seeFigure1a).
Onsomenonbroadcastnetworks,useofPointtoMultiPoint
modeanddatalinkprotocolssuchasInverseARP(see
[Ref14])willallowautodiscoveryofOSPFneighborseven
thoughbroadcastsupportisnotavailable.

**FROM**
++++
|RT3||RT4||RT3|RT4|RT5|RT6|
++++*
I3|N2|I4*RT3||X|X|X|
++TRT4|X|||X|
I5||I6ORT5|X|||X|
++++*RT6|X|X|X||
|RT5||RT6|*I3|X||||
++++I4||X|||
I5|||X||
I6||||X|

Figure1b:Networkmapcomponents
PointtoMultiPointnetworks
AllrouterscancommunicatedirectlyoverN2,except
routersRT4andRT5.I3throughI6indicateIP
interfaceaddresses
https://www.ietf.org/rfc/rfc2328.txt

13/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page17]
RFC2328OSPFVersion2April1998
2.1.2.Anexamplelinkstatedatabase
Figure2showsasamplemapofanAutonomousSystem.The
rectanglelabelledH1indicatesahost,whichhasaSLIP
connectiontoRouterRT12.RouterRT12istherefore
advertisingahostroute.Linesbetweenroutersindicate
physicalpointtopointnetworks.Theonlypointtopoint
networkthathasbeenassignedinterfaceaddressesisthe
onejoiningRoutersRT6andRT10.RoutersRT5andRT7have
BGPconnectionstootherAutonomousSystems.AsetofBGP
learnedrouteshavebeendisplayedforbothofthese
routers.
Acostisassociatedwiththeoutputsideofeachrouter
interface.Thiscostisconfigurablebythesystem
administrator.Thelowerthecost,themorelikelythe
interfaceistobeusedtoforwarddatatraffic.Costsare
alsoassociatedwiththeexternallyderivedroutingdata
(e.g.,theBGPlearnedroutes).
ThedirectedgraphresultingfromthemapinFigure2is
depictedinFigure3.Arcsarelabelledwiththecostof
thecorrespondingrouteroutputinterface.Arcshavingno
labelledcosthaveacostof0.Notethatarcsleadingfrom
networkstoroutersalwayshavecost0;theyaresignificant
nonetheless.Notealsothattheexternallyderivedrouting
dataappearsonthegraphasstubs.
ThelinkstatedatabaseispiecedtogetherfromLSAs
generatedbytherouters.Intheassociatedgraphical
representation,theneighborhoodofeachrouterortransit
networkisrepresentedinasingle,separateLSA.Figure4
showstheseLSAsgraphically.RouterRT12hasaninterface
totwobroadcastnetworksandaSLIPlinetoahost.
NetworkN6isabroadcastnetworkwiththreeattached
routers.ThecostofalllinksfromNetworkN6toits
attachedroutersis0.NotethattheLSAforNetworkN6is
actuallygeneratedbyoneofthenetwork'sattachedrouters:
therouterthathasbeenelectedDesignatedRouterforthe
network.

MoyStandardsTrack[Page18]
RFC2328OSPFVersion2April1998

+
|3++N12N14
N1||RT1|\1\N13/
|++\8\|8/8
https://www.ietf.org/rfc/rfc2328.txt

14/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

+\____\|/
/\1++88++6
*N3*|RT4||RT5|+
\____/++++|
+/||7|
|3++/|||
N2||RT2|/1|1|6|
|++++86++|
+|RT3||RT6||
++++|
|2Ia|7|
|||
++||
N4||
||
||
N11||
++||
|||N12
|3||62/
++|++/
|RT9|||RT7|N15
++|++9
|1+||1
_|__|Ib|5__|_
/\1++2|3++1/\
*N9*|RT11|||RT10|*N6*
\____/++|++\____/
|||
|1+|1
++10++N8++
|H1||RT12||RT8|
++SLIP++++
|2|4
||
++++
N10N7

MoyStandardsTrack[Page19]
RFC2328OSPFVersion2April1998
Figure2:AsampleAutonomousSystem
**FROM**
|RT|RT|RT|RT|RT|RT|RT|RT|RT|RT|RT|RT|
|1|2|3|4|5|6|7|8|9|10|11|12|N3|N6|N8|N9|

RT1|||||||||||||0||||
RT2|||||||||||||0||||
RT3||||||6|||||||0||||
RT4|||||8||||||||0||||
RT5||||8||6|6||||||||||
RT6|||8||7|||||5|||||||
RT7|||||6|||||||||0|||
*RT8||||||||||||||0|||
*RT9||||||||||||||||0|
TRT10||||||7||||||||0|0||
ORT11|||||||||||||||0|0|
*RT12||||||||||||||||0|
*N1|3||||||||||||||||
https://www.ietf.org/rfc/rfc2328.txt

15/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

N2||3|||||||||||||||
N3|1|1|1|1|||||||||||||
N4|||2||||||||||||||
N6|||||||1|1||1|||||||
N7||||||||4|||||||||
N8||||||||||3|2||||||
N9|||||||||1||1|1|||||
N10||||||||||||2|||||
N11|||||||||3||||||||
N12|||||8||2||||||||||
N13|||||8||||||||||||
N14|||||8||||||||||||
N15|||||||9||||||||||
H1||||||||||||10|||||
Figure3:Theresultingdirectedgraph
Networksandroutersarerepresentedbyvertices.
AnedgeofcostXconnectsVertexAtoVertexBiff
theintersectionofColumnAandRowBismarked
withanX.

MoyStandardsTrack[Page20]
RFC2328OSPFVersion2April1998
**FROM****FROM**
|RT12|N9|N10|H1||RT9|RT11|RT12|N9|
**
*RT12|||||*RT9||||0|
TN9|1||||TRT11||||0|
ON10|2||||ORT12||||0|
*H1|10||||*N9|||||
**
RT12'srouterLSAN9'snetworkLSA
Figure4:Individuallinkstatecomponents
Networksandroutersarerepresentedbyvertices.
AnedgeofcostXconnectsVertexAtoVertexBiff
theintersectionofColumnAandRowBismarked
withanX.
2.2.Theshortestpathtree
WhennoOSPFareasareconfigured,eachrouterintheAutonomous
Systemhasanidenticallinkstatedatabase,leadingtoan
identicalgraphicalrepresentation.Aroutergeneratesits
routingtablefromthisgraphbycalculatingatreeofshortest
pathswiththerouteritselfasroot.Obviously,theshortest
pathtreedependsontherouterdoingthecalculation.The
shortestpathtreeforRouterRT6inourexampleisdepictedin
Figure5.
Thetreegivestheentirepathtoanydestinationnetworkor
host.However,onlythenexthoptothedestinationisusedin
theforwardingprocess.Notealsothatthebestroutetoany
routerhasalsobeencalculated.Fortheprocessingofexternal
data,wenotethenexthopanddistancetoanyrouter
advertisingexternalroutes.Theresultingroutingtablefor
https://www.ietf.org/rfc/rfc2328.txt

16/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

RouterRT6ispicturedinTable2.Notethatthereisa
separaterouteforeachendofanumberedpointtopointnetwork
(inthiscase,theseriallinebetweenRoutersRT6andRT10).
RoutestonetworksbelongingtootherAS'es(suchasN12)appear
asdashedlinesontheshortestpathtreeinFigure5.Useof

MoyStandardsTrack[Page21]
RFC2328OSPFVersion2April1998

RT6(origin)
RT5oooIb
/|\6|\7
8/8|8\|\
/|\6|\
o|o|\7
N12oN14|\
N132|\
N4ooRT3\
/\5
1/RT10ooIa
/|\
RT4ooN33|\1
/||\N6RT7
/|N8ooo
/|||/|
RT2ooRT1||2/|9
/|||RT8/|
/3|3RT11oooo
/|||N12N15
N2ooN11||4
||
N9ooN7
/|
/|
N11RT9/|RT12
oooooH1
3|10
|2
|
oN10
Figure5:TheSPFtreeforRouterRT6
Edgesthatarenotmarkedwithacosthaveacostof
ofzero(thesearenetworktorouterlinks).Routes
tonetworksN12N15areexternalinformationthatis
consideredinSection2.3

MoyStandardsTrack[Page22]
RFC2328OSPFVersion2April1998

https://www.ietf.org/rfc/rfc2328.txt

17/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

DestinationNextHopDistance
__________________________________
N1RT310
N2RT310
N3RT37
N4RT38
Ib*7
IaRT1012
N6RT108
N7RT1012
N8RT1010
N9RT1011
N10RT1013
N11RT1014
H1RT1021
__________________________________
RT5RT56
RT7RT108
Table2:TheportionofRouterRT6'sroutingtablelistinglocal
destinations.
thisexternallyderivedroutinginformationisconsideredinthe
nextsection.
2.3.Useofexternalroutinginformation
Afterthetreeiscreatedtheexternalroutinginformationis
examined.Thisexternalroutinginformationmayoriginatefrom
anotherroutingprotocolsuchasBGP,orbestatically
configured(staticroutes).Defaultroutescanalsobeincluded
aspartoftheAutonomousSystem'sexternalroutinginformation.
Externalroutinginformationisfloodedunalteredthroughoutthe
AS.Inourexample,alltheroutersintheAutonomousSystem
knowthatRouterRT7hastwoexternalroutes,withmetrics2and
9.
OSPFsupportstwotypesofexternalmetrics.Type1external
metricsareexpressedinthesameunitsasOSPFinterfacecost

MoyStandardsTrack[Page23]
RFC2328OSPFVersion2April1998
(i.e.,intermsofthelinkstatemetric).Type2external
metricsareanorderofmagnitudelarger;anyType2metricis
consideredgreaterthanthecostofanypathinternaltotheAS.
UseofType2externalmetricsassumesthatroutingbetween
AS'esisthemajorcostofroutingapacket,andeliminatesthe
needforconversionofexternalcoststointernallinkstate
metrics.
AsanexampleofType1externalmetricprocessing,supposethat
theRoutersRT7andRT5inFigure2areadvertisingType1
externalmetrics.Foreachadvertisedexternalroute,thetotal
costfromRouterRT6iscalculatedasthesumoftheexternal
route'sadvertisedcostandthedistancefromRouterRT6tothe
advertisingrouter.Whentworoutersareadvertisingthesame
externaldestination,RT6pickstheadvertisingrouterproviding
https://www.ietf.org/rfc/rfc2328.txt

18/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

theminimumtotalcost.RT6thensetsthenexthoptothe
externaldestinationequaltothenexthopthatwouldbeused
whenroutingpacketstothechosenadvertisingrouter.
InFigure2,bothRouterRT5andRT7areadvertisinganexternal
routetodestinationNetworkN12.RouterRT7ispreferredsince
itisadvertisingN12atadistanceof10(8+2)toRouterRT6,
whichisbetterthanRouterRT5's14(6+8).Table3showsthe
entriesthatareaddedtotheroutingtablewhenexternalroutes
areexamined:

DestinationNextHopDistance
__________________________________
N12RT1010
N13RT514
N14RT514
N15RT1017
Table3:TheportionofRouterRT6'sroutingtable
listingexternaldestinations.
ProcessingofType2externalmetricsissimpler.TheAS
boundaryrouteradvertisingthesmallestexternalmetricis

MoyStandardsTrack[Page24]
RFC2328OSPFVersion2April1998
chosen,regardlessoftheinternaldistancetotheASboundary
router.SupposeinourexamplebothRouterRT5andRouterRT7
wereadvertisingType2externalroutes.Thenalltraffic
destinedforNetworkN12wouldbeforwardedtoRouterRT7,since
2<8.WhenseveralequalcostType2routesexist,the
internaldistancetotheadvertisingroutersisusedtobreak
thetie.
BothType1andType2externalmetricscanbepresentintheAS
atthesametime.Inthatevent,Type1externalmetricsalways
takeprecedence.
Thissectionhasassumedthatpacketsdestinedforexternal
destinationsarealwaysroutedthroughtheadvertisingAS
boundaryrouter.Thisisnotalwaysdesirable.Forexample,
supposeinFigure2thereisanadditionalrouterattachedto
NetworkN6,calledRouterRTX.SupposefurtherthatRTXdoes
notparticipateinOSPFrouting,butdoesexchangeBGP
informationwiththeASboundaryrouterRT7.Then,RouterRT7
wouldendupadvertisingOSPFexternalroutesforall
destinationsthatshouldberoutedtoRTX.Anextrahopwill
sometimesbeintroducedifpacketsforthesedestinationsneed
alwaysberoutedfirsttoRouterRT7(theadvertisingrouter).
Todealwiththissituation,theOSPFprotocolallowsanAS
boundaryroutertospecifya"forwardingaddress"initsAS
externalLSAs.Intheaboveexample,RouterRT7wouldspecify
RTX'sIPaddressasthe"forwardingaddress"forallthose
destinationswhosepacketsshouldberouteddirectlytoRTX.
https://www.ietf.org/rfc/rfc2328.txt

19/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

The"forwardingaddress"hasoneotherapplication.Itenables
routersintheAutonomousSystem'sinteriortofunctionas
"routeservers".Forexample,inFigure2therouterRT6could
becomearouteserver,gainingexternalroutinginformation
throughacombinationofstaticconfigurationandexternal
routingprotocols.RT6wouldthenstartadvertisingitselfas
anASboundaryrouter,andwouldoriginateacollectionofOSPF
ASexternalLSAs.IneachASexternalLSA,RouterRT6would
specifythecorrectAutonomousSystemexitpointtouseforthe
destinationthroughappropriatesettingoftheLSA's"forwarding
address"field.

MoyStandardsTrack[Page25]
RFC2328OSPFVersion2April1998
2.4.Equalcostmultipath
Theabovediscussionhasbeensimplifiedbyconsideringonlya
singleroutetoanydestination.Inreality,ifmultiple
equalcostroutestoadestinationexist,theyareall
discoveredandused.Thisrequiresnoconceptualchangestothe
algorithm,anditsdiscussionispostponeduntilweconsiderthe
treebuildingprocessinmoredetail.
Withequalcostmultipath,arouterpotentiallyhasseveral
availablenexthopstowardsanygivendestination.
3.SplittingtheASintoAreas
OSPFallowscollectionsofcontiguousnetworksandhoststobe
groupedtogether.Suchagroup,togetherwiththeroutershaving
interfacestoanyoneoftheincludednetworks,iscalledanarea.
Eacharearunsaseparatecopyofthebasiclinkstaterouting
algorithm.Thismeansthateachareahasitsownlinkstate
databaseandcorrespondinggraph,asexplainedintheprevious
section.
Thetopologyofanareaisinvisiblefromtheoutsideofthearea.
Conversely,routersinternaltoagivenareaknownothingofthe
detailedtopologyexternaltothearea.Thisisolationofknowledge
enablestheprotocoltoeffectamarkedreductioninroutingtraffic
ascomparedtotreatingtheentireAutonomousSystemasasingle
linkstatedomain.
Withtheintroductionofareas,itisnolongertruethatall
routersintheAShaveanidenticallinkstatedatabase.Arouter
actuallyhasaseparatelinkstatedatabaseforeachareaitis
connectedto.(Routersconnectedtomultipleareasarecalledarea
borderrouters).Tworoutersbelongingtothesameareahave,for
thatarea,identicalarealinkstatedatabases.
RoutingintheAutonomousSystemtakesplaceontwolevels,
dependingonwhetherthesourceanddestinationofapacketreside
inthesamearea(intraarearoutingisused)ordifferentareas
(interarearoutingisused).Inintraarearouting,thepacketis
routedsolelyoninformationobtainedwithinthearea;norouting

https://www.ietf.org/rfc/rfc2328.txt

20/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page26]
RFC2328OSPFVersion2April1998
informationobtainedfromoutsidetheareacanbeused.This
protectsintraarearoutingfromtheinjectionofbadrouting
information.WediscussinterarearoutinginSection3.2.
3.1.ThebackboneoftheAutonomousSystem
TheOSPFbackboneisthespecialOSPFArea0(oftenwrittenas
Area0.0.0.0,sinceOSPFAreaID'saretypicallyformattedasIP
addresses).TheOSPFbackbonealwayscontainsallareaborder
routers.Thebackboneisresponsiblefordistributingrouting
informationbetweennonbackboneareas.Thebackbonemustbe
contiguous.However,itneednotbephysicallycontiguous;
backboneconnectivitycanbeestablished/maintainedthroughthe
configurationofvirtuallinks.
Virtuallinkscanbeconfiguredbetweenanytwobackbonerouters
thathaveaninterfacetoacommonnonbackbonearea.Virtual
linksbelongtothebackbone.Theprotocoltreatstworouters
joinedbyavirtuallinkasiftheywereconnectedbyan
unnumberedpointtopointbackbonenetwork.Onthegraphofthe
backbone,twosuchroutersarejoinedbyarcswhosecostsare
theintraareadistancesbetweenthetworouters.Therouting
protocoltrafficthatflowsalongthevirtuallinkusesintra
arearoutingonly.
3.2.Interarearouting
Whenroutingapacketbetweentwononbackboneareasthe
backboneisused.Thepaththatthepacketwilltravelcanbe
brokenupintothreecontiguouspieces:anintraareapathfrom
thesourcetoanareaborderrouter,abackbonepathbetweenthe
sourceanddestinationareas,andthenanotherintraareapath
tothedestination.Thealgorithmfindsthesetofsuchpaths
thathavethesmallestcost.
Lookingatthisanotherway,interarearoutingcanbepictured
asforcingastarconfigurationontheAutonomousSystem,with
thebackboneashubandeachofthenonbackboneareasas
spokes.

MoyStandardsTrack[Page27]
RFC2328OSPFVersion2April1998
Thetopologyofthebackbonedictatesthebackbonepathsused
betweenareas.Thetopologyofthebackbonecanbeenhancedby
addingvirtuallinks.Thisgivesthesystemadministratorsome
controlovertheroutestakenbyinterareatraffic.
Thecorrectareaborderroutertouseasthepacketexitsthe
sourceareaischoseninexactlythesamewayrouters
advertisingexternalroutesarechosen.Eachareaborderrouter
inanareasummarizesfortheareaitscosttoallnetworks
externaltothearea.AftertheSPFtreeiscalculatedforthe
https://www.ietf.org/rfc/rfc2328.txt

21/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

area,routestoallinterareadestinationsarecalculatedby
examiningthesummariesoftheareaborderrouters.
3.3.Classificationofrouters
Beforetheintroductionofareas,theonlyOSPFroutershavinga
specializedfunctionwerethoseadvertisingexternalrouting
information,suchasRouterRT5inFigure2.WhentheASis
splitintoOSPFareas,theroutersarefurtherdividedaccording
tofunctionintothefollowingfouroverlappingcategories:
Internalrouters
Arouterwithalldirectlyconnectednetworksbelongingto
thesamearea.Theseroutersrunasinglecopyofthebasic
routingalgorithm.
Areaborderrouters
Arouterthatattachestomultipleareas.Areaborder
routersrunmultiplecopiesofthebasicalgorithm,onecopy
foreachattachedarea.Areaborderrouterscondensethe
topologicalinformationoftheirattachedareasfor
distributiontothebackbone.Thebackboneinturn
distributestheinformationtotheotherareas.
Backbonerouters
Arouterthathasaninterfacetothebackbonearea.This
includesallroutersthatinterfacetomorethanonearea
(i.e.,areaborderrouters).However,backboneroutersdo
nothavetobeareaborderrouters.Routerswithall
interfacesconnectingtothebackboneareaaresupported.

MoyStandardsTrack[Page28]
RFC2328OSPFVersion2April1998
ASboundaryrouters
Arouterthatexchangesroutinginformationwithrouters
belongingtootherAutonomousSystems.Sucharouter
advertisesASexternalroutinginformationthroughoutthe
AutonomousSystem.ThepathstoeachASboundaryrouterare
knownbyeveryrouterintheAS.Thisclassificationis
completelyindependentofthepreviousclassifications:AS
boundaryroutersmaybeinternalorareaborderrouters,and
mayormaynotparticipateinthebackbone.
3.4.Asampleareaconfiguration
Figure6showsasampleareaconfiguration.Thefirstarea
consistsofnetworksN1N4,alongwiththeirattachedrouters
RT1RT4.ThesecondareaconsistsofnetworksN6N8,alongwith
theirattachedroutersRT7,RT8,RT10andRT11.Thethirdarea
consistsofnetworksN9N11andHostH1,alongwiththeir
attachedroutersRT9,RT11andRT12.Thethirdareahasbeen
configuredsothatnetworksN9N11andHostH1willallbe
groupedintoasingleroute,whenadvertisedexternaltothe
area(seeSection3.5formoredetails).
InFigure6,RoutersRT1,RT2,RT5,RT6,RT8,RT9andRT12are
internalrouters.RoutersRT3,RT4,RT7,RT10andRT11arearea
https://www.ietf.org/rfc/rfc2328.txt

22/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

borderrouters.Finally,asbefore,RoutersRT5andRT7areAS
boundaryrouters.
Figure7showstheresultinglinkstatedatabasefortheArea1.
Thefigurecompletelydescribesthatarea'sintraarearouting.
Italsoshowsthecompleteviewoftheinternetforthetwo
internalroutersRT1andRT2.Itisthejoboftheareaborder
routers,RT3andRT4,toadvertiseintoArea1thedistancesto
alldestinationsexternaltothearea.Theseareindicatedin
Figure7bythedashedstubroutes.Also,RT3andRT4must
advertiseintoArea1thelocationoftheASboundaryrouters
RT5andRT7.Finally,ASexternalLSAsfromRT5andRT7are
floodedthroughouttheentireAS,andinparticularthroughout
Area1.TheseLSAsareincludedinArea1'sdatabase,andyield
routestoNetworksN12N15.
RoutersRT3andRT4mustalsosummarizeArea1'stopologyfor

MoyStandardsTrack[Page29]
RFC2328OSPFVersion2April1998

...........................
.+.
.|3++.N12N14
.N1||RT1|\1.\N13/
.|++\.8\|8/8
.+\____.\|/
./\1++88++6
.*N3*|RT4||RT5|+
.\____/++++|
.+/\.|7|
.|3++/\.||
.N2||RT2|/11\.|6|
.|++++86++|
.+|RT3||RT6||
.++++|
.2/.Ia|7|
./.||
.++.||
.Area1N4.||
...........................||
..........................||
.N11.||
.++.||
.|.||N12
.|3.Ib|5|62/
.++.++++/
.|RT9|..........|RT10|.....|RT7|N15.
.++..++++9.
.|1..+/31\|1.
._|__..|/\__|_.
./\1++2|/\/\.
.*N9*|RT11||*N6*.
.\____/++|\____/.
.|..||.
.|1..+|1.
.++10++..N8++.
.|H1||RT12|..|RT8|.
.++SLIP++..++.
.|2..|4.
https://www.ietf.org/rfc/rfc2328.txt

23/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

.|..|.
.++..++.

MoyStandardsTrack[Page30]
RFC2328OSPFVersion2April1998
.N10..N7.
...Area2.
.Area3.................................
..........................
Figure6:AsampleOSPFareaconfiguration
distributiontothebackbone.TheirbackboneLSAsareshownin
Table4.Thesesummariesshowwhichnetworksarecontainedin
Area1(i.e.,NetworksN1N4),andthedistancetothese
networksfromtheroutersRT3andRT4respectively.
ThelinkstatedatabaseforthebackboneisshowninFigure8.
Thesetofrouterspicturedarethebackbonerouters.Router
RT11isabackbonerouterbecauseitbelongstotwoareas.In
ordertomakethebackboneconnected,avirtuallinkhasbeen
configuredbetweenRoutersR10andR11.
TheareaborderroutersRT3,RT4,RT7,RT10andRT11condense
theroutinginformationoftheirattachednonbackboneareasfor
distributionviathebackbone;thesearethedashedstubsthat
appearinFigure8.Rememberthatthethirdareahasbeen
configuredtocondenseNetworksN9N11andHostH1intoasingle
route.ThisyieldsasingledashedlinefornetworksN9N11and
HostH1inFigure8.RoutersRT5andRT7areASboundary
routers;theirexternallyderivedinformationalsoappearson
thegraphinFigure8asstubs.

NetworkRT3adv.RT4adv.
_____________________________
N144
N244
N311
N423
Table4:Networksadvertisedtothebackbone
byRoutersRT3andRT4.

MoyStandardsTrack[Page31]
RFC2328OSPFVersion2April1998

**FROM**
|RT|RT|RT|RT|RT|RT|
|1|2|3|4|5|7|N3|
https://www.ietf.org/rfc/rfc2328.txt

24/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

RT1|||||||0|
RT2|||||||0|
RT3|||||||0|
*RT4|||||||0|
*RT5|||14|8||||
TRT7|||20|14||||
ON1|3|||||||
*N2||3||||||
*N3|1|1|1|1||||
N4|||2|||||
Ia,Ib|||20|27||||
N6|||16|15||||
N7|||20|19||||
N8|||18|18||||
N9N11,H1|||29|36||||
N12|||||8|2||
N13|||||8|||
N14|||||8|||
N15||||||9||
Figure7:Area1'sDatabase.
Networksandroutersarerepresentedbyvertices.
AnedgeofcostXconnectsVertexAtoVertexBiff
theintersectionofColumnAandRowBismarked
withanX.

MoyStandardsTrack[Page32]
RFC2328OSPFVersion2April1998
**FROM**
|RT|RT|RT|RT|RT|RT|RT
|3|4|5|6|7|10|11|

RT3||||6||||
RT4|||8|||||
RT5||8||6|6|||
RT6|8||7|||5||
RT7|||6|||||
*RT10||||7|||2|
*RT11||||||3||
TN1|4|4||||||
ON2|4|4||||||
*N3|1|1||||||
*N4|2|3||||||
Ia||||||5||
Ib||||7||||
N6|||||1|1|3|
N7|||||5|5|7|
https://www.ietf.org/rfc/rfc2328.txt

25/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

N8|||||4|3|2|
N9N11,H1|||||||11|
N12|||8||2|||
N13|||8|||||
N14|||8|||||
N15|||||9|||
Figure8:Thebackbone'sdatabase.
Networksandroutersarerepresentedbyvertices.
AnedgeofcostXconnectsVertexAtoVertexBiff
theintersectionofColumnAandRowBismarked
withanX.
Thebackboneenablestheexchangeofsummaryinformationbetween
areaborderrouters.Everyareaborderrouterhearsthearea
summariesfromallotherareaborderrouters.Itthenformsa
pictureofthedistancetoallnetworksoutsideofitsareaby
examiningthecollectedLSAs,andaddinginthebackbone
distancetoeachadvertisingrouter.

MoyStandardsTrack[Page33]
RFC2328OSPFVersion2April1998
AgainusingRoutersRT3andRT4asanexample,theprocedure
goesasfollows:TheyfirstcalculatetheSPFtreeforthe
backbone.Thisgivesthedistancestoallotherareaborder
routers.Alsonotedarethedistancestonetworks(IaandIb)
andASboundaryrouters(RT5andRT7)thatbelongtothe
backbone.ThiscalculationisshowninTable5.
Next,bylookingattheareasummariesfromtheseareaborder
routers,RT3andRT4candeterminethedistancetoallnetworks
outsidetheirarea.Thesedistancesarethenadvertised
internallytotheareabyRT3andRT4.Theadvertisementsthat
RouterRT3andRT4willmakeintoArea1areshowninTable6.
NotethatTable6assumesthatanarearangehasbeenconfigured
forthebackbonewhichgroupsIaandIbintoasingleLSA.
TheinformationimportedintoArea1byRoutersRT3andRT4
enablesaninternalrouter,suchasRT1,tochooseanarea
borderrouterintelligently.RouterRT1woulduseRT4for
traffictoNetworkN6,RT3fortraffictoNetworkN10,andwould
distfromdistfrom
RT3RT4
__________________________________
toRT3*21
toRT422*
toRT72014
toRT101522
toRT111825
__________________________________
toIa2027
toIb1522
__________________________________
https://www.ietf.org/rfc/rfc2328.txt

26/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

toRT5148
toRT72014
Table5:Backbonedistancescalculated
byRoutersRT3andRT4.

MoyStandardsTrack[Page34]
RFC2328OSPFVersion2April1998

DestinationRT3adv.RT4adv.
_________________________________
Ia,Ib2027
N61615
N72019
N81818
N9N11,H12936
_________________________________
RT5148
RT72014
Table6:DestinationsadvertisedintoArea1
byRoutersRT3andRT4.
loadsharebetweenthetwofortraffictoNetworkN8.
RouterRT1canalsodetermineinthismannertheshortestpath
totheASboundaryroutersRT5andRT7.Then,bylookingatRT5
andRT7'sASexternalLSAs,RouterRT1candecidebetweenRT5or
RT7whensendingtoadestinationinanotherAutonomousSystem
(oneofthenetworksN12N15).
NotethatafailureofthelinebetweenRoutersRT6andRT10
willcausethebackbonetobecomedisconnected.Configuringa
virtuallinkbetweenRoutersRT7andRT10willgivethebackbone
moreconnectivityandmoreresistancetosuchfailures.
3.5.IPsubnettingsupport
OSPFattachesanIPaddressmasktoeachadvertisedroute.The
maskindicatestherangeofaddressesbeingdescribedbythe
particularroute.Forexample,asummaryLSAforthe
destination128.185.0.0withamaskof0xffff0000actuallyis
describingasingleroutetothecollectionofdestinations
128.185.0.0128.185.255.255.Similarly,hostroutesare
alwaysadvertisedwithamaskof0xffffffff,indicatingthe
presenceofonlyasingledestination.

MoyStandardsTrack[Page35]
RFC2328OSPFVersion2April1998

https://www.ietf.org/rfc/rfc2328.txt

27/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Includingthemaskwitheachadvertiseddestinationenablesthe
implementationofwhatiscommonlyreferredtoasvariable
lengthsubnetting.ThismeansthatasingleIPclassA,B,orC
networknumbercanbebrokenupintomanysubnetsofvarious
sizes.Forexample,thenetwork128.185.0.0couldbebrokenup
into62variablesizedsubnets:15subnetsofsize4K,15
subnetsofsize256,and32subnetsofsize8.Table7shows
someoftheresultingnetworkaddressestogetherwiththeir
masks.

NetworkaddressIPaddressmaskSubnetsize
_______________________________________________
128.185.16.00xfffff0004K
128.185.1.00xffffff00256
128.185.0.80xfffffff88
Table7:Somesamplesubnetsizes.
TherearemanypossiblewaysofdividingupaclassA,B,andC
networkintovariablesizedsubnets.Thepreciseprocedurefor
doingsoisbeyondthescopeofthisspecification.This
specificationhoweverestablishesthefollowingguideline:When
anIPpacketisforwarded,itisalwaysforwardedtothenetwork
thatisthebestmatchforthepacket'sdestination.Herebest
matchissynonymouswiththelongestormostspecificmatch.
Forexample,thedefaultroutewithdestinationof0.0.0.0and
mask0x00000000isalwaysamatchforeveryIPdestination.Yet
itisalwayslessspecificthananyothermatch.Subnetmasks
mustbeassignedsothatthebestmatchforanyIPdestination
isunambiguous.
Attachinganaddressmasktoeachroutealsoenablesthesupport
ofIPsupernetting.Forexample,asinglephysicalnetwork
segmentcouldbeassignedthe[address,mask]pair
[192.9.4.0,0xfffffc00].ThesegmentwouldthenbesingleIP
network,containingaddressesfromthefourconsecutiveclassC
networknumbers192.9.4.0through192.9.7.0.Suchaddressingis
nowbecomingcommonplacewiththeadventofCIDR(see[Ref10]).

MoyStandardsTrack[Page36]
RFC2328OSPFVersion2April1998
Inordertogetbetteraggregationatareaboundaries,area
addressrangescanbeemployed(seeSectionC.2formore
details).Eachaddressrangeisdefinedasan[address,mask]
pair.Manyseparatenetworksmaythenbecontainedinasingle
addressrange,justasasubnettednetworkiscomposedofmany
separatesubnets.Areaborderroutersthensummarizethearea
contents(fordistributiontothebackbone)byadvertisinga
singlerouteforeachaddressrange.Thecostoftherouteis
themaximumcosttoanyofthenetworksfallinginthespecified
range.
Forexample,anIPsubnettednetworkmightbeconfiguredasa
singleOSPFarea.Inthatcase,asingleaddressrangecouldbe
configured:aclassA,B,orCnetworknumberalongwithits
naturalIPmask.Insidethearea,anynumberofvariablesized
https://www.ietf.org/rfc/rfc2328.txt

28/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

subnetscouldbedefined.However,externaltotheareaa
singleroutefortheentiresubnettednetworkwouldbe
distributed,hidingeventhefactthatthenetworkissubnetted
atall.Thecostofthisrouteisthemaximumofthesetof
coststothecomponentsubnets.
3.6.Supportingstubareas
InsomeAutonomousSystems,themajorityofthelinkstate
databasemayconsistofASexternalLSAs.AnOSPFASexternal
LSAisusuallyfloodedthroughouttheentireAS.However,OSPF
allowscertainareastobeconfiguredas"stubareas".AS
externalLSAsarenotfloodedinto/throughoutstubareas;
routingtoASexternaldestinationsintheseareasisbasedona
(perarea)defaultonly.Thisreducesthelinkstatedatabase
size,andthereforethememoryrequirements,forastubarea's
internalrouters.
InordertotakeadvantageoftheOSPFstubareasupport,
defaultroutingmustbeusedinthestubarea.Thisis
accomplishedasfollows.Oneormoreofthestubarea'sarea
borderroutersmustadvertiseadefaultrouteintothestubarea
viasummaryLSAs.Thesesummarydefaultsarefloodedthroughout
thestubarea,butnofurther.(Forthisreasonthesedefaults
pertainonlytotheparticularstubarea).Thesesummary
defaultrouteswillbeusedforanydestinationthatisnot

MoyStandardsTrack[Page37]
RFC2328OSPFVersion2April1998
explicitlyreachablebyanintraareaorinterareapath(i.e.,
ASexternaldestinations).
Anareacanbeconfiguredasastubwhenthereisasingleexit
pointfromthearea,orwhenthechoiceofexitpointneednot
bemadeonaperexternaldestinationbasis.Forexample,Area
3inFigure6couldbeconfiguredasastubarea,becauseall
externaltrafficmusttravelthoughitssingleareaborder
routerRT11.IfArea3wereconfiguredasastub,RouterRT11
wouldadvertiseadefaultroutefordistributioninsideArea3
(inasummaryLSA),insteadoffloodingtheASexternalLSAsfor
NetworksN12N15into/throughoutthearea.
TheOSPFprotocolensuresthatallroutersbelongingtoanarea
agreeonwhethertheareahasbeenconfiguredasastub.This
guaranteesthatnoconfusionwillariseinthefloodingofAS
externalLSAs.
Thereareacoupleofrestrictionsontheuseofstubareas.
Virtuallinkscannotbeconfiguredthroughstubareas.In
addition,ASboundaryrouterscannotbeplacedinternaltostub
areas.
3.7.Partitionsofareas
OSPFdoesnotactivelyattempttorepairareapartitions.When
anareabecomespartitioned,eachcomponentsimplybecomesa
separatearea.Thebackbonethenperformsroutingbetweenthe
newareas.Somedestinationsreachableviaintraarearouting
https://www.ietf.org/rfc/rfc2328.txt

29/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

beforethepartitionwillnowrequireinterarearouting.
However,inordertomaintainfullroutingafterthepartition,
anaddressrangemustnotbesplitacrossmultiplecomponentsof
theareapartition.Also,thebackboneitselfmustnot
partition.Ifitdoes,partsoftheAutonomousSystemwill
becomeunreachable.Backbonepartitionscanberepairedby
configuringvirtuallinks(seeSection15).
Anotherwaytothinkaboutareapartitionsistolookatthe
AutonomousSystemgraphthatwasintroducedinSection2.Area
IDscanbeviewedascolorsforthegraph'sedges.[1]Eachedge

MoyStandardsTrack[Page38]
RFC2328OSPFVersion2April1998
ofthegraphconnectstoanetwork,orisitselfapointto
pointnetwork.Ineithercase,theedgeiscoloredwiththe
network'sAreaID.
Agroupofedges,allhavingthesamecolor,andinterconnected
byvertices,representsanarea.Ifthetopologyofthe
AutonomousSystemisintact,thegraphwillhaveseveralregions
ofcolor,eachcolorbeingadistinctAreaID.
WhentheAStopologychanges,oneoftheareasmaybecome
partitioned.ThegraphoftheASwillthenhavemultiple
regionsofthesamecolor(AreaID).Theroutinginthe
AutonomousSystemwillcontinuetofunctionaslongasthese
regionsofsamecolorareconnectedbythesinglebackbone
region.

https://www.ietf.org/rfc/rfc2328.txt

30/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page39]
RFC2328OSPFVersion2April1998
4.FunctionalSummary
AseparatecopyofOSPF'sbasicroutingalgorithmrunsineacharea.
Routershavinginterfacestomultipleareasrunmultiplecopiesof
thealgorithm.Abriefsummaryoftheroutingalgorithmfollows.
Whenarouterstarts,itfirstinitializestheroutingprotocoldata
structures.Therouterthenwaitsforindicationsfromthelower
levelprotocolsthatitsinterfacesarefunctional.
ArouterthenusestheOSPF'sHelloProtocoltoacquireneighbors.
TheroutersendsHellopacketstoitsneighbors,andinturn
receivestheirHellopackets.Onbroadcastandpointtopoint
networks,therouterdynamicallydetectsitsneighboringroutersby
sendingitsHellopacketstothemulticastaddressAllSPFRouters.
Onnonbroadcastnetworks,someconfigurationinformationmaybe
necessaryinordertodiscoverneighbors.OnbroadcastandNBMA
networkstheHelloProtocolalsoelectsaDesignatedrouterforthe
network.
Therouterwillattempttoformadjacencieswithsomeofitsnewly
acquiredneighbors.Linkstatedatabasesaresynchronizedbetween
pairsofadjacentrouters.OnbroadcastandNBMAnetworks,the
DesignatedRouterdetermineswhichroutersshouldbecomeadjacent.
Adjacenciescontrolthedistributionofroutinginformation.
Routingupdatesaresentandreceivedonlyonadjacencies.
Arouterperiodicallyadvertisesitsstate,whichisalsocalled
linkstate.Linkstateisalsoadvertisedwhenarouter'sstate
changes.Arouter'sadjacenciesarereflectedinthecontentsof
itsLSAs.Thisrelationshipbetweenadjacenciesandlinkstate
allowstheprotocoltodetectdeadroutersinatimelyfashion.
LSAsarefloodedthroughoutthearea.Thefloodingalgorithmis
reliable,ensuringthatallroutersinanareahaveexactlythesame
linkstatedatabase.Thisdatabaseconsistsofthecollectionof
LSAsoriginatedbyeachrouterbelongingtothearea.Fromthis
databaseeachroutercalculatesashortestpathtree,withitselfas
root.Thisshortestpathtreeinturnyieldsaroutingtablefor
theprotocol.

MoyStandardsTrack[Page40]
RFC2328OSPFVersion2April1998
4.1.Interarearouting
Theprevioussectiondescribedtheoperationoftheprotocol
withinasinglearea.Forintraarearouting,nootherrouting
informationispertinent.Inordertobeabletorouteto
destinationsoutsideofthearea,theareaborderroutersinject
additionalroutinginformationintothearea.Thisadditional
informationisadistillationoftherestoftheAutonomous
System'stopology.
https://www.ietf.org/rfc/rfc2328.txt

31/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Thisdistillationisaccomplishedasfollows:Eachareaborder
routerisbydefinitionconnectedtothebackbone.Eacharea
borderroutersummarizesthetopologyofitsattachednon
backboneareasfortransmissiononthebackbone,andhenceto
allotherareaborderrouters.Anareaborderrouterthenhas
completetopologicalinformationconcerningthebackbone,and
theareasummariesfromeachoftheotherareaborderrouters.
Fromthisinformation,theroutercalculatespathstoall
interareadestinations.Therouterthenadvertisesthesepaths
intoitsattachedareas.Thisenablesthearea'sinternal
routerstopickthebestexitrouterwhenforwardingtraffic
interareadestinations.
4.2.ASexternalroutes
RoutersthathaveinformationregardingotherAutonomousSystems
canfloodthisinformationthroughouttheAS.Thisexternal
routinginformationisdistributedverbatimtoevery
participatingrouter.Thereisoneexception:externalrouting
informationisnotfloodedinto"stub"areas(seeSection3.6).
Toutilizeexternalroutinginformation,thepathtoallrouters
advertisingexternalinformationmustbeknownthroughouttheAS
(exceptingthestubareas).Forthatreason,thelocationsof
theseASboundaryroutersaresummarizedbythe(nonstub)area
borderrouters.

MoyStandardsTrack[Page41]
RFC2328OSPFVersion2April1998
4.3.Routingprotocolpackets
TheOSPFprotocolrunsdirectlyoverIP,usingIPprotocol89.
OSPFdoesnotprovideanyexplicitfragmentation/reassembly
support.Whenfragmentationisnecessary,IP
fragmentation/reassemblyisused.OSPFprotocolpacketshave
beendesignedsothatlargeprotocolpacketscangenerallybe
splitintoseveralsmallerprotocolpackets.Thispracticeis
recommended;IPfragmentationshouldbeavoidedwhenever
possible.
RoutingprotocolpacketsshouldalwaysbesentwiththeIPTOS
fieldsetto0.Ifatallpossible,routingprotocolpackets
shouldbegivenpreferenceoverregularIPdatatraffic,both
whenbeingsentandreceived.Asanaidtoaccomplishingthis,
OSPFprotocolpacketsshouldhavetheirIPprecedencefieldset
tothevalueInternetworkControl(see[Ref5]).
AllOSPFprotocolpacketsshareacommonprotocolheaderthatis
describedinAppendixA.TheOSPFpackettypesarelistedbelow
inTable8.TheirformatsarealsodescribedinAppendixA.

TypePacketnameProtocolfunction
https://www.ietf.org/rfc/rfc2328.txt

32/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

__________________________________________________________
1HelloDiscover/maintainneighbors
2DatabaseDescriptionSummarizedatabasecontents
3LinkStateRequestDatabasedownload
4LinkStateUpdateDatabaseupdate
5LinkStateAckFloodingacknowledgment
Table8:OSPFpackettypes.
OSPF'sHelloprotocolusesHellopacketstodiscoverand
maintainneighborrelationships.TheDatabaseDescriptionand
LinkStateRequestpacketsareusedintheformingof
adjacencies.OSPF'sreliableupdatemechanismisimplementedby
theLinkStateUpdateandLinkStateAcknowledgmentpackets.

MoyStandardsTrack[Page42]
RFC2328OSPFVersion2April1998
EachLinkStateUpdatepacketcarriesasetofnewlinkstate
advertisements(LSAs)onehopfurtherawayfromtheirpointof
origination.AsingleLinkStateUpdatepacketmaycontainthe
LSAsofseveralrouters.EachLSAistaggedwiththeIDofthe
originatingrouterandachecksumofitslinkstatecontents.
EachLSAalsohasatypefield;thedifferenttypesofOSPFLSAs
arelistedbelowinTable9.
OSPFroutingpackets(withtheexceptionofHellos)aresent
onlyoveradjacencies.ThismeansthatallOSPFprotocol
packetstravelasingleIPhop,exceptthosethataresentover
virtualadjacencies.TheIPsourceaddressofanOSPFprotocol
packetisoneendofarouteradjacency,andtheIPdestination
addressiseithertheotherendoftheadjacencyoranIP
multicastaddress.
4.4.Basicimplementationrequirements
AnimplementationofOSPFrequiresthefollowingpiecesof
systemsupport:
Timers
Twodifferentkindoftimersarerequired.Thefirstkind,
called"singleshottimers",fireonceandcauseaprotocol
eventtobeprocessed.Thesecondkind,called"interval
timers",fireatcontinuousintervals.Theseareusedfor
thesendingofpacketsatregularintervals.Agoodexample
ofthisistheregularbroadcastofHellopackets.The
granularityofbothkindsoftimersisonesecond.
Intervaltimersshouldbeimplementedtoavoiddrift.In
somerouterimplementations,packetprocessingcanaffect
timerexecution.Whenmultipleroutersareattachedtoa
singlenetwork,alldoingbroadcasts,thiscanleadtothe
synchronizationofroutingpackets(whichshouldbe
avoided).Iftimerscannotbeimplementedtoavoiddrift,
smallrandomamountsshouldbeaddedto/subtractedfromthe
intervaltimerateachfiring.
https://www.ietf.org/rfc/rfc2328.txt

33/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page43]
RFC2328OSPFVersion2April1998

LSLSALSAdescription
typename
________________________________________________________
1RouterLSAsOriginatedbyallrouters.
ThisLSAdescribes
thecollectedstatesofthe
router'sinterfacestoan
area.Floodedthroughouta
singleareaonly.
________________________________________________________
2NetworkLSAsOriginatedforbroadcast
andNBMAnetworksby
theDesignatedRouter.This
LSAcontainsthe
listofroutersconnected
tothenetwork.Flooded
throughoutasingleareaonly.
________________________________________________________
3,4SummaryLSAsOriginatedbyareaborder
routers,andfloodedthrough
outtheLSA'sassociated
area.EachsummaryLSA
describesaroutetoa
destinationoutsidethearea,
yetstillinsidetheAS
(i.e.,aninterarearoute).
Type3summaryLSAsdescribe
routestonetworks.Type4
summaryLSAsdescribe
routestoASboundaryrouters.
________________________________________________________
5ASexternalLSAsOriginatedbyASboundary
routers,andfloodedthrough
outtheAS.Each
ASexternalLSAdescribes
aroutetoadestinationin
anotherAutonomousSystem.
DefaultroutesfortheAScan
alsobedescribedby
ASexternalLSAs.

MoyStandardsTrack[Page44]
RFC2328OSPFVersion2April1998
Table9:OSPFlinkstateadvertisements(LSAs).

IPmulticast
https://www.ietf.org/rfc/rfc2328.txt

34/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

CertainOSPFpacketstaketheformofIPmulticast
datagrams.SupportforreceivingandsendingIPmulticast
datagrams,alongwiththeappropriatelowerlevelprotocol
support,isrequired.TheIPmulticastdatagramsusedby
OSPFnevertravelmorethanonehop.Forthisreason,the
abilitytoforwardIPmulticastdatagramsisnotrequired.
ForinformationonIPmulticast,see[Ref7].
Variablelengthsubnetsupport
Therouter'sIPprotocolsupportmustincludetheabilityto
divideasingleIPclassA,B,orCnetworknumberintomany
subnetsofvarioussizes.Thisiscommonlycalled
variablelengthsubnetting;seeSection3.5fordetails.
IPsupernettingsupport
Therouter'sIPprotocolsupportmustincludetheabilityto
aggregatecontiguouscollectionsofIPclassA,B,andC
networksintolargerquantitiescalledsupernets.
Supernettinghasbeenproposedasonewaytoimprovethe
scalingofIProutingintheworldwideInternet.Formore
informationonIPsupernetting,see[Ref10].
Lowerlevelprotocolsupport
Thelowerlevelprotocolsreferredtoherearethenetwork
accessprotocols,suchastheEthernetdatalinklayer.
IndicationsmustbepassedfromtheseprotocolstoOSPFas
thenetworkinterfacegoesupanddown.Forexample,onan
ethernetitwouldbevaluabletoknowwhentheethernet
transceivercablebecomesunplugged.
Nonbroadcastlowerlevelprotocolsupport
Onnonbroadcastnetworks,theOSPFHelloProtocolcanbe
aidedbyprovidinganindicationwhenanattemptismadeto
sendapackettoadeadornonexistentrouter.For
example,onanX.25PDNadeadneighboringroutermaybe

MoyStandardsTrack[Page45]
RFC2328OSPFVersion2April1998
indicatedbythereceptionofaX.25clearwithan
appropriatecauseanddiagnostic,andthisinformationwould
bepassedtoOSPF.
Listmanipulationprimitives
MuchoftheOSPFfunctionalityisdescribedintermsofits
operationonlistsofLSAs.Forexample,thecollectionof
LSAsthatwillberetransmittedtoanadjacentrouteruntil
acknowledgedaredescribedasalist.AnyparticularLSA
maybeonmanysuchlists.AnOSPFimplementationneedsto
beabletomanipulatetheselists,addinganddeleting
constituentLSAsasnecessary.
Taskingsupport
Certainproceduresdescribedinthisspecificationinvoke
otherprocedures.Attimes,theseotherproceduresshould
beexecutedinline,thatis,beforethecurrentprocedure
isfinished.Thisisindicatedinthetextbyinstructions
toexecuteaprocedure.Atothertimes,theother
proceduresaretobeexecutedonlywhenthecurrent
https://www.ietf.org/rfc/rfc2328.txt

35/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

procedurehasfinished.Thisisindicatedbyinstructions
toscheduleatask.
4.5.OptionalOSPFcapabilities
TheOSPFprotocoldefinesseveraloptionalcapabilities.A
routerindicatestheoptionalcapabilitiesthatitsupportsin
itsOSPFHellopackets,DatabaseDescriptionpacketsandinits
LSAs.Thisenablesrouterssupportingamixofoptional
capabilitiestocoexistinasingleAutonomousSystem.
Somecapabilitiesmustbesupportedbyallroutersattachedtoa
specificarea.Inthiscase,arouterwillnotaccepta
neighbor'sHelloPacketunlessthereisamatchinreported
capabilities(i.e.,acapabilitymismatchpreventsaneighbor
relationshipfromforming).Anexampleofthisisthe
ExternalRoutingCapability(seebelow).
OthercapabilitiescanbenegotiatedduringtheDatabase
Exchangeprocess.Thisisaccomplishedbyspecifyingthe
optionalcapabilitiesinDatabaseDescriptionpackets.A

MoyStandardsTrack[Page46]
RFC2328OSPFVersion2April1998
capabilitymismatchwithaneighborinthiscasewillresultin
onlyasubsetofthelinkstatedatabasebeingexchangedbetween
thetwoneighbors.
Theroutingtablebuildprocesscanalsobeaffectedbythe
presence/absenceofoptionalcapabilities.Forexample,since
theoptionalcapabilitiesarereportedinLSAs,routers
incapableofcertainfunctionscanbeavoidedwhenbuildingthe
shortestpathtree.
TheOSPFoptionalcapabilitiesdefinedinthismemoarelisted
below.SeeSectionA.2formoreinformation.
ExternalRoutingCapability
EntireOSPFareascanbeconfiguredas"stubs"(seeSection
3.6).ASexternalLSAswillnotbefloodedintostubareas.
ThiscapabilityisrepresentedbytheEbitintheOSPF
Optionsfield(seeSectionA.2).Inordertoensure
consistentconfigurationofstubareas,allrouters
interfacingtosuchanareamusthavetheEbitclearin
theirHellopackets(seeSections9.5and10.5).
5.ProtocolDataStructures
TheOSPFprotocolisdescribedhereinintermsofitsoperationon
variousprotocoldatastructures.Thefollowinglistcomprisesthe
toplevelOSPFdatastructures.Anyinitializationthatneedstobe
doneisnoted.OSPFareas,interfacesandneighborsalsohave
associateddatastructuresthataredescribedlaterinthis
specification.
RouterID
A32bitnumberthatuniquelyidentifiesthisrouterintheAS.
https://www.ietf.org/rfc/rfc2328.txt

36/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Onepossibleimplementationstrategywouldbetousethe
smallestIPinterfaceaddressbelongingtotherouter.Ifa
router'sOSPFRouterIDischanged,therouter'sOSPFsoftware
shouldberestartedbeforethenewRouterIDtakeseffect.In
thiscasetheroutershouldflushitsselforiginatedLSAsfrom
theroutingdomain(seeSection14.1)beforerestarting,orthey
willpersistforuptoMaxAgeminutes.

MoyStandardsTrack[Page47]
RFC2328OSPFVersion2April1998
Areastructures
Eachoneoftheareastowhichtherouterisconnectedhasits
owndatastructure.Thisdatastructuredescribestheworking
ofthebasicOSPFalgorithm.Rememberthateacharearunsa
separatecopyofthebasicOSPFalgorithm.
Backbone(area)structure
TheOSPFbackboneareaisresponsibleforthedisseminationof
interarearoutinginformation.
Virtuallinksconfigured
Thevirtuallinksconfiguredwiththisrouterasoneendpoint.
Inordertohaveconfiguredvirtuallinks,therouteritself
mustbeanareaborderrouter.Virtuallinksareidentifiedby
theRouterIDoftheotherendpointwhichisanotherarea
borderrouter.Thesetwoendpointroutersmustbeattachedtoa
commonarea,calledthevirtuallink'sTransitarea.Virtual
linksarepartofthebackbone,andbehaveasiftheywere
unnumberedpointtopointnetworksbetweenthetworouters.A
virtuallinkusestheintraarearoutingofitsTransitareato
forwardpackets.Virtuallinksarebroughtupanddownthrough
thebuildingoftheshortestpathtreesfortheTransitarea.
Listofexternalroutes
TheseareroutestodestinationsexternaltotheAutonomous
System,thathavebeengainedeitherthroughdirectexperience
withanotherroutingprotocol(suchasBGP),orthrough
configurationinformation,orthroughacombinationofthetwo
(e.g.,dynamicexternalinformationtobeadvertisedbyOSPF
withconfiguredmetric).Anyrouterhavingtheseexternalroutes
iscalledanASboundaryrouter.Theseroutesareadvertisedby
therouterintotheOSPFroutingdomainviaASexternalLSAs.
ListofASexternalLSAs
Partofthelinkstatedatabase.Thesehaveoriginatedfromthe
ASboundaryrouters.Theycompriseroutestodestinations
externaltotheAutonomousSystem.Notethat,iftherouteris
itselfanASboundaryrouter,someoftheseASexternalLSAs
havebeenselforiginated.

MoyStandardsTrack[Page48]
RFC2328OSPFVersion2April1998

https://www.ietf.org/rfc/rfc2328.txt

37/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Theroutingtable
Derivedfromthelinkstatedatabase.Eachentryintherouting
tableisindexedbyadestination,andcontainsthe
destination'scostandasetofpathstouseinforwarding
packetstothedestination.Apathisdescribedbyitstypeand
nexthop.Formoreinformation,seeSection11.
Figure9showsthecollectionofdatastructurespresentina
typicalrouter.TherouterpicturedisRT10,fromthemapinFigure
6.NotethatRouterRT10hasavirtuallinkconfiguredtoRouter
RT11,withArea2asthelink'sTransitarea.Thisisindicatedby
thedashedlineinFigure9.Whenthevirtuallinkbecomesactive,
throughthebuildingoftheshortestpathtreeforArea2,it
becomesaninterfacetothebackbone(seethetwobackbone
interfacesdepictedinFigure9).
6.TheAreaDataStructure
Theareadatastructurecontainsalltheinformationusedtorunthe
basicOSPFroutingalgorithm.Eachareamaintainsitsownlinkstate
database.Anetworkbelongstoasinglearea,andarouterinterface
connectstoasinglearea.Eachrouteradjacencyalsobelongstoa
singlearea.
TheOSPFbackboneisthespecialOSPFarearesponsiblefor
disseminatinginterarearoutinginformation.
Thearealinkstatedatabaseconsistsofthecollectionofrouter
LSAs,networkLSAsandsummaryLSAsthathaveoriginatedfromthe
area'srouters.Thisinformationisfloodedthroughoutasingle
areaonly.ThelistofASexternalLSAs(seeSection5)isalso
consideredtobepartofeacharea'slinkstatedatabase.
AreaID
A32bitnumberidentifyingthearea.TheAreaIDof0.0.0.0is
reservedforthebackbone.
Listofareaaddressranges
Inordertoaggregateroutinginformationatareaboundaries,
areaaddressrangescanbeemployed.Eachaddressrangeis
specifiedbyan[address,mask]pairandastatusindicationof
eitherAdvertiseorDoNotAdvertise(seeSection12.4.3).

MoyStandardsTrack[Page49]
RFC2328OSPFVersion2April1998

++
|RT10|+
++\++
/\|RoutingTable|
/\++
/\
++/\++
|Area2|++|Backbone|
++***********+++
/\*/\
/\*/\
++++++++
https://www.ietf.org/rfc/rfc2328.txt

38/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

|Interface||Interface||VirtualLink||InterfaceIb|
|toN6||toN8||toRT11|++
++++++|
/\|||
/\|||
++++|++++
|Neighbor||Neighbor|||NeighborRT11||NeighborRT6|
|RT8||RT7||++++
++++|
|
++
|NeighborRT11|
++
Figure9:RouterRT10'sDatastructures
Associatedrouterinterfaces
Thisrouter'sinterfacesconnectingtothearea.Arouter
interfacebelongstooneandonlyonearea(orthebackbone).
Forthebackboneareathislistincludesallthevirtuallinks.
AvirtuallinkisidentifiedbytheRouterIDofitsother
endpoint;itscostisthecostoftheshortestintraareapath
throughtheTransitareathatexistsbetweenthetworouters.

MoyStandardsTrack[Page50]
RFC2328OSPFVersion2April1998
ListofrouterLSAs
ArouterLSAisgeneratedbyeachrouterinthearea.It
describesthestateoftherouter'sinterfacestothearea.
ListofnetworkLSAs
OnenetworkLSAisgeneratedforeachtransitbroadcastandNBMA
networkinthearea.AnetworkLSAdescribesthesetofrouters
currentlyconnectedtothenetwork.
ListofsummaryLSAs
SummaryLSAsoriginatefromthearea'sareaborderrouters.
TheydescriberoutestodestinationsinternaltotheAutonomous
System,yetexternaltothearea(i.e.,interarea
destinations).
Shortestpathtree
Theshortestpathtreeforthearea,withthisrouteritselfas
root.DerivedfromthecollectedrouterLSAsandnetworkLSAs
bytheDijkstraalgorithm(seeSection16.1).
TransitCapability
Thisparameterindicateswhethertheareacancarrydatatraffic
thatneitheroriginatesnorterminatesintheareaitself.This
parameteriscalculatedwhenthearea'sshortestpathtreeis
built(seeSection16.1,whereTransitCapabilityissettoTRUE
ifandonlyifthereareoneormorefullyadjacentvirtual
linksusingtheareaasTransitarea),andisusedasaninput
toasubsequentstepoftheroutingtablebuildprocess(see
Section16.3).Whenanarea'sTransitCapabilityissettoTRUE,
theareaissaidtobea"transitarea".
https://www.ietf.org/rfc/rfc2328.txt

39/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

ExternalRoutingCapability
WhetherASexternalLSAswillbefloodedinto/throughoutthe
area.Thisisaconfigurableparameter.IfASexternalLSAs
areexcludedfromthearea,theareaiscalleda"stub".Within
stubareas,routingtoASexternaldestinationswillbebased
solelyonadefaultsummaryroute.Thebackbonecannotbe
configuredasastubarea.Also,virtuallinkscannotbe
configuredthroughstubareas.Formoreinformation,see
Section3.6.

MoyStandardsTrack[Page51]
RFC2328OSPFVersion2April1998
StubDefaultCost
Iftheareahasbeenconfiguredasastubarea,andtherouter
itselfisanareaborderrouter,thentheStubDefaultCost
indicatesthecostofthedefaultsummaryLSAthattherouter
shouldadvertiseintothearea.SeeSection12.4.3formore
information.
Unlessotherwisespecified,theremainingsectionsofthisdocument
refertotheoperationoftheOSPFprotocolwithinasinglearea.
7.BringingUpAdjacencies
OSPFcreatesadjacenciesbetweenneighboringroutersforthepurpose
ofexchangingroutinginformation.Noteverytwoneighboring
routerswillbecomeadjacent.Thissectioncoversthegeneralities
involvedincreatingadjacencies.Forfurtherdetailsconsult
Section10.
7.1.TheHelloProtocol
TheHelloProtocolisresponsibleforestablishingand
maintainingneighborrelationships.Italsoensuresthat
communicationbetweenneighborsisbidirectional.Hellopackets
aresentperiodicallyoutallrouterinterfaces.Bidirectional
communicationisindicatedwhentherouterseesitselflistedin
theneighbor'sHelloPacket.OnbroadcastandNBMAnetworks,
theHelloProtocolelectsaDesignatedRouterforthenetwork.
TheHelloProtocolworksdifferentlyonbroadcastnetworks,NBMA
networksandPointtoMultiPointnetworks.Onbroadcast
networks,eachrouteradvertisesitselfbyperiodically
multicastingHelloPackets.Thisallowsneighborstobe
discovereddynamically.TheseHelloPacketscontainthe
router'sviewoftheDesignatedRouter'sidentity,andthelist
ofrouterswhoseHelloPacketshavebeenseenrecently.
OnNBMAnetworkssomeconfigurationinformationmaybenecessary
fortheoperationoftheHelloProtocol.Eachrouterthatmay
potentiallybecomeDesignatedRouterhasalistofallother

https://www.ietf.org/rfc/rfc2328.txt

40/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page52]
RFC2328OSPFVersion2April1998
routersattachedtothenetwork.Arouter,havingDesignated
Routerpotential,sendsHelloPacketstoallotherpotential
DesignatedRouterswhenitsinterfacetotheNBMAnetworkfirst
becomesoperational.ThisisanattempttofindtheDesignated
Routerforthenetwork.Iftherouteritselfiselected
DesignatedRouter,itbeginssendingHelloPacketstoallother
routersattachedtothenetwork.
OnPointtoMultiPointnetworks,aroutersendsHelloPacketsto
allneighborswithwhichitcancommunicatedirectly.These
neighborsmaybediscovereddynamicallythroughaprotocolsuch
asInverseARP(see[Ref14]),ortheymaybeconfigured.
Afteraneighborhasbeendiscovered,bidirectional
communicationensured,and(ifonabroadcastorNBMAnetwork)a
DesignatedRouterelected,adecisionismaderegardingwhether
ornotanadjacencyshouldbeformedwiththeneighbor(see
Section10.4).Ifanadjacencyistobeformed,thefirststep
istosynchronizetheneighbors'linkstatedatabases.Thisis
coveredinthenextsection.
7.2.TheSynchronizationofDatabases
Inalinkstateroutingalgorithm,itisveryimportantforall
routers'linkstatedatabasestostaysynchronized.OSPF
simplifiesthisbyrequiringonlyadjacentrouterstoremain
synchronized.Thesynchronizationprocessbeginsassoonasthe
routersattempttobringuptheadjacency.Eachrouter
describesitsdatabasebysendingasequenceofDatabase
Descriptionpacketstoitsneighbor.EachDatabaseDescription
PacketdescribesasetofLSAsbelongingtotherouter's
database.WhentheneighborseesanLSAthatismorerecent
thanitsowndatabasecopy,itmakesanotethatthisnewerLSA
shouldberequested.
ThissendingandreceivingofDatabaseDescriptionpacketsis
calledthe"DatabaseExchangeProcess".Duringthisprocess,
thetworoutersformamaster/slaverelationship.EachDatabase
DescriptionPackethasasequencenumber.DatabaseDescription
Packetssentbythemaster(polls)areacknowledgedbytheslave
throughechoingofthesequencenumber.Bothpollsandtheir

MoyStandardsTrack[Page53]
RFC2328OSPFVersion2April1998
responsescontainsummariesoflinkstatedata.Themasteris
theonlyoneallowedtoretransmitDatabaseDescriptionPackets.
Itdoessoonlyatfixedintervals,thelengthofwhichisthe
configuredperinterfaceconstantRxmtInterval.
EachDatabaseDescriptioncontainsanindicationthatthereare
morepacketstofollowtheMbit.TheDatabaseExchange
ProcessisoverwhenarouterhasreceivedandsentDatabase
DescriptionPacketswiththeMbitoff.
https://www.ietf.org/rfc/rfc2328.txt

41/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

DuringandaftertheDatabaseExchangeProcess,eachrouterhas
alistofthoseLSAsforwhichtheneighborhasmoreuptodate
instances.TheseLSAsarerequestedinLinkStateRequest
Packets.LinkStateRequestpacketsthatarenotsatisfiedare
retransmittedatfixedintervalsoftimeRxmtInterval.Whenthe
DatabaseDescriptionProcesshascompletedandallLinkState
Requestshavebeensatisfied,thedatabasesaredeemed
synchronizedandtheroutersaremarkedfullyadjacent.Atthis
timetheadjacencyisfullyfunctionalandisadvertisedinthe
tworouters'routerLSAs.
Theadjacencyisusedbythefloodingprocedureassoonasthe
DatabaseExchangeProcessbegins.Thissimplifiesdatabase
synchronization,andguaranteesthatitfinishesina
predictableperiodoftime.
7.3.TheDesignatedRouter
EverybroadcastandNBMAnetworkhasaDesignatedRouter.The
DesignatedRouterperformstwomainfunctionsfortherouting
protocol:
oTheDesignatedRouteroriginatesanetworkLSAonbehalfof
thenetwork.ThisLSAliststhesetofrouters(including
theDesignatedRouteritself)currentlyattachedtothe
network.TheLinkStateIDforthisLSA(seeSection
12.1.4)istheIPinterfaceaddressoftheDesignated
Router.TheIPnetworknumbercanthenbeobtainedbyusing
thenetwork'ssubnet/networkmask.

MoyStandardsTrack[Page54]
RFC2328OSPFVersion2April1998
oTheDesignatedRouterbecomesadjacenttoallotherrouters
onthenetwork.Sincethelinkstatedatabasesare
synchronizedacrossadjacencies(throughadjacencybringup
andthenthefloodingprocedure),theDesignatedRouter
playsacentralpartinthesynchronizationprocess.
TheDesignatedRouteriselectedbytheHelloProtocol.A
router'sHelloPacketcontainsitsRouterPriority,whichis
configurableonaperinterfacebasis.Ingeneral,whena
router'sinterfacetoanetworkfirstbecomesfunctional,it
checkstoseewhetherthereiscurrentlyaDesignatedRouterfor
thenetwork.Ifthereis,itacceptsthatDesignatedRouter,
regardlessofitsRouterPriority.(Thismakesitharderto
predicttheidentityoftheDesignatedRouter,butensuresthat
theDesignatedRouterchangeslessoften.Seebelow.)
Otherwise,therouteritselfbecomesDesignatedRouterifithas
thehighestRouterPriorityonthenetwork.Amoredetailed
(andmoreaccurate)descriptionofDesignatedRouterelectionis
presentedinSection9.4.
TheDesignatedRouteristheendpointofmanyadjacencies.In
ordertooptimizethefloodingprocedureonbroadcastnetworks,
theDesignatedRoutermulticastsitsLinkStateUpdatePackets
totheaddressAllSPFRouters,ratherthansendingseparate
https://www.ietf.org/rfc/rfc2328.txt

42/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

packetsovereachadjacency.
Section2ofthisdocumentdiscussesthedirectedgraph
representationofanarea.Routernodesarelabelledwiththeir
RouterID.Transitnetworknodesareactuallylabelledwiththe
IPaddressoftheirDesignatedRouter.Itfollowsthatwhenthe
DesignatedRouterchanges,itappearsasifthenetworknodeon
thegraphisreplacedbyanentirelynewnode.Thiswillcause
thenetworkandallitsattachedrouterstooriginatenewLSAs.
Untilthelinkstatedatabasesagainconverge,sometemporary
lossofconnectivitymayresult.ThismayresultinICMP
unreachablemessagesbeingsentinresponsetodatatraffic.
Forthatreason,theDesignatedRoutershouldchangeonly
infrequently.RouterPrioritiesshouldbeconfiguredsothat
themostdependablerouteronanetworkeventuallybecomes
DesignatedRouter.

MoyStandardsTrack[Page55]
RFC2328OSPFVersion2April1998
7.4.TheBackupDesignatedRouter
InordertomakethetransitiontoanewDesignatedRouter
smoother,thereisaBackupDesignatedRouterforeachbroadcast
andNBMAnetwork.TheBackupDesignatedRouterisalsoadjacent
toallroutersonthenetwork,andbecomesDesignatedRouter
whenthepreviousDesignatedRouterfails.Iftherewereno
BackupDesignatedRouter,whenanewDesignatedRouterbecame
necessary,newadjacencieswouldhavetobeformedbetweenthe
newDesignatedRouterandallotherroutersattachedtothe
network.Partoftheadjacencyformingprocessisthe
synchronizingoflinkstatedatabases,whichcanpotentially
takequitealongtime.Duringthistime,thenetworkwouldnot
beavailablefortransitdatatraffic.TheBackupDesignated
obviatestheneedtoformtheseadjacencies,sincetheyalready
exist.Thismeanstheperiodofdisruptionintransittraffic
lastsonlyaslongasittakestofloodthenewLSAs(which
announcethenewDesignatedRouter).
TheBackupDesignatedRouterdoesnotgenerateanetworkLSAfor
thenetwork.(Ifitdid,thetransitiontoanewDesignated
Routerwouldbeevenfaster.However,thisisatradeoff
betweendatabasesizeandspeedofconvergencewhenthe
DesignatedRouterdisappears.)
TheBackupDesignatedRouterisalsoelectedbytheHello
Protocol.EachHelloPackethasafieldthatspecifiesthe
BackupDesignatedRouterforthenetwork.
Insomestepsofthefloodingprocedure,theBackupDesignated
Routerplaysapassiverole,lettingtheDesignatedRouterdo
moreofthework.Thiscutsdownontheamountoflocalrouting
traffic.SeeSection13.3formoreinformation.
7.5.Thegraphofadjacencies
Anadjacencyisboundtothenetworkthatthetworoutershave
incommon.Iftworoutershavemultiplenetworksincommon,
theymayhavemultipleadjacenciesbetweenthem.
https://www.ietf.org/rfc/rfc2328.txt

43/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page56]
RFC2328OSPFVersion2April1998
Onecanpicturethecollectionofadjacenciesonanetworkas
forminganundirectedgraph.Theverticesconsistofrouters,
withanedgejoiningtworoutersiftheyareadjacent.The
graphofadjacenciesdescribestheflowofroutingprotocol
packets,andinparticularLinkStateUpdatePackets,through
theAutonomousSystem.
Twographsarepossible,dependingonwhetheraDesignated
Routeriselectedforthenetwork.Onphysicalpointtopoint
networks,PointtoMultiPointnetworksandvirtuallinks,
neighboringroutersbecomeadjacentwhenevertheycan
communicatedirectly.Incontrast,onbroadcastandNBMA
networksonlytheDesignatedRouterandtheBackupDesignated
Routerbecomeadjacenttoallotherroutersattachedtothe
network.

++++
|RT1||RT2|oo
++N1++RT1RT2

RT7
o+
++++++/|\|
|RT7||RT3||RT4|/|\|
++++++/|\|
|||/|\|
++RT5oRT6ooRT4|
||N2***|
++++***|
|RT5||RT6|***|
++++***|
o+
RT3
Figure10:Thegraphofadjacencies

MoyStandardsTrack[Page57]
RFC2328OSPFVersion2April1998
ThesegraphsareshowninFigure10.ItisassumedthatRouter
RT7hasbecometheDesignatedRouter,andRouterRT3theBackup
DesignatedRouter,fortheNetworkN2.TheBackupDesignated
Routerperformsalesserfunctionduringthefloodingprocedure
thantheDesignatedRouter(seeSection13.3).Thisisthe
https://www.ietf.org/rfc/rfc2328.txt

44/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

reasonforthedashedlinesconnectingtheBackupDesignated
RouterRT3.
8.ProtocolPacketProcessing
ThissectiondiscussesthegeneralprocessingofOSPFrouting
protocolpackets.Itisveryimportantthattherouterlinkstate
databasesremainsynchronized.Forthisreason,routingprotocol
packetsshouldgetpreferentialtreatmentoverordinarydata
packets,bothinsendingandreceiving.
Routingprotocolpacketsaresentalongadjacenciesonly(withthe
exceptionofHellopackets,whichareusedtodiscoverthe
adjacencies).Thismeansthatallroutingprotocolpacketstravela
singleIPhop,exceptthosesentovervirtuallinks.
Allroutingprotocolpacketsbeginwithastandardheader.The
sectionsbelowprovidedetailsonhowtofillinandverifythis
standardheader.Then,foreachpackettype,thesectiongiving
moredetailsonthatparticularpackettype'sprocessingislisted.
8.1.Sendingprotocolpackets
Whenaroutersendsaroutingprotocolpacket,itfillsinthe
fieldsofthestandardOSPFpacketheaderasfollows.Formore
detailsontheheaderformatconsultSectionA.3.1:
Version#
Setto2,theversionnumberoftheprotocolasdocumented
inthisspecification.
Packettype
ThetypeofOSPFpacket,suchasLinkstateUpdateorHello
Packet.

MoyStandardsTrack[Page58]
RFC2328OSPFVersion2April1998
Packetlength
ThelengthoftheentireOSPFpacketinbytes,includingthe
standardOSPFpacketheader.
RouterID
Theidentityoftherouteritself(whoisoriginatingthe
packet).
AreaID
TheOSPFareathatthepacketisbeingsentinto.
Checksum
ThestandardIP16bitone'scomplementchecksumofthe
entireOSPFpacket,excludingthe64bitauthentication
field.Thischecksumiscalculatedaspartofthe
appropriateauthenticationprocedure;forsomeOSPF
authenticationtypes,thechecksumcalculationisomitted.
SeeSectionD.4fordetails.
AuTypeandAuthentication
https://www.ietf.org/rfc/rfc2328.txt

45/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

EachOSPFpacketexchangeisauthenticated.Authentication
typesareassignedbytheprotocolandaredocumentedin
AppendixD.Adifferentauthenticationprocedurecanbe
usedforeachIPnetwork/subnet.Autypeindicatesthetype
ofauthenticationprocedureinuse.The64bit
authenticationfieldisthenforusebythechosen
authenticationprocedure.Thisprocedureshouldbethelast
calledwhenformingthepackettobesent.SeeSectionD.4
fordetails.
TheIPdestinationaddressforthepacketisselectedas
follows.Onphysicalpointtopointnetworks,theIP
destinationisalwayssettotheaddressAllSPFRouters.Onall
othernetworktypes(includingvirtuallinks),themajorityof
OSPFpacketsaresentasunicasts,i.e.,sentdirectlytothe
otherendoftheadjacency.Inthiscase,theIPdestinationis
justtheNeighborIPaddressassociatedwiththeotherendof
theadjacency(seeSection10).Theonlypacketsnotsentas
unicastsareonbroadcastnetworks;onthesenetworksHello
packetsaresenttothemulticastdestinationAllSPFRouters,the
DesignatedRouteranditsBackupsendbothLinkStateUpdate

MoyStandardsTrack[Page59]
RFC2328OSPFVersion2April1998
PacketsandLinkStateAcknowledgmentPacketstothemulticast
addressAllSPFRouters,whileallotherrouterssendboththeir
LinkStateUpdateandLinkStateAcknowledgmentPacketstothe
multicastaddressAllDRouters.
RetransmissionsofLinkStateUpdatepacketsareALWAYSsent
directlytotheneighbor.Onmultiaccessnetworks,thismeans
thatretransmissionsshouldbesenttotheneighbor'sIP
address.
TheIPsourceaddressshouldbesettotheIPaddressofthe
sendinginterface.Interfacestounnumberedpointtopoint
networkshavenoassociatedIPaddress.Ontheseinterfaces,
theIPsourceshouldbesettoanyoftheotherIPaddresses
belongingtotherouter.Forthisreason,theremustbeat
leastoneIPaddressassignedtotherouter.[2]Notethat,for
mostpurposes,virtuallinksactpreciselythesameas
unnumberedpointtopointnetworks.However,eachvirtuallink
doeshaveanIPinterfaceaddress(discoveredduringtherouting
tablebuildprocess)whichisusedastheIPsourcewhensending
packetsoverthevirtuallink.
FormoreinformationontheformatofspecificOSPFpacket
types,consultthesectionslistedinTable10.

TypePacketnamedetailedsection(transmit)
_________________________________________________________
1HelloSection9.5
2DatabasedescriptionSection10.8
3LinkstaterequestSection10.9
4LinkstateupdateSection13.3
5LinkstateackSection13.5
https://www.ietf.org/rfc/rfc2328.txt

46/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Table10:SectionsdescribingOSPFprotocolpackettransmission.

MoyStandardsTrack[Page60]
RFC2328OSPFVersion2April1998
8.2.Receivingprotocolpackets
Wheneveraprotocolpacketisreceivedbytherouteritis
markedwiththeinterfaceitwasreceivedon.Forroutersthat
havevirtuallinksconfigured,itmaynotbeimmediatelyobvious
whichinterfacetoassociatethepacketwith.Forexample,
considertheRouterRT11depictedinFigure6.IfRT11receives
anOSPFprotocolpacketonitsinterfacetoNetworkN8,itmay
wanttoassociatethepacketwiththeinterfacetoArea2,or
withthevirtuallinktoRouterRT10(whichispartofthe
backbone).Inthefollowing,weassumethatthepacketis
initiallyassociatedwiththenonvirtuallink.[3]
InorderforthepackettobeacceptedattheIPlevel,itmust
passanumberoftests,evenbeforethepacketispassedtoOSPF
forprocessing:
oTheIPchecksummustbecorrect.
oThepacket'sIPdestinationaddressmustbetheIPaddress
ofthereceivinginterface,oroneoftheIPmulticast
addressesAllSPFRoutersorAllDRouters.
oTheIPprotocolspecifiedmustbeOSPF(89).
oLocallyoriginatedpacketsshouldnotbepassedontoOSPF.
Thatis,thesourceIPaddressshouldbeexaminedtomake
surethisisnotamulticastpacketthattherouteritself
generated.
Next,theOSPFpacketheaderisverified.Thefieldsspecified
intheheadermustmatchthoseconfiguredforthereceiving
interface.Iftheydonot,thepacketshouldbediscarded:
oTheversionnumberfieldmustspecifyprotocolversion2.
oTheAreaIDfoundintheOSPFheadermustbeverified.If
bothofthefollowingcasesfail,thepacketshouldbe
discarded.TheAreaIDspecifiedintheheadermusteither:

MoyStandardsTrack[Page61]
RFC2328OSPFVersion2April1998

https://www.ietf.org/rfc/rfc2328.txt

47/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

(1)MatchtheAreaIDofthereceivinginterface.Inthis
case,thepackethasbeensentoverasinglehop.
Therefore,thepacket'sIPsourceaddressisrequiredto
beonthesamenetworkasthereceivinginterface.This
canbeverifiedbycomparingthepacket'sIPsource
addresstotheinterface'sIPaddress,aftermasking
bothaddresseswiththeinterfacemask.Thiscomparison
shouldnotbeperformedonpointtopointnetworks.On
pointtopointnetworks,theinterfaceaddressesofeach
endofthelinkareassignedindependently,iftheyare
assignedatall.
(2)Indicatethebackbone.Inthiscase,thepackethas
beensentoveravirtuallink.Thereceivingrouter
mustbeanareaborderrouter,andtheRouterID
specifiedinthepacket(thesourcerouter)mustbethe
otherendofaconfiguredvirtuallink.Thereceiving
interfacemustalsoattachtothevirtuallink's
configuredTransitarea.Ifallofthesechecks
succeed,thepacketisacceptedandisfromnowon
associatedwiththevirtuallink(andthebackbone
area).
oPacketswhoseIPdestinationisAllDRoutersshouldonlybe
acceptedifthestateofthereceivinginterfaceisDRor
Backup(seeSection9.1).
oTheAuTypespecifiedinthepacketmustmatchtheAuType
specifiedfortheassociatedarea.
oThepacketmustbeauthenticated.Theauthentication
procedureisindicatedbythesettingofAuType(see
AppendixD).Theauthenticationproceduremayuseoneor
moreAuthenticationkeys,whichcanbeconfiguredonaper
interfacebasis.Theauthenticationproceduremayalso
verifythechecksumfieldintheOSPFpacketheader(which,
whenused,issettothestandardIP16bitone'scomplement
checksumoftheOSPFpacket'scontentsafterexcludingthe
64bitauthenticationfield).Iftheauthentication
procedurefails,thepacketshouldbediscarded.

MoyStandardsTrack[Page62]
RFC2328OSPFVersion2April1998
IfthepackettypeisHello,itshouldthenbefurtherprocessed
bytheHelloProtocol(seeSection10.5).Allotherpacket
typesaresent/receivedonlyonadjacencies.Thismeansthat
thepacketmusthavebeensentbyoneoftherouter'sactive
neighbors.Ifthereceivinginterfaceconnectstoabroadcast
network,PointtoMultiPointnetworkorNBMAnetworkthesender
isidentifiedbytheIPsourceaddressfoundinthepacket'sIP
header.Ifthereceivinginterfaceconnectstoapointtopoint
networkoravirtuallink,thesenderisidentifiedbythe
RouterID(sourcerouter)foundinthepacket'sOSPFheader.
Thedatastructureassociatedwiththereceivinginterface
containsthelistofactiveneighbors.Packetsnotmatchingany
activeneighborarediscarded.
Atthispointallreceivedprotocolpacketsareassociatedwith
https://www.ietf.org/rfc/rfc2328.txt

48/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

anactiveneighbor.Forthefurtherinputprocessingof
specificpackettypes,consultthesectionslistedinTable11.

TypePacketnamedetailedsection(receive)
________________________________________________________
1HelloSection10.5
2DatabasedescriptionSection10.6
3LinkstaterequestSection10.7
4LinkstateupdateSection13
5LinkstateackSection13.7
Table11:SectionsdescribingOSPFprotocolpacketreception.

9.TheInterfaceDataStructure
AnOSPFinterfaceistheconnectionbetweenarouterandanetwork.
WeassumeasingleOSPFinterfacetoeachattachednetwork/subnet,
althoughsupportingmultipleinterfacesonasinglenetworkis
consideredinAppendixF.Eachinterfacestructurehasatmostone
IPinterfaceaddress.

MoyStandardsTrack[Page63]
RFC2328OSPFVersion2April1998
AnOSPFinterfacecanbeconsideredtobelongtotheareathat
containstheattachednetwork.Allroutingprotocolpackets
originatedbytherouteroverthisinterfacearelabelledwiththe
interface'sAreaID.Oneormorerouteradjacenciesmaydevelop
overaninterface.Arouter'sLSAsreflectthestateofits
interfacesandtheirassociatedadjacencies.
Thefollowingdataitemsareassociatedwithaninterface.Note
thatanumberoftheseitemsareactuallyconfigurationforthe
attachednetwork;suchitemsmustbethesameforallrouters
connectedtothenetwork.
Type
TheOSPFinterfacetypeiseitherpointtopoint,broadcast,
NBMA,PointtoMultiPointorvirtuallink.
State
Thefunctionallevelofaninterface.Statedetermineswhether
ornotfulladjacenciesareallowedtoformovertheinterface.
Stateisalsoreflectedintherouter'sLSAs.
IPinterfaceaddress
TheIPaddressassociatedwiththeinterface.Thisappearsas
theIPsourceaddressinallroutingprotocolpacketsoriginated
overthisinterface.Interfacestounnumberedpointtopoint
networksdonothaveanassociatedIPaddress.
IPinterfacemask
Alsoreferredtoasthesubnetmask,thisindicatestheportion
oftheIPinterfaceaddressthatidentifiestheattached
https://www.ietf.org/rfc/rfc2328.txt

49/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

network.MaskingtheIPinterfaceaddresswiththeIPinterface
maskyieldstheIPnetworknumberoftheattachednetwork.On
pointtopointnetworksandvirtuallinks,theIPinterfacemask
isnotdefined.Onthesenetworks,thelinkitselfisnot
assignedanIPnetworknumber,andsotheaddressesofeachside
ofthelinkareassignedindependently,iftheyareassignedat
all.
AreaID
TheAreaIDoftheareatowhichtheattachednetworkbelongs.
Allroutingprotocolpacketsoriginatingfromtheinterfaceare
labelledwiththisAreaID.

MoyStandardsTrack[Page64]
RFC2328OSPFVersion2April1998
HelloInterval
Thelengthoftime,inseconds,betweentheHellopacketsthat
theroutersendsontheinterface.AdvertisedinHellopackets
sentoutthisinterface.
RouterDeadInterval
Thenumberofsecondsbeforetherouter'sneighborswilldeclare
itdown,whentheystophearingtherouter'sHelloPackets.
AdvertisedinHellopacketssentoutthisinterface.
InfTransDelay
TheestimatednumberofsecondsittakestotransmitaLink
StateUpdatePacketoverthisinterface.LSAscontainedinthe
LinkStateUpdatepacketwillhavetheirageincrementedbythis
amountbeforetransmission.Thisvalueshouldtakeintoaccount
transmissionandpropagationdelays;itmustbegreaterthan
zero.
RouterPriority
An8bitunsignedinteger.Whentworoutersattachedtoa
networkbothattempttobecomeDesignatedRouter,theonewith
thehighestRouterPrioritytakesprecedence.Arouterwhose
RouterPriorityissetto0isineligibletobecomeDesignated
Routerontheattachednetwork.AdvertisedinHellopackets
sentoutthisinterface.
HelloTimer
AnintervaltimerthatcausestheinterfacetosendaHello
packet.ThistimerfireseveryHelloIntervalseconds.Note
thatonnonbroadcastnetworksaseparateHellopacketissent
toeachqualifiedneighbor.
WaitTimer
Asingleshottimerthatcausestheinterfacetoexitthe
Waitingstate,andasaconsequenceselectaDesignatedRouter
onthenetwork.ThelengthofthetimerisRouterDeadInterval
seconds.
Listofneighboringrouters
Theotherroutersattachedtothisnetwork.Thislistisformed
bytheHelloProtocol.Adjacencieswillbeformedtosomeof

https://www.ietf.org/rfc/rfc2328.txt

50/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page65]
RFC2328OSPFVersion2April1998
theseneighbors.Thesetofadjacentneighborscanbe
determinedbyanexaminationofalloftheneighbors'states.
DesignatedRouter
TheDesignatedRouterselectedfortheattachednetwork.The
DesignatedRouterisselectedonallbroadcastandNBMAnetworks
bytheHelloProtocol.Twopiecesofidentificationarekept
fortheDesignatedRouter:itsRouterIDanditsIPinterface
addressonthenetwork.TheDesignatedRouteradvertiseslink
stateforthenetwork;thisnetworkLSAislabelledwiththe
DesignatedRouter'sIPaddress.TheDesignatedRouteris
initializedto0.0.0.0,whichindicatesthelackofaDesignated
Router.
BackupDesignatedRouter
TheBackupDesignatedRouterisalsoselectedonallbroadcast
andNBMAnetworksbytheHelloProtocol.Allroutersonthe
attachednetworkbecomeadjacenttoboththeDesignatedRouter
andtheBackupDesignatedRouter.TheBackupDesignatedRouter
becomesDesignatedRouterwhenthecurrentDesignatedRouter
fails.TheBackupDesignatedRouterisinitializedto0.0.0.0,
indicatingthelackofaBackupDesignatedRouter.
Interfaceoutputcost(s)
Thecostofsendingadatapacketontheinterface,expressedin
thelinkstatemetric.Thisisadvertisedasthelinkcostfor
thisinterfaceintherouterLSA.Thecostofaninterfacemust
begreaterthanzero.
RxmtInterval
ThenumberofsecondsbetweenLSAretransmissions,for
adjacenciesbelongingtothisinterface.Alsousedwhen
retransmittingDatabaseDescriptionandLinkStateRequest
Packets.
AuType
Thetypeofauthenticationusedontheattachednetwork/subnet.
AuthenticationtypesaredefinedinAppendixD.AllOSPFpacket
exchangesareauthenticated.Differentauthenticationschemes
maybeusedondifferentnetworks/subnets.

MoyStandardsTrack[Page66]
RFC2328OSPFVersion2April1998
Authenticationkey
Thisconfigureddataallowstheauthenticationprocedureto
generateand/orverifyOSPFprotocolpackets.The
Authenticationkeycanbeconfiguredonaperinterfacebasis.
Forexample,iftheAuTypeindicatessimplepassword,the
Authenticationkeywouldbea64bitclearpasswordwhichis
insertedintotheOSPFpacketheader.IfinsteadAutype
indicatesCryptographicauthentication,thentheAuthentication
keyisasharedsecretwhichenablesthegeneration/verification
ofmessagedigestswhichareappendedtotheOSPFprotocol
https://www.ietf.org/rfc/rfc2328.txt

51/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

packets.WhenCryptographicauthenticationisused,multiple
simultaneouskeysaresupportedinordertoachievesmoothkey
transition(seeSectionD.3).
9.1.Interfacestates
Thevariousstatesthatrouterinterfacesmayattainis
documentedinthissection.Thestatesarelistedinorderof
progressingfunctionality.Forexample,theinoperativestate
islistedfirst,followedbyalistofintermediatestates
beforethefinal,fullyfunctionalstateisachieved.The
specificationmakesuseofthisorderingbysometimesmaking
referencessuchas"thoseinterfacesinstategreaterthanX".
Figure11showsthegraphofinterfacestatechanges.Thearcs
ofthegrapharelabelledwiththeeventcausingthestate
change.TheseeventsaredocumentedinSection9.2.The
interfacestatemachineisdescribedinmoredetailinSection
9.3.
Down
Thisistheinitialinterfacestate.Inthisstate,the
lowerlevelprotocolshaveindicatedthattheinterfaceis
unusable.Noprotocoltrafficatallwillbesentor
receivedonsuchainterface.Inthisstate,interface
parametersshouldbesettotheirinitialvalues.All
interfacetimersshouldbedisabled,andthereshouldbeno
adjacenciesassociatedwiththeinterface.
Loopback
Inthisstate,therouter'sinterfacetothenetworkis

MoyStandardsTrack[Page67]
RFC2328OSPFVersion2April1998

++UnloopInd++
|Down|<|Loopback|
++++
|
|InterfaceUp
++|++
|Waiting|<+>|Pointtopoint|
++++
|
WaitTimer|BackupSeen
|
|
|NeighborChange
++++<++
|Backup|<|?|>|DROther|
++>++<+++
Neighbor||
Change||Neighbor
||Change
|++
+>|DR|
++
Figure11:InterfaceStatechanges
https://www.ietf.org/rfc/rfc2328.txt

52/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Inadditiontothestatetransitionspictured,
EventInterfaceDownalwaysforcesDownState,and
EventLoopIndalwaysforcesLoopbackState
loopedback.Theinterfacemaybeloopedbackinhardware
orsoftware.Theinterfacewillbeunavailableforregular
datatraffic.However,itmaystillbedesirabletogain
informationonthequalityofthisinterface,eitherthrough
sendingICMPpingstotheinterfaceorthroughsomething
likeabiterrortest.Forthisreason,IPpacketsmay
stillbeaddressedtoaninterfaceinLoopbackstate.To

MoyStandardsTrack[Page68]
RFC2328OSPFVersion2April1998
facilitatethis,suchinterfacesareadvertisedinrouter
LSAsassinglehostroutes,whosedestinationistheIP
interfaceaddress.[4]
Waiting
Inthisstate,therouteristryingtodeterminethe
identityofthe(Backup)DesignatedRouterforthenetwork.
Todothis,theroutermonitorstheHelloPacketsit
receives.TherouterisnotallowedtoelectaBackup
DesignatedRouternoraDesignatedRouteruntilit
transitionsoutofWaitingstate.Thispreventsunnecessary
changesof(Backup)DesignatedRouter.
Pointtopoint
Inthisstate,theinterfaceisoperational,andconnects
eithertoaphysicalpointtopointnetworkortoavirtual
link.Uponenteringthisstate,therouterattemptstoform
anadjacencywiththeneighboringrouter.HelloPacketsare
senttotheneighboreveryHelloIntervalseconds.
DROther
TheinterfaceistoabroadcastorNBMAnetworkonwhich
anotherrouterhasbeenselectedtobetheDesignated
Router.Inthisstate,therouteritselfhasnotbeen
selectedBackupDesignatedRoutereither.Therouterforms
adjacenciestoboththeDesignatedRouterandtheBackup
DesignatedRouter(iftheyexist).
Backup
Inthisstate,therouteritselfistheBackupDesignated
Routerontheattachednetwork.Itwillbepromotedto
DesignatedRouterwhenthepresentDesignatedRouterfails.
Therouterestablishesadjacenciestoallotherrouters
attachedtothenetwork.TheBackupDesignatedRouter
performsslightlydifferentfunctionsduringtheFlooding
Procedure,ascomparedtotheDesignatedRouter(seeSection
13.3).SeeSection7.4formoredetailsonthefunctions
performedbytheBackupDesignatedRouter.
DRInthisstate,thisrouteritselfistheDesignatedRouter
https://www.ietf.org/rfc/rfc2328.txt

53/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

ontheattachednetwork.Adjacenciesareestablishedtoall
otherroutersattachedtothenetwork.Theroutermustalso

MoyStandardsTrack[Page69]
RFC2328OSPFVersion2April1998
originateanetworkLSAforthenetworknode.Thenetwork
LSAwillcontainlinkstoallrouters(includingthe
DesignatedRouteritself)attachedtothenetwork.See
Section7.3formoredetailsonthefunctionsperformedby
theDesignatedRouter.
9.2.Eventscausinginterfacestatechanges
Statechangescanbeeffectedbyanumberofevents.These
eventsarepicturedasthelabelledarcsinFigure11.The
labeldefinitionsarelistedbelow.Foradetailedexplanation
oftheeffectoftheseeventsonOSPFprotocoloperation,
consultSection9.3.
InterfaceUp
Lowerlevelprotocolshaveindicatedthatthenetwork
interfaceisoperational.Thisenablestheinterfaceto
transitionoutofDownstate.Onvirtuallinks,the
interfaceoperationalindicationisactuallyaresultofthe
shortestpathcalculation(seeSection16.7).
WaitTimer
TheWaitTimerhasfired,indicatingtheendofthewaiting
periodthatisrequiredbeforeelectinga(Backup)
DesignatedRouter.
BackupSeen
Therouterhasdetectedtheexistenceornonexistenceofa
BackupDesignatedRouterforthenetwork.Thisisdonein
oneoftwoways.First,anHelloPacketmaybereceived
fromaneighborclaimingtobeitselftheBackupDesignated
Router.Alternatively,anHelloPacketmaybereceivedfrom
aneighborclaimingtobeitselftheDesignatedRouter,and
indicatingthatthereisnoBackupDesignatedRouter.In
eithercasetheremustbebidirectionalcommunicationwith
theneighbor,i.e.,theroutermustalsoappearinthe
neighbor'sHelloPacket.Thiseventsignalsanendtothe
Waitingstate.

MoyStandardsTrack[Page70]
RFC2328OSPFVersion2April1998
NeighborChange
Therehasbeenachangeinthesetofbidirectional
neighborsassociatedwiththeinterface.The(Backup)
DesignatedRouterneedstoberecalculated.Thefollowing
neighborchangesleadtotheNeighborChangeevent.Foran
https://www.ietf.org/rfc/rfc2328.txt

54/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

explanationofneighborstates,seeSection10.1.
oBidirectionalcommunicationhasbeenestablishedtoa
neighbor.Inotherwords,thestateoftheneighborhas
transitionedto2Wayorhigher.
oThereisnolongerbidirectionalcommunicationwitha
neighbor.Inotherwords,thestateoftheneighborhas
transitionedtoInitorlower.
oOneofthebidirectionalneighborsisnewlydeclaring
itselfaseitherDesignatedRouterorBackupDesignated
Router.Thisisdetectedthroughexaminationofthat
neighbor'sHelloPackets.
oOneofthebidirectionalneighborsisnolonger
declaringitselfasDesignatedRouter,orisnolonger
declaringitselfasBackupDesignatedRouter.Thisis
againdetectedthroughexaminationofthatneighbor's
HelloPackets.
oTheadvertisedRouterPriorityforabidirectional
neighborhaschanged.Thisisagaindetectedthrough
examinationofthatneighbor'sHelloPackets.
LoopInd
Anindicationhasbeenreceivedthattheinterfaceisnow
loopedbacktoitself.Thisindicationcanbereceived
eitherfromnetworkmanagementorfromthelowerlevel
protocols.
UnloopInd
Anindicationhasbeenreceivedthattheinterfaceisno
longerloopedback.AswiththeLoopIndevent,this

MoyStandardsTrack[Page71]
RFC2328OSPFVersion2April1998
indicationcanbereceivedeitherfromnetworkmanagementor
fromthelowerlevelprotocols.
InterfaceDown
Lowerlevelprotocolsindicatethatthisinterfaceisno
longerfunctional.Nomatterwhatthecurrentinterface
stateis,thenewinterfacestatewillbeDown.
9.3.TheInterfacestatemachine
Adetaileddescriptionoftheinterfacestatechangesfollows.
Eachstatechangeisinvokedbyanevent(Section9.2).This
eventmayproducedifferenteffects,dependingonthecurrent
stateoftheinterface.Forthisreason,thestatemachine
belowisorganizedbycurrentinterfacestateandreceived
event.Eachentryinthestatemachinedescribestheresulting
newinterfacestateandtherequiredsetofadditionalactions.
Whenaninterface'sstatechanges,itmaybenecessaryto
originateanewrouterLSA.SeeSection12.4formoredetails.
https://www.ietf.org/rfc/rfc2328.txt

55/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Someoftherequiredactionsbelowinvolvegeneratingeventsfor
theneighborstatemachine.Forexample,whenaninterface
becomesinoperative,allneighborconnectionsassociatedwith
theinterfacemustbedestroyed.Formoreinformationonthe
neighborstatemachine,seeSection10.3.
State(s):Down
Event:InterfaceUp
Newstate:Dependsuponactionroutine
Action:StarttheintervalHelloTimer,enablingthe
periodicsendingofHellopacketsouttheinterface.
Iftheattachednetworkisaphysicalpointtopoint
network,PointtoMultiPointnetworkorvirtual
link,theinterfacestatetransitionstoPointto
Point.Else,iftherouterisnoteligibleto
becomeDesignatedRoutertheinterfacestate
transitionstoDROther.

MoyStandardsTrack[Page72]
RFC2328OSPFVersion2April1998
Otherwise,theattachednetworkisabroadcastor
NBMAnetworkandtherouteriseligibletobecome
DesignatedRouter.Inthiscase,inanattemptto
discovertheattachednetwork'sDesignatedRouter
theinterfacestateissettoWaitingandthesingle
shotWaitTimerisstarted.Additionally,ifthe
networkisanNBMAnetworkexaminetheconfigured
listofneighborsforthisinterfaceandgenerate
theneighboreventStartforeachneighborthatis
alsoeligibletobecomeDesignatedRouter.
State(s):Waiting
Event:BackupSeen
Newstate:Dependsuponactionroutine.
Action:Calculatetheattachednetwork'sBackupDesignated
RouterandDesignatedRouter,asshowninSection
9.4.Asaresultofthiscalculation,thenewstate
oftheinterfacewillbeeitherDROther,Backupor
DR.
State(s):Waiting
Event:WaitTimer
Newstate:Dependsuponactionroutine.
Action:Calculatetheattachednetwork'sBackupDesignated
RouterandDesignatedRouter,asshowninSection
9.4.Asaresultofthiscalculation,thenewstate
oftheinterfacewillbeeitherDROther,Backupor
https://www.ietf.org/rfc/rfc2328.txt

56/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

DR.
State(s):DROther,BackuporDR
Event:NeighborChange

MoyStandardsTrack[Page73]
RFC2328OSPFVersion2April1998
Newstate:Dependsuponactionroutine.
Action:Recalculatetheattachednetwork'sBackupDesignated
RouterandDesignatedRouter,asshowninSection
9.4.Asaresultofthiscalculation,thenewstate
oftheinterfacewillbeeitherDROther,Backupor
DR.
State(s):AnyState
Event:InterfaceDown
Newstate:Down
Action:Allinterfacevariablesarereset,andinterface
timersdisabled.Also,allneighborconnections
associatedwiththeinterfacearedestroyed.This
isdonebygeneratingtheeventKillNbronall
associatedneighbors(seeSection10.2).
State(s):AnyState
Event:LoopInd
Newstate:Loopback
Action:Sincethisinterfaceisnolongerconnectedtothe
attachednetworktheactionsassociatedwiththe
aboveInterfaceDowneventareexecuted.
State(s):Loopback
Event:UnloopInd
Newstate:Down
Action:Noactionsarenecessary.Forexample,the
interfacevariableshavealreadybeenresetupon
enteringtheLoopbackstate.Notethatreceptionof

MoyStandardsTrack[Page74]
RFC2328OSPFVersion2April1998

https://www.ietf.org/rfc/rfc2328.txt

57/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

anInterfaceUpeventisnecessarybeforethe
interfaceagainbecomesfullyfunctional.
9.4.ElectingtheDesignatedRouter
Thissectiondescribesthealgorithmusedforcalculatinga
network'sDesignatedRouterandBackupDesignatedRouter.This
algorithmisinvokedbytheInterfacestatemachine.The
initialtimearouterrunstheelectionalgorithmforanetwork,
thenetwork'sDesignatedRouterandBackupDesignatedRouterare
initializedto0.0.0.0.Thisindicatesthelackofbotha
DesignatedRouterandaBackupDesignatedRouter.
TheDesignatedRouterelectionalgorithmproceedsasfollows:
CalltherouterdoingthecalculationRouterX.Thelistof
neighborsattachedtothenetworkandhavingestablished
bidirectionalcommunicationwithRouterXisexamined.This
listispreciselythecollectionofRouterX'sneighbors(on
thisnetwork)whosestateisgreaterthanorequalto2Way(see
Section10.1).RouterXitselfisalsoconsideredtobeonthe
list.Discardallroutersfromthelistthatareineligibleto
becomeDesignatedRouter.(RoutershavingRouterPriorityof0
areineligibletobecomeDesignatedRouter.)Thefollowing
stepsarethenexecuted,consideringonlythoseroutersthat
remainonthelist:
(1)Notethecurrentvaluesforthenetwork'sDesignatedRouter
andBackupDesignatedRouter.Thisisusedlaterfor
comparisonpurposes.
(2)CalculatethenewBackupDesignatedRouterforthenetwork
asfollows.Onlythoseroutersonthelistthathavenot
declaredthemselvestobeDesignatedRouterareeligibleto
becomeBackupDesignatedRouter.Ifoneormoreofthese
routershavedeclaredthemselvesBackupDesignatedRouter
(i.e.,theyarecurrentlylistingthemselvesasBackup
DesignatedRouter,butnotasDesignatedRouter,intheir
HelloPackets)theonehavinghighestRouterPriorityis
declaredtobeBackupDesignatedRouter.Incaseofatie,
theonehavingthehighestRouterIDischosen.Ifno
routershavedeclaredthemselvesBackupDesignatedRouter,

MoyStandardsTrack[Page75]
RFC2328OSPFVersion2April1998
choosetherouterhavinghighestRouterPriority,(again
excludingthoserouterswhohavedeclaredthemselves
DesignatedRouter),andagainusetheRouterIDtobreak
ties.
(3)CalculatethenewDesignatedRouterforthenetworkas
follows.Ifoneormoreoftheroutershavedeclared
themselvesDesignatedRouter(i.e.,theyarecurrently
listingthemselvesasDesignatedRouterintheirHello
Packets)theonehavinghighestRouterPriorityisdeclared
tobeDesignatedRouter.Incaseofatie,theonehaving
thehighestRouterIDischosen.Ifnoroutershave
declaredthemselvesDesignatedRouter,assigntheDesignated
RoutertobethesameasthenewlyelectedBackupDesignated
Router.
https://www.ietf.org/rfc/rfc2328.txt

58/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

(4)IfRouterXisnownewlytheDesignatedRouterornewlythe
BackupDesignatedRouter,orisnownolongertheDesignated
RouterornolongertheBackupDesignatedRouter,repeat
steps2and3,andthenproceedtostep5.Forexample,if
RouterXisnowtheDesignatedRouter,whenstep2is
repeatedXwillnolongerbeeligibleforBackupDesignated
Routerelection.Amongotherthings,thiswillensurethat
norouterwilldeclareitselfbothBackupDesignatedRouter
andDesignatedRouter.[5]
(5)Asaresultofthesecalculations,therouteritselfmaynow
beDesignatedRouterorBackupDesignatedRouter.See
Sections7.3and7.4fortheadditionaldutiesthiswould
entail.Therouter'sinterfacestateshouldbeset
accordingly.IftherouteritselfisnowDesignatedRouter,
thenewinterfacestateisDR.Iftherouteritselfisnow
BackupDesignatedRouter,thenewinterfacestateisBackup.
Otherwise,thenewinterfacestateisDROther.
(6)IftheattachednetworkisanNBMAnetwork,andtherouter
itselfhasjustbecomeeitherDesignatedRouterorBackup
DesignatedRouter,itmuststartsendingHelloPacketsto
thoseneighborsthatarenoteligibletobecomeDesignated
Router(seeSection9.5.1).Thisisdonebyinvokingthe
neighboreventStartforeachneighborhavingaRouter
Priorityof0.

MoyStandardsTrack[Page76]
RFC2328OSPFVersion2April1998
(7)Iftheabovecalculationshavecausedtheidentityofeither
theDesignatedRouterorBackupDesignatedRoutertochange,
thesetofadjacenciesassociatedwiththisinterfacewill
needtobemodified.Someadjacenciesmayneedtobe
formed,andothersmayneedtobebroken.Toaccomplish
this,invoketheeventAdjOK?onallneighborswhosestate
isatleast2Way.Thiswillcausetheireligibilityfor
adjacencytobereexamined(seeSections10.3and10.4).
Thereasonbehindtheelectionalgorithm'scomplexityisthe
desireforanorderlytransitionfromBackupDesignatedRouter
toDesignatedRouter,whenthecurrentDesignatedRouterfails.
Thisorderlytransitionisensuredthroughtheintroductionof
hysteresis:nonewBackupDesignatedRoutercanbechosenuntil
theoldBackupacceptsitsnewDesignatedRouter
responsibilities.
Theaboveproceduremayelectthesameroutertobeboth
DesignatedRouterandBackupDesignatedRouter,althoughthat
routerwillneverbethecalculatingrouter(RouterX)itself.
TheelectedDesignatedRoutermaynotbetherouterhavingthe
highestRouterPriority,norwilltheBackupDesignatedRouter
necessarilyhavethesecondhighestRouterPriority.IfRouter
XisnotitselfeligibletobecomeDesignatedRouter,itis
possiblethatneitheraBackupDesignatedRouternora
DesignatedRouterwillbeselectedintheaboveprocedure.Note
alsothatifRouterXistheonlyattachedrouterthatis
eligibletobecomeDesignatedRouter,itwillselectitselfas
DesignatedRouterandtherewillbenoBackupDesignatedRouter
https://www.ietf.org/rfc/rfc2328.txt

59/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

forthenetwork.
9.5.SendingHellopackets
Hellopacketsaresentouteachfunctioningrouterinterface.
Theyareusedtodiscoverandmaintainneighbor
relationships.[6]OnbroadcastandNBMAnetworks,HelloPackets
arealsousedtoelecttheDesignatedRouterandBackup
DesignatedRouter.

MoyStandardsTrack[Page77]
RFC2328OSPFVersion2April1998
TheformatofanHellopacketisdetailedinSectionA.3.2.The
HelloPacketcontainstherouter'sRouterPriority(usedin
choosingtheDesignatedRouter),andtheintervalbetweenHello
Packetssentouttheinterface(HelloInterval).TheHello
Packetalsoindicateshowoftenaneighbormustbeheardfromto
remainactive(RouterDeadInterval).BothHelloIntervaland
RouterDeadIntervalmustbethesameforallroutersattachedto
acommonnetwork.TheHellopacketalsocontainstheIPaddress
maskoftheattachednetwork(NetworkMask).Onunnumbered
pointtopointnetworksandonvirtuallinksthisfieldshould
besetto0.0.0.0.
TheHellopacket'sOptionsfielddescribestherouter'soptional
OSPFcapabilities.Oneoptionalcapabilityisdefinedinthis
specification(seeSections4.5andA.2).TheEbitofthe
Optionsfieldshouldbesetifandonlyiftheattachedareais
capableofprocessingASexternalLSAs(i.e.,itisnotastub
area).IftheEbitissetincorrectlytheneighboringrouters
willrefusetoaccepttheHelloPacket(seeSection10.5).
UnrecognizedbitsintheHelloPacket'sOptionsfieldshouldbe
settozero.
Inordertoensuretwowaycommunicationbetweenadjacent
routers,theHellopacketcontainsthelistofallrouterson
thenetworkfromwhichHelloPacketshavebeenseenrecently.
TheHellopacketalsocontainstherouter'scurrentchoicefor
DesignatedRouterandBackupDesignatedRouter.Avalueof
0.0.0.0inthesefieldsmeansthatonehasnotyetbeen
selected.
Onbroadcastnetworksandphysicalpointtopointnetworks,
HellopacketsaresenteveryHelloIntervalsecondstotheIP
multicastaddressAllSPFRouters.Onvirtuallinks,Hello
packetsaresentasunicasts(addresseddirectlytotheother
endofthevirtuallink)everyHelloIntervalseconds.OnPoint
toMultiPointnetworks,separateHellopacketsaresenttoeach
attachedneighboreveryHelloIntervalseconds.SendingofHello
packetsonNBMAnetworksiscoveredinthenextsection.

https://www.ietf.org/rfc/rfc2328.txt

60/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page78]
RFC2328OSPFVersion2April1998
9.5.1.SendingHellopacketsonNBMAnetworks
Staticconfigurationinformationmaybenecessaryinorder
fortheHelloProtocoltofunctiononnonbroadcastnetworks
(seeSectionsC.5andC.6).OnNBMAnetworks,every
attachedrouterwhichiseligibletobecomeDesignated
Routerbecomesawareofallofitsneighborsonthenetwork
(eitherthroughconfigurationorbysomeunspecified
mechanism).Eachneighborislabelledwiththeneighbor's
DesignatedRoutereligibility.
TheinterfacestatemustbeatleastWaitingforanyHello
PacketstobesentouttheNBMAinterface.HelloPackets
arethensentdirectly(asunicasts)tosomesubsetofa
router'sneighbors.SometimesanHelloPacketissent
periodicallyonatimer;atothertimesitissentasa
responsetoareceivedHelloPacket.Arouter'shello
sendingbehaviorvariesdependingonwhethertherouter
itselfiseligibletobecomeDesignatedRouter.
IftherouteriseligibletobecomeDesignatedRouter,it
mustperiodicallysendHelloPacketstoallneighborsthat
arealsoeligible.Inaddition,iftherouterisitselfthe
DesignatedRouterorBackupDesignatedRouter,itmustalso
sendperiodicHelloPacketstoallotherneighbors.This
meansthatanytwoeligibleroutersarealwaysexchanging
HelloPackets,whichisnecessaryforthecorrectoperation
oftheDesignatedRouterelectionalgorithm.Tominimize
thenumberofHelloPacketssent,thenumberofeligible
routersonanNBMAnetworkshouldbekeptsmall.
IftherouterisnoteligibletobecomeDesignatedRouter,
itmustperiodicallysendHelloPacketstoboththe
DesignatedRouterandtheBackupDesignatedRouter(ifthey
exist).ItmustalsosendanHelloPacketinreplytoan
HelloPacketreceivedfromanyeligibleneighbor(otherthan
thecurrentDesignatedRouterandBackupDesignatedRouter).
Thisisneededtoestablishaninitialbidirectional
relationshipwithanypotentialDesignatedRouter.
WhensendingHellopacketsperiodicallytoanyneighbor,the
intervalbetweenHelloPacketsisdeterminedbythe

MoyStandardsTrack[Page79]
RFC2328OSPFVersion2April1998
neighbor'sstate.IftheneighborisinstateDown,Hello
PacketsaresenteveryPollIntervalseconds.Otherwise,
HelloPacketsaresenteveryHelloIntervalseconds.
10.TheNeighborDataStructure
AnOSPFrouterconverseswithitsneighboringrouters.Each
separateconversationisdescribedbya"neighbordatastructure".
EachconversationisboundtoaparticularOSPFrouterinterface,
https://www.ietf.org/rfc/rfc2328.txt

61/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

andisidentifiedeitherbytheneighboringrouter'sOSPFRouterID
orbyitsNeighborIPaddress(seebelow).ThusiftheOSPFrouter
andanotherrouterhavemultipleattachednetworksincommon,
multipleconversationsensue,eachdescribedbyauniqueneighbor
datastructure.Eachseparateconversationislooselyreferredto
inthetextasbeingaseparate"neighbor".
Theneighbordatastructurecontainsallinformationpertinentto
theformingorformedadjacencybetweenthetwoneighbors.
(However,rememberthatnotallneighborsbecomeadjacent.)An
adjacencycanbeviewedasahighlydevelopedconversationbetween
tworouters.
State
Thefunctionalleveloftheneighborconversation.Thisis
describedinmoredetailinSection10.1.
InactivityTimer
AsingleshottimerwhosefiringindicatesthatnoHelloPacket
hasbeenseenfromthisneighborrecently.Thelengthofthe
timerisRouterDeadIntervalseconds.
Master/Slave
Whenthetwoneighborsareexchangingdatabases,theyforma
master/slaverelationship.ThemastersendsthefirstDatabase
DescriptionPacket,andistheonlypartthatisallowedto
retransmit.Theslavecanonlyrespondtothemaster'sDatabase
DescriptionPackets.Themaster/slaverelationshipis
negotiatedinstateExStart.

MoyStandardsTrack[Page80]
RFC2328OSPFVersion2April1998
DDSequenceNumber
TheDDSequencenumberoftheDatabaseDescriptionpacketthat
iscurrentlybeingsenttotheneighbor.
LastreceivedDatabaseDescriptionpacket
Theinitialize(I),more(M)andmaster(MS)bits,Optionsfield,
andDDsequencenumbercontainedinthelastDatabase
Descriptionpacketreceivedfromtheneighbor.Usedtodetermine
whetherthenextDatabaseDescriptionpacketreceivedfromthe
neighborisaduplicate.
NeighborID
TheOSPFRouterIDoftheneighboringrouter.TheNeighborID
islearnedwhenHellopacketsarereceivedfromtheneighbor,or
isconfiguredifthisisavirtualadjacency(seeSectionC.4).
NeighborPriority
TheRouterPriorityoftheneighboringrouter.Containedinthe
neighbor'sHellopackets,thisitemisusedwhenselectingthe
DesignatedRouterfortheattachednetwork.
NeighborIPaddress
TheIPaddressoftheneighboringrouter'sinterfacetothe
attachednetwork.UsedastheDestinationIPaddresswhen
protocolpacketsaresentasunicastsalongthisadjacency.
https://www.ietf.org/rfc/rfc2328.txt

62/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

AlsousedinrouterLSAsastheLinkIDfortheattachednetwork
iftheneighboringrouterisselectedtobeDesignatedRouter
(seeSection12.4.1).TheNeighborIPaddressislearnedwhen
Hellopacketsarereceivedfromtheneighbor.Forvirtual
links,theNeighborIPaddressislearnedduringtherouting
tablebuildprocess(seeSection15).
NeighborOptions
TheoptionalOSPFcapabilitiessupportedbytheneighbor.
LearnedduringtheDatabaseExchangeprocess(seeSection10.6).
Theneighbor'soptionalOSPFcapabilitiesarealsolistedinits
Hellopackets.ThisenablesreceivedHelloPacketstobe
rejected(i.e.,neighborrelationshipswillnotevenstartto
form)ifthereisamismatchincertaincrucialOSPF
capabilities(seeSection10.5).TheoptionalOSPFcapabilities
aredocumentedinSection4.5.

MoyStandardsTrack[Page81]
RFC2328OSPFVersion2April1998
Neighbor'sDesignatedRouter
Theneighbor'sideaoftheDesignatedRouter.Ifthisisthe
neighboritself,thisisimportantinthelocalcalculationof
theDesignatedRouter.DefinedonlyonbroadcastandNBMA
networks.
Neighbor'sBackupDesignatedRouter
Theneighbor'sideaoftheBackupDesignatedRouter.Ifthisis
theneighboritself,thisisimportantinthelocalcalculation
oftheBackupDesignatedRouter.Definedonlyonbroadcastand
NBMAnetworks.
ThenextsetofvariablesarelistsofLSAs.Theselistsdescribe
subsetsofthearealinkstatedatabase.Thismemodefinesfive
distincttypesofLSAs,allofwhichmaybepresentinanarea
linkstatedatabase:routerLSAs,networkLSAs,andType3and4
summaryLSAs(allstoredintheareadatastructure),andAS
externalLSAs(storedintheglobaldatastructure).
Linkstateretransmissionlist
ThelistofLSAsthathavebeenfloodedbutnotacknowledgedon
thisadjacency.Thesewillberetransmittedatintervalsuntil
theyareacknowledged,oruntiltheadjacencyisdestroyed.
Databasesummarylist
ThecompletelistofLSAsthatmakeupthearealinkstate
database,atthemomenttheneighborgoesintoDatabaseExchange
state.ThislistissenttotheneighborinDatabase
Descriptionpackets.
Linkstaterequestlist
ThelistofLSAsthatneedtobereceivedfromthisneighborin
ordertosynchronizethetwoneighbors'linkstatedatabases.
ThislistiscreatedasDatabaseDescriptionpacketsare
received,andisthensenttotheneighborinLinkStateRequest
packets.ThelistisdepletedasappropriateLinkStateUpdate
packetsarereceived.
https://www.ietf.org/rfc/rfc2328.txt

63/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page82]
RFC2328OSPFVersion2April1998
10.1.Neighborstates
Thestateofaneighbor(really,thestateofaconversation
beingheldwithaneighboringrouter)isdocumentedinthe
followingsections.Thestatesarelistedinorderof
progressingfunctionality.Forexample,theinoperativestate
islistedfirst,followedbyalistofintermediatestates
beforethefinal,fullyfunctionalstateisachieved.The
specificationmakesuseofthisorderingbysometimesmaking
referencessuchas"thoseneighbors/adjacenciesinstategreater
thanX".Figures12and13showthegraphofneighborstate
changes.Thearcsofthegraphsarelabelledwiththeevent
causingthestatechange.Theneighboreventsaredocumentedin
Section10.2.
ThegraphinFigure12showsthestatechangeseffectedbythe
HelloProtocol.TheHelloProtocolisresponsibleforneighbor
acquisitionandmaintenance,andforensuringtwoway
communicationbetweenneighbors.
ThegraphinFigure13showstheformingofanadjacency.Not
everytwoneighboringroutersbecomeadjacent(seeSection
10.4).Theadjacencystartstoformwhentheneighborisin
stateExStart.Afterthetworoutersdiscovertheir
master/slavestatus,thestatetransitionstoExchange.Atthis
pointtheneighborstartstobeusedinthefloodingprocedure,
andthetwoneighboringroutersbeginsynchronizingtheir
databases.Whenthissynchronizationisfinished,theneighbor
isinstateFullandwesaythatthetworoutersarefully
adjacent.AtthispointtheadjacencyislistedinLSAs.
Foramoredetaileddescriptionofneighborstatechanges,
togetherwiththeadditionalactionsinvolvedineachchange,
seeSection10.3.
Down
Thisistheinitialstateofaneighborconversation.It
indicatesthattherehasbeennorecentinformationreceived
fromtheneighbor.OnNBMAnetworks,Hellopacketsmay
stillbesentto"Down"neighbors,althoughatareduced
frequency(seeSection9.5.1).

MoyStandardsTrack[Page83]
RFC2328OSPFVersion2April1998

++
|Down|
++
|\
https://www.ietf.org/rfc/rfc2328.txt

64/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

|\Start
|\++
Hello|+>|Attempt|
Received|++
||
++<+|HelloReceived
|Init|<+
++<+
||
|2Way|1Way
|Received|Received
||
++|++
|ExStart|<+>|2Way|
++++
Figure12:Neighborstatechanges(HelloProtocol)
Inadditiontothestatetransitionspictured,
EventKillNbralwaysforcesDownState,
EventInactivityTimeralwaysforcesDownState,
EventLLDownalwaysforcesDownState

MoyStandardsTrack[Page84]
RFC2328OSPFVersion2April1998
++
|ExStart|
++
|
NegotiationDone|
+>++
|Exchange|
+++
|
Exchange|
Done|
++|++
|Full|<+>|Loading|
++<+++
|LoadingDone|
++
Figure13:Neighborstatechanges(DatabaseExchange)
Inadditiontothestatetransitionspictured,
https://www.ietf.org/rfc/rfc2328.txt

65/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

EventSeqNumberMismatchforcesExStartstate,
EventBadLSReqforcesExStartstate,
Event1WayforcesInitstate,
EventKillNbralwaysforcesDownState,
EventInactivityTimeralwaysforcesDownState,
EventLLDownalwaysforcesDownState,
EventAdjOK?leadstoadjacencyforming/breaking
Attempt
ThisstateisonlyvalidforneighborsattachedtoNBMA
networks.Itindicatesthatnorecentinformationhasbeen
receivedfromtheneighbor,butthatamoreconcertedeffort
shouldbemadetocontacttheneighbor.Thisisdoneby
sendingtheneighborHellopacketsatintervalsof
HelloInterval(seeSection9.5.1).
Init
Inthisstate,anHellopackethasrecentlybeenseenfrom
theneighbor.However,bidirectionalcommunicationhasnot
yetbeenestablishedwiththeneighbor(i.e.,therouter
itselfdidnotappearintheneighbor'sHellopacket).All

MoyStandardsTrack[Page85]
RFC2328OSPFVersion2April1998
neighborsinthisstate(orhigher)arelistedintheHello
packetssentfromtheassociatedinterface.
2Way
Inthisstate,communicationbetweenthetworoutersis
bidirectional.Thishasbeenassuredbytheoperationof
theHelloProtocol.Thisisthemostadvancedstateshort
ofbeginningadjacencyestablishment.The(Backup)
DesignatedRouterisselectedfromthesetofneighborsin
state2Wayorgreater.
ExStart
Thisisthefirststepincreatinganadjacencybetweenthe
twoneighboringrouters.Thegoalofthisstepistodecide
whichrouteristhemaster,andtodecideupontheinitial
DDsequencenumber.Neighborconversationsinthisstateor
greaterarecalledadjacencies.
Exchange
Inthisstatetherouterisdescribingitsentirelinkstate
databasebysendingDatabaseDescriptionpacketstothe
neighbor.EachDatabaseDescriptionPackethasaDD
sequencenumber,andisexplicitlyacknowledged.Onlyone
DatabaseDescriptionPacketisallowedoutstandingatany
onetime.Inthisstate,LinkStateRequestPacketsmay
alsobesentaskingfortheneighbor'smorerecentLSAs.
AlladjacenciesinExchangestateorgreaterareusedbythe
floodingprocedure.Infact,theseadjacenciesarefully
capableoftransmittingandreceivingalltypesofOSPF
routingprotocolpackets.
Loading
Inthisstate,LinkStateRequestpacketsaresenttothe
neighboraskingforthemorerecentLSAsthathavebeen
discovered(butnotyetreceived)intheExchangestate.
https://www.ietf.org/rfc/rfc2328.txt

66/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Full
Inthisstate,theneighboringroutersarefullyadjacent.
TheseadjacencieswillnowappearinrouterLSAsand
networkLSAs.

MoyStandardsTrack[Page86]
RFC2328OSPFVersion2April1998
10.2.Eventscausingneighborstatechanges
Statechangescanbeeffectedbyanumberofevents.These
eventsareshowninthelabelsofthearcsinFigures12and13.
Thelabeldefinitionsareasfollows:
HelloReceived
AnHellopackethasbeenreceivedfromtheneighbor.
Start
ThisisanindicationthatHelloPacketsshouldnowbesent
totheneighboratintervalsofHelloIntervalseconds.This
eventisgeneratedonlyforneighborsassociatedwithNBMA
networks.
2WayReceived
Bidirectionalcommunicationhasbeenrealizedbetweenthe
twoneighboringrouters.Thisisindicatedbytherouter
seeingitselfintheneighbor'sHellopacket.
NegotiationDone
TheMaster/Slaverelationshiphasbeennegotiated,andDD
sequencenumbershavebeenexchanged.Thissignalsthe
startofthesending/receivingofDatabaseDescription
packets.Formoreinformationonthegenerationofthis
event,consultSection10.8.
ExchangeDone
Bothroutershavesuccessfullytransmittedafullsequence
ofDatabaseDescriptionpackets.Eachrouternowknowswhat
partsofitslinkstatedatabaseareoutofdate.Formore
informationonthegenerationofthisevent,consultSection
10.8.
BadLSReq
ALinkStateRequesthasbeenreceivedforanLSAnot
containedinthedatabase.Thisindicatesanerrorinthe
DatabaseExchangeprocess.
LoadingDone
LinkStateUpdateshavebeenreceivedforalloutofdate

MoyStandardsTrack[Page87]
RFC2328OSPFVersion2April1998

https://www.ietf.org/rfc/rfc2328.txt

67/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

portionsofthedatabase.ThisisindicatedbytheLink
staterequestlistbecomingemptyaftertheDatabase
Exchangeprocesshascompleted.
AdjOK?
Adecisionmustbemadeastowhetheranadjacencyshouldbe
established/maintainedwiththeneighbor.Thiseventwill
startsomeadjacenciesforming,anddestroyothers.
Thefollowingeventscausewelldevelopedneighborstorevertto
lesserstates.Unliketheaboveevents,theseeventsmayoccur
whentheneighborconversationisinanyofanumberofstates.
SeqNumberMismatch
ADatabaseDescriptionpackethasbeenreceivedthateither
a)hasanunexpectedDDsequencenumber,b)unexpectedlyhas
theInitbitsetorc)hasanOptionsfielddifferingfrom
thelastOptionsfieldreceivedinaDatabaseDescription
packet.Anyoftheseconditionsindicatethatsomeerror
hasoccurredduringadjacencyestablishment.
1Way
AnHellopackethasbeenreceivedfromtheneighbor,in
whichtherouterisnotmentioned.Thisindicatesthat
communicationwiththeneighborisnotbidirectional.
KillNbr
Thisisanindicationthatallcommunicationwiththe
neighborisnowimpossible,forcingtheneighborto
reverttoDownstate.
InactivityTimer
TheinactivityTimerhasfired.ThismeansthatnoHello
packetshavebeenseenrecentlyfromtheneighbor.The
neighborrevertstoDownstate.
LLDown
Thisisanindicationfromthelowerlevelprotocolsthat
theneighborisnowunreachable.Forexample,onanX.25
networkthiscouldbeindicatedbyanX.25clearindication

MoyStandardsTrack[Page88]
RFC2328OSPFVersion2April1998
withappropriatecauseanddiagnosticfields.Thisevent
forcestheneighborintoDownstate.
10.3.TheNeighborstatemachine
Adetaileddescriptionoftheneighborstatechangesfollows.
Eachstatechangeisinvokedbyanevent(Section10.2).This
eventmayproducedifferenteffects,dependingonthecurrent
stateoftheneighbor.Forthisreason,thestatemachinebelow
isorganizedbycurrentneighborstateandreceivedevent.Each
entryinthestatemachinedescribestheresultingnewneighbor
stateandtherequiredsetofadditionalactions.
Whenaneighbor'sstatechanges,itmaybenecessarytorerun
https://www.ietf.org/rfc/rfc2328.txt

68/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

theDesignatedRouterelectionalgorithm.Thisisdeterminedby
whethertheinterfaceNeighborChangeeventisgenerated(see
Section9.2).Also,iftheInterfaceisinDRstate(therouter
isitselfDesignatedRouter),changesinneighborstatemay
causeanewnetworkLSAtobeoriginated(seeSection12.4).
Whentheneighborstatemachineneedstoinvoketheinterface
statemachine,itshouldbedoneasascheduledtask(see
Section4.4).Thissimplifiesthings,byensuringthatneither
statemachinewillbeexecutedrecursively.
State(s):Down
Event:Start
Newstate:Attempt
Action:SendanHelloPackettotheneighbor(thisneighbor
isalwaysassociatedwithanNBMAnetwork)andstart
theInactivityTimerfortheneighbor.Thetimer's
laterfiringwouldindicatethatcommunicationwith
theneighborwasnotattained.
State(s):Attempt

MoyStandardsTrack[Page89]
RFC2328OSPFVersion2April1998
Event:HelloReceived
Newstate:Init
Action:RestarttheInactivityTimerfortheneighbor,since
theneighborhasnowbeenheardfrom.
State(s):Down
Event:HelloReceived
Newstate:Init
Action:StarttheInactivityTimerfortheneighbor.The
timer'slaterfiringwouldindicatethatthe
neighborisdead.
State(s):Initorgreater
Event:HelloReceived
Newstate:Nostatechange.
Action:RestarttheInactivityTimerfortheneighbor,since
theneighborhasagainbeenheardfrom.
State(s):Init
https://www.ietf.org/rfc/rfc2328.txt

69/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Event:2WayReceived
Newstate:Dependsuponactionroutine.
Action:Determinewhetheranadjacencyshouldbeestablished
withtheneighbor(seeSection10.4).Ifnot,the
newneighborstateis2Way.
Otherwise(anadjacencyshouldbeestablished)the
neighborstatetransitionstoExStart.Upon
enteringthisstate,therouterincrementstheDD

MoyStandardsTrack[Page90]
RFC2328OSPFVersion2April1998
sequencenumberintheneighbordatastructure.If
thisisthefirsttimethatanadjacencyhasbeen
attempted,theDDsequencenumbershouldbeassigned
someuniquevalue(likethetimeofdayclock).It
thendeclaresitselfmaster(setsthemaster/slave
bittomaster),andstartssendingDatabase
DescriptionPackets,withtheinitialize(I),more
(M)andmaster(MS)bitsset.ThisDatabase
DescriptionPacketshouldbeotherwiseempty.This
DatabaseDescriptionPacketshouldberetransmitted
atintervalsofRxmtIntervaluntilthenextstateis
entered(seeSection10.8).
State(s):ExStart
Event:NegotiationDone
Newstate:Exchange
Action:Theroutermustlistthecontentsofitsentirearea
linkstatedatabaseintheneighborDatabasesummary
list.Thearealinkstatedatabaseconsistsofthe
routerLSAs,networkLSAsandsummaryLSAscontained
intheareastructure,alongwiththeASexternal
LSAscontainedintheglobalstructure.AS
externalLSAsareomittedfromavirtualneighbor's
Databasesummarylist.ASexternalLSAsareomitted
fromtheDatabasesummarylistiftheareahasbeen
configuredasastub(seeSection3.6).LSAswhose
ageisequaltoMaxAgeareinsteadaddedtothe
neighbor'sLinkstateretransmissionlist.A
summaryoftheDatabasesummarylistwillbesentto
theneighborinDatabaseDescriptionpackets.Each
DatabaseDescriptionPackethasaDDsequence
number,andisexplicitlyacknowledged.Onlyone
DatabaseDescriptionPacketisallowedoutstanding
atanyonetime.Formoredetailonthesendingand
receivingofDatabaseDescriptionpackets,see
Sections10.8and10.6.

https://www.ietf.org/rfc/rfc2328.txt

70/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page91]
RFC2328OSPFVersion2April1998
State(s):Exchange
Event:ExchangeDone
Newstate:Dependsuponactionroutine.
Action:IftheneighborLinkstaterequestlistisempty,
thenewneighborstateisFull.Nootheractionis
required.Thisisanadjacency'sfinalstate.
Otherwise,thenewneighborstateisLoading.Start
(orcontinue)sendingLinkStateRequestpacketsto
theneighbor(seeSection10.9).Thesearerequests
fortheneighbor'smorerecentLSAs(whichwere
discoveredbutnotyetreceivedintheExchange
state).TheseLSAsarelistedintheLinkstate
requestlistassociatedwiththeneighbor.
State(s):Loading
Event:LoadingDone
Newstate:Full
Action:Noactionrequired.Thisisanadjacency'sfinal
state.
State(s):2Way
Event:AdjOK?
Newstate:Dependsuponactionroutine.
Action:Determinewhetheranadjacencyshouldbeformedwith
theneighboringrouter(seeSection10.4).Ifnot,
theneighborstateremainsat2Way.Otherwise,
transitiontheneighborstatetoExStartandperform
theactionsassociatedwiththeabovestatemachine
entryforstateInitandevent2WayReceived.

MoyStandardsTrack[Page92]
RFC2328OSPFVersion2April1998
State(s):ExStartorgreater
Event:AdjOK?
Newstate:Dependsuponactionroutine.
Action:Determinewhethertheneighboringroutershould
stillbeadjacent.Ifyes,thereisnostatechange
andnofurtheractionisnecessary.
https://www.ietf.org/rfc/rfc2328.txt

71/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Otherwise,the(possiblypartiallyformed)adjacency
mustbedestroyed.Theneighborstatetransitions
to2Way.TheLinkstateretransmissionlist,
DatabasesummarylistandLinkstaterequestlist
areclearedofLSAs.
State(s):Exchangeorgreater
Event:SeqNumberMismatch
Newstate:ExStart
Action:The(possiblypartiallyformed)adjacencyistorn
down,andthenanattemptismadeat
reestablishment.Theneighborstatefirst
transitionstoExStart.TheLinkstate
retransmissionlist,DatabasesummarylistandLink
staterequestlistareclearedofLSAs.Thenthe
routerincrementstheDDsequencenumberinthe
neighbordatastructure,declaresitselfmaster
(setsthemaster/slavebittomaster),andstarts
sendingDatabaseDescriptionPackets,withthe
initialize(I),more(M)andmaster(MS)bitsset.
ThisDatabaseDescriptionPacketshouldbeotherwise
empty(seeSection10.8).
State(s):Exchangeorgreater
Event:BadLSReq

MoyStandardsTrack[Page93]
RFC2328OSPFVersion2April1998
Newstate:ExStart
Action:TheactionforeventBadLSReqisexactlythesameas
fortheneighboreventSeqNumberMismatch.The
(possiblypartiallyformed)adjacencyistorndown,
andthenanattemptismadeatreestablishment.For
moreinformation,seetheneighborstatemachine
entrythatisinvokedwheneventSeqNumberMismatch
isgeneratedinstateExchangeorgreater.
State(s):Anystate
Event:KillNbr
Newstate:Down
Action:TheLinkstateretransmissionlist,Databasesummary
listandLinkstaterequestlistareclearedof
LSAs.Also,theInactivityTimerisdisabled.
State(s):Anystate
Event:LLDown
https://www.ietf.org/rfc/rfc2328.txt

72/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Newstate:Down
Action:TheLinkstateretransmissionlist,Databasesummary
listandLinkstaterequestlistareclearedof
LSAs.Also,theInactivityTimerisdisabled.
State(s):Anystate
Event:InactivityTimer
Newstate:Down
Action:TheLinkstateretransmissionlist,Databasesummary
listandLinkstaterequestlistareclearedof
LSAs.

MoyStandardsTrack[Page94]
RFC2328OSPFVersion2April1998
State(s):2Wayorgreater
Event:1WayReceived
Newstate:Init
Action:TheLinkstateretransmissionlist,Databasesummary
listandLinkstaterequestlistareclearedof
LSAs.
State(s):2Wayorgreater
Event:2WayReceived
Newstate:Nostatechange.
Action:Noactionrequired.
State(s):Init
Event:1WayReceived
Newstate:Nostatechange.
Action:Noactionrequired.
10.4.Whethertobecomeadjacent
Adjacenciesareestablishedwithsomesubsetoftherouter's
neighbors.Routersconnectedbypointtopointnetworks,
PointtoMultiPointnetworksandvirtuallinksalwaysbecome
adjacent.OnbroadcastandNBMAnetworks,allroutersbecome
adjacenttoboththeDesignatedRouterandtheBackupDesignated
Router.
Theadjacencyformingdecisionoccursintwoplacesinthe
neighborstatemachine.First,whenbidirectionalcommunication
https://www.ietf.org/rfc/rfc2328.txt

73/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

isinitiallyestablishedwiththeneighbor,andsecondly,when
theidentityoftheattachednetwork's(Backup)Designated

MoyStandardsTrack[Page95]
RFC2328OSPFVersion2April1998
Routerchanges.Ifthedecisionismadetonotattemptan
adjacency,thestateoftheneighborcommunicationstopsat2
Way.
Anadjacencyshouldbeestablishedwithabidirectionalneighbor
whenatleastoneofthefollowingconditionsholds:
oTheunderlyingnetworktypeispointtopoint
oTheunderlyingnetworktypeisPointtoMultiPoint
oTheunderlyingnetworktypeisvirtuallink
oTherouteritselfistheDesignatedRouter
oTherouteritselfistheBackupDesignatedRouter
oTheneighboringrouteristheDesignatedRouter
oTheneighboringrouteristheBackupDesignatedRouter
10.5.ReceivingHelloPackets
Thissectionexplainsthedetailedprocessingofareceived
HelloPacket.(SeeSectionA.3.2fortheformatofHello
packets.)ThegenericinputprocessingofOSPFpacketswill
havecheckedthevalidityoftheIPheaderandtheOSPFpacket
header.Next,thevaluesoftheNetworkMask,HelloInterval,
andRouterDeadIntervalfieldsinthereceivedHellopacketmust
becheckedagainstthevaluesconfiguredforthereceiving
interface.Anymismatchcausesprocessingtostopandthe
packettobedropped.Inotherwords,theabovefieldsare
reallydescribingtheattachednetwork'sconfiguration.However,
thereisoneexceptiontotheaboverule:onpointtopoint
networksandonvirtuallinks,theNetworkMaskinthereceived
HelloPacketshouldbeignored.
ThereceivinginterfaceattachestoasingleOSPFarea(this
couldbethebackbone).ThesettingoftheEbitfoundinthe
HelloPacket'sOptionsfieldmustmatchthisarea's

MoyStandardsTrack[Page96]
RFC2328OSPFVersion2April1998
ExternalRoutingCapability.IfASexternalLSAsarenotflooded
into/throughoutthearea(i.e,theareaisa"stub")theEbit
mustbeclearinreceivedHelloPackets,otherwisetheEbit
mustbeset.Amismatchcausesprocessingtostopandthe
packettobedropped.Thesettingoftherestofthebitsin
https://www.ietf.org/rfc/rfc2328.txt

74/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

theHelloPacket'sOptionsfieldshouldbeignored.
Atthispoint,anattemptismadetomatchthesourceofthe
HelloPackettooneofthereceivinginterface'sneighbors.If
thereceivinginterfaceconnectstoabroadcast,Pointto
MultiPointorNBMAnetworkthesourceisidentifiedbytheIP
sourceaddressfoundintheHello'sIPheader.Ifthereceiving
interfaceconnectstoapointtopointlinkoravirtuallink,
thesourceisidentifiedbytheRouterIDfoundintheHello's
OSPFpacketheader.Theinterface'scurrentlistofneighbors
iscontainedintheinterface'sdatastructure.Ifamatching
neighborstructurecannotbefound,(i.e.,thisisthefirst
timetheneighborhasbeendetected),oneiscreated.The
initialstateofanewlycreatedneighborissettoDown.
WhenreceivinganHelloPacketfromaneighboronabroadcast,
PointtoMultiPointorNBMAnetwork,settheneighbor
structure'sNeighborIDequaltotheRouterIDfoundinthe
packet'sOSPFheader.Forthesenetworktypes,theneighbor
structure'sRouterPriorityfield,Neighbor'sDesignatedRouter
field,andNeighbor'sBackupDesignatedRouterfieldarealso
setequaltothecorrespondingfieldsfoundinthereceived
HelloPacket;changesinthesefieldsshouldbenotedfor
possibleuseinthestepsbelow.WhenreceivinganHelloona
pointtopointnetwork(butnotonavirtuallink)setthe
neighborstructure'sNeighborIPaddresstothepacket'sIP
sourceaddress.
NowtherestoftheHelloPacketisexamined,generatingevents
tobegiventotheneighborandinterfacestatemachines.These
statemachinesarespecifiedeithertobeexecutedorscheduled
(seeSection4.4).Forexample,byspecifyingbelowthatthe
neighborstatemachinebeexecutedinline,severalneighbor
statetransitionsmaybeeffectedbyasinglereceivedHello:

MoyStandardsTrack[Page97]
RFC2328OSPFVersion2April1998
oEachHelloPacketcausestheneighborstatemachinetobe
executedwiththeeventHelloReceived.
oThenthelistofneighborscontainedintheHelloPacketis
examined.Iftherouteritselfappearsinthislist,the
neighborstatemachineshouldbeexecutedwiththeevent2
WayReceived.Otherwise,theneighborstatemachineshould
beexecutedwiththeevent1WayReceived,andtheprocessing
ofthepacketstops.
oNext,ifachangeintheneighbor'sRouterPriorityfield
wasnoted,thereceivinginterface'sstatemachineis
scheduledwiththeeventNeighborChange.
oIftheneighborisbothdeclaringitselftobeDesignated
Router(HelloPacket'sDesignatedRouterfield=NeighborIP
address)andtheBackupDesignatedRouterfieldinthe
packetisequalto0.0.0.0andthereceivinginterfaceisin
stateWaiting,thereceivinginterface'sstatemachineis
scheduledwiththeeventBackupSeen.Otherwise,ifthe
https://www.ietf.org/rfc/rfc2328.txt

75/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

neighborisdeclaringitselftobeDesignatedRouterandit
hadnotpreviously,ortheneighborisnotdeclaringitself
DesignatedRouterwhereithadpreviously,thereceiving
interface'sstatemachineisscheduledwiththeevent
NeighborChange.
oIftheneighborisdeclaringitselftobeBackupDesignated
Router(HelloPacket'sBackupDesignatedRouterfield=
NeighborIPaddress)andthereceivinginterfaceisinstate
Waiting,thereceivinginterface'sstatemachineis
scheduledwiththeeventBackupSeen.Otherwise,ifthe
neighborisdeclaringitselftobeBackupDesignatedRouter
andithadnotpreviously,ortheneighborisnotdeclaring
itselfBackupDesignatedRouterwhereithadpreviously,the
receivinginterface'sstatemachineisscheduledwiththe
eventNeighborChange.
OnNBMAnetworks,receiptofanHelloPacketmayalsocausean
HelloPackettobesentbacktotheneighborinresponse.See
Section9.5.1formoredetails.

MoyStandardsTrack[Page98]
RFC2328OSPFVersion2April1998
10.6.ReceivingDatabaseDescriptionPackets
Thissectionexplainsthedetailedprocessingofareceived
DatabaseDescriptionPacket.TheincomingDatabaseDescription
Packethasalreadybeenassociatedwithaneighborandreceiving
interfacebythegenericinputpacketprocessing(Section8.2).
WhethertheDatabaseDescriptionpacketshouldbeaccepted,and
ifso,howitshouldbefurtherprocesseddependsuponthe
neighborstate.
IfaDatabaseDescriptionpacketisaccepted,thefollowing
packetfieldsshouldbesavedinthecorrespondingneighbordata
structureunder"lastreceivedDatabaseDescriptionpacket":
thepacket'sinitialize(I),more(M)andmaster(MS)bits,
Optionsfield,andDDsequencenumber.Ifthesefieldsareset
identicallyintwoconsecutiveDatabaseDescriptionpackets
receivedfromtheneighbor,thesecondDatabaseDescription
packetisconsideredtobea"duplicate"intheprocessing
describedbelow.
IftheInterfaceMTUfieldintheDatabaseDescriptionpacket
indicatesanIPdatagramsizethatislargerthantheroutercan
acceptonthereceivinginterfacewithoutfragmentation,the
DatabaseDescriptionpacketisrejected.Otherwise,ifthe
neighborstateis:
Down
Thepacketshouldberejected.
Attempt
Thepacketshouldberejected.
Init
Theneighborstatemachineshouldbeexecutedwiththeevent
2WayReceived.Thiscausesanimmediatestatechangeto
https://www.ietf.org/rfc/rfc2328.txt

76/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

eitherstate2WayorstateExStart.Ifthenewstateis
ExStart,theprocessingofthecurrentpacketshouldthen
continueinthisnewstatebyfallingthroughtocase
ExStartbelow.

MoyStandardsTrack[Page99]
RFC2328OSPFVersion2April1998
2Way
Thepacketshouldbeignored.DatabaseDescriptionPackets
areusedonlyforthepurposeofbringingupadjacencies.[7]
ExStart
Ifthereceivedpacketmatchesoneofthefollowingcases,
thentheneighborstatemachineshouldbeexecutedwiththe
eventNegotiationDone(causingthestatetotransitionto
Exchange),thepacket'sOptionsfieldshouldberecordedin
theneighborstructure'sNeighborOptionsfieldandthe
packetshouldbeacceptedasnextinsequenceandprocessed
further(seebelow).Otherwise,thepacketshouldbe
ignored.
oTheinitialize(I),more(M)andmaster(MS)bitsareset,
thecontentsofthepacketareempty,andtheneighbor's
RouterIDislargerthantherouter'sown.Inthiscase
therouterisnowSlave.Setthemaster/slavebitto
slave,andsettheneighbordatastructure'sDDsequence
numbertothatspecifiedbythemaster.
oTheinitialize(I)andmaster(MS)bitsareoff,the
packet'sDDsequencenumberequalstheneighbordata
structure'sDDsequencenumber(indicating
acknowledgment)andtheneighbor'sRouterIDissmaller
thantherouter'sown.Inthiscasetherouteris
Master.
Exchange
DuplicateDatabaseDescriptionpacketsarediscardedbythe
master,andcausetheslavetoretransmitthelastDatabase
Descriptionpacketthatithadsent.Otherwise(thepacket
isnotaduplicate):
oIfthestateoftheMSbitisinconsistentwiththe
master/slavestateoftheconnection,generatethe
neighboreventSeqNumberMismatchandstopprocessingthe
packet.
oIftheinitialize(I)bitisset,generatetheneighbor
eventSeqNumberMismatchandstopprocessingthepacket.

MoyStandardsTrack[Page100]
RFC2328OSPFVersion2April1998

https://www.ietf.org/rfc/rfc2328.txt

77/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

oIfthepacket'sOptionsfieldindicatesadifferentset
ofoptionalOSPFcapabilitiesthanwerepreviously
receivedfromtheneighbor(recordedintheNeighbor
Optionsfieldoftheneighborstructure),generatethe
neighboreventSeqNumberMismatchandstopprocessingthe
packet.
oDatabaseDescriptionpacketsmustbeprocessedin
sequence,asindicatedbythepackets'DDsequence
numbers.Iftherouterismaster,thenextpacket
receivedshouldhaveDDsequencenumberequaltotheDD
sequencenumberintheneighbordatastructure.Ifthe
routerisslave,thenextpacketreceivedshouldhaveDD
sequencenumberequaltoonemorethantheDDsequence
numberstoredintheneighbordatastructure.Ineither
case,ifthepacketisthenextinsequenceitshouldbe
acceptedanditscontentsprocessedasspecifiedbelow.
oElse,generatetheneighboreventSeqNumberMismatchand
stopprocessingthepacket.
LoadingorFull
Inthisstate,therouterhassentandreceivedanentire
sequenceofDatabaseDescriptionPackets.Theonlypackets
receivedshouldbeduplicates(seeabove).Inparticular,
thepacket'sOptionsfieldshouldmatchthesetofoptional
OSPFcapabilitiespreviouslyindicatedbytheneighbor
(storedintheneighborstructure'sNeighborOptionsfield).
Anyotherpacketsreceived,includingthereceptionofa
packetwiththeInitialize(I)bitset,shouldgeneratethe
neighboreventSeqNumberMismatch.[8]Duplicatesshouldbe
discardedbythemaster.Theslavemustrespondto
duplicatesbyrepeatingthelastDatabaseDescriptionpacket
thatithadsent.
WhentherouteracceptsareceivedDatabaseDescriptionPacket
asthenextinsequencethepacketcontentsareprocessedas
follows.ForeachLSAlisted,theLSA'sLStypeischeckedfor
validity.IftheLStypeisunknown(e.g.,notoneoftheLS
types15definedbythisspecification),orifthisisanAS
externalLSA(LStype=5)andtheneighborisassociatedwitha

MoyStandardsTrack[Page101]
RFC2328OSPFVersion2April1998
stubarea,generatetheneighboreventSeqNumberMismatchand
stopprocessingthepacket.Otherwise,therouterlooksupthe
LSAinitsdatabasetoseewhetheritalsohasaninstanceof
theLSA.Ifitdoesnot,orifthedatabasecopyislessrecent
(seeSection13.1),theLSAisputontheLinkstaterequest
listsothatitcanberequested(immediatelyoratsomelater
time)inLinkStateRequestPackets.
WhentherouteracceptsareceivedDatabaseDescriptionPacket
asthenextinsequence,italsoperformsthefollowingactions,
dependingonwhetheritismasterorslave:
Master
IncrementstheDDsequencenumberintheneighbordata
https://www.ietf.org/rfc/rfc2328.txt

78/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

structure.Iftherouterhasalreadysentitsentire
sequenceofDatabaseDescriptionPackets,andthejust
acceptedpackethasthemorebit(M)setto0,theneighbor
eventExchangeDoneisgenerated.Otherwise,itshouldsend
anewDatabaseDescriptiontotheslave.
Slave
SetstheDDsequencenumberintheneighbordatastructure
totheDDsequencenumberappearinginthereceivedpacket.
TheslavemustsendaDatabaseDescriptionPacketinreply.
Ifthereceivedpackethasthemorebit(M)setto0,and
thepackettobesentbytheslavewillalsohavetheMbit
setto0,theneighboreventExchangeDoneisgenerated.
Notethattheslavealwaysgeneratesthiseventbeforethe
master.
10.7.ReceivingLinkStateRequestPackets
ThissectionexplainsthedetailedprocessingofreceivedLink
StateRequestpackets.ReceivedLinkStateRequestPackets
specifyalistofLSAsthattheneighborwishestoreceive.
LinkStateRequestPacketsshouldbeacceptedwhentheneighbor
isinstatesExchange,Loading,orFull.Inallotherstates
LinkStateRequestPacketsshouldbeignored.

MoyStandardsTrack[Page102]
RFC2328OSPFVersion2April1998
EachLSAspecifiedintheLinkStateRequestpacketshouldbe
locatedintherouter'sdatabase,andcopiedintoLinkState
Updatepacketsfortransmissiontotheneighbor.TheseLSAs
shouldNOTbeplacedontheLinkstateretransmissionlistfor
theneighbor.IfanLSAcannotbefoundinthedatabase,
somethinghasgonewrongwiththeDatabaseExchangeprocess,and
neighboreventBadLSReqshouldbegenerated.
10.8.SendingDatabaseDescriptionPackets
ThissectiondescribeshowDatabaseDescriptionPacketsaresent
toaneighbor.TheDatabaseDescriptionpacket'sInterfaceMTU
fieldissettothesizeofthelargestIPdatagramthatcanbe
sentoutthesendinginterface,withoutfragmentation.Common
MTUsinuseintheInternetcanbefoundinTable71of
[Ref22].InterfaceMTUshouldbesetto0inDatabase
Descriptionpacketssentovervirtuallinks.
Therouter'soptionalOSPFcapabilities(seeSection4.5)are
transmittedtotheneighborintheOptionsfieldoftheDatabase
Descriptionpacket.Theroutershouldmaintainthesamesetof
optionalcapabilitiesthroughouttheDatabaseExchangeand
floodingprocedures.Ifforsomereasontherouter'soptional
capabilitieschange,theDatabaseExchangeprocedureshouldbe
restartedbyrevertingtoneighborstateExStart.Oneoptional
capabilityisdefinedinthisspecification(seeSections4.5
andA.2).TheEbitshouldbesetifandonlyiftheattached
networkbelongstoanonstubarea.Unrecognizedbitsinthe
Optionsfieldshouldbesettozero.
https://www.ietf.org/rfc/rfc2328.txt

79/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

ThesendingofDatabaseDescriptionpacketsdependsonthe
neighbor'sstate.InstateExStarttheroutersendsempty
DatabaseDescriptionpackets,withtheinitialize(I),more(M)
andmaster(MS)bitsset.Thesepacketsareretransmittedevery
RxmtIntervalseconds.
InstateExchangetheDatabaseDescriptionPacketsactually
containsummariesofthelinkstateinformationcontainedinthe
router'sdatabase.EachLSAinthearea'slinkstatedatabase
(atthetimetheneighbortransitionsintoExchangestate)is
listedintheneighborDatabasesummarylist.EachnewDatabase

MoyStandardsTrack[Page103]
RFC2328OSPFVersion2April1998
DescriptionPacketcopiesitsDDsequencenumberfromthe
neighbordatastructureandthendescribesthecurrenttopof
theDatabasesummarylist.ItemsareremovedfromtheDatabase
summarylistwhenthepreviouspacketisacknowledged.
InstateExchange,thedeterminationofwhentosendaDatabase
Descriptionpacketdependsonwhethertherouterismasteror
slave:
Master
DatabaseDescriptionpacketsaresentwheneithera)the
slaveacknowledgesthepreviousDatabaseDescriptionpacket
byechoingtheDDsequencenumberorb)RxmtIntervalseconds
elapsewithoutanacknowledgment,inwhichcasetheprevious
DatabaseDescriptionpacketisretransmitted.
Slave
DatabaseDescriptionpacketsaresentonlyinresponseto
DatabaseDescriptionpacketsreceivedfromthemaster.If
theDatabaseDescriptionpacketreceivedfromthemasteris
new,anewDatabaseDescriptionpacketissent,otherwise
thepreviousDatabaseDescriptionpacketisresent.
InstatesLoadingandFulltheslavemustresenditslast
DatabaseDescriptionpacketinresponsetoduplicateDatabase
Descriptionpacketsreceivedfromthemaster.Forthisreason
theslavemustwaitRouterDeadIntervalsecondsbeforefreeing
thelastDatabaseDescriptionpacket.ReceptionofaDatabase
Descriptionpacketfromthemasterafterthisintervalwill
generateaSeqNumberMismatchneighborevent.
10.9.SendingLinkStateRequestPackets
InneighborstatesExchangeorLoading,theLinkstaterequest
listcontainsalistofthoseLSAsthatneedtobeobtainedfrom
theneighbor.TorequesttheseLSAs,aroutersendsthe
neighborthebeginningoftheLinkstaterequestlist,packaged
inaLinkStateRequestpacket.

https://www.ietf.org/rfc/rfc2328.txt

80/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page104]
RFC2328OSPFVersion2April1998
Whentheneighborrespondstotheserequestswiththeproper
LinkStateUpdatepacket(s),theLinkstaterequestlistis
truncatedandanewLinkStateRequestpacketissent.This
processcontinuesuntiltheLinkstaterequestlistbecomes
empty.LSAsontheLinkstaterequestlistthathavebeen
requested,butnotyetreceived,arepackagedintoLinkState
RequestpacketsforretransmissionatintervalsofRxmtInterval.
ThereshouldbeatmostoneLinkStateRequestpacket
outstandingatanyonetime.
WhentheLinkstaterequestlistbecomesempty,andtheneighbor
stateisLoading(i.e.,acompletesequenceofDatabase
Descriptionpacketshasbeensenttoandreceivedfromthe
neighbor),theLoadingDoneneighboreventisgenerated.
10.10.AnExample
Figure14showsanexampleofanadjacencyforming.RoutersRT1
andRT2arebothconnectedtoabroadcastnetwork.Itis
assumedthatRT2istheDesignatedRouterforthenetwork,and
thatRT2hasahigherRouterIDthanRouterRT1.
Theneighborstatechangesrealizedbyeachrouterarelistedon
thesidesofthefigure.
AtthebeginningofFigure14,RouterRT1'sinterfacetothe
networkbecomesoperational.ItbeginssendingHelloPackets,
althoughitdoesn'tknowtheidentityoftheDesignatedRouter
orofanyotherneighboringrouters.RouterRT2hearsthis
hello(movingtheneighbortoInitstate),andinitsnextHello
PacketindicatesthatitisitselftheDesignatedRouterand
thatithasheardHelloPacketsfromRT1.Thisinturncauses
RT1togotostateExStart,asitstartstobringupthe
adjacency.
RT1beginsbyassertingitselfasthemaster.Whenitseesthat
RT2isindeedthemaster(becauseofRT2'shigherRouterID),
RT1transitionstoslavestateandadoptsitsneighbor'sDD
sequencenumber.DatabaseDescriptionpacketsarethen
exchanged,withpollscomingfromthemaster(RT2)andresponses
fromtheslave(RT1).ThissequenceofDatabaseDescription

MoyStandardsTrack[Page105]
RFC2328OSPFVersion2April1998

++++
|RT1||RT2|
++++
DownDown
https://www.ietf.org/rfc/rfc2328.txt

81/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Hello(DR=0,seen=0)
>
Hello(DR=RT2,seen=RT1,...)Init
<
ExStartDD(Seq=x,I,M,Master)
>
DD(Seq=y,I,M,Master)ExStart
<
ExchangeDD(Seq=y,M,Slave)
>
DD(Seq=y+1,M,Master)Exchange
<
DD(Seq=y+1,M,Slave)
>
...
...
...
DD(Seq=y+n,Master)
<
DD(Seq=y+n,Slave)
Loading>
LSRequestFull
>
LSUpdate
<
LSRequest
>
LSUpdate
<
Full

MoyStandardsTrack[Page106]
RFC2328OSPFVersion2April1998
Figure14:Anadjacencybringupexample

Packetsendswhenboththepollandassociatedresponsehasthe
Mbitoff.
Inthisexample,itisassumedthatRT2hasacompletelyupto
datedatabase.Inthatcase,RT2goesimmediatelyintoFull
state.RT1willgointoFullstateafterupdatingthenecessary
partsofitsdatabase.ThisisdonebysendingLinkState
RequestPackets,andreceivingLinkStateUpdatePacketsin
response.Notethat,whileRT1haswaiteduntilacompleteset
ofDatabaseDescriptionPacketshasbeenreceived(fromRT2)
beforesendinganyLinkStateRequestPackets,thisneednotbe
thecase.RT1couldhaveinterleavedthesendingofLinkState
RequestPacketswiththereceptionofDatabaseDescription
Packets.
11.TheRoutingTableStructure
Theroutingtabledatastructurecontainsalltheinformation
https://www.ietf.org/rfc/rfc2328.txt

82/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

necessarytoforwardanIPdatapackettowarditsdestination.Each
routingtableentrydescribesthecollectionofbestpathstoa
particulardestination.WhenforwardinganIPdatapacket,the
routingtableentryprovidingthebestmatchforthepacket'sIP
destinationislocated.Thematchingroutingtableentrythen
providesthenexthoptowardsthepacket'sdestination.OSPFalso
providesfortheexistenceofadefaultroute(DestinationID=
DefaultDestination,AddressMask=0x00000000).Whenthedefault
routeexists,itmatchesallIPdestinations(althoughanyother
matchingentryisabettermatch).Findingtheroutingtableentry
thatbestmatchesanIPdestinationisfurtherdescribedinSection
11.1.
Thereisasingleroutingtableineachrouter.Twosamplerouting
tablesaredescribedinSections11.2and11.3.Thebuildingofthe
routingtableisdiscussedinSection16.

MoyStandardsTrack[Page107]
RFC2328OSPFVersion2April1998
Therestofthissectiondefinesthefieldsfoundinaroutingtable
entry.Thefirstsetoffieldsdescribestheroutingtableentry's
destination.
DestinationType
Destinationtypeiseither"network"or"router".Onlynetwork
entriesareactuallyusedwhenforwardingIPdatatraffic.
Routerroutingtableentriesareusedsolelyasintermediate
stepsintheroutingtablebuildprocess.
AnetworkisarangeofIPaddresses,towhichIPdatatraffic
maybeforwarded.ThisincludesIPnetworks(classA,B,orC),
IPsubnets,IPsupernetsandsingleIPhosts.Thedefaultroute
alsofallsintothiscategory.
RouterentriesarekeptforareaborderroutersandASboundary
routers.Routingtableentriesforareaborderroutersareused
whencalculatingtheinterarearoutes(seeSection16.2),and
whenmaintainingconfiguredvirtuallinks(seeSection15).
RoutingtableentriesforASboundaryroutersareusedwhen
calculatingtheASexternalroutes(seeSection16.4).
DestinationID
Thedestination'sidentifierorname.Thisdependsonthe
DestinationType.Fornetworks,theidentifieristheir
associatedIPaddress.Forrouters,theidentifieristheOSPF
RouterID.[9]
AddressMask
Onlydefinedfornetworks.Thenetwork'sIPaddresstogether
withitsaddressmaskdefinesarangeofIPaddresses.ForIP
subnets,theaddressmaskisreferredtoasthesubnetmask.
Forhostroutes,themaskis"allones"(0xffffffff).
OptionalCapabilities
Whenthedestinationisarouterthisfieldindicatesthe
optionalOSPFcapabilitiessupportedbythedestinationrouter.
Theonlyoptionalcapabilitydefinedbythisspecificationis
theabilitytoprocessASexternalLSAs.Forafurther
https://www.ietf.org/rfc/rfc2328.txt

83/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

discussionofOSPF'soptionalcapabilities,seeSection4.5.

MoyStandardsTrack[Page108]
RFC2328OSPFVersion2April1998
ThesetofpathstouseforadestinationmayvarybasedontheOSPF
areatowhichthepathsbelong.Thismeansthattheremaybe
multipleroutingtableentriesforthesamedestination,depending
onthevaluesofthenextfield.
Area
Thisfieldindicatestheareawhoselinkstateinformationhas
ledtotheroutingtableentry'scollectionofpaths.Thisis
calledtheentry'sassociatedarea.ForsetsofASexternal
paths,thisfieldisnotdefined.Fordestinationsoftype
"router",theremaybeseparatesetsofpaths(andtherefore
separateroutingtableentries)associatedwitheachofseveral
areas.Forexample,thiswillhappenwhentwoareaborder
routerssharemultipleareasincommon.Fordestinationsof
type"network",onlythesetofpathsassociatedwiththebest
area(theoneprovidingthepreferredroute)iskept.
Therestoftheroutingtableentrydescribesthesetofpathsto
thedestination.Thefollowingfieldspertaintothesetofpaths
asawhole.Inotherwords,eachoneofthepathscontainedina
routingtableentryisofthesamepathtypeandcost(seebelow).
Pathtype
Therearefourpossibletypesofpathsusedtoroutetrafficto
thedestination,listedhereindecreasingorderofpreference:
intraarea,interarea,type1externalortype2external.
Intraareapathsindicatedestinationsbelongingtooneofthe
router'sattachedareas.Interareapathsarepathsto
destinationsinotherOSPFareas.Thesearediscoveredthrough
theexaminationofreceivedsummaryLSAs.ASexternalpathsare
pathstodestinationsexternaltotheAS.Thesearedetected
throughtheexaminationofreceivedASexternalLSAs.
Cost
Thelinkstatecostofthepathtothedestination.Forall
pathsexcepttype2externalpathsthisdescribestheentire
path'scost.ForType2externalpaths,thisfielddescribes
thecostoftheportionofthepathinternaltotheAS.This

MoyStandardsTrack[Page109]
RFC2328OSPFVersion2April1998
costiscalculatedasthesumofthecostsofthepath's
constituentlinks.
Type2cost
Onlyvalidfortype2externalpaths.Forthesepaths,this
https://www.ietf.org/rfc/rfc2328.txt

84/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

fieldindicatesthecostofthepath'sexternalportion.This
costhasbeenadvertisedbyanASboundaryrouter,andisthe
mostsignificantpartofthetotalpathcost.Forexample,a
type2externalpathwithtype2costof5isalwayspreferred
overapathwithtype2costof10,regardlessofthecostof
thetwopaths'internalcomponents.
LinkStateOrigin
Validonlyforintraareapaths,thisfieldindicatestheLSA
(routerLSAornetworkLSA)thatdirectlyreferencesthe
destination.Forexample,ifthedestinationisatransit
network,thisisthetransitnetwork'snetworkLSA.Ifthe
destinationisastubnetwork,thisistherouterLSAforthe
attachedrouter.TheLSAisdiscoveredduringtheshortestpath
treecalculation(seeSection16.1).MultipleLSAsmay
referencethedestination,howeveratiebreakingschemealways
reducesthechoicetoasingleLSA.TheLinkStateOriginfield
isnotusedbytheOSPFprotocol,butitisusedbytherouting
tablecalculationinOSPF'sMulticastroutingextensions
(MOSPF).
Whenmultiplepathsofequalpathtypeandcostexisttoa
destination(calledelsewhere"equalcost"paths),theyarestored
inasingleroutingtableentry.Eachoneofthe"equalcost"paths
isdistinguishedbythefollowingfields:
Nexthop
Theoutgoingrouterinterfacetousewhenforwardingtrafficto
thedestination.Onbroadcast,PointtoMultiPointandNBMA
networks,thenexthopalsoincludestheIPaddressofthenext
router(ifany)inthepathtowardsthedestination.
Advertisingrouter
ValidonlyforinterareaandASexternalpaths.Thisfield
indicatestheRouterIDoftherouteradvertisingthesummary
LSAorASexternalLSAthatledtothispath.

MoyStandardsTrack[Page110]
RFC2328OSPFVersion2April1998
11.1.Routingtablelookup
WhenanIPdatapacketisreceived,anOSPFrouterfindsthe
routingtableentrythatbestmatchesthepacket'sdestination.
Thisroutingtableentrythenprovidestheoutgoinginterface
andnexthoproutertouseinforwardingthepacket.This
sectiondescribestheprocessoffindingthebestmatching
routingtableentry.
Beforethelookupbegins,"discard"routingtableentriesshould
beinsertedintotheroutingtableforeachoftherouter's
activeareaaddressranges(seeSection3.5).(Anarearangeis
considered"active"iftherangecontainsoneormorenetworks
reachablebyintraareapaths.)Thedestinationofa"discard"
entryisthesetofaddressesdescribedbyitsassociatedactive
areaaddressrange,andthepathtypeofeach"discard"entryis
setto"interarea".[10]
Severalroutingtableentriesmaymatchthedestinationaddress.
Inthiscase,the"bestmatch"istheroutingtableentrythat
https://www.ietf.org/rfc/rfc2328.txt

85/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

providesthemostspecific(longest)match.Anotherwayof
sayingthisistochoosetheentrythatspecifiesthenarrowest
rangeofIPaddresses.[11]Forexample,theentryforthe
address/maskpairof(128.185.1.0,0xffffff00)ismorespecific
thananentryforthepair(128.185.0.0,0xffff0000).The
defaultrouteistheleastspecificmatch,sinceitmatchesall
destinations.(Notethatforanysingleroutingtableentry,
multiplepathsmaybepossible.Inthesecases,thecalculations
inSections16.1,16.2,and16.4alwaysyieldthepathshaving
themostpreferentialpathtype,asdescribedinSection11).
Ifthereisnomatchingroutingtableentry,orthebestmatch
routingtableentryisoneoftheabove"discard"routingtable
entries,thenthepacket'sIPdestinationisconsidered
unreachable.Insteadofbeingforwarded,thepacketshouldthen
bediscardedandanICMPdestinationunreachablemessageshould
bereturnedtothepacket'ssource.
11.2.Sampleroutingtable,withoutareas
ConsidertheAutonomousSystempicturedinFigure2.NoOSPF
areashavebeenconfigured.Asinglemetricisshownper

MoyStandardsTrack[Page111]
RFC2328OSPFVersion2April1998
outboundinterface.ThecalculationofRouterRT6'srouting
tableproceedsasdescribedinSection2.2.Theresulting
routingtableisshowninTable12.Destinationtypesare
abbreviated:Networkas"N",Routeras"R".
Therearenoinstancesofmultipleequalcostshortestpathsin
thisexample.Also,sincetherearenoareas,thereareno
interareapaths.
RoutersRT5andRT7areASboundaryrouters.Intraarearoutes
havebeencalculatedtoRoutersRT5andRT7.Thisallows
externalroutestobecalculatedtothedestinationsadvertised
byRT5andRT7(i.e.,NetworksN12,N13,N14andN15).Itis
assumedallASexternalLSAsoriginatedbyRT5andRT7are
advertisingtype1externalmetrics.Thisresultsintype1
externalpathsbeingcalculatedtodestinationsN12N15.

11.3.Sampleroutingtable,withareas
Considerthepreviousexample,thistimesplitintoOSPFareas.
AnOSPFareaconfigurationispicturedinFigure6.Router
RT4'sroutingtablewillbedescribedforthisarea
configuration.RouterRT4hasaconnectiontoArea1anda
backboneconnection.ThiscausesRouterRT4toviewtheASas
theconcatenationofthetwographsshowninFigures7and8.
TheresultingroutingtableisdisplayedinTable13.
Again,RoutersRT5andRT7areASboundaryrouters.Routers
RT3,RT4,RT7,RT10andRT11areareaborderrouters.Notethat
therearetworoutingentriesfortheareaborderrouterRT3,
sinceithastwoareasincommonwithRT4(Area1andthe
backbone).
https://www.ietf.org/rfc/rfc2328.txt

86/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Backbonepathshavebeencalculatedtoallareaborderrouters.
Theseareusedwhendeterminingtheinterarearoutes.Note
thatalloftheinterarearoutesareassociatedwiththe
backbone;thisisalwaysthecasewhenthecalculatingrouteris
itselfanareaborderrouter.Routinginformationiscondensed
atareaboundaries.Inthisexample,weassumethatArea3has
beendefinedsothatnetworksN9N11andthehostroutetoH1

MoyStandardsTrack[Page112]
RFC2328OSPFVersion2April1998

TypeDestAreaPathTypeCostNextAdv.
Hop(s)Router(s)
____________________________________________________________
NN10intraarea10RT3*
NN20intraarea10RT3*
NN30intraarea7RT3*
NN40intraarea8RT3*
NIb0intraarea7**
NIa0intraarea12RT10*
NN60intraarea8RT10*
NN70intraarea12RT10*
NN80intraarea10RT10*
NN90intraarea11RT10*
NN100intraarea13RT10*
NN110intraarea14RT10*
NH10intraarea21RT10*
RRT50intraarea6RT5*
RRT70intraarea8RT10*
____________________________________________________________
NN12*type1ext.10RT10RT7
NN13*type1ext.14RT5RT5
NN14*type1ext.14RT5RT5
NN15*type1ext.17RT10RT7
Table12:TheroutingtableforRouterRT6
(noconfiguredareas).
areallcondensedtoasingleroutewhenadvertisedintothe
backbone(byRouterRT11).Notethatthecostofthisrouteis
themaximumofthesetofcoststoitsindividualcomponents.
ThereisavirtuallinkconfiguredbetweenRoutersRT10and
RT11.Withoutthisconfiguredvirtuallink,RT11wouldbe
unabletoadvertisearoutefornetworksN9N11andHostH1into
thebackbone,andtherewouldnotbeanentryforthesenetworks
inRouterRT4'sroutingtable.
InthisexampletherearetwoequalcostpathstoNetworkN12.
However,theybothusethesamenexthop(RouterRT5).

MoyStandardsTrack[Page113]
RFC2328OSPFVersion2April1998

https://www.ietf.org/rfc/rfc2328.txt

87/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

RouterRT4'sroutingtablewouldimprove(i.e.,someofthe
pathsintheroutingtablewouldbecomeshorter)ifan
additionalvirtuallinkwereconfiguredbetweenRouterRT4and
RouterRT3.Thenewvirtuallinkwoulditselfbeassociated
withthefirstentryforareaborderrouterRT3inTable13(an
intraareapaththroughArea1).Thiswouldyieldacostof1
forthevirtuallink.Theroutingtableentrieschangesthat
wouldbecausedbytheadditionofthisvirtuallinkareshown
TypeDestAreaPathTypeCostNextAdv.
Hops(s)Router(s)
__________________________________________________________________
NN11intraarea4RT1*
NN21intraarea4RT2*
NN31intraarea1**
NN41intraarea3RT3*
RRT31intraarea1**
__________________________________________________________________
NIb0intraarea22RT5*
NIa0intraarea27RT5*
RRT30intraarea21RT5*
RRT50intraarea8**
RRT70intraarea14RT5*
RRT100intraarea22RT5*
RRT110intraarea25RT5*
__________________________________________________________________
NN60interarea15RT5RT7
NN70interarea19RT5RT7
NN80interarea18RT5RT7
NN9N11,H10interarea36RT5RT11
__________________________________________________________________
NN12*type1ext.16RT5RT5,RT7
NN13*type1ext.16RT5RT5
NN14*type1ext.16RT5RT5
NN15*type1ext.23RT5RT7
Table13:RouterRT4'sroutingtable
inthepresenceofareas.

MoyStandardsTrack[Page114]
RFC2328OSPFVersion2April1998
inTable14.

12.LinkStateAdvertisements(LSAs)
EachrouterintheAutonomousSystemoriginatesoneormorelink
stateadvertisements(LSAs).Thismemodefinesfivedistincttypes
ofLSAs,whicharedescribedinSection4.3.ThecollectionofLSAs
formsthelinkstatedatabase.EachseparatetypeofLSAhasa
separatefunction.RouterLSAsandnetworkLSAsdescribehowan
area'sroutersandnetworksareinterconnected.SummaryLSAs
provideawayofcondensinganarea'sroutinginformation.AS
externalLSAsprovideawayoftransparentlyadvertising
externallyderivedroutinginformationthroughouttheAutonomous
https://www.ietf.org/rfc/rfc2328.txt

88/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

System.
EachLSAbeginswithastandard20byteheader.ThisLSAheaderis
discussedbelow.

TypeDestAreaPathTypeCostNextAdv.
Hop(s)Router(s)
________________________________________________________________
NIb0intraarea16RT3*
NIa0intraarea21RT3*
RRT30intraarea1**
RRT100intraarea16RT3*
RRT110intraarea19RT3*
________________________________________________________________
NN9N11,H10interarea30RT3RT11
Table14:Changesresultingfroman
additionalvirtuallink.

MoyStandardsTrack[Page115]
RFC2328OSPFVersion2April1998
12.1.TheLSAHeader
TheLSAheadercontainstheLStype,LinkStateIDand
AdvertisingRouterfields.Thecombinationofthesethree
fieldsuniquelyidentifiestheLSA.
TheremaybeseveralinstancesofanLSApresentinthe
AutonomousSystem,allatthesametime.Itmustthenbe
determinedwhichinstanceismorerecent.Thisdeterminationis
madebyexaminingtheLSsequence,LSchecksumandLSage
fields.Thesefieldsarealsocontainedinthe20byteLSA
header.
SeveraloftheOSPFpackettypeslistLSAs.Whentheinstance
isnotimportant,anLSAisreferredtobyitsLStype,Link
StateIDandAdvertisingRouter(seeLinkStateRequest
Packets).Otherwise,theLSsequencenumber,LSageandLS
checksumfieldsmustalsobereferenced.
AdetailedexplanationofthefieldscontainedintheLSAheader
follows.
12.1.1.LSage
ThisfieldistheageoftheLSAinseconds.Itshouldbe
processedasanunsigned16bitinteger.Itissetto0
whentheLSAisoriginated.Itmustbeincrementedby
InfTransDelayoneveryhopofthefloodingprocedure.LSAs
arealsoagedastheyareheldineachrouter'sdatabase.
https://www.ietf.org/rfc/rfc2328.txt

89/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

TheageofanLSAisneverincrementedpastMaxAge.LSAs
havingageMaxAgearenotusedintheroutingtable
calculation.WhenanLSA'sagefirstreachesMaxAge,itis
reflooded.AnLSAofageMaxAgeisfinallyflushedfromthe
databasewhenitisnolongerneededtoensuredatabase
synchronization.FormoreinformationontheagingofLSAs,
consultSection14.
TheLSagefieldisexaminedwhenarouterreceivestwo
instancesofanLSA,bothhavingidenticalLSsequence
numbersandLSchecksums.AninstanceofageMaxAgeisthen

MoyStandardsTrack[Page116]
RFC2328OSPFVersion2April1998
alwaysacceptedasmostrecent;thisallowsoldLSAstobe
flushedquicklyfromtheroutingdomain.Otherwise,ifthe
agesdifferbymorethanMaxAgeDiff,theinstancehavingthe
smallerageisacceptedasmostrecent.[12]SeeSection13.1
formoredetails.
12.1.2.Options
TheOptionsfieldintheLSAheaderindicateswhichoptional
capabilitiesareassociatedwiththeLSA.OSPF'soptional
capabilitiesaredescribedinSection4.5.Oneoptional
capabilityisdefinedbythisspecification,representedby
theEbitfoundintheOptionsfield.Theunrecognizedbits
intheOptionsfieldshouldbesettozero.
TheEbitrepresentsOSPF'sExternalRoutingCapability.This
bitshouldbesetinallLSAsassociatedwiththebackbone,
andallLSAsassociatedwithnonstubareas(seeSection
3.6).ItshouldalsobesetinallASexternalLSAs.It
shouldberesetinallrouterLSAs,networkLSAsand
summaryLSAsassociatedwithastubarea.ForallLSAs,the
settingoftheEbitisforinformationalpurposesonly;it
doesnotaffecttheroutingtablecalculation.
12.1.3.LStype
TheLStypefielddictatestheformatandfunctionofthe
LSA.LSAsofdifferenttypeshavedifferentnames(e.g.,
routerLSAsornetworkLSAs).AllLSAtypesdefinedbythis
memo,excepttheASexternalLSAs(LStype=5),areflooded
throughoutasingleareaonly.ASexternalLSAsareflooded
throughouttheentireAutonomousSystem,exceptingstub
areas(seeSection3.6).EachseparateLSAtypeisbriefly
describedbelowinTable15.
12.1.4.LinkStateID
Thisfieldidentifiesthepieceoftheroutingdomainthat
isbeingdescribedbytheLSA.DependingontheLSA'sLS
type,theLinkStateIDtakesonthevalueslistedinTable

https://www.ietf.org/rfc/rfc2328.txt

90/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page117]
RFC2328OSPFVersion2April1998

LSTypeLSAdescription
________________________________________________
1ThesearetherouterLSAs.
Theydescribethecollected
statesoftherouter's
interfaces.Formoreinformation,
consultSection12.4.1.
________________________________________________
2ThesearethenetworkLSAs.
Theydescribethesetofrouters
attachedtothenetwork.For
moreinformation,consult
Section12.4.2.
________________________________________________
3or4ThesearethesummaryLSAs.
Theydescribeinterarearoutes,
andenablethecondensationof
routinginformationatarea
borders.Originatedbyareaborder
routers,theType3summaryLSAs
describeroutestonetworkswhilethe
Type4summaryLSAsdescriberoutesto
ASboundaryrouters.
________________________________________________
5ThesearetheASexternalLSAs.
OriginatedbyASboundaryrouters,
theydescriberoutes
todestinationsexternaltothe
AutonomousSystem.Adefaultroutefor
theAutonomousSystemcanalsobe
describedbyanASexternalLSA.
Table15:OSPFlinkstateadvertisements(LSAs).
16.
Actually,forType3summaryLSAs(LStype=3)andAS
externalLSAs(LStype=5),theLinkStateIDmay

MoyStandardsTrack[Page118]
RFC2328OSPFVersion2April1998

LSTypeLinkStateID
_______________________________________________
1Theoriginatingrouter'sRouterID.
2TheIPinterfaceaddressofthe
network'sDesignatedRouter.
3Thedestinationnetwork'sIPaddress.
4TheRouterIDofthedescribedAS
boundaryrouter.
https://www.ietf.org/rfc/rfc2328.txt

91/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

5Thedestinationnetwork'sIPaddress.
Table16:TheLSA'sLinkStateID.
additionallyhaveoneormoreofthedestinationnetwork's
"host"bitsset.Forexample,whenoriginatinganAS
externalLSAforthenetwork10.0.0.0withmaskof
255.0.0.0,theLinkStateIDcanbesettoanythinginthe
range10.0.0.0through10.255.255.255inclusive(although
10.0.0.0shouldbeusedwheneverpossible).Thefreedomto
setcertainhostbitsallowsaroutertooriginateseparate
LSAsfortwonetworkshavingthesameaddressbutdifferent
masks.SeeAppendixEfordetails.
WhentheLSAisdescribinganetwork(LStype=2,3or5),
thenetwork'sIPaddressiseasilyderivedbymaskingthe
LinkStateIDwiththenetwork/subnetmaskcontainedinthe
bodyoftheLSA.WhentheLSAisdescribingarouter(LS
type=1or4),theLinkStateIDisalwaysthedescribed
router'sOSPFRouterID.
WhenanASexternalLSA(LSType=5)isdescribinga
defaultroute,itsLinkStateIDissetto
DefaultDestination(0.0.0.0).
12.1.5.AdvertisingRouter
ThisfieldspecifiestheOSPFRouterIDoftheLSA's
originator.ForrouterLSAs,thisfieldisidenticaltothe
LinkStateIDfield.NetworkLSAsareoriginatedbythe

MoyStandardsTrack[Page119]
RFC2328OSPFVersion2April1998
network'sDesignatedRouter.SummaryLSAsoriginatedby
areaborderrouters.ASexternalLSAsareoriginatedbyAS
boundaryrouters.
12.1.6.LSsequencenumber
Thesequencenumberfieldisasigned32bitinteger.Itis
usedtodetectoldandduplicateLSAs.Thespaceof
sequencenumbersislinearlyordered.Thelargerthe
sequencenumber(whencomparedassigned32bitintegers)
themorerecenttheLSA.Todescribetosequencenumber
spacemoreprecisely,letNreferinthediscussionbelowto
theconstant2**31.
ThesequencenumberN(0x80000000)isreserved(and
unused).ThisleavesN+1(0x80000001)asthesmallest
(andthereforeoldest)sequencenumber;thissequencenumber
isreferredtoastheconstantInitialSequenceNumber.A
routerusesInitialSequenceNumberthefirsttimeit
originatesanyLSA.Afterwards,theLSA'ssequencenumber
isincrementedeachtimetherouteroriginatesanew
instanceoftheLSA.Whenanattemptismadetoincrement
thesequencenumberpastthemaximumvalueofN1
(0x7fffffff;alsoreferredtoasMaxSequenceNumber),the
https://www.ietf.org/rfc/rfc2328.txt

92/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

currentinstanceoftheLSAmustfirstbeflushedfromthe
routingdomain.ThisisdonebyprematurelyagingtheLSA
(seeSection14.1)andrefloodingit.Assoonasthisflood
hasbeenacknowledgedbyalladjacentneighbors,anew
instancecanbeoriginatedwithsequencenumberof
InitialSequenceNumber.
Theroutermaybeforcedtopromotethesequencenumberof
oneofitsLSAswhenamorerecentinstanceoftheLSAis
unexpectedlyreceivedduringthefloodingprocess.This
shouldbearareevent.Thismayindicatethatanoutof
dateLSA,originatedbytherouteritselfbeforeitslast
restart/reload,stillexistsintheAutonomousSystem.For
moreinformationseeSection13.4.

MoyStandardsTrack[Page120]
RFC2328OSPFVersion2April1998
12.1.7.LSchecksum
Thisfieldisthechecksumofthecompletecontentsofthe
LSA,exceptingtheLSagefield.TheLSagefieldis
exceptedsothatanLSA'sagecanbeincrementedwithout
updatingthechecksum.Thechecksumusedisthesamethat
isusedforISOconnectionlessdatagrams;itiscommonly
referredtoastheFletcherchecksum.Itisdocumentedin
AnnexBof[Ref6].TheLSAheaderalsocontainsthelength
oftheLSAinbytes;subtractingthesizeoftheLSage
field(twobytes)yieldstheamountofdatatochecksum.
ThechecksumisusedtodetectdatacorruptionofanLSA.
ThiscorruptioncanoccurwhileanLSAisbeingflooded,or
whileitisbeingheldinarouter'smemory.TheLS
checksumfieldcannottakeonthevalueofzero;the
occurrenceofsuchavalueshouldbeconsideredachecksum
failure.Inotherwords,calculationofthechecksumisnot
optional.
ThechecksumofanLSAisverifiedintwocases:a)whenit
isreceivedinaLinkStateUpdatePacketandb)attimes
duringtheagingofthelinkstatedatabase.Thedetection
ofachecksumfailureleadstoseparateactionsineach
case.SeeSections13and14formoredetails.
WhenevertheLSsequencenumberfieldindicatesthattwo
instancesofanLSAarethesame,theLSchecksumfieldis
examined.Ifthereisadifference,theinstancewiththe
largerLSchecksumisconsideredtobemostrecent.[13]See
Section13.1formoredetails.
12.2.Thelinkstatedatabase
Arouterhasaseparatelinkstatedatabaseforeveryareato
whichitbelongs.Allroutersbelongingtothesameareahave
identicallinkstatedatabasesforthearea.
Thedatabasesforeachindividualareaarealwaysdealtwith
https://www.ietf.org/rfc/rfc2328.txt

93/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

separately.Theshortestpathcalculationisperformed
separatelyforeacharea(seeSection16).Componentsofthe

MoyStandardsTrack[Page121]
RFC2328OSPFVersion2April1998
arealinkstatedatabasearefloodedthroughouttheareaonly.
Finally,whenanadjacency(belongingtoAreaA)isbeing
broughtup,onlythedatabaseforAreaAissynchronizedbetween
thetworouters.
TheareadatabaseiscomposedofrouterLSAs,networkLSAsand
summaryLSAs(alllistedintheareadatastructure).In
addition,externalroutes(ASexternalLSAs)areincludedinall
nonstubareadatabases(seeSection3.6).
AnimplementationofOSPFmustbeabletoaccessindividual
piecesofanareadatabase.Thislookupfunctionisbasedonan
LSA'sLStype,LinkStateIDandAdvertisingRouter.[14]There
willbeasingleinstance(themostuptodate)ofeachLSAin
thedatabase.Thedatabaselookupfunctionisinvokedduring
theLSAfloodingprocedure(Section13)andtheroutingtable
calculation(Section16).Inaddition,usingthislookup
functiontheroutercandeterminewhetherithasitselfever
originatedaparticularLSA,andifso,withwhatLSsequence
number.
AnLSAisaddedtoarouter'sdatabasewheneithera)itis
receivedduringthefloodingprocess(Section13)orb)itis
originatedbytherouteritself(Section12.4).AnLSAis
deletedfromarouter'sdatabasewheneithera)ithasbeen
overwrittenbyanewerinstanceduringthefloodingprocess
(Section13)orb)therouteroriginatesanewerinstanceofone
ofitsselforiginatedLSAs(Section12.4)orc)theLSAages
outandisflushedfromtheroutingdomain(Section14).
WheneveranLSAisdeletedfromthedatabaseitmustalsobe
removedfromallneighbors'Linkstateretransmissionlists(see
Section10).
12.3.RepresentationofTOS
ForbackwardcompatibilitywithpreviousversionsoftheOSPF
specification([Ref9]),TOSspecificinformationcanbeincluded
inrouterLSAs,summaryLSAsandASexternalLSAs.Theencoding
ofTOSinOSPFLSAsisspecifiedinTable17.Thattablerelates
theOSPFencodingtotheIPpacketheader'sTOSfield(defined
in[Ref12]).TheOSPFencodingisexpressedasadecimal

MoyStandardsTrack[Page122]
RFC2328OSPFVersion2April1998
integer,andtheIPpacketheader'sTOSfieldisexpressedin
thebinaryTOSvaluesusedin[Ref12].

https://www.ietf.org/rfc/rfc2328.txt

94/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

OSPFencodingRFC1349TOSvalues
___________________________________________
00000normalservice
20001minimizemonetarycost
40010maximizereliability
60011
80100maximizethroughput
100101
120110
140111
161000minimizedelay
181001
201010
221011
241100
261101
281110
301111
Table17:RepresentingTOSinOSPF.
12.4.OriginatingLSAs
IntoanygivenOSPFarea,arouterwilloriginateseveralLSAs.
EachrouteroriginatesarouterLSA.Iftherouterisalsothe
DesignatedRouterforanyofthearea'snetworks,itwill
originatenetworkLSAsforthosenetworks.
AreaborderroutersoriginateasinglesummaryLSAforeach
knowninterareadestination.ASboundaryroutersoriginatea
singleASexternalLSAforeachknownASexternaldestination.
Destinationsareadvertisedoneatatimesothatthechangein
anysingleroutecanbefloodedwithoutrefloodingtheentire
collectionofroutes.Duringthefloodingprocedure,manyLSAs
canbecarriedbyasingleLinkStateUpdatepacket.

MoyStandardsTrack[Page123]
RFC2328OSPFVersion2April1998
Asanexample,considerRouterRT4inFigure6.Itisanarea
borderrouter,havingaconnectiontoArea1andthebackbone.
RouterRT4originates5distinctLSAsintothebackbone(one
routerLSA,andonesummaryLSAforeachofthenetworksN1N4).
RouterRT4willalsooriginate8distinctLSAsintoArea1(one
routerLSAandsevensummaryLSAsaspicturedinFigure7).If
RT4hasbeenselectedasDesignatedRouterforNetworkN3,it
willalsooriginateanetworkLSAforN3intoArea1.
Inthissamefigure,RouterRT5willbeoriginating3distinct
ASexternalLSAs(oneforeachofthenetworksN12N14).These
willbefloodedthroughouttheentireAS,assumingthatnoneof
theareashavebeenconfiguredasstubs.However,ifarea3has
beenconfiguredasastubarea,theASexternalLSAsfor
networksN12N14willnotbefloodedintoarea3(seeSection
3.6).Instead,RouterRT11wouldoriginateadefaultsummary
LSAthatwouldbefloodedthroughoutarea3(seeSection
12.4.3).Thisinstructsallofarea3'sinternalroutersto
sendtheirASexternaltraffictoRT11.
https://www.ietf.org/rfc/rfc2328.txt

95/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

WheneveranewinstanceofanLSAisoriginated,itsLSsequence
numberisincremented,itsLSageissetto0,itsLSchecksum
iscalculated,andtheLSAisaddedtothelinkstatedatabase
andfloodedouttheappropriateinterfaces.SeeSection13.2
fordetailsconcerningtheinstallationoftheLSAintothelink
statedatabase.SeeSection13.3fordetailsconcerningthe
floodingofnewlyoriginatedLSAs.
TheteneventsthatcancauseanewinstanceofanLSAtobe
originatedare:
(1)TheLSagefieldofoneoftherouter'sselforiginatedLSAs
reachesthevalueLSRefreshTime.Inthiscase,anew
instanceoftheLSAisoriginated,eventhoughthecontents
oftheLSA(apartfromtheLSAheader)willbethesame.
ThisguaranteesperiodicoriginationsofallLSAs.This
periodicupdatingofLSAsaddsrobustnesstothelinkstate
algorithm.LSAsthatsolelydescribeunreachable
destinationsshouldnotberefreshed,butshouldinsteadbe
flushedfromtheroutingdomain(seeSection14.1).

MoyStandardsTrack[Page124]
RFC2328OSPFVersion2April1998
WhenwhateverisbeingdescribedbyanLSAchanges,anewLSAis
originated.However,twoinstancesofthesameLSAmaynotbe
originatedwithinthetimeperiodMinLSInterval.Thismay
requirethatthegenerationofthenextinstancebedelayedby
uptoMinLSInterval.Thefollowingeventsmaycausethe
contentsofanLSAtochange.Theseeventsshouldcausenew
originationsifandonlyifthecontentsofthenewLSAwouldbe
different:
(2)Aninterface'sstatechanges(seeSection9.1).Thismay
meanthatitisnecessarytoproduceanewinstanceofthe
routerLSA.
(3)Anattachednetwork'sDesignatedRouterchanges.Anew
routerLSAshouldbeoriginated.Also,iftherouteritself
isnowtheDesignatedRouter,anewnetworkLSAshouldbe
produced.IftherouteritselfisnolongertheDesignated
Router,anynetworkLSAthatitmighthaveoriginatedfor
thenetworkshouldbeflushedfromtheroutingdomain(see
Section14.1).
(4)Oneoftheneighboringrouterschangesto/fromtheFULL
state.Thismaymeanthatitisnecessarytoproduceanew
instanceoftherouterLSA.Also,iftherouterisitself
theDesignatedRouterfortheattachednetwork,anew
networkLSAshouldbeproduced.
Thenextfoureventsconcernareaborderroutersonly:
(5)Anintraarearoutehasbeenadded/deleted/modifiedinthe
routingtable.Thismaycauseanewinstanceofasummary
LSA(forthisroute)tobeoriginatedineachattachedarea
https://www.ietf.org/rfc/rfc2328.txt

96/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

(possiblyincludingthebackbone).
(6)Aninterarearoutehasbeenadded/deleted/modifiedinthe
routingtable.Thismaycauseanewinstanceofasummary
LSA(forthisroute)tobeoriginatedineachattachedarea
(butNEVERforthebackbone).

MoyStandardsTrack[Page125]
RFC2328OSPFVersion2April1998
(7)Therouterbecomesnewlyattachedtoanarea.Therouter
mustthenoriginatesummaryLSAsintothenewlyattached
areaforallpertinentintraareaandinterarearoutesin
therouter'sroutingtable.SeeSection12.4.3formore
details.
(8)Whenthestateofoneoftherouter'sconfiguredvirtual
linkschanges,itmaybenecessarytooriginateanew
routerLSAintothevirtuallink'sTransitarea(seethe
discussionoftherouterLSA'sbitVinSection12.4.1),as
wellasoriginatinganewrouterLSAintothebackbone.
ThelasttwoeventsconcernASboundaryrouters(andformerAS
boundaryrouters)only:
(9)Anexternalroutegainedthroughdirectexperiencewithan
externalroutingprotocol(likeBGP)changes.Thiswill
causeanASboundaryroutertooriginateanewinstanceof
anASexternalLSA.
(10)
ArouterceasestobeanASboundaryrouter,perhapsafter
restarting.Inthissituationtheroutershouldflushall
ASexternalLSAsthatithadpreviouslyoriginated.These
LSAscanbeflushedviatheprematureagingprocedure
specifiedinSection14.1.
TheconstructionofeachtypeofLSAisexplainedindetail
below.Ingeneral,thesesectionsdescribethecontentsofthe
LSAbody(i.e.,thepartcomingafterthe20byteLSAheader).
ForinformationconcerningthebuildingoftheLSAheader,see
Section12.1.
12.4.1.RouterLSAs
ArouteroriginatesarouterLSAforeachareathatit
belongsto.SuchanLSAdescribesthecollectedstatesof
therouter'slinkstothearea.TheLSAisflooded
throughouttheparticulararea,andnofurther.

MoyStandardsTrack[Page126]
RFC2328OSPFVersion2April1998

https://www.ietf.org/rfc/rfc2328.txt

97/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

....................................
.192.1.2Area1.
.+.
.|.
.|3++1.
.N1||RT1|+.
.|++\.
.|\_______N3.
.+\/\.1++
.*192.1.1*|RT4|
.+/\_______/.++
.|/|.
.|3++1/|.
.N2||RT2|+1|.
.|++++8.6++
.||RT3||RT6|
.+++.++
.192.1.3|2.18.10.0.6|7
.|.|
.++.
.192.1.4(N4).
....................................
Figure15:Area1withIPaddressesshown
TheformatofarouterLSAisshowninAppendixA(Section
A.4.2).Thefirst20bytesoftheLSAconsistofthe
genericLSAheaderthatwasdiscussedinSection12.1.
routerLSAshaveLStype=1.
Arouteralsoindicateswhetheritisanareaborderrouter,
oranASboundaryrouter,bysettingtheappropriatebits
(bitBandbitE,respectively)initsrouterLSAs.This
enablespathstothosetypesofrouterstobesavedinthe
routingtable,forlaterprocessingofsummaryLSAsandAS
externalLSAs.BitBshouldbesetwhenevertherouteris
activelyattachedtotwoormoreareas,eveniftherouter
isnotcurrentlyattachedtotheOSPFbackbonearea.BitE
shouldneverbesetinarouterLSAforastubarea(stub
areascannotcontainASboundaryrouters).

MoyStandardsTrack[Page127]
RFC2328OSPFVersion2April1998
Inaddition,theroutersetsbitVinitsrouterLSAfor
AreaAifandonlyiftherouteristheendpointofoneor
morefullyadjacentvirtuallinkshavingAreaAastheir
Transitarea.ThesettingofbitVenablesotherroutersin
AreaAtodiscoverwhethertheareasupportstransittraffic
(seeTransitCapabilityinSection6).
TherouterLSAthendescribestherouter'sworking
connections(i.e.,interfacesorlinks)tothearea.Each
linkistypedaccordingtothekindofattachednetwork.
EachlinkisalsolabelledwithitsLinkID.ThisLinkID
givesanametotheentitythatisontheotherendofthe
link.Table18summarizesthevaluesusedfortheTypeand
LinkIDfields.
https://www.ietf.org/rfc/rfc2328.txt

98/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

LinktypeDescriptionLinkID
__________________________________________________
1PointtopointNeighborRouterID
link
2LinktotransitInterfaceaddressof
networkDesignatedRouter
3LinktostubIPnetworknumber
network
4VirtuallinkNeighborRouterID
Table18:Linkdescriptionsinthe
routerLSA.
Inaddition,theLinkDatafieldisspecifiedforeachlink.
Thisfieldgives32bitsofextrainformationforthelink.
Forlinkstotransitnetworks,numberedpointtopointlinks
andvirtuallinks,thisfieldspecifiestheIPinterface
addressoftheassociatedrouterinterface(thisisneeded
bytheroutingtablecalculation,seeSection16.1.1).For
linkstostubnetworks,thisfieldspecifiesthestub
network'sIPaddressmask.Forunnumberedpointtopoint
links,theLinkDatafieldshouldbesettotheunnumbered
interface'sMIBII[Ref8]ifIndexvalue.

MoyStandardsTrack[Page128]
RFC2328OSPFVersion2April1998
Finally,thecostofusingthelinkforoutputisspecified.
Theoutputcostofalinkisconfigurable.Withthe
exceptionoflinkstostubnetworks,theoutputcostmust
alwaysbenonzero.
Tofurtherdescribetheprocessofbuildingthelistoflink
descriptions,supposearouterwishestobuildarouterLSA
forAreaA.Therouterexaminesitscollectionofinterface
datastructures.Foreachinterface,thefollowingsteps
aretaken:
oIftheattachednetworkdoesnotbelongtoAreaA,no
linksareaddedtotheLSA,andthenextinterface
shouldbeexamined.
oIfthestateoftheinterfaceisDown,nolinksare
added.
oIfthestateoftheinterfaceisLoopback,addaType3
link(stubnetwork)aslongasthisisnotaninterface
toanunnumberedpointtopointnetwork.TheLinkID
shouldbesettotheIPinterfaceaddress,theLinkData
settothemask0xffffffff(indicatingahostroute),
andthecostsetto0.
oOtherwise,thelinkdescriptionsaddedtotherouterLSA
dependontheOSPFinterfacetype.Linkdescriptions
usedforpointtopointinterfacesarespecifiedin
Section12.4.1.1,forvirtuallinksinSection12.4.1.2,
https://www.ietf.org/rfc/rfc2328.txt

99/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

forbroadcastandNBMAinterfacesin12.4.1.3,andfor
PointtoMultiPointinterfacesin12.4.1.4.
Afterconsiderationofalltherouterinterfaces,hostlinks
areaddedtotherouterLSAbyexaminingthelistof
attachedhostsbelongingtoAreaA.Ahostrouteis
representedasaType3link(stubnetwork)whoseLinkIDis
thehost'sIPaddress,LinkDataisthemaskofallones
(0xffffffff),andcostthehost'sconfiguredcost(see
SectionC.7).

MoyStandardsTrack[Page129]
RFC2328OSPFVersion2April1998
12.4.1.1.Describingpointtopointinterfaces
Forpointtopointinterfaces,oneormorelink
descriptionsareaddedtotherouterLSAasfollows:
oIftheneighboringrouterisfullyadjacent,adda
Type1link(pointtopoint).TheLinkIDshouldbe
settotheRouterIDoftheneighboringrouter.For
numberedpointtopointnetworks,theLinkData
shouldspecifytheIPinterfaceaddress.For
unnumberedpointtopointnetworks,theLinkData
fieldshouldspecifytheinterface'sMIBII[Ref8]
ifIndexvalue.Thecostshouldbesettotheoutput
costofthepointtopointinterface.
oInaddition,aslongasthestateoftheinterface
is"PointtoPoint"(andregardlessofthe
neighboringrouterstate),aType3link(stub
network)shouldbeadded.Therearetwoformsthat
thisstublinkcantake:
Option1
Assumingthattheneighboringrouter'sIP
addressisknown,settheLinkIDoftheType3
linktotheneighbor'sIPaddress,theLinkData
tothemask0xffffffff(indicatingahost
route),andthecosttotheinterface's
configuredoutputcost.[15]
Option2
Ifasubnethasbeenassignedtothepointto
pointlink,settheLinkIDoftheType3link
tothesubnet'sIPaddress,theLinkDatatothe
subnet'smask,andthecosttotheinterface's
configuredoutputcost.[16]
12.4.1.2.DescribingbroadcastandNBMAinterfaces
ForoperationalbroadcastandNBMAinterfaces,asingle
linkdescriptionisaddedtotherouterLSAasfollows:

https://www.ietf.org/rfc/rfc2328.txt

100/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page130]
RFC2328OSPFVersion2April1998
oIfthestateoftheinterfaceisWaiting,addaType
3link(stubnetwork)withLinkIDsettotheIP
networknumberoftheattachednetwork,LinkData
settotheattachednetwork'saddressmask,andcost
equaltotheinterface'sconfiguredoutputcost.
oElse,therehasbeenaDesignatedRouterelectedfor
theattachednetwork.Iftherouterisfully
adjacenttotheDesignatedRouter,oriftherouter
itselfisDesignatedRouterandisfullyadjacentto
atleastoneotherrouter,addasingleType2link
(transitnetwork)withLinkIDsettotheIP
interfaceaddressoftheattachednetwork's
DesignatedRouter(whichmaybetherouteritself),
LinkDatasettotherouter'sownIPinterface
address,andcostequaltotheinterface's
configuredoutputcost.Otherwise,addalinkasif
theinterfacestatewereWaiting(seeabove).
12.4.1.3.Describingvirtuallinks
Forvirtuallinks,alinkdescriptionisaddedtothe
routerLSAonlywhenthevirtualneighborisfully
adjacent.Inthiscase,addaType4link(virtuallink)
withLinkIDsettotheRouterIDofthevirtual
neighbor,LinkDatasettotheIPinterfaceaddress
associatedwiththevirtuallinkandcostsettothe
costcalculatedforthevirtuallinkduringtherouting
tablecalculation(seeSection15).
12.4.1.4.DescribingPointtoMultiPointinterfaces
ForoperationalPointtoMultiPointinterfaces,oneor
morelinkdescriptionsareaddedtotherouterLSAas
follows:
oAsingleType3link(stubnetwork)isaddedwith
LinkIDsettotherouter'sownIPinterface
address,LinkDatasettothemask0xffffffff
(indicatingahostroute),andcostsetto0.

MoyStandardsTrack[Page131]
RFC2328OSPFVersion2April1998
oForeachfullyadjacentneighborassociatedwiththe
interface,addanadditionalType1link(pointto
point)withLinkIDsettotheRouterIDofthe
neighboringrouter,LinkDatasettotheIP
interfaceaddressandcostequaltotheinterface's
configuredoutputcost.
12.4.1.5.ExamplesofrouterLSAs
https://www.ietf.org/rfc/rfc2328.txt

101/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

ConsidertherouterLSAsgeneratedbyRouterRT3,as
picturedinFigure6.TheareacontainingRouterRT3
(Area1)hasbeenredrawn,withactualnetwork
addresses,inFigure15.Assumethatthelastbyteof
allofRT3'sinterfaceaddressesis3,givingitthe
interfaceaddresses192.1.1.3and192.1.4.3,andthat
theotherroutershavesimilaraddressingschemes.In
addition,assumethatalllinksarefunctional,andthat
RouterIDsareassignedasthesmallestIPinterface
address.
RT3originatestworouterLSAs,oneforArea1andone
forthebackbone.AssumethatRouterRT4hasbeen
selectedastheDesignatedrouterfornetwork192.1.1.0.
RT3'srouterLSAforArea1isthenshownbelow.It
indicatesthatRT3hastwoconnectionstoArea1,the
firstalinktothetransitnetwork192.1.1.0andthe
secondalinktothestubnetwork192.1.4.0.Notethat
thetransitnetworkisidentifiedbytheIPinterfaceof
itsDesignatedRouter(i.e.,theLinkID=192.1.1.4
whichistheDesignatedRouterRT4'sIPinterfaceto
192.1.1.0).NotealsothatRT3hasindicatedthatitis
anareaborderrouter.
;RT3'srouterLSAforArea1
LSage=0;alwaystrueonorigination
Options=(Ebit);
LStype=1;indicatesrouterLSA
LinkStateID=192.1.1.3;RT3'sRouterID
AdvertisingRouter=192.1.1.3;RT3'sRouterID
bitE=0;notanASboundaryrouter

MoyStandardsTrack[Page132]
RFC2328OSPFVersion2April1998
bitB=1;areaborderrouter
#links=2
LinkID=192.1.1.4;IPaddressofDesig.Rtr.
LinkData=192.1.1.3;RT3'sIPinterfacetonet
Type=2;connectstotransitnetwork
#TOSmetrics=0
metric=1
LinkID=192.1.4.0;IPNetworknumber
LinkData=0xffffff00;Networkmask
Type=3;connectstostubnetwork
#TOSmetrics=0
metric=2
NextRT3'srouterLSAforthebackboneisshown.It
indicatesthatRT3hasasingleattachmenttothe
backbone.Thisattachmentisviaanunnumbered
pointtopointlinktoRouterRT6.RT3hasagain
indicatedthatitisanareaborderrouter.
;RT3'srouterLSAforthebackbone
LSage=0;alwaystrueonorigination
Options=(Ebit);
LStype=1;indicatesrouterLSA
https://www.ietf.org/rfc/rfc2328.txt

102/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

LinkStateID=192.1.1.3;RT3'srouterID
AdvertisingRouter=192.1.1.3;RT3'srouterID
bitE=0;notanASboundaryrouter
bitB=1;areaborderrouter
#links=1
LinkID=18.10.0.6;Neighbor'sRouterID
LinkData=0.0.0.3;MIBIIifIndexofPPlink
Type=1;connectstorouter
#TOSmetrics=0
metric=8
12.4.2.NetworkLSAs
AnetworkLSAisgeneratedforeverytransitbroadcastor
NBMAnetwork.(Atransitnetworkisanetworkhavingtwoor
moreattachedrouters).ThenetworkLSAdescribesallthe
routersthatareattachedtothenetwork.

MoyStandardsTrack[Page133]
RFC2328OSPFVersion2April1998
TheDesignatedRouterforthenetworkoriginatestheLSA.
TheDesignatedRouteroriginatestheLSAonlyifitisfully
adjacenttoatleastoneotherrouteronthenetwork.The
networkLSAisfloodedthroughouttheareathatcontainsthe
transitnetwork,andnofurther.ThenetworkLSAlists
thoseroutersthatarefullyadjacenttotheDesignated
Router;eachfullyadjacentrouterisidentifiedbyitsOSPF
RouterID.TheDesignatedRouterincludesitselfinthis
list.
TheLinkStateIDforanetworkLSAistheIPinterface
addressoftheDesignatedRouter.Thisvalue,maskedbythe
network'saddressmask(whichisalsocontainedinthe
networkLSA)yieldsthenetwork'sIPaddress.
ArouterthathasformerlybeentheDesignatedRouterfora
network,butisnolonger,shouldflushthenetworkLSAthat
ithadpreviouslyoriginated.ThisLSAisnolongerusedin
theroutingtablecalculation.Itisflushedbyprematurely
incrementingtheLSA'sagetoMaxAgeandreflooding(see
Section14.1).Inaddition,inthoserarecaseswherea
router'sRouterIDhaschanged,anynetworkLSAsthatwere
originatedwiththerouter'spreviousRouterIDmustbe
flushed.Sincetheroutermayhavenoideawhatit's
previousRouterIDmighthavebeen,thesenetworkLSAsare
indicatedbyhavingtheirLinkStateIDequaltooneofthe
router'sIPinterfaceaddressesandtheirAdvertisingRouter
equaltosomevalueotherthantherouter'scurrentRouter
ID(seeSection13.4formoredetails).
12.4.2.1.ExamplesofnetworkLSAs
AgainconsidertheareaconfigurationinFigure6.
NetworkLSAsareoriginatedforNetworkN3inArea1,
NetworksN6andN8inArea2,andNetworkN9inArea3.
AssumingthatRouterRT4hasbeenselectedasthe
DesignatedRouterforNetworkN3,thefollowing
networkLSAisgeneratedbyRT4onbehalfofNetworkN3
(seeFigure15fortheaddressassignments):
https://www.ietf.org/rfc/rfc2328.txt

103/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

;NetworkLSAforNetworkN3

MoyStandardsTrack[Page134]
RFC2328OSPFVersion2April1998
LSage=0;alwaystrueonorigination
Options=(Ebit);
LStype=2;indicatesnetworkLSA
LinkStateID=192.1.1.4;IPaddressofDesig.Rtr.
AdvertisingRouter=192.1.1.4;RT4'sRouterID
NetworkMask=0xffffff00
AttachedRouter=192.1.1.4;RouterID
AttachedRouter=192.1.1.1;RouterID
AttachedRouter=192.1.1.2;RouterID
AttachedRouter=192.1.1.3;RouterID
12.4.3.SummaryLSAs
ThedestinationdescribedbyasummaryLSAiseitheranIP
network,anASboundaryrouterorarangeofIPaddresses.
SummaryLSAsarefloodedthroughoutasingleareaonly.The
destinationdescribedisonethatisexternaltothearea,
yetstillbelongstotheAutonomousSystem.
SummaryLSAsareoriginatedbyareaborderrouters.The
precisesummaryroutestoadvertiseintoanareaare
determinedbyexaminingtheroutingtablestructure(see
Section11)inaccordancewiththealgorithmdescribed
below.Notethatonlyintraarearoutesareadvertisedinto
thebackbone,whilebothintraareaandinterarearoutes
areadvertisedintotheotherareas.
TodeterminewhichroutestoadvertiseintoanattachedArea
A,eachroutingtableentryisprocessedasfollows.
Rememberthateachroutingtableentrydescribesasetof
equalcostbestpathstoaparticulardestination:
oOnlyDestinationTypesofnetworkandASboundaryrouter
areadvertisedinsummaryLSAs.Iftheroutingtable
entry'sDestinationTypeisareaborderrouter,examine
thenextroutingtableentry.
oASexternalroutesareneveradvertisedinsummaryLSAs.
IftheroutingtableentryhasPathtypeoftype1
externalortype2external,examinethenextrouting
tableentry.

MoyStandardsTrack[Page135]
RFC2328OSPFVersion2April1998
oElse,iftheareaassociatedwiththissetofpathsis
theAreaAitself,donotgenerateasummaryLSAforthe
route.[17]
oElse,ifthenexthopsassociatedwiththissetofpaths
https://www.ietf.org/rfc/rfc2328.txt

104/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

belongtoAreaAitself,donotgenerateasummaryLSA
fortheroute.[18]Thisisthelogicalequivalentofa
DistanceVectorprotocol'ssplithorizonlogic.
oElse,iftheroutingtablecostequalsorexceedsthe
valueLSInfinity,asummaryLSAcannotbegeneratedfor
thisroute.
oElse,ifthedestinationofthisrouteisanASboundary
router,asummaryLSAshouldbeoriginatedifandonly
iftheroutingtableentrydescribesthepreferredpath
totheASboundaryrouter(seeStep3ofSection16.4).
Ifso,aType4summaryLSAisoriginatedforthe
destination,withLinkStateIDequaltotheASboundary
router'sRouterIDandmetricequaltotheroutingtable
entry'scost.Note:theseLSAsshouldnotbegenerated
ifAreaAhasbeenconfiguredasastubarea.
oElse,theDestinationtypeisnetwork.Ifthisisan
interarearoute,generateaType3summaryLSAforthe
destination,withLinkStateIDequaltothenetwork's
address(ifnecessary,theLinkStateIDcanalsohave
oneormoreofthenetwork'shostbitsset;seeAppendix
Efordetails)andmetricequaltotheroutingtable
cost.
oTheoneremainingcaseisanintraarearoutetoa
network.Thismeansthatthenetworkiscontainedin
oneoftherouter'sdirectlyattachedareas.In
general,thisinformationmustbecondensedbefore
appearinginsummaryLSAs.Rememberthatanareahasa
configuredlistofaddressranges,eachrangeconsisting
ofan[address,mask]pairandastatusindicationof
eitherAdvertiseorDoNotAdvertise.Atmostasingle
Type3summaryLSAisoriginatedforeachrange.When
therange'sstatusindicatesAdvertise,aType3
summaryLSAisgeneratedwithLinkStateIDequaltothe

MoyStandardsTrack[Page136]
RFC2328OSPFVersion2April1998
range'saddress(ifnecessary,theLinkStateIDcan
alsohaveoneormoreoftherange's"host"bitsset;
seeAppendixEfordetails)andcostequaltothe
largestcostofanyofthecomponentnetworks.Whenthe
range'sstatusindicatesDoNotAdvertise,theType3
summaryLSAissuppressedandthecomponentnetworks
remainhiddenfromotherareas.
Bydefault,ifanetworkisnotcontainedinany
explicitlyconfiguredaddressrange,aType3summary
LSAisgeneratedwithLinkStateIDequaltothe
network'saddress(ifnecessary,theLinkStateIDcan
alsohaveoneormoreofthenetwork's"host"bitsset;
seeAppendixEfordetails)andmetricequaltothe
network'sroutingtablecost.
Ifanareaiscapableofcarryingtransittraffic(i.e.,
itsTransitCapabilityissettoTRUE),routing
informationconcerningbackbonenetworksshouldnotbe
condensedbeforebeingsummarizedintothearea.Nor
https://www.ietf.org/rfc/rfc2328.txt

105/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

shouldtheadvertisementofbackbonenetworksinto
transitareasbesuppressed.Inotherwords,the
backbone'sconfiguredrangesshouldbeignoredwhen
originatingsummaryLSAsintotransitareas.
IfarouteradvertisesasummaryLSAforadestinationwhich
thenbecomesunreachable,theroutermustthenflushtheLSA
fromtheroutingdomainbysettingitsagetoMaxAgeand
reflooding(seeSection14.1).Also,ifthedestinationis
stillreachable,yetcannolongerbeadvertisedaccording
totheaboveprocedure(e.g.,itisnowaninterarearoute,
whenitusedtobeanintraarearouteassociatedwithsome
nonbackbonearea;itwouldthusnolongerbeadvertisable
tothebackbone),theLSAshouldalsobeflushedfromthe
routingdomain.
12.4.3.1.OriginatingsummaryLSAsintostubareas
ThealgorithminSection12.4.3isoptionalwhenAreaA
isanOSPFstubarea.Areaborderroutersconnectingto
astubareacanoriginatesummaryLSAsintothearea

MoyStandardsTrack[Page137]
RFC2328OSPFVersion2April1998
accordingtotheSection12.4.3'salgorithm,orcan
choosetooriginateonlyasubsetofthesummaryLSAs,
possiblyunderconfigurationcontrol.ThefewerLSAs
originated,thesmallerthestubarea'slinkstate
database,furtherreducingthedemandsonitsrouters'
resources.However,omittingLSAsmayalsoleadtosub
optimalinterarearouting,althoughroutingwill
continuetofunction.
AsspecifiedinSection12.4.3,Type4summaryLSAs
(ASBRsummaryLSAs)areneveroriginatedintostub
areas.
Inastubarea,insteadofimportingexternalroutes
eachareaborderrouteroriginatesa"defaultsummary
LSA"intothearea.TheLinkStateIDforthedefault
summaryLSAissettoDefaultDestination,andthemetric
settothe(perarea)configurableparameter
StubDefaultCost.NotethatStubDefaultCostneednotbe
configuredidenticallyinallofthestubarea'sarea
borderrouters.
12.4.3.2.ExamplesofsummaryLSAs
ConsideragaintheareaconfigurationinFigure6.
RoutersRT3,RT4,RT7,RT10andRT11areallareaborder
routers,andthereforeareoriginatingsummaryLSAs.
ConsiderinparticularRouterRT4.Itsroutingtable
wascalculatedastheexampleinSection11.3.RT4
originatessummaryLSAsintoboththebackboneandArea
1.Intothebackbone,RouterRT4originatesseparate
LSAsforeachofthenetworksN1N4.IntoArea1,
RouterRT4originatesseparateLSAsfornetworksN6N8
andtheASboundaryroutersRT5,RT7.Italsocondenses
https://www.ietf.org/rfc/rfc2328.txt

106/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

hostroutesIaandIbintoasinglesummaryLSA.
Finally,theroutestonetworksN9,N10,N11andHostH1
areadvertisedbyasinglesummaryLSA.This
condensationwasoriginallyperformedbytherouter
RT11.

MoyStandardsTrack[Page138]
RFC2328OSPFVersion2April1998
TheseLSAsareillustratedgraphicallyinFigures7and
8.TwoofthesummaryLSAsoriginatedbyRouterRT4
follow.TheactualIPaddressesforthenetworksand
routersinquestionhavebeenassignedinFigure15.
;SummaryLSAforNetworkN1,
;originatedbyRouterRT4intothebackbone
LSage=0;alwaystrueonorigination
Options=(Ebit);
LStype=3;Type3summaryLSA
LinkStateID=192.1.2.0;N1'sIPnetworknumber
AdvertisingRouter=192.1.1.4;RT4'sID
metric=4
;SummaryLSAforASboundaryrouterRT7
;originatedbyRouterRT4intoArea1
LSage=0;alwaystrueonorigination
Options=(Ebit);
LStype=4;Type4summaryLSA
LinkStateID=RouterRT7'sID
AdvertisingRouter=192.1.1.4;RT4'sID
metric=14
12.4.4.ASexternalLSAs
ASexternalLSAsdescriberoutestodestinationsexternalto
theAutonomousSystem.MostASexternalLSAsdescribe
routestospecificexternaldestinations;inthesecasesthe
LSA'sLinkStateIDissettothedestinationnetwork'sIP
address(ifnecessary,theLinkStateIDcanalsohaveone
ormoreofthenetwork's"host"bitsset;seeAppendixEfor
details).However,adefaultroutefortheAutonomous
SystemcanbedescribedinanASexternalLSAbysettingthe
LSA'sLinkStateIDtoDefaultDestination(0.0.0.0).AS
externalLSAsareoriginatedbyASboundaryrouters.AnAS
boundaryrouteroriginatesasingleASexternalLSAforeach
externalroutethatithaslearned,eitherthroughanother
routingprotocol(suchasBGP),orthroughconfiguration
information.

MoyStandardsTrack[Page139]
RFC2328OSPFVersion2April1998

https://www.ietf.org/rfc/rfc2328.txt

107/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

ASexternalLSAsaretheonlytypeofLSAsthatareflooded
throughouttheentireAutonomousSystem;allothertypesof
LSAsarespecifictoasinglearea.However,ASexternal
LSAsarenotfloodedinto/throughoutstubareas(seeSection
3.6).Thisenablesareductioninlinkstatedatabasesize
forroutersinternaltostubareas.
Themetricthatisadvertisedforanexternalroutecanbe
oneoftwotypes.Type1metricsarecomparabletothelink
statemetric.Type2metricsareassumedtobelargerthan
thecostofanyintraASpath.
IfarouteradvertisesanASexternalLSAforadestination
whichthenbecomesunreachable,theroutermustthenflush
theLSAfromtheroutingdomainbysettingitsagetoMaxAge
andreflooding(seeSection14.1).
12.4.4.1.ExamplesofASexternalLSAs
ConsideronceagaintheASpicturedinFigure6.There
aretwoASboundaryrouters:RT5andRT7.RouterRT5
originatesthreeASexternalLSAs,fornetworksN12N14.
RouterRT7originatestwoASexternalLSAs,fornetworks
N12andN15.AssumethatRT7haslearneditsrouteto
N12viaBGP,andthatitwishestoadvertiseaType2
metrictotheAS.RT7wouldthenoriginatethe
followingLSAforN12:
;ASexternalLSAforNetworkN12,
;originatedbyRouterRT7
LSage=0;alwaystrueonorigination
Options=(Ebit);
LStype=5;ASexternalLSA
LinkStateID=N12'sIPnetworknumber
AdvertisingRouter=RouterRT7'sID
bitE=1;Type2metric
metric=2
Forwardingaddress=0.0.0.0

MoyStandardsTrack[Page140]
RFC2328OSPFVersion2April1998
Intheaboveexample,theforwardingaddressfield
hasbeensetto0.0.0.0,indicatingthatpacketsfor
theexternaldestinationshouldbeforwardedtothe
advertisingOSPFrouter(RT7).Thisisnotalways
desirable.ConsidertheexamplepicturedinFigure
16.TherearethreeOSPFrouters(RTA,RTBandRTC)
connectedtoacommonnetwork.Onlyoneofthese
routers,RTA,isexchangingBGPinformationwiththe
nonOSPFrouterRTX.RTAmustthenoriginateAS
externalLSAsforthosedestinationsithaslearned
fromRTX.ByusingtheASexternalLSA'sforwarding
addressfield,RTAcanspecifythatpacketsfor
thesedestinationsbeforwardeddirectlytoRTX.
Withoutthisfeature,RoutersRTBandRTCwouldtake
anextrahoptogettothesedestinations.
https://www.ietf.org/rfc/rfc2328.txt

108/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Notethatwhentheforwardingaddressfieldisnon
zero,itshouldpointtoarouterbelongingto
anotherAutonomousSystem.
Aforwardingaddresscanalsobespecifiedforthe
defaultroute.Forexample,infigure16RTAmay
wanttospecifythatallexternallydestinedpackets
shouldbydefaultbeforwardedtoitsBGPpeerRTX.
TheresultingASexternalLSAispicturedbelow.
NotethattheLinkStateIDissetto
DefaultDestination.
;Defaultroute,originatedbyRouterRTA
;PacketsforwardedthroughRTX
LSage=0;alwaystrueonorigination
Options=(Ebit);
LStype=5;ASexternalLSA
LinkStateID=DefaultDestination;defaultroute
AdvertisingRouter=RouterRTA'sID
bitE=1;Type2metric
metric=1
Forwardingaddress=RTX'sIPaddress
Infigure16,supposeinsteadthatbothRTAandRTB
exchangeBGPinformationwithRTX.Inthiscase,

MoyStandardsTrack[Page141]
RFC2328OSPFVersion2April1998
RTAandRTBwouldoriginatethesamesetofAS
externalLSAs.TheseLSAs,iftheyspecifythesame
metric,wouldbefunctionallyequivalentsincethey
wouldspecifythesamedestinationandforwarding
address(RTX).Thisleadstoaclearduplicationof
effort.IfonlyoneofRTAorRTBoriginatedthe
setofASexternalLSAs,theroutingwouldremain
thesame,andthesizeofthelinkstatedatabase
woulddecrease.However,itmustbeunambiguously
definedastowhichrouteroriginatestheLSAs
(otherwiseneithermay,ortheidentityofthe
originatormayoscillate).Thefollowingruleis
therebyestablished:iftworouters,bothreachable
fromoneanother,originatefunctionallyequivalent
ASexternalLSAs(i.e.,samedestination,costand
nonzeroforwardingaddress),thentheLSA
originatedbytherouterhavingthehighestOSPF
RouterIDisused.TherouterhavingthelowerOSPF
RouterIDcanthenflushitsLSA.FlushinganLSA
isdiscussedinSection14.1.
+
|
++.....|.BGP
|RTA||.....++
++||RTX|
|++
++|
|RTB||
https://www.ietf.org/rfc/rfc2328.txt

109/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

++|
|
++|
|RTC||
++|
|
+
Figure16:Forwardingaddressexample

MoyStandardsTrack[Page142]
RFC2328OSPFVersion2April1998
13.TheFloodingProcedure
LinkStateUpdatepacketsprovidethemechanismforfloodingLSAs.
ALinkStateUpdatepacketmaycontainseveraldistinctLSAs,and
floodseachLSAonehopfurtherfromitspointoforigination.To
makethefloodingprocedurereliable,eachLSAmustbeacknowledged
separately.AcknowledgmentsaretransmittedinLinkState
Acknowledgmentpackets.Manyseparateacknowledgmentscanalsobe
groupedtogetherintoasinglepacket.
ThefloodingprocedurestartswhenaLinkStateUpdatepackethas
beenreceived.Manyconsistencycheckshavebeenmadeonthe
receivedpacketbeforebeinghandedtothefloodingprocedure(see
Section8.2).Inparticular,theLinkStateUpdatepackethasbeen
associatedwithaparticularneighbor,andaparticulararea.If
theneighborisinalesserstatethanExchange,thepacketshould
bedroppedwithoutfurtherprocessing.
AlltypesofLSAs,otherthanASexternalLSAs,areassociatedwith
aspecificarea.However,LSAsdonotcontainanareafield.An
LSA'sareamustbededucedfromtheLinkStateUpdatepacketheader.
ForeachLSAcontainedinaLinkStateUpdatepacket,thefollowing
stepsaretaken:
(1)ValidatetheLSA'sLSchecksum.Ifthechecksumturnsouttobe
invalid,discardtheLSAandgetthenextonefromtheLink
StateUpdatepacket.
(2)ExaminetheLSA'sLStype.IftheLStypeisunknown,discard
theLSAandgetthenextonefromtheLinkStateUpdatePacket.
ThisspecificationdefinesLStypes15(seeSection4.3).
(3)ElseifthisisanASexternalLSA(LStype=5),andthearea
hasbeenconfiguredasastubarea,discardtheLSAandgetthe
nextonefromtheLinkStateUpdatePacket.ASexternalLSAs
arenotfloodedinto/throughoutstubareas(seeSection3.6).
(4)ElseiftheLSA'sLSageisequaltoMaxAge,andthereis
currentlynoinstanceoftheLSAintherouter'slinkstate
database,andnoneofrouter'sneighborsareinstatesExchange

https://www.ietf.org/rfc/rfc2328.txt

110/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page143]
RFC2328OSPFVersion2April1998
orLoading,thentakethefollowingactions:a)Acknowledgethe
receiptoftheLSAbysendingaLinkStateAcknowledgmentpacket
backtothesendingneighbor(seeSection13.5),andb)Discard
theLSAandexaminethenextLSA(ifany)listedintheLink
StateUpdatepacket.
(5)Otherwise,findtheinstanceofthisLSAthatiscurrently
containedintherouter'slinkstatedatabase.Ifthereisno
databasecopy,orthereceivedLSAismorerecentthanthe
databasecopy(seeSection13.1belowforthedeterminationof
whichLSAismorerecent)thefollowingstepsmustbeperformed:
(a)Ifthereisalreadyadatabasecopy,andifthedatabase
copywasreceivedviafloodingandinstalledlessthan
MinLSArrivalsecondsago,discardthenewLSA(without
acknowledgingit)andexaminethenextLSA(ifany)listed
intheLinkStateUpdatepacket.
(b)OtherwiseimmediatelyfloodthenewLSAoutsomesubsetof
therouter'sinterfaces(seeSection13.3).Insomecases
(e.g.,thestateofthereceivinginterfaceisDRandthe
LSAwasreceivedfromarouterotherthantheBackupDR)the
LSAwillbefloodedbackoutthereceivinginterface.This
occurrenceshouldbenotedforlaterusebythe
acknowledgmentprocess(Section13.5).
(c)Removethecurrentdatabasecopyfromallneighbors'Link
stateretransmissionlists.
(d)InstallthenewLSAinthelinkstatedatabase(replacing
thecurrentdatabasecopy).Thismaycausetherouting
tablecalculationtobescheduled.Inaddition,timestamp
thenewLSAwiththecurrenttime(i.e.,thetimeitwas
received).Thefloodingprocedurecannotoverwritethe
newlyinstalledLSAuntilMinLSArrivalsecondshaveelapsed.
TheLSAinstallationprocessisdiscussedfurtherinSection
13.2.
(e)PossiblyacknowledgethereceiptoftheLSAbysendinga
LinkStateAcknowledgmentpacketbackoutthereceiving
interface.ThisisexplainedbelowinSection13.5.

MoyStandardsTrack[Page144]
RFC2328OSPFVersion2April1998
(f)IfthisnewLSAindicatesthatitwasoriginatedbythe
receivingrouteritself(i.e.,isconsideredaself
originatedLSA),theroutermusttakespecialaction,either
updatingtheLSAorinsomecasesflushingitfromthe
routingdomain.Foradescriptionofhowselforiginated
LSAsaredetectedandsubsequentlyhandled,seeSection
13.4.
(6)Else,ifthereisaninstanceoftheLSAonthesending
neighbor'sLinkstaterequestlist,anerrorhasoccurredinthe
https://www.ietf.org/rfc/rfc2328.txt

111/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

DatabaseExchangeprocess.Inthiscase,restarttheDatabase
ExchangeprocessbygeneratingtheneighboreventBadLSReqfor
thesendingneighborandstopprocessingtheLinkStateUpdate
packet.
(7)Else,ifthereceivedLSAisthesameinstanceasthedatabase
copy(i.e.,neitheroneismorerecent)thefollowingtwosteps
shouldbeperformed:
(a)IftheLSAislistedintheLinkstateretransmissionlist
forthereceivingadjacency,therouteritselfisexpecting
anacknowledgmentforthisLSA.Theroutershouldtreatthe
receivedLSAasanacknowledgmentbyremovingtheLSAfrom
theLinkstateretransmissionlist.Thisistermedan
"impliedacknowledgment".Itsoccurrenceshouldbenoted
forlaterusebytheacknowledgmentprocess(Section13.5).
(b)PossiblyacknowledgethereceiptoftheLSAbysendinga
LinkStateAcknowledgmentpacketbackoutthereceiving
interface.ThisisexplainedbelowinSection13.5.
(8)Else,thedatabasecopyismorerecent.Ifthedatabasecopy
hasLSageequaltoMaxAgeandLSsequencenumberequalto
MaxSequenceNumber,simplydiscardthereceivedLSAwithout
acknowledgingit.(Inthiscase,theLSA'sLSsequencenumberis
wrapping,andtheMaxSequenceNumberLSAmustbecompletely
flushedbeforeanynewLSAinstancecanbeintroduced).
Otherwise,aslongasthedatabasecopyhasnotbeensentina
LinkStateUpdatewithinthelastMinLSArrivalseconds,sendthe
databasecopybacktothesendingneighbor,encapsulatedwithin
aLinkStateUpdatePacket.TheLinkStateUpdatePacketshould
besentdirectlytotheneighbor.Insodoing,donotputthe

MoyStandardsTrack[Page145]
RFC2328OSPFVersion2April1998
databasecopyoftheLSAontheneighbor'slinkstate
retransmissionlist,anddonotacknowledgethereceived(less
recent)LSAinstance.
13.1.DeterminingwhichLSAisnewer
WhenarouterencounterstwoinstancesofanLSA,itmust
determinewhichismorerecent.Thisoccurredabovewhen
comparingareceivedLSAtoitsdatabasecopy.Thiscomparison
mustalsobedoneduringtheDatabaseExchangeprocedurewhich
occursduringadjacencybringup.
AnLSAisidentifiedbyitsLStype,LinkStateIDand
AdvertisingRouter.FortwoinstancesofthesameLSA,theLS
sequencenumber,LSage,andLSchecksumfieldsareusedto
determinewhichinstanceismorerecent:
oTheLSAhavingthenewerLSsequencenumberismorerecent.
SeeSection12.1.6foranexplanationoftheLSsequence
numberspace.IfbothinstanceshavethesameLSsequence
number,then:
oIfthetwoinstanceshavedifferentLSchecksums,thenthe
https://www.ietf.org/rfc/rfc2328.txt

112/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

instancehavingthelargerLSchecksum(whenconsideredasa
16bitunsignedinteger)isconsideredmorerecent.
oElse,ifonlyoneoftheinstanceshasitsLSagefieldset
toMaxAge,theinstanceofageMaxAgeisconsideredtobe
morerecent.
oElse,iftheLSagefieldsofthetwoinstancesdifferby
morethanMaxAgeDiff,theinstancehavingthesmaller
(younger)LSageisconsideredtobemorerecent.
oElse,thetwoinstancesareconsideredtobeidentical.

MoyStandardsTrack[Page146]
RFC2328OSPFVersion2April1998
13.2.InstallingLSAsinthedatabase
InstallinganewLSAinthedatabase,eitherastheresultof
floodingoranewlyselforiginatedLSA,maycausetheOSPF
routingtablestructuretoberecalculated.Thecontentsofthe
newLSAshouldbecomparedtotheoldinstance,ifpresent.If
thereisnodifference,thereisnoneedtorecalculatethe
routingtable.WhencomparinganLSAtoitspreviousinstance,
thefollowingareallconsideredtobedifferencesincontents:
oTheLSA'sOptionsfieldhaschanged.
oOneoftheLSAinstanceshasLSagesettoMaxAge,and
theotherdoesnot.
oThelengthfieldintheLSAheaderhaschanged.
oThebodyoftheLSA(i.e.,anythingoutsidethe20byte
LSAheader)haschanged.Notethatthisexcludeschanges
inLSSequenceNumberandLSChecksum.
Ifthecontentsaredifferent,thefollowingpiecesofthe
routingtablemustberecalculated,dependingonthenewLSA's
LStypefield:
RouterLSAsandnetworkLSAs
Theentireroutingtablemustberecalculated,startingwith
theshortestpathcalculationsforeacharea(notjustthe
areawhoselinkstatedatabasehaschanged).Thereason
thattheshortestpathcalculationcannotberestrictedto
thesinglechangedareahastodowiththefactthatAS
boundaryroutersmaybelongtomultipleareas.Achangein
theareacurrentlyprovidingthebestroutemayforcethe
routertouseanintraarearouteprovidedbyadifferent
area.[19]
SummaryLSAs
Thebestroutetothedestinationdescribedbythesummary
LSAmustberecalculated(seeSection16.5).Ifthis
https://www.ietf.org/rfc/rfc2328.txt

113/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

destinationisanASboundaryrouter,itmayalsobe
necessarytoreexaminealltheASexternalLSAs.

MoyStandardsTrack[Page147]
RFC2328OSPFVersion2April1998
ASexternalLSAs
ThebestroutetothedestinationdescribedbytheAS
externalLSAmustberecalculated(seeSection16.6).
Also,anyoldinstanceoftheLSAmustberemovedfromthe
databasewhenthenewLSAisinstalled.Thisoldinstancemust
alsoberemovedfromallneighbors'Linkstateretransmission
lists(seeSection10).
13.3.Nextstepinthefloodingprocedure
Whenanew(andmorerecent)LSAhasbeenreceived,itmustbe
floodedoutsomesetoftherouter'sinterfaces.Thissection
describesthesecondpartoffloodingprocedure(thefirstpart
beingtheprocessingthatoccurredinSection13),namely,
selectingtheoutgoinginterfacesandaddingtheLSAtothe
appropriateneighbors'Linkstateretransmissionlists.Also
includedinthispartofthefloodingprocedureisthe
maintenanceoftheneighbors'Linkstaterequestlists.
ThissectionisequallyapplicabletothefloodingofanLSA
thattherouteritselfhasjustoriginated(seeSection12.4).
FortheseLSAs,thissectionprovidestheentiretyofthe
floodingprocedure(i.e.,theprocessingofSection13isnot
performed,since,forexample,theLSAhasnotbeenreceived
fromaneighborandthereforedoesnotneedtobeacknowledged).
DependingupontheLSA'sLStype,theLSAcanbefloodedout
onlycertaininterfaces.Theseinterfaces,definedbythe
following,arecalledtheeligibleinterfaces:
ASexternalLSAs(LSType=5)
ASexternalLSAsarefloodedthroughouttheentireAS,with
theexceptionofstubareas(seeSection3.6).Theeligible
interfacesarealltherouter'sinterfaces,excluding
virtuallinksandthoseinterfacesattachingtostubareas.
AllotherLStypes
Allothertypesarespecifictoasinglearea(AreaA).The

MoyStandardsTrack[Page148]
RFC2328OSPFVersion2April1998
eligibleinterfacesareallthoseinterfacesattachingto
theAreaA.IfAreaAisthebackbone,thisincludesall
thevirtuallinks.

https://www.ietf.org/rfc/rfc2328.txt

114/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Linkstatedatabasesmustremainsynchronizedoverall
adjacenciesassociatedwiththeaboveeligibleinterfaces.This
isaccomplishedbyexecutingthefollowingstepsoneach
eligibleinterface.Itshouldbenotedthatthisproceduremay
decidenottofloodanLSAoutaparticularinterface,ifthere
isahighprobabilitythattheattachedneighborshavealready
receivedtheLSA.However,inthesecasestheflooding
proceduremustbeabsolutelysurethattheneighborseventually
doreceivetheLSA,sotheLSAisstilladdedtoeach
adjacency'sLinkstateretransmissionlist.Foreacheligible
interface:
(1)Eachoftheneighborsattachedtothisinterfaceare
examined,todeterminewhethertheymustreceivethenew
LSA.Thefollowingstepsareexecutedforeachneighbor:
(a)IftheneighborisinalesserstatethanExchange,it
doesnotparticipateinflooding,andthenextneighbor
shouldbeexamined.
(b)Else,iftheadjacencyisnotyetfull(neighborstate
isExchangeorLoading),examinetheLinkstaterequest
listassociatedwiththisadjacency.Ifthereisan
instanceofthenewLSAonthelist,itindicatesthat
theneighboringrouterhasaninstanceoftheLSA
already.ComparethenewLSAtotheneighbor'scopy:
oIfthenewLSAislessrecent,thenexaminethenext
neighbor.
oIfthetwocopiesarethesameinstance,thendelete
theLSAfromtheLinkstaterequestlist,and
examinethenextneighbor.[20]
oElse,thenewLSAismorerecent.DeletetheLSA
fromtheLinkstaterequestlist.

MoyStandardsTrack[Page149]
RFC2328OSPFVersion2April1998
(c)IfthenewLSAwasreceivedfromthisneighbor,examine
thenextneighbor.
(d)Atthispointwearenotpositivethattheneighborhas
anuptodateinstanceofthisnewLSA.AddthenewLSA
totheLinkstateretransmissionlistfortheadjacency.
Thisensuresthatthefloodingprocedureisreliable;
theLSAwillberetransmittedatintervalsuntilan
acknowledgmentisseenfromtheneighbor.
(2)TheroutermustnowdecidewhethertofloodthenewLSAout
thisinterface.Ifinthepreviousstep,theLSAwasNOT
addedtoanyoftheLinkstateretransmissionlists,there
isnoneedtofloodtheLSAouttheinterfaceandthenext
interfaceshouldbeexamined.
(3)IfthenewLSAwasreceivedonthisinterface,anditwas
receivedfromeithertheDesignatedRouterortheBackup
DesignatedRouter,chancesarethatalltheneighborshave
receivedtheLSAalready.Therefore,examinethenext
https://www.ietf.org/rfc/rfc2328.txt

115/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

interface.
(4)IfthenewLSAwasreceivedonthisinterface,andthe
interfacestateisBackup(i.e.,therouteritselfisthe
BackupDesignatedRouter),examinethenextinterface.The
DesignatedRouterwilldothefloodingonthisinterface.
However,iftheDesignatedRouterfailstherouter(i.e.,
theBackupDesignatedRouter)willendupretransmittingthe
updates.
(5)Ifthisstepisreached,theLSAmustbefloodedoutthe
interface.SendaLinkStateUpdatepacket(includingthe
newLSAascontents)outtheinterface.TheLSA'sLSage
mustbeincrementedbyInfTransDelay(whichmustbe>0)
whenitiscopiedintotheoutgoingLinkStateUpdatepacket
(untiltheLSagefieldreachesthemaximumvalueof
MaxAge).
Onbroadcastnetworks,theLinkStateUpdatepacketsare
multicast.ThedestinationIPaddressspecifiedforthe
LinkStateUpdatePacketdependsonthestateofthe
interface.IftheinterfacestateisDRorBackup,the

MoyStandardsTrack[Page150]
RFC2328OSPFVersion2April1998
addressAllSPFRoutersshouldbeused.Otherwise,the
addressAllDRoutersshouldbeused.
Onnonbroadcastnetworks,separateLinkStateUpdate
packetsmustbesent,asunicasts,toeachadjacentneighbor
(i.e.,thoseinstateExchangeorgreater).Thedestination
IPaddressesforthesepacketsaretheneighbors'IP
addresses.
13.4.ReceivingselforiginatedLSAs
Itisacommonoccurrenceforaroutertoreceiveself
originatedLSAsviathefloodingprocedure.Aselforiginated
LSAisdetectedwheneither1)theLSA'sAdvertisingRouteris
equaltotherouter'sownRouterIDor2)theLSAisanetwork
LSAanditsLinkStateIDisequaltooneoftherouter'sownIP
interfaceaddresses.
However,ifthereceivedselforiginatedLSAisnewerthanthe
lastinstancethattherouteractuallyoriginated,therouter
musttakespecialaction.ThereceptionofsuchanLSA
indicatesthatthereareLSAsintheroutingdomainthatwere
originatedbytherouterbeforethelasttimeitwasrestarted.
Inmostcases,theroutermustthenadvancetheLSA'sLS
sequencenumberonepastthereceivedLSsequencenumber,and
originateanewinstanceoftheLSA.
Itmaybethecasetherouternolongerwishestooriginatethe
receivedLSA.Possibleexamplesinclude:1)theLSAisa
summaryLSAorASexternalLSAandtherouternolongerhasan
(advertisable)routetothedestination,2)theLSAisa
networkLSAbuttherouterisnolongerDesignatedRouterfor
thenetworkor3)theLSAisanetworkLSAwhoseLinkStateID
isoneoftherouter'sownIPinterfaceaddressesbutwhose
https://www.ietf.org/rfc/rfc2328.txt

116/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

AdvertisingRouterisnotequaltotherouter'sownRouterID
(thislattercaseshouldberare,anditindicatesthatthe
router'sRouterIDhaschangedsinceoriginatingtheLSA).In
allthesecases,insteadofupdatingtheLSA,theLSAshouldbe
flushedfromtheroutingdomainbyincrementingthereceived
LSA'sLSagetoMaxAgeandreflooding(seeSection14.1).

MoyStandardsTrack[Page151]
RFC2328OSPFVersion2April1998
13.5.SendingLinkStateAcknowledgmentpackets
EachnewlyreceivedLSAmustbeacknowledged.Thisisusually
donebysendingLinkStateAcknowledgmentpackets.However,
acknowledgmentscanalsobeaccomplishedimplicitlybysending
LinkStateUpdatepackets(seestep7aofSection13).
ManyacknowledgmentsmaybegroupedtogetherintoasingleLink
StateAcknowledgmentpacket.Suchapacketissentbackoutthe
interfacewhichreceivedtheLSAs.Thepacketcanbesentin
oneoftwoways:delayedandsentonanintervaltimer,orsent
directlytoaparticularneighbor.Theparticular
acknowledgmentstrategyuseddependsonthecircumstances
surroundingthereceiptoftheLSA.
Sendingdelayedacknowledgmentsaccomplishesseveralthings:1)
itfacilitatesthepackagingofmultipleacknowledgmentsina
singleLinkStateAcknowledgmentpacket,2)itenablesasingle
LinkStateAcknowledgmentpackettoindicateacknowledgmentsto
severalneighborsatonce(throughmulticasting)and3)it
randomizestheLinkStateAcknowledgmentpacketssentbythe
variousroutersattachedtoacommonnetwork.Thefixed
intervalbetweenarouter'sdelayedtransmissionsmustbeshort
(lessthanRxmtInterval)orneedlessretransmissionswillensue.
Directacknowledgmentsaresentdirectlytoaparticular
neighborinresponsetothereceiptofduplicateLSAs.Direct
acknowledgmentsaresentimmediatelywhentheduplicateis
received.Onmultiaccessnetworks,theseacknowledgmentsare
sentdirectlytotheneighbor'sIPaddress.
ThepreciseprocedureforsendingLinkStateAcknowledgment
packetsisdescribedinTable19.Thecircumstancessurrounding
thereceiptoftheLSAarelistedintheleftcolumn.The
acknowledgmentactionthentakenislistedinoneofthetwo
rightcolumns.Thisactiondependsonthestateofthe
concernedinterface;interfacesinstateBackupbehave
differentlyfrominterfacesinallotherstates.Delayed
acknowledgmentsmustbedeliveredtoalladjacentrouters
associatedwiththeinterface.Onbroadcastnetworks,thisis
accomplishedbysendingthedelayedLinkStateAcknowledgment
packetsasmulticasts.TheDestinationIPaddressuseddepends

MoyStandardsTrack[Page152]
RFC2328OSPFVersion2April1998

https://www.ietf.org/rfc/rfc2328.txt

117/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Actiontakeninstate
CircumstancesBackupAllotherstates
_________________________________________________________________
LSAhasNoacknowledgmentNoacknowledgment
beenfloodedbacksent.sent.
outreceivingin
terface(seeSec
tion13,step5b).
_________________________________________________________________
LSAisDelayedacknowledgDelayedack
morerecentthanmentsentifadvernowledgmentsent.
databasecopy,buttisementreceived
wasnotfloodedfromDesignated
backoutreceivingRouter,otherwise
interfacedonothing
_________________________________________________________________
LSAisaDelayedacknowledgNoacknowledgment
duplicate,andwasmentsentifadversent.
treatedasanimtisementreceived
pliedacknowledgfromDesignated
ment(seeSectionRouter,otherwise
13,step7a).donothing
_________________________________________________________________
LSAisaDirectacknowledgDirectacknowledg
duplicate,andwasmentsent.mentsent.
nottreatedasan
impliedack
nowledgment.
_________________________________________________________________
LSA'sLSDirectacknowledgDirectacknowledg
ageisequaltomentsent.mentsent.
MaxAge,andthereis
nocurrentinstance
oftheLSA
inthelinkstate
database,andnone
ofrouter'sneighbors
areinstatesExchange

MoyStandardsTrack[Page153]
RFC2328OSPFVersion2April1998
orLoading(see
Section13,step4).
Table19:Sendinglinkstateacknowledgements.

onthestateoftheinterface.IftheinterfacestateisDRor
Backup,thedestinationAllSPFRoutersisused.Inallother
states,thedestinationAllDRoutersisused.Onnonbroadcast
networks,delayedLinkStateAcknowledgmentpacketsmustbe
unicastseparatelyovereachadjacency(i.e.,neighborwhose
stateis>=Exchange).
https://www.ietf.org/rfc/rfc2328.txt

118/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Thereasoningbehindsendingtheabovepacketsasmulticastsis
bestexplainedbyanexample.Considerthenetwork
configurationdepictedinFigure15.SupposeRT4hasbeen
electedasDesignatedRouter,andRT3asBackupDesignated
RouterforthenetworkN3.WhenRouterRT4floodsanewLSAto
NetworkN3,itisreceivedbyroutersRT1,RT2,andRT3.These
routerswillnotfloodtheLSAbackontonetN3,buttheystill
mustensurethattheirlinkstatedatabasesremainsynchronized
withtheiradjacentneighbors.SoRT1,RT2,andRT4arewaiting
toseeanacknowledgmentfromRT3.Likewise,RT4andRT3are
bothwaitingtoseeacknowledgmentsfromRT1andRT2.Thisis
bestachievedbysendingtheacknowledgmentsasmulticasts.
ThereasonthattheacknowledgmentlogicforBackupDRsis
slightlydifferentisbecausetheyperformdifferentlyduring
thefloodingofLSAs(seeSection13.3,step4).

13.6.RetransmittingLSAs
LSAsfloodedoutanadjacencyareplacedontheadjacency'sLink
stateretransmissionlist.Inordertoensurethatfloodingis
reliable,theseLSAsareretransmitteduntiltheyare
acknowledged.Thelengthoftimebetweenretransmissionsisa
configurableperinterfacevalue,RxmtInterval.Ifthisisset

MoyStandardsTrack[Page154]
RFC2328OSPFVersion2April1998
toolowforaninterface,needlessretransmissionswillensue.
Ifthevalueissettoohigh,thespeedoftheflooding,inthe
faceoflostpackets,maybeaffected.
SeveralretransmittedLSAsmayfitintoasingleLinkState
Updatepacket.WhenLSAsaretoberetransmitted,onlythe
numberfittinginasingleLinkStateUpdatepacketshouldbe
sent.Anotherpacketofretransmissionscanbesentwhenever
someoftheLSAsareacknowledged,oronthenextfiringofthe
retransmissiontimer.
LinkStateUpdatePacketscarryingretransmissionsarealways
sentdirectlytotheneighbor.Onmultiaccessnetworks,this
meansthatretransmissionsaresentdirectlytotheneighbor's
IPaddress.EachLSA'sLSagemustbeincrementedby
InfTransDelay(whichmustbe>0)whenitiscopiedintothe
outgoingLinkStateUpdatepacket(untiltheLSagefield
reachesthemaximumvalueofMaxAge).
Ifanadjacentroutergoesdown,retransmissionsmayoccuruntil
theadjacencyisdestroyedbyOSPF'sHelloProtocol.Whenthe
adjacencyisdestroyed,theLinkstateretransmissionlistis
cleared.
13.7.Receivinglinkstateacknowledgments
ManyconsistencycheckshavebeenmadeonareceivedLinkState
Acknowledgmentpacketbeforeitishandedtotheflooding
procedure.Inparticular,ithasbeenassociatedwitha
https://www.ietf.org/rfc/rfc2328.txt

119/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

particularneighbor.Ifthisneighborisinalesserstatethan
Exchange,theLinkStateAcknowledgmentpacketisdiscarded.
Otherwise,foreachacknowledgmentintheLinkState
Acknowledgmentpacket,thefollowingstepsareperformed:
oDoestheLSAacknowledgedhaveaninstanceontheLinkstate
retransmissionlistfortheneighbor?Ifnot,examinethe
nextacknowledgment.Otherwise:

MoyStandardsTrack[Page155]
RFC2328OSPFVersion2April1998
oIftheacknowledgmentisforthesameinstancethatis
containedonthelist,removetheitemfromthelistand
examinethenextacknowledgment.Otherwise:
oLogthequestionableacknowledgment,andexaminethenext
one.
14.AgingTheLinkStateDatabase
EachLSAhasanLSagefield.TheLSageisexpressedinseconds.
AnLSA'sLSagefieldisincrementedwhileitiscontainedina
router'sdatabase.Also,whencopiedintoaLinkStateUpdate
Packetforfloodingoutaparticularinterface,theLSA'sLSageis
incrementedbyInfTransDelay.
AnLSA'sLSageisneverincrementedpastthevalueMaxAge.LSAs
havingageMaxAgearenotusedintheroutingtablecalculation.As
arouteragesitslinkstatedatabase,anLSA'sLSagemayreach
MaxAge.[21]Atthistime,theroutermustattempttoflushtheLSA
fromtheroutingdomain.Thisisdonesimplybyrefloodingthe
MaxAgeLSAjustasifitwasanewlyoriginatedLSA(seeSection
13.3).
WhencreatingaDatabasesummarylistforanewlyformingadjacency,
anyMaxAgeLSAspresentinthelinkstatedatabaseareaddedtothe
neighbor'sLinkstateretransmissionlistinsteadoftheneighbor's
Databasesummarylist.SeeSection10.3formoredetails.
AMaxAgeLSAmustberemovedimmediatelyfromtherouter'slink
statedatabaseassoonasbotha)itisnolongercontainedonany
neighborLinkstateretransmissionlistsandb)noneoftherouter's
neighborsareinstatesExchangeorLoading.
When,intheprocessofagingthelinkstatedatabase,anLSA'sLS
agehitsamultipleofCheckAge,itsLSchecksumshouldbeverified.
IftheLSchecksumisincorrect,aprogramormemoryerrorhasbeen
detected,andattheveryleasttherouteritselfshouldbe
restarted.

https://www.ietf.org/rfc/rfc2328.txt

120/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page156]
RFC2328OSPFVersion2April1998
14.1.PrematureagingofLSAs
AnLSAcanbeflushedfromtheroutingdomainbysettingitsLS
agetoMaxAge,whileleavingitsLSsequencenumberalone,and
thenrefloodingtheLSA.Thisprocedurefollowsthesamecourse
asflushinganLSAwhoseLSagehasnaturallyreachedthevalue
MaxAge(seeSection14).Inparticular,theMaxAgeLSAis
removedfromtherouter'slinkstatedatabaseassoonasa)it
isnolongercontainedonanyneighborLinkstateretransmission
listsandb)noneoftherouter'sneighborsareinstates
ExchangeorLoading.WecallthesettingofanLSA'sLSageto
MaxAge"prematureaging".
Prematureagingisusedwhenitistimeforaselforiginated
LSA'ssequencenumberfieldtowrap.Atthispoint,thecurrent
LSAinstance(havingLSsequencenumberMaxSequenceNumber)must
beprematurelyagedandflushedfromtheroutingdomainbeforea
newinstancewithsequencenumberequaltoInitialSequenceNumber
canbeoriginated.SeeSection12.1.6formoreinformation.
Prematureagingcanalsobeusedwhen,forexample,oneofthe
router'spreviouslyadvertisedexternalroutesisnolonger
reachable.Inthiscircumstance,theroutercanflushitsAS
externalLSAfromtheroutingdomainviaprematureaging.This
procedureispreferabletothealternative,whichisto
originateanewLSAforthedestinationspecifyingametricof
LSInfinity.Prematureagingisalsobeusedwhenunexpectedly
receivingselforiginatedLSAsduringthefloodingprocedure
(seeSection13.4).
AroutermayonlyprematurelyageitsownselforiginatedLSAs.
TheroutermaynotprematurelyageLSAsthathavebeen
originatedbyotherrouters.AnLSAisconsideredself
originatedwheneither1)theLSA'sAdvertisingRouterisequal
totherouter'sownRouterIDor2)theLSAisanetworkLSAand
itsLinkStateIDisequaltooneoftherouter'sownIP
interfaceaddresses.

MoyStandardsTrack[Page157]
RFC2328OSPFVersion2April1998
15.VirtualLinks
Thesinglebackbonearea(AreaID=0.0.0.0)cannotbedisconnected,
orsomeareasoftheAutonomousSystemwillbecomeunreachable.To
establish/maintainconnectivityofthebackbone,virtuallinkscan
beconfiguredthroughnonbackboneareas.Virtuallinksserveto
connectphysicallyseparatecomponentsofthebackbone.Thetwo
endpointsofavirtuallinkareareaborderrouters.Thevirtual
linkmustbeconfiguredinbothrouters.Theconfiguration
informationineachrouterconsistsoftheothervirtualendpoint
https://www.ietf.org/rfc/rfc2328.txt

121/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

(theotherareaborderrouter),andthenonbackboneareathetwo
routershaveincommon(calledtheTransitarea).Virtuallinks
cannotbeconfiguredthroughstubareas(seeSection3.6).
Thevirtuallinkistreatedasifitwereanunnumberedpointto
pointnetworkbelongingtothebackboneandjoiningthetwoarea
borderrouters.Anattemptismadetoestablishanadjacencyover
thevirtuallink.Whenthisadjacencyisestablished,thevirtual
linkwillbeincludedinbackbonerouterLSAs,andOSPFpackets
pertainingtothebackboneareawillflowovertheadjacency.Such
anadjacencyhasbeenreferredtointhisdocumentasa"virtual
adjacency".
Ineachendpointrouter,thecostandviabilityofthevirtuallink
isdiscoveredbyexaminingtheroutingtableentryfortheother
endpointrouter.(Theentry'sassociatedareamustbethe
configuredTransitarea).Thisiscalledthevirtuallink's
correspondingroutingtableentry.TheInterfaceUpeventoccursfor
avirtuallinkwhenitscorrespondingroutingtableentrybecomes
reachable.Conversely,theInterfaceDowneventoccurswhenits
routingtableentrybecomesunreachable.Inotherwords,the
virtuallink'sviabilityisdeterminedbytheexistenceofan
intraareapath,throughtheTransitarea,betweenthetwo
endpoints.Notethatavirtuallinkwhoseunderlyingpathhascost
greaterthanhexadecimal0xffff(themaximumsizeofaninterface
costinarouterLSA)shouldbeconsideredinoperational(i.e.,
treatedthesameasifthepathdidnotexist).
Theotherdetailsconcerningvirtuallinksareasfollows:
oASexternalLSAsareNEVERfloodedovervirtualadjacencies.
Thiswouldbeduplicationofeffort,sincethesameAS

MoyStandardsTrack[Page158]
RFC2328OSPFVersion2April1998
externalLSAsarealreadyfloodedthroughoutthevirtuallink's
Transitarea.Forthissamereason,ASexternalLSAsarenot
summarizedovervirtualadjacenciesduringtheDatabaseExchange
process.
oThecostofavirtuallinkisNOTconfigured.Itisdefinedto
bethecostoftheintraareapathbetweenthetwodefiningarea
borderrouters.Thiscostappearsinthevirtuallink's
correspondingroutingtableentry.Whenthecostofavirtual
linkchanges,anewrouterLSAshouldbeoriginatedforthe
backbonearea.
oJustasthevirtuallink'scostandviabilityaredeterminedby
theroutingtablebuildprocess(throughconstructionofthe
routingtableentryfortheotherendpoint),soaretheIP
interfaceaddressforthevirtualinterfaceandthevirtual
neighbor'sIPaddress.TheseareusedwhensendingOSPF
protocolpacketsoverthevirtuallink.Notethatwhenone(or
both)ofthevirtuallinkendpointsconnecttotheTransitarea
viaanunnumberedpointtopointlink,itmaybeimpossibleto
calculateeitherthevirtualinterface'sIPaddressand/orthe
virtualneighbor'sIPaddress,therebycausingthevirtuallink
tofail.
oIneachendpoint'srouterLSAforthebackbone,thevirtuallink
https://www.ietf.org/rfc/rfc2328.txt

122/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

isrepresentedasaType4linkwhoseLinkIDissettothe
virtualneighbor'sOSPFRouterIDandwhoseLinkDataissetto
thevirtualinterface'sIPaddress.SeeSection12.4.1formore
information.
oAnonbackboneareacancarrytransitdatatraffic(i.e.,is
considereda"transitarea")ifandonlyifitservesasthe
Transitareaforoneormorefullyadjacentvirtuallinks(see
TransitCapabilityinSections6and16.1).Suchanarearequires
specialtreatmentwhensummarizingbackbonenetworksintoit
(seeSection12.4.3),andduringtheroutingcalculation(see
Section16.3).
oThetimebetweenlinkstateretransmissions,RxmtInterval,is
configuredforavirtuallink.Thisshouldbewelloverthe
expectedroundtripdelaybetweenthetworouters.Thismaybe

MoyStandardsTrack[Page159]
RFC2328OSPFVersion2April1998
hardtoestimateforavirtuallink;itisbettertoerronthe
sideofmakingittoolarge.
16.Calculationoftheroutingtable
ThissectiondetailstheOSPFroutingtablecalculation.Usingits
attachedareas'linkstatedatabasesasinput,arouterrunsthe
followingalgorithm,buildingitsroutingtablestepbystep.At
eachstep,theroutermustaccessindividualpiecesofthelink
statedatabases(e.g.,arouterLSAoriginatedbyacertainrouter).
ThisaccessisperformedbythelookupfunctiondiscussedinSection
12.2.ThelookupprocessmayreturnanLSAwhoseLSageisequalto
MaxAge.SuchanLSAshouldnotbeusedintheroutingtable
calculation,andistreatedjustasifthelookupprocesshad
failed.
TheOSPFroutingtable'sorganizationisexplainedinSection11.
Twoexamplesoftheroutingtablebuildprocessarepresentedin
Sections11.2and11.3.Thisprocesscanbebrokenintothe
followingsteps:
(1)Thepresentroutingtableisinvalidated.Theroutingtableis
builtagainfromscratch.Theoldroutingtableissavedso
thatchangesinroutingtableentriescanbeidentified.
(2)Theintraarearoutesarecalculatedbybuildingtheshortest
pathtreeforeachattachedarea.Inparticular,allrouting
tableentrieswhoseDestinationTypeis"areaborderrouter"are
calculatedinthisstep.Thisstepisdescribedintwoparts.
Atfirstthetreeisconstructedbyonlyconsideringthoselinks
betweenroutersandtransitnetworks.Thenthestubnetworks
areincorporatedintothetree.Duringthearea'sshortestpath
treecalculation,thearea'sTransitCapabilityisalso
calculatedforlateruseinStep4.
(3)Theinterarearoutesarecalculated,throughexaminationof
summaryLSAs.Iftherouterisattachedtomultipleareas
(i.e.,itisanareaborderrouter),onlybackbonesummaryLSAs
areexamined.
https://www.ietf.org/rfc/rfc2328.txt

123/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page160]
RFC2328OSPFVersion2April1998
(4)Inareaborderroutersconnectingtooneormoretransitareas
(i.e,nonbackboneareaswhoseTransitCapabilityisfoundtobe
TRUE),thetransitareas'summaryLSAsareexaminedtosee
whetherbetterpathsexistusingthetransitareasthanwere
foundinSteps23above.
(5)Routestoexternaldestinationsarecalculated,through
examinationofASexternalLSAs.ThelocationsoftheAS
boundaryrouters(whichoriginatetheASexternalLSAs)have
beendeterminedinsteps24.
Steps25areexplainedinfurtherdetailbelow.
Changesmadetoroutingtableentriesasaresultofthese
calculationscancausetheOSPFprotocoltotakefurtheractions.
Forexample,achangetoanintraarearoutewillcauseanarea
borderroutertooriginatenewsummaryLSAs(seeSection12.4).See
Section16.7foracompletelistoftheOSPFprotocolactions
resultingfromroutingtablechanges.
16.1.Calculatingtheshortestpathtreeforanarea
Thiscalculationyieldsthesetofintraarearoutesassociated
withanarea(calledhereafterAreaA).Aroutercalculatesthe
shortestpathtreeusingitselfastheroot.[22]Theformation
oftheshortestpathtreeisdonehereintwostages.Inthe
firststage,onlylinksbetweenroutersandtransitnetworksare
considered.UsingtheDijkstraalgorithm,atreeisformedfrom
thissubsetofthelinkstatedatabase.Inthesecondstage,
leavesareaddedtothetreebyconsideringthelinkstostub
networks.
Theprocedurewillbeexplainedusingthegraphterminologythat
wasintroducedinSection2.Thearea'slinkstatedatabaseis
representedasadirectedgraph.Thegraph'sverticesare
routers,transitnetworksandstubnetworks.Thefirststageof
theprocedureconcernsonlythetransitvertices(routersand
transitnetworks)andtheirconnectinglinks.Throughoutthe
shortestpathcalculation,thefollowingdataisalsoassociated
witheachtransitvertex:

MoyStandardsTrack[Page161]
RFC2328OSPFVersion2April1998
Vertex(node)ID
A32bitnumberwhichtogetherwiththevertextype(router
ornetwork)uniquelyidentifiesthevertex.Forrouter
verticestheVertexIDistherouter'sOSPFRouterID.For
networkvertices,itistheIPaddressofthenetwork's
https://www.ietf.org/rfc/rfc2328.txt

124/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

DesignatedRouter.
AnLSA
EachtransitvertexhasanassociatedLSA.Forrouter
vertices,thisisarouterLSA.Fortransitnetworks,this
isanetworkLSA(whichisactuallyoriginatedbythe
network'sDesignatedRouter).Inanycase,theLSA'sLink
StateIDisalwaysequaltotheaboveVertexID.
Listofnexthops
Thelistofnexthopsforthecurrentsetofshortestpaths
fromtheroottothisvertex.Therecanbemultiple
shortestpathsduetotheequalcostmultipathcapability.
Eachnexthopindicatestheoutgoingrouterinterfacetouse
whenforwardingtraffictothedestination.Onbroadcast,
PointtoMultiPointandNBMAnetworks,thenexthopalso
includestheIPaddressofthenextrouter(ifany)inthe
pathtowardsthedestination.
Distancefromroot
Thelinkstatecostofthecurrentsetofshortestpaths
fromtheroottothevertex.Thelinkstatecostofapath
iscalculatedasthesumofthecostsofthepath's
constituentlinks(asadvertisedinrouterLSAsand
networkLSAs).Onepathissaidtobe"shorter"than
anotherifithasasmallerlinkstatecost.
Thefirststageoftheprocedure(i.e.,theDijkstraalgorithm)
cannowbesummarizedasfollows.Ateachiterationofthe
algorithm,thereisalistofcandidatevertices.Pathsfrom
theroottotheseverticeshavebeenfound,butnotnecessarily
theshortestones.However,thepathstothecandidatevertex
thatisclosesttotherootareguaranteedtobeshortest;this
vertexisaddedtotheshortestpathtree,removedfromthe
candidatelist,anditsadjacentverticesareexaminedfor
possibleadditionto/modificationofthecandidatelist.The

MoyStandardsTrack[Page162]
RFC2328OSPFVersion2April1998
algorithmtheniteratesagain.Itterminateswhenthecandidate
listbecomesempty.
Thefollowingstepsdescribethealgorithmindetail.Remember
thatwearecomputingtheshortestpathtreeforAreaA.All
referencestolinkstatedatabaselookupbelowarefromAreaA's
database.
(1)Initializethealgorithm'sdatastructures.Clearthelist
ofcandidatevertices.Initializetheshortestpathtreeto
onlytheroot(whichistherouterdoingthecalculation).
SetAreaA'sTransitCapabilitytoFALSE.
(2)CallthevertexjustaddedtothetreevertexV.Examine
theLSAassociatedwithvertexV.Thisisalookupinthe
AreaA'slinkstatedatabasebasedontheVertexID.If
thisisarouterLSA,andbitVoftherouterLSA(see
SectionA.4.2)isset,setAreaA'sTransitCapabilityto
TRUE.Inanycase,eachlinkdescribedbytheLSAgivesthe
costtoanadjacentvertex.Foreachdescribedlink,(say
https://www.ietf.org/rfc/rfc2328.txt

125/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

itjoinsvertexVtovertexW):
(a)Ifthisisalinktoastubnetwork,examinethenext
linkinV'sLSA.Linkstostubnetworkswillbe
consideredinthesecondstageoftheshortestpath
calculation.
(b)Otherwise,Wisatransitvertex(routerortransit
network).LookupthevertexW'sLSA(routerLSAor
networkLSA)inAreaA'slinkstatedatabase.Ifthe
LSAdoesnotexist,oritsLSageisequaltoMaxAge,or
itdoesnothavealinkbacktovertexV,examinethe
nextlinkinV'sLSA.[23]
(c)IfvertexWisalreadyontheshortestpathtree,
examinethenextlinkintheLSA.
(d)CalculatethelinkstatecostDoftheresultingpath
fromtheroottovertexW.Disequaltothesumofthe
linkstatecostofthe(alreadycalculated)shortest
pathtovertexVandtheadvertisedcostofthelink
betweenverticesVandW.IfDis:

MoyStandardsTrack[Page163]
RFC2328OSPFVersion2April1998
oGreaterthanthevaluethatalreadyappearsfor
vertexWonthecandidatelist,thenexaminethe
nextlink.
oEqualtothevaluethatappearsforvertexWonthe
candidatelist,calculatethesetofnexthopsthat
resultfromusingtheadvertisedlink.Inputto
thiscalculationisthedestination(W),andits
parent(V).ThiscalculationisshowninSection
16.1.1.Thissetofhopsshouldbeaddedtothe
nexthopvaluesthatappearforWonthecandidate
list.
oLessthanthevaluethatappearsforvertexWonthe
candidatelist,orifWdoesnotyetappearonthe
candidatelist,thensettheentryforWonthe
candidatelisttoindicateadistanceofDfromthe
root.Alsocalculatethelistofnexthopsthat
resultfromusingtheadvertisedlink,settingthe
nexthopvaluesforWaccordingly.Thenexthop
calculationisdescribedinSection16.1.1;ittakes
asinputthedestination(W)anditsparent(V).
(3)Ifatthisstepthecandidatelistisempty,theshortest
pathtree(oftransitvertices)hasbeencompletelybuilt
andthisstageoftheprocedureterminates.Otherwise,
choosethevertexbelongingtothecandidatelistthatis
closesttotheroot,andaddittotheshortestpathtree
(removingitfromthecandidatelistintheprocess).Note
thatwhenthereisachoiceofverticesclosesttotheroot,
networkverticesmustbechosenbeforerouterverticesin
ordertonecessarilyfindallequalcostpaths.Thisis
consistentwiththetiebreakersthatwereintroducedinthe
modifiedDijkstraalgorithmusedbyOSPF'sMulticastrouting
extensions(MOSPF).
https://www.ietf.org/rfc/rfc2328.txt

126/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

(4)Possiblymodifytheroutingtable.Forthoseroutingtable
entriesmodified,theassociatedareawillbesettoAreaA,
thepathtypewillbesettointraarea,andthecostwill
besettothenewlydiscoveredshortestpath'scalculated
distance.

MoyStandardsTrack[Page164]
RFC2328OSPFVersion2April1998
IfthenewlyaddedvertexisanareaborderrouterorAS
boundaryrouter,aroutingtableentryisaddedwhose
destinationtypeis"router".TheOptionsfieldfoundin
theassociatedrouterLSAiscopiedintotheroutingtable
entry'sOptionalcapabilitiesfield.Callthenewlyadded
vertexRouterX.IfRouterXistheendpointofoneofthe
calculatingrouter'svirtuallinks,andthevirtuallink
usesAreaAasTransitarea:thevirtuallinkisdeclared
up,theIPaddressofthevirtualinterfaceissettotheIP
addressoftheoutgoinginterfacecalculatedabovefor
RouterX,andthevirtualneighbor'sIPaddressissetto
RouterX'sinterfaceaddress(containedinRouterX's
routerLSA)thatpointsbacktotherootoftheshortest
pathtree;equivalently,thisistheinterfacethatpoints
backtoRouterX'sparentvertexontheshortestpathtree
(similartothecalculationinSection16.1.1).
Ifthenewlyaddedvertexisatransitnetwork,therouting
tableentryforthenetworkislocated.Theentry's
DestinationIDistheIPnetworknumber,whichcanbe
obtainedbymaskingtheVertexID(LinkStateID)withits
associatedsubnetmask(foundinthebodyoftheassociated
networkLSA).Iftheroutingtableentryalreadyexists
(i.e.,thereisalreadyanintraarearoutetothe
destinationinstalledintheroutingtable),multiple
verticeshavemappedtothesameIPnetwork.Forexample,
thiscanoccurwhenanewDesignatedRouterisbeing
established.Inthiscase,thecurrentroutingtableentry
shouldbeoverwrittenifandonlyifthenewlyfoundpathis
justasshortandthecurrentroutingtableentry'sLink
StateOriginhasasmallerLinkStateIDthanthenewly
addedvertex'LSA.
Ifthereisnoroutingtableentryforthenetwork(the
usualcase),aroutingtableentryfortheIPnetworkshould
beadded.Theroutingtableentry'sLinkStateOrigin
shouldbesettothenewlyaddedvertex'LSA.
(5)IteratethealgorithmbyreturningtoStep2.

MoyStandardsTrack[Page165]
RFC2328OSPFVersion2April1998

https://www.ietf.org/rfc/rfc2328.txt

127/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Thestubnetworksareaddedtothetreeintheprocedure's
secondstage.Inthisstage,allrouterverticesareagain
examined.Thosethathavebeendeterminedtobeunreachablein
theabovefirstphasearediscarded.Foreachreachablerouter
vertex(callitV),theassociatedrouterLSAisfoundinthe
linkstatedatabase.Eachstubnetworklinkappearinginthe
LSAisthenexamined,andthefollowingstepsareexecuted:
(1)CalculatethedistanceDofstubnetworkfromtheroot.D
isequaltothedistancefromtheroottotheroutervertex
(calculatedinstage1),plusthestubnetworklink's
advertisedcost.Comparethisdistancetothecurrentbest
costtothestubnetwork.Thisisdonebylookingupthe
stubnetwork'scurrentroutingtableentry.Ifthe
calculateddistanceDislarger,goontoexaminethenext
stubnetworklinkintheLSA.
(2)Ifthisstepisreached,thestubnetwork'sroutingtable
entrymustbeupdated.Calculatethesetofnexthopsthat
wouldresultfromusingthestubnetworklink.This
calculationisshowninSection16.1.1;inputtothis
calculationisthedestination(thestubnetwork)andthe
parentvertex(theroutervertex).IfthedistanceDisthe
sameasthecurrentroutingtablecost,simplyaddthisset
ofnexthopstotheroutingtableentry'slistofnexthops.
Inthiscase,theroutingtablealreadyhasaLinkState
Origin.IfthisLinkStateOriginisarouterLSAwhose
LinkStateIDissmallerthanV'sRouterID,resettheLink
StateOrigintoV'srouterLSA.
OtherwiseDissmallerthantheroutingtablecost.
Overwritethecurrentroutingtableentrybysettingthe
routingtableentry'scosttoD,andbysettingtheentry's
listofnexthopstothenewlycalculatedset.Setthe
routingtableentry'sLinkStateOrigintoV'srouterLSA.
Thengoontoexaminethenextstubnetworklink.
Forallroutingtableentriesadded/modifiedinthesecond
stage,theassociatedareawillbesettoAreaAandthepath
typewillbesettointraarea.Whenthelistofreachable
routerLSAsisexhausted,thesecondstageiscompleted.At

MoyStandardsTrack[Page166]
RFC2328OSPFVersion2April1998
thistime,allintraarearoutesassociatedwithAreaAhave
beendetermined.
Thespecificationdoesnotrequirethattheabovetwostage
methodbeusedtocalculatetheshortestpathtree.However,if
anotheralgorithmisused,anidenticaltreemustbeproduced.
Forthisreason,itisimportanttonotethatlinksbetween
transitverticesmustbebidirectionalinordertobeincluded
intheabovetree.Itshouldalsobementionedthatmore
efficientalgorithmsexistforcalculatingthetree;for
example,theincrementalSPFalgorithmdescribedin[Ref1].
16.1.1.Thenexthopcalculation
https://www.ietf.org/rfc/rfc2328.txt

128/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Thissectionexplainshowtocalculatethecurrentsetof
nexthopstouseforadestination.Eachnexthopconsists
oftheoutgoinginterfacetouseinforwardingpacketsto
thedestinationtogetherwiththeIPaddressofthenexthop
router(ifany).Thenexthopcalculationisinvokedeach
timeashorterpathtothedestinationisdiscovered.This
canhappenineitherstageoftheshortestpathtree
calculation(seeSection16.1).Instage1ofthe
shortestpathtreecalculationashorterpathisfoundas
thedestinationisaddedtothecandidatelist,orwhenthe
destination'sentryonthecandidatelistismodified(Step
2dofStage1).Instage2ashorterpathisdiscovered
eachtimethedestination'sroutingtableentryismodified
(Step2ofStage2).
Thesetofnexthopstouseforthedestinationmaybe
recalculatedseveraltimesduringtheshortestpathtree
calculation,asshorterandshorterpathsarediscovered.
Intheend,thedestination'sroutingtableentrywill
alwaysreflectthenexthopsresultingfromtheabsolute
shortestpath(s).
Inputtothenexthopcalculationisa)thedestinationand
b)itsparentinthecurrentshortestpathbetweentheroot
(thecalculatingrouter)andthedestination.Theparentis
alwaysatransitvertex(i.e.,alwaysarouteroratransit
network).

MoyStandardsTrack[Page167]
RFC2328OSPFVersion2April1998
Ifthereisatleastoneinterveningrouterinthecurrent
shortestpathbetweenthedestinationandtheroot,the
destinationsimplyinheritsthesetofnexthopsfromthe
parent.Otherwise,therearetwocases.Inthefirstcase,
theparentvertexistheroot(thecalculatingrouter
itself).Thismeansthatthedestinationiseithera
directlyconnectednetworkordirectlyconnectedrouter.
TheoutgoinginterfaceinthiscaseissimplytheOSPF
interfaceconnectingtothedestinationnetwork/router.If
thedestinationisarouterwhichconnectstothe
calculatingrouterviaaPointtoMultiPointnetwork,the
destination'snexthopIPaddress(es)canbedeterminedby
examiningthedestination'srouterLSA:eachlinkpointing
backtothecalculatingrouterandhavingaLinkDatafield
belongingtothePointtoMultiPointnetworkprovidesanIP
addressofthenexthoprouter.Ifthedestinationisa
directlyconnectednetwork,orarouterwhichconnectsto
thecalculatingrouterviaapointtopointinterface,no
nexthopIPaddressisrequired.Ifthedestinationisa
routerconnectedtothecalculatingrouterviaavirtual
link,thesettingofthenexthopshouldbedeferreduntil
thecalculationinSection16.3.
Inthesecondcase,theparentvertexisanetworkthat
directlyconnectsthecalculatingroutertothedestination
router.Thelistofnexthopsisthendeterminedby
examiningthedestination'srouterLSA.Foreachlinkin
therouterLSAthatpointsbacktotheparentnetwork,the
link'sLinkDatafieldprovidestheIPaddressofanexthop
router.Theoutgoinginterfacetousecanthenbederived
https://www.ietf.org/rfc/rfc2328.txt

129/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

fromthenexthopIPaddress(oritcanbeinheritedfrom
theparentnetwork).
16.2.Calculatingtheinterarearoutes
TheinterarearoutesarecalculatedbyexaminingsummaryLSAs.
Iftherouterhasactiveattachmentstomultipleareas,only
backbonesummaryLSAsareexamined.Routersattachedtoa
singleareaexaminethatarea'ssummaryLSAs.Ineithercase,
thesummaryLSAsexaminedbelowareallpartofasinglearea's
linkstatedatabase(callitAreaA).

MoyStandardsTrack[Page168]
RFC2328OSPFVersion2April1998
SummaryLSAsareoriginatedbytheareaborderrouters.Each
summaryLSAinAreaAisconsideredinturn.Rememberthatthe
destinationdescribedbyasummaryLSAiseitheranetwork(Type
3summaryLSAs)oranASboundaryrouter(Type4summaryLSAs).
ForeachsummaryLSA:
(1)IfthecostspecifiedbytheLSAisLSInfinity,orifthe
LSA'sLSageisequaltoMaxAge,thenexaminethethenext
LSA.
(2)IftheLSAwasoriginatedbythecalculatingrouteritself,
examinethenextLSA.
(3)IfitisaType3summaryLSA,andthecollectionof
destinationsdescribedbythesummaryLSAequalsoneofthe
router'sconfiguredareaaddressranges(seeSection3.5),
andtheparticularareaaddressrangeisactive,thenthe
summaryLSAshouldbeignored."Active"meansthatthere
areoneormorereachable(byintraareapaths)networks
containedinthearearange.
(4)Else,callthedestinationdescribedbytheLSAN(forType
3summaryLSAs,N'saddressisobtainedbymaskingtheLSA's
LinkStateIDwiththenetwork/subnetmaskcontainedinthe
bodyoftheLSA),andtheareaborderoriginatingtheLSA
BR.LookuptheroutingtableentryforBRhavingAreaAas
itsassociatedarea.IfnosuchentryexistsforrouterBR
(i.e.,BRisunreachableinAreaA),donothingwiththis
LSAandconsiderthenextinthelist.Else,thisLSA
describesaninterareapathtodestinationN,whosecostis
thedistancetoBRplusthecostspecifiedintheLSA.Call
thecostofthisinterareapathIAC.
(5)Next,lookuptheroutingtableentryforthedestinationN.
(IfNisanASboundaryrouter,lookupthe"router"routing
tableentryassociatedwithAreaA).Ifnoentryexistsfor
Noriftheentry'spathtypeis"type1external"or"type
2external",theninstalltheinterareapathtoN,with
associatedareaAreaA,costIAC,nexthopequaltothelist
ofnexthopstorouterBR,andAdvertisingrouterequalto
BR.

https://www.ietf.org/rfc/rfc2328.txt

130/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page169]
RFC2328OSPFVersion2April1998
(6)Else,ifthepathspresentinthetableareintraarea
paths,donothingwiththeLSA(intraareapathsarealways
preferred).
(7)Else,thepathspresentintheroutingtablearealso
interareapaths.InstallthenewpaththroughBRifitis
cheaper,overridingthepathsintheroutingtable.
Otherwise,ifthenewpathisthesamecost,addittothe
listofpathsthatappearintheroutingtableentry.
16.3.Examiningtransitareas'summaryLSAs
Thisstepisonlyperformedbyareaborderroutersattachedto
oneormorenonbackboneareasthatarecapableofcarrying
transittraffic(i.e.,"transitareas",orthoseareaswhose
TransitCapabilityparameterhasbeensettoTRUEinStep2of
theDijkstraalgorithm(seeSection16.1).
Thepurposeofthecalculationbelowistoexaminethetransit
areastoseewhethertheyprovideanybetter(shorter)paths
thanthepathspreviouslycalculatedinSections16.1and16.2.
Anypathsfoundthatarebetterthanorequaltopreviously
discoveredpathsareinstalledintheroutingtable.
Thecalculationalsodeterminestheactualnexthop(s)forthose
destinationswhosenexthopwascalculatedasavirtuallinkin
Sections16.1and16.2.Aftercompletionofthecalculation
below,anypathscalculatedinSections16.1and16.2thatstill
haveunresolvedvirtualnexthopsshouldbediscarded.
Thecalculationproceedsasfollows.Allthetransitareas'
summaryLSAsareexaminedinturn.EachsuchsummaryLSA
describesaroutethroughatransitareaAreaAtoaNetworkN
(N'saddressisobtainedbymaskingtheLSA'sLinkStateIDwith
thenetwork/subnetmaskcontainedinthebodyoftheLSA)orin
thecaseofaType4summaryLSA,toanASboundaryrouterN.
SupposealsothatthesummaryLSAwasoriginatedbyanarea
borderrouterBR.
(1)IfthecostadvertisedbythesummaryLSAisLSInfinity,or
iftheLSA'sLSageisequaltoMaxAge,thenexaminethe
nextLSA.

MoyStandardsTrack[Page170]
RFC2328OSPFVersion2April1998
(2)IfthesummaryLSAwasoriginatedbythecalculatingrouter
itself,examinethenextLSA.
(3)LookuptheroutingtableentryforN.(IfNisanAS
boundaryrouter,lookupthe"router"routingtableentry
associatedwiththebackbonearea).Ifitdoesnotexist,or
iftheroutetypeisotherthanintraareaorinterarea,or
iftheareaassociatedwiththeroutingtableentryisnot
thebackbonearea,thenexaminethenextLSA.Inother
words,thiscalculationonlyupdatesbackboneintraarea
https://www.ietf.org/rfc/rfc2328.txt

131/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

routesfoundinSection16.1andinterarearoutesfoundin
Section16.2.
(4)Lookuptheroutingtableentryfortheadvertisingrouter
BRassociatedwiththeAreaA.Ifitisunreachable,examine
thenextLSA.Otherwise,thecosttodestinationNisthe
sumofthecostinBR'sAreaAroutingtableentryandthe
costadvertisedintheLSA.CallthiscostIAC.
(5)IfthiscostislessthanthecostoccurringinN'srouting
tableentry,overwriteN'slistofnexthopswiththoseused
forBR,andsetN'sroutingtablecosttoIAC.Else,ifIAC
isthesameasN'scurrentcost,addBR'slistofnexthops
toN'slistofnexthops.Inanycase,theareaassociated
withN'sroutingtableentrymustremainthebackbonearea,
andthepathtype(eitherintraareaorinterarea)must
alsoremainthesame.
Itisimportanttonotethattheabovecalculationnevermakes
unreachabledestinationsreachable,butinsteadjustpotentially
findsbetterpathstoalreadyreachabledestinations.The
calculationinstallsanybettercostfoundintotherouting
tableentry,fromwhichitmaybereadvertisedinsummaryLSAs
tootherareas.
Asanexampleofthecalculation,considertheAutonomousSystem
picturedinFigure17.Thereisasinglenonbackbonearea
(Area1)thatphysicallydividesthebackboneintotwoseparate
pieces.Tomaintainconnectivityofthebackbone,avirtuallink
hasbeenconfiguredbetweenroutersRT1andRT4.Ontheright
sideofthefigure,NetworkN1belongstothebackbone.The
dottedlinesindicatethatthereisamuchshorterintraarea

MoyStandardsTrack[Page171]
RFC2328OSPFVersion2April1998

........................
.Area1(transit).+
..|
.++11++100|
.|RT2||RT4|=========|
.1/++*********++|
./*******.|
.1/*Virtual.|
1++/*Link.Net|work
=======|RT1|*.|N1
++\.|
.\.|
.\.|
.1\++11++20|
.|RT3||RT5|=========|
.++++|
..|
........................+
Figure17:Routingthroughtransitareas
backbonepathbetweenrouterRT5andNetworkN1(cost20)than
thereisbetweenRouterRT4andNetworkN1(cost100).Both
RouterRT4andRouterRT5willinjectsummaryLSAsforNetwork
https://www.ietf.org/rfc/rfc2328.txt

132/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

N1intoArea1.
Aftertheshortestpathtreehasbeencalculatedforthe
backboneinSection16.1,RouterRT1(leftendofthevirtual
link)willhavecalculatedapaththroughRouterRT4forall
datatrafficdestinedforNetworkN1.However,sinceRouterRT5
issomuchclosertoNetworkN1,allroutersinternaltoArea1
(e.g.,RoutersRT2andRT3)willforwardtheirNetworkN1
traffictowardsRouterRT5,insteadofRT4.Andindeed,after
examiningArea1'ssummaryLSAsbytheabovecalculation,Router
RT1willalsoforwardNetworkN1traffictowardsRT5.Notethat
inthisexamplethevirtuallinkenablestransitdatatrafficto
beforwardedthroughArea1,buttheactualpaththetransit
datatraffictakesdoesnotfollowthevirtuallink.Inother
words,virtuallinksallowtransittraffictobeforwarded
throughanarea,butdonotdictatetheprecisepaththatthe
trafficwilltake.

MoyStandardsTrack[Page172]
RFC2328OSPFVersion2April1998
16.4.CalculatingASexternalroutes
ASexternalroutesarecalculatedbyexaminingASexternalLSAs.
EachoftheASexternalLSAsisconsideredinturn.MostAS
externalLSAsdescriberoutestospecificIPdestinations.An
ASexternalLSAcanalsodescribeadefaultrouteforthe
AutonomousSystem(DestinationID=DefaultDestination,
network/subnetmask=0x00000000).ForeachASexternalLSA:
(1)IfthecostspecifiedbytheLSAisLSInfinity,orifthe
LSA'sLSageisequaltoMaxAge,thenexaminethenextLSA.
(2)IftheLSAwasoriginatedbythecalculatingrouteritself,
examinethenextLSA.
(3)CallthedestinationdescribedbytheLSAN.N'saddressis
obtainedbymaskingtheLSA'sLinkStateIDwiththe
network/subnetmaskcontainedinthebodyoftheLSA.Look
uptheroutingtableentries(potentiallyoneperattached
area)fortheASboundaryrouter(ASBR)thatoriginatedthe
LSA.IfnoentriesexistforrouterASBR(i.e.,ASBRis
unreachable),donothingwiththisLSAandconsiderthenext
inthelist.
Else,thisLSAdescribesanASexternalpathtodestination
N.ExaminetheforwardingaddressspecifiedintheAS
externalLSA.ThisindicatestheIPaddresstowhich
packetsforthedestinationshouldbeforwarded.
Iftheforwardingaddressissetto0.0.0.0,packetsshould
besenttotheASBRitself.Amongthemultipleroutingtable
entriesfortheASBR,selectthepreferredentryasfollows.
IfRFC1583Compatibilityissetto"disabled",prunetheset
ofroutingtableentriesfortheASBRasdescribedin
Section16.4.1.Inanycase,amongtheremainingrouting
tableentries,selecttheroutingtableentrywiththeleast
cost;whentherearemultipleleastcostroutingtable
entriestheentrywhoseassociatedareahasthelargestOSPF
AreaID(whenconsideredasanunsigned32bitinteger)is
https://www.ietf.org/rfc/rfc2328.txt

133/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

chosen.

MoyStandardsTrack[Page173]
RFC2328OSPFVersion2April1998
Iftheforwardingaddressisnonzero,lookupthe
forwardingaddressintheroutingtable.[24]Thematching
routingtableentrymustspecifyanintraareaorinterarea
path;ifnosuchpathexists,donothingwiththeLSAand
considerthenextinthelist.
(4)LetXbethecostspecifiedbythepreferredroutingtable
entryfortheASBR/forwardingaddress,andYthecost
specifiedintheLSA.Xisintermsofthelinkstate
metric,andYisatype1or2externalmetric.
(5)LookuptheroutingtableentryforthedestinationN.If
noentryexistsforN,installtheASexternalpathtoN,
withnexthopequaltothelistofnexthopstothe
forwardingaddress,andadvertisingrouterequaltoASBR.
Iftheexternalmetrictypeis1,thenthepathtypeisset
totype1externalandthecostisequaltoX+Y.Ifthe
externalmetrictypeis2,thepathtypeissettotype2
external,thelinkstatecomponentoftheroute'scostisX,
andthetype2costisY.
(6)ComparetheASexternalpathdescribedbytheLSAwiththe
existingpathsinN'sroutingtableentry,asfollows.If
thenewpathispreferred,itreplacesthepresentpathsin
N'sroutingtableentry.Ifthenewpathisofequal
preference,itisaddedtoN'sroutingtableentry'slistof
paths.
(a)Intraareaandinterareapathsarealwayspreferred
overASexternalpaths.
(b)Type1externalpathsarealwayspreferredovertype2
externalpaths.Whenallpathsaretype2external
paths,thepathswiththesmallestadvertisedtype2
metricarealwayspreferred.
(c)IfthenewASexternalpathisstillindistinguishable
fromthecurrentpathsintheN'sroutingtableentry,
andRFC1583Compatibilityissetto"disabled",select
thepreferredpathsbasedontheintraASpathstothe
ASBR/forwardingaddresses,asspecifiedinSection
16.4.1.

MoyStandardsTrack[Page174]
RFC2328OSPFVersion2April1998
(d)IfthenewASexternalpathisstillindistinguishable
fromthecurrentpathsintheN'sroutingtableentry,
selectthepreferredpathbasedonaleastcost
comparison.Type1externalpathsarecomparedby
lookingatthesumofthedistancetotheforwarding
https://www.ietf.org/rfc/rfc2328.txt

134/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

addressandtheadvertisedtype1metric(X+Y).Type2
externalpathsadvertisingequaltype2metricsare
comparedbylookingatthedistancetotheforwarding
addresses.
16.4.1.Externalpathpreferences
WhenmultipleintraASpathsareavailableto
ASBRs/forwardingaddresses,thefollowingrulesindicate
whichpathsarepreferred.Theserulesapplywhenthesame
ASBRisreachablethroughmultipleareas,orwhentryingto
decidewhichofseveralASexternalLSAsshouldbe
preferred.Intheformercasethepathsallterminateatthe
sameASBR,whileinthelatterthepathsterminateat
separateASBRs/forwardingaddresses.Ineithercase,each
pathisrepresentedbyaseparateroutingtableentryas
definedinSection11.
ThissectiononlyapplieswhenRFC1583Compatibilityisset
to"disabled".
Thepathpreferencerules,statedfromhighesttolowest
preference,areasfollows.Notethatasaresultofthese
rules,theremaystillbemultiplepathsofthehighest
preference.Inthiscase,thepathtousemustbedetermined
basedoncost,asdescribedinSection16.4.
oIntraareapathsusingnonbackboneareasarealwaysthe
mostpreferred.
oTheotherpaths,intraareabackbonepathsandinter
areapaths,areofequalpreference.
16.5.IncrementalupdatessummaryLSAs
WhenanewsummaryLSAisreceived,itisnotnecessaryto
recalculatetheentireroutingtable.Callthedestination

MoyStandardsTrack[Page175]
RFC2328OSPFVersion2April1998
describedbythesummaryLSAN(N'saddressisobtainedby
maskingtheLSA'sLinkStateIDwiththenetwork/subnetmask
containedinthebodyoftheLSA),andletAreaAbetheareato
whichtheLSAbelongs.Therearethentwoseparatecases:
Case1:AreaAisthebackboneand/ortherouterisnotanarea
borderrouter.
Inthiscase,thefollowingcalculationsmustbeperformed.
First,ifthereispresentlyaninterarearoutetothe
destinationN,N'sroutingtableentryisinvalidated,
savingtheentry'svaluesforlatercomparisons.Thenthe
calculationinSection16.2isrunagainforthesingle
destinationN.Inthiscalculation,allofAreaA's
summaryLSAsthatdescribearoutetoNareexamined.In
addition,iftherouterisanareaborderrouterattachedto
oneormoretransitareas,thecalculationinSection16.3
mustberunagainforthesingledestination.Ifthe
resultsofthesecalculationshavechangedthecost/pathto
anASboundaryrouter(aswouldbethecaseforaType4
summaryLSA)ortoanyforwardingaddresses,allAS
https://www.ietf.org/rfc/rfc2328.txt

135/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

externalLSAswillhavetobereexaminedbyrerunningthe
calculationinSection16.4.Otherwise,ifNisnownewly
unreachable,thecalculationinSection16.4mustbererun
forthesingledestinationN,incaseanalternateexternal
routetoNexists.
Case2:AreaAisatransitareaandtherouterisanarea
borderrouter.
Inthiscase,thefollowingcalculationsmustbeperformed.
First,ifN'sroutingtableentrypresentlycontainsoneor
moreinterareapathsthatutilizethetransitareaAreaA,
thesepathsshouldberemoved.Ifthisremovesallpaths
fromtheroutingtableentry,theentryshouldbe
invalidated.Theentry'soldvaluesshouldbesavedfor
latercomparisons.NextthecalculationinSection16.3must
berunagainforthesingledestinationN.Iftheresultsof
thiscalculationhavecausedthecosttoNtoincrease,the
completeroutingtablecalculationmustbererunstarting
withtheDijkstraalgorithmspecifiedinSection16.1.
Otherwise,ifthecost/pathtoanASboundaryrouter(as
wouldbethecaseforaType4summaryLSA)ortoany
forwardingaddresseshaschanged,allASexternalLSAswill

MoyStandardsTrack[Page176]
RFC2328OSPFVersion2April1998
havetobereexaminedbyrerunningthecalculationin
Section16.4.Otherwise,ifNisnownewlyunreachable,the
calculationinSection16.4mustbererunforthesingle
destinationN,incaseanalternateexternalroutetoN
exists.
16.6.IncrementalupdatesASexternalLSAs
WhenanewASexternalLSAisreceived,itisnotnecessaryto
recalculatetheentireroutingtable.Callthedestination
describedbytheASexternalLSAN.N'saddressisobtainedby
maskingtheLSA'sLinkStateIDwiththenetwork/subnetmask
containedinthebodyoftheLSA.Ifthereisalreadyanintra
areaorinterarearoutetothedestination,norecalculationis
necessary(internalroutestakeprecedence).
Otherwise,theprocedureinSection16.4willhavetobe
performed,butonlyforthoseASexternalLSAswhosedestination
isN.Beforethisprocedureisperformed,thepresentrouting
tableentryforNshouldbeinvalidated.
16.7.Eventsgeneratedasaresultofroutingtablechanges
ChangestoroutingtableentriessometimescausetheOSPFarea
borderrouterstotakeadditionalactions.Theseroutersneed
toactonthefollowingroutingtablechanges:
oThecostorpathtypeofaroutingtableentryhaschanged.
IfthedestinationdescribedbythisentryisaNetworkor
ASboundaryrouter,andthisisnotsimplyachangeofAS
externalroutes,newsummaryLSAsmayhavetobegenerated
(potentiallyoneforeachattachedarea,includingthe
backbone).SeeSection12.4.3formoreinformation.Ifa
previouslyadvertisedentryhasbeendeleted,orisno
longeradvertisabletoaparticulararea,theLSAmustbe
https://www.ietf.org/rfc/rfc2328.txt

136/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

flushedfromtheroutingdomainbysettingitsLSageto
MaxAgeandreflooding(seeSection14.1).
oAroutingtableentryassociatedwithaconfiguredvirtual
linkhaschanged.Thedestinationofsucharoutingtable
entryisanareaborderrouter.Thechangeindicatesa
modificationtothevirtuallink'scostorviability.

MoyStandardsTrack[Page177]
RFC2328OSPFVersion2April1998
Iftheentryindicatesthattheareaborderrouterisnewly
reachable,thecorrespondingvirtuallinkisnow
operational.AnInterfaceUpeventshouldbegeneratedfor
thevirtuallink,whichwillcauseavirtualadjacencyto
begintoform(seeSection10.3).Atthistimethevirtual
link'sIPinterfaceaddressandthevirtualneighbor's
NeighborIPaddressarealsocalculated.
Iftheentryindicatesthattheareaborderrouterisno
longerreachable,thevirtuallinkanditsassociated
adjacencyshouldbedestroyed.ThismeansanInterfaceDown
eventshouldbegeneratedfortheassociatedvirtuallink.
Ifthecostoftheentryhaschanged,andthereisafully
establishedvirtualadjacency,anewrouterLSAforthe
backbonemustbeoriginated.Thisinturnmaycausefurther
routingtablechanges.
16.8.Equalcostmultipath
TheOSPFprotocolmaintainsmultipleequalcostroutestoall
destinations.Thiscanbeseeninthestepsusedaboveto
calculatetheroutingtable,andinthedefinitionofthe
routingtablestructure.
Eachoneofthemultiplerouteswillbeofthesametype
(intraarea,interarea,type1externalortype2external),
cost,andwillhavethesameassociatedarea.However,each
routemayspecifyaseparatenexthopandAdvertisingrouter.
ThereisnorequirementthatarouterrunningOSPFkeeptrackof
allpossibleequalcostroutestoadestination.An
implementationmaychoosetokeeponlyafixednumberofroutes
toanygivendestination.Thisdoesnotaffectanyofthe
algorithmspresentedinthisspecification.

MoyStandardsTrack[Page178]
RFC2328OSPFVersion2April1998

https://www.ietf.org/rfc/rfc2328.txt

137/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Footnotes
[1]Thegraph'sverticesrepresenteitherrouters,transitnetworks,
orstubnetworks.Sinceroutersmaybelongtomultipleareas,itis
notpossibletocolorthegraph'svertices.
[2]Itispossibleforallofarouter'sinterfacestobeunnumbered
pointtopointlinks.Inthiscase,anIPaddressmustbeassigned
totherouter.Thisaddresswillthenbeadvertisedintherouter's
routerLSAasahostroute.
[3]Notethatinthesecasesbothinterfaces,thenonvirtualandthe
virtual,wouldhavethesameIPaddress.
[4]Notethatnohostrouteisgeneratedfor,andnoIPpacketscan
beaddressedto,interfacestounnumberedpointtopointnetworks.
Thisisregardlessofsuchaninterface'sstate.
[5]ItisinstructivetoseewhathappenswhentheDesignatedRouter
forthenetworkcrashes.CalltheDesignatedRouterforthenetwork
RT1,andtheBackupDesignatedRouterRT2.IfRouterRT1crashes
(ormaybeitsinterfacetothenetworkdies),theotherrouterson
thenetworkwilldetectRT1'sabsencewithinRouterDeadInterval
seconds.Allroutersmaynotdetectthisatpreciselythesame
time;theroutersthatdetectRT1'sabsencebeforeRT2doeswill,
foratime,selectRT2tobebothDesignatedRouterandBackup
DesignatedRouter.WhenRT2detectsthatRT1isgoneitwillmove
itselftoDesignatedRouter.Atthistime,theremainingrouter
havinghighestRouterPrioritywillbeselectedasBackupDesignated
Router.
[6]Onpointtopointnetworks,thelowerlevelprotocolsindicate
whethertheneighborisupandrunning.Likewise,existenceofthe
neighboronvirtuallinksisindicatedbytheroutingtable
calculation.However,inboththesecases,theHelloProtocolis
stillused.Thisensuresthatcommunicationbetweentheneighbors
isbidirectional,andthateachoftheneighborshasafunctioning
routingprotocollayer.
[7]WhentheidentityoftheDesignatedRouterischanging,itmaybe
quitecommonforaneighborinthisstatetosendtheroutera

MoyStandardsTrack[Page179]
RFC2328OSPFVersion2April1998
DatabaseDescriptionpacket;thismeansthatthereissomemomentary
disagreementontheDesignatedRouter'sidentity.
[8]Notethatitispossibleforaroutertoresynchronizeanyofits
fullyestablishedadjacenciesbysettingtheadjacency'sstateback
toExStart.Thiswillcausetheotherendoftheadjacencyto
processaSeqNumberMismatchevent,andthereforetoalsogobackto
ExStartstate.
[9]TheaddressspaceofIPnetworksandtheaddressspaceofOSPF
RouterIDsmayoverlap.Thatis,anetworkmayhaveanIPaddress
whichisidentical(whenconsideredasa32bitnumber)tosome
router'sRouterID.
[10]"Discard"entriesarenecessarytoensurethatroute
https://www.ietf.org/rfc/rfc2328.txt

138/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

summarizationatareaboundarieswillnotcausepacketlooping.
[11]Itisassumedthat,fortwodifferentaddressrangesmatching
thedestination,onerangeismorespecificthantheother.Non
contiguoussubnetmaskscanbeconfiguredtoviolatethis
assumption.Suchsubnetmaskconfigurationscannotbehandledbythe
OSPFprotocol.
[12]MaxAgeDiffisanarchitecturalconstant.Itindicatesthe
maximumdispersionofages,inseconds,thatcanoccurforasingle
LSAinstanceasitisfloodedthroughouttheroutingdomain.Iftwo
LSAsdifferbymorethanthis,theyareassumedtobedifferent
instancesofthesameLSA.Thiscanoccurwhenarouterrestarts
andlosestrackoftheLSA'spreviousLSsequencenumber.See
Section13.4formoredetails.
[13]WhentwoLSAshavedifferentLSchecksums,theyareassumedto
beseparateinstances.Thiscanoccurwhenarouterrestarts,and
losestrackoftheLSA'spreviousLSsequencenumber.Inthecase
wherethetwoLSAshavethesameLSsequencenumber,itisnot
possibletodeterminewhichLSAisactuallynewer.However,ifthe
wrongLSAisacceptedasnewer,theoriginatingrouterwillsimply
originateanotherinstance.SeeSection13.4forfurtherdetails.
[14]Thereisoneinstancewherealookupmustbedonebasedon
partialinformation.Thisisduringtheroutingtablecalculation,
whenanetworkLSAmustbefoundbasedsolelyonitsLinkStateID.

MoyStandardsTrack[Page180]
RFC2328OSPFVersion2April1998
Thelookupinthiscaseisstillwelldefined,sincenotwo
networkLSAscanhavethesameLinkStateID.
[15]ThisisthewayRFC1583specifiedpointtopoint
representation.Ithasthreeadvantages:a)itdoesnotrequire
allocatingasubnettothepointtopointlink,b)ittendstobias
theroutingsothatpacketsdestinedforthepointtopoint
interfacewillactuallybereceivedovertheinterface(whichis
usefulfordiagnosticpurposes)andc)itallowsnetwork
bootstrappingofaneighbor,withoutrequiringthatthebootstrap
programcontainanOSPFimplementation.
[16]Thisisthemoretraditionalpointtopointrepresentationused
byprotocolssuchasRIP.
[17]Thisclausecoversthecase:Interarearoutesarenot
summarizedtothebackbone.Thisisbecauseinterarearoutesare
alwaysassociatedwiththebackbonearea.
[18]ThisclauseisonlyinvokedwhenanonbackboneAreaAsupports
transitdatatraffic(i.e.,hasTransitCapabilitysettoTRUE).For
example,intheareaconfigurationofFigure6,Area2cansupport
transittrafficduetotheconfiguredvirtuallinkbetweenRouters
RT10andRT11.Asaresult,RouterRT11needonlyoriginateasingle
summaryLSAintoArea2(havingthecollapseddestinationN9
N11,H1),sinceallofRouterRT11'sothereligiblerouteshavenext
hopsbelongingtoArea2itself(andassuchonlyneedbeadvertised
byotherareaborderrouters;inthiscase,RoutersRT10andRT7).
[19]Bykeepingmoreinformationintheroutingtable,itispossible
https://www.ietf.org/rfc/rfc2328.txt

139/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

foranimplementationtorecalculatetheshortestpathtreeforonly
asinglearea.Infact,thereareincrementalalgorithmsthatallow
animplementationtorecalculateonlyaportionofasinglearea's
shortestpathtree[Ref1].However,thesealgorithmsarebeyondthe
scopeofthisspecification.
[20]ThisishowtheLinkstaterequestlistisemptied,which
eventuallycausestheneighborstatetotransitiontoFull.See
Section10.9formoredetails.
[21]ItshouldbearelativelyrareoccurrenceforanLSA'sLSageto
reachMaxAgeinthisfashion.Usually,theLSAwillbereplacedby

MoyStandardsTrack[Page181]
RFC2328OSPFVersion2April1998
amorerecentinstancebeforeitagesout.
[22]Strictlyspeaking,becauseofequalcostmultipath,the
algorithmdoesnotcreateatree.Wecontinuetousethe"tree"
terminologybecausethatiswhatoccursmostoftenintheexisting
literature.
[23]NotethatthepresenceofanylinkbacktoVissufficient;it
neednotbethematchinghalfofthelinkunderconsiderationfromV
toW.Thisisenoughtoensurethat,beforedatatrafficflows
betweenapairofneighboringrouters,theirlinkstatedatabases
willbesynchronized.
[24]Whentheforwardingaddressisnonzero,itshouldpointtoa
routerbelongingtoanotherAutonomousSystem.SeeSection12.4.4
formoredetails.

https://www.ietf.org/rfc/rfc2328.txt

140/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page182]
RFC2328OSPFVersion2April1998
References
[Ref1]McQuillan,J.,I.RicherandE.Rosen,"ARPANETRouting
AlgorithmImprovements",BBNTechnicalReport3803,April
1978.
[Ref2]DigitalEquipmentCorporation,"Informationprocessing
systemsDatacommunicationsIntermediateSystemto
IntermediateSystemIntraDomainRoutingProtocol",October
1987.
[Ref3]McQuillan,J.,et.al.,"TheNewRoutingAlgorithmforthe
ARPANET",IEEETransactionsonCommunications,May1980.
[Ref4]Perlman,R.,"FaultTolerantBroadcastofRouting
Information",ComputerNetworks,December1983.
[Ref5]Postel,J.,"InternetProtocol",STD5,RFC791,September
1981.
[Ref6]McKenzie,A.,"ISOTransportProtocolspecificationISODP
8073",RFC905,April1984.
[Ref7]Deering,S.,"HostextensionsforIPmulticasting",STD5,
RFC1112,May1988.
[Ref8]McCloghrie,K.,andM.Rose,"ManagementInformationBase
fornetworkmanagementofTCP/IPbasedinternets:MIBII",
STD17,RFC1213,March1991.
[Ref9]Moy,J.,"OSPFVersion2",RFC1583,March1994.
[Ref10]Fuller,V.,T.Li,J.Yu,andK.Varadhan,"Classless
InterDomainRouting(CIDR):anAddressAssignmentand
AggregationStrategy",RFC1519,September1993.
[Ref11]Reynolds,J.,andJ.Postel,"AssignedNumbers",STD2,RFC
1700,October1994.
[Ref12]Almquist,P.,"TypeofServiceintheInternetProtocol
Suite",RFC1349,July1992.

MoyStandardsTrack[Page183]
RFC2328OSPFVersion2April1998
[Ref13]Leiner,B.,et.al.,"TheDARPAInternetProtocolSuite",DDN
ProtocolHandbook,April1985.
[Ref14]Bradley,T.,andC.Brown,"InverseAddressResolution
Protocol",RFC1293,January1992.
[Ref15]deSouza,O.,andM.Rodrigues,"GuidelinesforRunningOSPF
OverFrameRelayNetworks",RFC1586,March1994.
[Ref16]Bellovin,S.,"SecurityProblemsintheTCP/IPProtocol
https://www.ietf.org/rfc/rfc2328.txt

141/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Suite",ACMComputerCommunicationsReview,Volume19,
Number2,pp.3238,April1989.
[Ref17]Rivest,R.,"TheMD5MessageDigestAlgorithm",RFC1321,
April1992.
[Ref18]Moy,J.,"MulticastExtensionstoOSPF",RFC1584,March
1994.
[Ref19]Coltun,R.,andV.Fuller,"TheOSPFNSSAOption",RFC1587,
March1994.
[Ref20]Ferguson,D.,"TheOSPFExternalAttributesLSA",workin
progress.
[Ref21]Moy,J.,"ExtendingOSPFtoSupportDemandCircuits",RFC
1793,April1995.
[Ref22]Mogul,J.,andS.Deering,"PathMTUDiscovery",RFC1191,
November1990.
[Ref23]Rekhter,Y.,andT.Li,"ABorderGatewayProtocol4(BGP
4)",RFC1771,March1995.
[Ref24]Hinden,R.,"InternetRoutingProtocolStandardization
Criteria",BBN,October1991.
[Ref25]Moy,J.,"OSPFVersion2",RFC2178,July1997.
[Ref26]Rosen,E.,"VulnerabilitiesofNetworkControlProtocols:An
Example",ComputerCommunicationReview,July1981.

MoyStandardsTrack[Page184]
RFC2328OSPFVersion2April1998
A.OSPFdataformats
ThisappendixdescribestheformatofOSPFprotocolpacketsandOSPF
LSAs.TheOSPFprotocolrunsdirectlyovertheIPnetworklayer.
Beforeanydataformatsaredescribed,thedetailsoftheOSPF
encapsulationareexplained.
NexttheOSPFOptionsfieldisdescribed.Thisfielddescribes
variouscapabilitiesthatmayormaynotbesupportedbypiecesof
theOSPFroutingdomain.TheOSPFOptionsfieldiscontainedinOSPF
Hellopackets,DatabaseDescriptionpacketsandinOSPFLSAs.
OSPFpacketformatsaredetailedinSectionA.3.Adescriptionof
OSPFLSAsappearsinSectionA.4.
A.1EncapsulationofOSPFpackets
OSPFrunsdirectlyovertheInternetProtocol'snetworklayer.OSPF
packetsarethereforeencapsulatedsolelybyIPandlocaldatalink
headers.
OSPFdoesnotdefineawaytofragmentitsprotocolpackets,and
dependsonIPfragmentationwhentransmittingpacketslargerthan
thenetworkMTU.Ifnecessary,thelengthofOSPFpacketscanbeup
to65,535bytes(includingtheIPheader).TheOSPFpackettypes
https://www.ietf.org/rfc/rfc2328.txt

142/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

thatarelikelytobelarge(DatabaseDescriptionPackets,Link
StateRequest,LinkStateUpdate,andLinkStateAcknowledgment
packets)canusuallybesplitintoseveralseparateprotocol
packets,withoutlossoffunctionality.Thisisrecommended;IP
fragmentationshouldbeavoidedwheneverpossible.Usingthis
reasoning,anattemptshouldbemadetolimitthesizesofOSPF
packetssentovervirtuallinksto576bytesunlessPathMTU
Discoveryisbeingperformed(see[Ref22]).
TheotherimportantfeaturesofOSPF'sIPencapsulationare:
oUseofIPmulticast.SomeOSPFmessagesaremulticast,when
sentoverbroadcastnetworks.TwodistinctIPmulticast
addressesareused.Packetssenttothesemulticastaddresses
shouldneverbeforwarded;theyaremeanttotravelasinglehop
only.Toensurethatthesepacketswillnottravelmultiple
hops,theirIPTTLmustbesetto1.

MoyStandardsTrack[Page185]
RFC2328OSPFVersion2April1998
AllSPFRouters
Thismulticastaddresshasbeenassignedthevalue
224.0.0.5.AllroutersrunningOSPFshouldbepreparedto
receivepacketssenttothisaddress.Hellopacketsare
alwayssenttothisdestination.Also,certainOSPF
protocolpacketsaresenttothisaddressduringthe
floodingprocedure.
AllDRouters
Thismulticastaddresshasbeenassignedthevalue
224.0.0.6.BoththeDesignatedRouterandBackupDesignated
Routermustbepreparedtoreceivepacketsdestinedtothis
address.CertainOSPFprotocolpacketsaresenttothis
addressduringthefloodingprocedure.
oOSPFisIPprotocolnumber89.Thisnumberhasbeenregistered
withtheNetworkInformationCenter.IPprotocolnumber
assignmentsaredocumentedin[Ref11].
oAllOSPFroutingprotocolpacketsaresentusingthenormal
serviceTOSvalueofbinary0000definedin[Ref12].
oRoutingprotocolpacketsaresentwithIPprecedencesetto
InternetworkControl.OSPFprotocolpacketsshouldbegiven
precedenceoverregularIPdatatraffic,inbothsendingand
receiving.SettingtheIPprecedencefieldintheIPheaderto
InternetworkControl[Ref5]mayhelpimplementthisobjective.

https://www.ietf.org/rfc/rfc2328.txt

143/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page186]
RFC2328OSPFVersion2April1998
A.2TheOptionsfield
TheOSPFOptionsfieldispresentinOSPFHellopackets,Database
DescriptionpacketsandallLSAs.TheOptionsfieldenablesOSPF
routerstosupport(ornotsupport)optionalcapabilities,andto
communicatetheircapabilityleveltootherOSPFrouters.Through
thismechanismroutersofdifferingcapabilitiescanbemixedwithin
anOSPFroutingdomain.
WhenusedinHellopackets,theOptionsfieldallowsarouterto
rejectaneighborbecauseofacapabilitymismatch.Alternatively,
whencapabilitiesareexchangedinDatabaseDescriptionpacketsa
routercanchoosenottoforwardcertainLSAstoaneighborbecause
ofitsreducedfunctionality.Lastly,listingcapabilitiesinLSAs
allowsrouterstoforwardtrafficaroundreducedfunctionality
routers,byexcludingthemfrompartsoftheroutingtable
calculation.
FivebitsoftheOSPFOptionsfieldhavebeenassigned,although
onlyone(theEbit)isdescribedcompletelybythismemo.Eachbit
isdescribedbrieflybelow.Routersshouldreset(i.e.clear)
unrecognizedbitsintheOptionsfieldwhensendingHellopacketsor
DatabaseDescriptionpacketsandwhenoriginatingLSAs.Conversely,
routersencounteringunrecognizedOptionbitsinreceivedHello
Packets,DatabaseDescriptionpacketsorLSAsshouldignorethe
capabilityandprocessthepacket/LSAnormally.
++
|*|*|DC|EA|N/P|MC|E|*|
++
TheOptionsfield
Ebit
ThisbitdescribesthewayASexternalLSAsareflooded,as
describedinSections3.6,9.5,10.8and12.1.2ofthismemo.
MCbit
ThisbitdescribeswhetherIPmulticastdatagramsareforwarded
accordingtothespecificationsin[Ref18].

MoyStandardsTrack[Page187]
RFC2328OSPFVersion2April1998
N/Pbit
ThisbitdescribesthehandlingofType7LSAs,asspecifiedin
[Ref19].
EAbit
https://www.ietf.org/rfc/rfc2328.txt

144/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Thisbitdescribestherouter'swillingnesstoreceiveand
forwardExternalAttributesLSAs,asspecifiedin[Ref20].
DCbit
Thisbitdescribestherouter'shandlingofdemandcircuits,as
specifiedin[Ref21].

MoyStandardsTrack[Page188]
RFC2328OSPFVersion2April1998
A.3OSPFPacketFormats
TherearefivedistinctOSPFpackettypes.AllOSPFpackettypes
beginwithastandard24byteheader.Thisheaderisdescribed
first.Eachpackettypeisthendescribedinasucceedingsection.
Inthesesectionseachpacket'sdivisionintofieldsisdisplayed,
andthenthefielddefinitionsareenumerated.
AllOSPFpackettypes(otherthantheOSPFHellopackets)dealwith
listsofLSAs.Forexample,LinkStateUpdatepacketsimplementthe
floodingofLSAsthroughouttheOSPFroutingdomain.Becauseof
this,OSPFprotocolpacketscannotbeparsedunlesstheformatof
LSAsisalsounderstood.TheformatofLSAsisdescribedinSection
A.4.
ThereceiveprocessingofOSPFpacketsisdetailedinSection8.2.
ThesendingofOSPFpacketsisexplainedinSection8.1.

https://www.ietf.org/rfc/rfc2328.txt

145/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page189]
RFC2328OSPFVersion2April1998
A.3.1TheOSPFpacketheader
EveryOSPFpacketstartswithastandard24byteheader.This
headercontainsalltheinformationnecessarytodeterminewhether
thepacketshouldbeacceptedforfurtherprocessing.This
determinationisdescribedinSection8.2ofthespecification.
0123
01234567890123456789012345678901
+++++++++++++++++++++++++++++++++
|Version#|Type|Packetlength|
+++++++++++++++++++++++++++++++++
|RouterID|
+++++++++++++++++++++++++++++++++
|AreaID|
+++++++++++++++++++++++++++++++++
|Checksum|AuType|
+++++++++++++++++++++++++++++++++
|Authentication|
+++++++++++++++++++++++++++++++++
|Authentication|
+++++++++++++++++++++++++++++++++

Version#
TheOSPFversionnumber.Thisspecificationdocumentsversion2
oftheprotocol.
Type
TheOSPFpackettypesareasfollows.SeeSectionsA.3.2through
A.3.6fordetails.

https://www.ietf.org/rfc/rfc2328.txt

146/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page190]
RFC2328OSPFVersion2April1998

TypeDescription
________________________________
1Hello
2DatabaseDescription
3LinkStateRequest
4LinkStateUpdate
5LinkStateAcknowledgment

Packetlength
ThelengthoftheOSPFprotocolpacketinbytes.Thislength
includesthestandardOSPFheader.
RouterID
TheRouterIDofthepacket'ssource.
AreaID
A32bitnumberidentifyingtheareathatthispacketbelongs
to.AllOSPFpacketsareassociatedwithasinglearea.Most
travelasinglehoponly.Packetstravellingoveravirtual
linkarelabelledwiththebackboneAreaIDof0.0.0.0.
Checksum
ThestandardIPchecksumoftheentirecontentsofthepacket,
startingwiththeOSPFpacketheaderbutexcludingthe64bit
authenticationfield.Thischecksumiscalculatedasthe16bit
one'scomplementoftheone'scomplementsumofallthe16bit
wordsinthepacket,exceptingtheauthenticationfield.Ifthe
packet'slengthisnotanintegralnumberof16bitwords,the
packetispaddedwithabyteofzerobeforechecksumming.The
checksumisconsideredtobepartofthepacketauthentication
procedure;forsomeauthenticationtypesthechecksum
calculationisomitted.
AuType
Identifiestheauthenticationproceduretobeusedforthe
packet.AuthenticationisdiscussedinAppendixDofthe
specification.ConsultAppendixDforalistofthecurrently
definedauthenticationtypes.

MoyStandardsTrack[Page191]
RFC2328OSPFVersion2April1998

https://www.ietf.org/rfc/rfc2328.txt

147/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Authentication
A64bitfieldforusebytheauthenticationscheme.See
AppendixDfordetails.

MoyStandardsTrack[Page192]
RFC2328OSPFVersion2April1998
A.3.2TheHellopacket
HellopacketsareOSPFpackettype1.Thesepacketsaresent
periodicallyonallinterfaces(includingvirtuallinks)inorderto
establishandmaintainneighborrelationships.Inaddition,Hello
Packetsaremulticastonthosephysicalnetworkshavingamulticast
orbroadcastcapability,enablingdynamicdiscoveryofneighboring
routers.
Allroutersconnectedtoacommonnetworkmustagreeoncertain
parameters(Networkmask,HelloIntervalandRouterDeadInterval).
TheseparametersareincludedinHellopackets,sothatdifferences
caninhibittheformingofneighborrelationships.Adetailed
explanationofthereceiveprocessingforHellopacketsispresented
inSection10.5.ThesendingofHellopacketsiscoveredinSection
https://www.ietf.org/rfc/rfc2328.txt

148/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

9.5.
0123
01234567890123456789012345678901
+++++++++++++++++++++++++++++++++
|Version#|1|Packetlength|
+++++++++++++++++++++++++++++++++
|RouterID|
+++++++++++++++++++++++++++++++++
|AreaID|
+++++++++++++++++++++++++++++++++
|Checksum|AuType|
+++++++++++++++++++++++++++++++++
|Authentication|
+++++++++++++++++++++++++++++++++
|Authentication|
+++++++++++++++++++++++++++++++++
|NetworkMask|
+++++++++++++++++++++++++++++++++
|HelloInterval|Options|RtrPri|
+++++++++++++++++++++++++++++++++
|RouterDeadInterval|
+++++++++++++++++++++++++++++++++
|DesignatedRouter|
+++++++++++++++++++++++++++++++++
|BackupDesignatedRouter|

MoyStandardsTrack[Page193]
RFC2328OSPFVersion2April1998
+++++++++++++++++++++++++++++++++
|Neighbor|
+++++++++++++++++++++++++++++++++
|...|
Networkmask
Thenetworkmaskassociatedwiththisinterface.Forexample,
iftheinterfaceistoaclassBnetworkwhosethirdbyteis
usedforsubnetting,thenetworkmaskis0xffffff00.
Options
Theoptionalcapabilitiessupportedbytherouter,asdocumented
inSectionA.2.
HelloInterval
Thenumberofsecondsbetweenthisrouter'sHellopackets.
RtrPri
Thisrouter'sRouterPriority.Usedin(Backup)Designated
Routerelection.Ifsetto0,therouterwillbeineligibleto
become(Backup)DesignatedRouter.
RouterDeadInterval
Thenumberofsecondsbeforedeclaringasilentrouterdown.
DesignatedRouter
TheidentityoftheDesignatedRouterforthisnetwork,inthe
viewofthesendingrouter.TheDesignatedRouterisidentified
herebyitsIPinterfaceaddressonthenetwork.Setto0.0.0.0
https://www.ietf.org/rfc/rfc2328.txt

149/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

ifthereisnoDesignatedRouter.
BackupDesignatedRouter
TheidentityoftheBackupDesignatedRouterforthisnetwork,
intheviewofthesendingrouter.TheBackupDesignatedRouter
isidentifiedherebyitsIPinterfaceaddressonthenetwork.
Setto0.0.0.0ifthereisnoBackupDesignatedRouter.
Neighbor
TheRouterIDsofeachrouterfromwhomvalidHellopacketshave
beenseenrecentlyonthenetwork.Recentlymeansinthelast
RouterDeadIntervalseconds.

MoyStandardsTrack[Page194]
RFC2328OSPFVersion2April1998
A.3.3TheDatabaseDescriptionpacket
DatabaseDescriptionpacketsareOSPFpackettype2.Thesepackets
areexchangedwhenanadjacencyisbeinginitialized.Theydescribe
thecontentsofthelinkstatedatabase.Multiplepacketsmaybe
usedtodescribethedatabase.Forthispurposeapollresponse
procedureisused.Oneoftheroutersisdesignatedtobethe
master,theothertheslave.ThemastersendsDatabaseDescription
packets(polls)whichareacknowledgedbyDatabaseDescription
packetssentbytheslave(responses).Theresponsesarelinkedto
thepollsviathepackets'DDsequencenumbers.
0123
01234567890123456789012345678901
+++++++++++++++++++++++++++++++++
|Version#|2|Packetlength|
+++++++++++++++++++++++++++++++++
|RouterID|
+++++++++++++++++++++++++++++++++
|AreaID|
+++++++++++++++++++++++++++++++++
|Checksum|AuType|
+++++++++++++++++++++++++++++++++
|Authentication|
+++++++++++++++++++++++++++++++++
|Authentication|
+++++++++++++++++++++++++++++++++
|InterfaceMTU|Options|0|0|0|0|0|I|M|MS
+++++++++++++++++++++++++++++++++
|DDsequencenumber|
+++++++++++++++++++++++++++++++++
||
++
||
+AnLSAHeader+
||
++
||
++
||
+++++++++++++++++++++++++++++++++
|...|

https://www.ietf.org/rfc/rfc2328.txt

150/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page195]
RFC2328OSPFVersion2April1998
TheformatoftheDatabaseDescriptionpacketisverysimilarto
boththeLinkStateRequestandLinkStateAcknowledgmentpackets.
Themainpartofallthreeisalistofitems,eachitemdescribing
apieceofthelinkstatedatabase.ThesendingofDatabase
DescriptionPacketsisdocumentedinSection10.8.Thereceptionof
DatabaseDescriptionpacketsisdocumentedinSection10.6.
InterfaceMTU
ThesizeinbytesofthelargestIPdatagramthatcanbesent
outtheassociatedinterface,withoutfragmentation.TheMTUs
ofcommonInternetlinktypescanbefoundinTable71of
[Ref22].InterfaceMTUshouldbesetto0inDatabase
Descriptionpacketssentovervirtuallinks.
Options
Theoptionalcapabilitiessupportedbytherouter,asdocumented
inSectionA.2.
Ibit
TheInitbit.Whensetto1,thispacketisthefirstinthe
sequenceofDatabaseDescriptionPackets.
Mbit
TheMorebit.Whensetto1,itindicatesthatmoreDatabase
DescriptionPacketsaretofollow.
MSbit
TheMaster/Slavebit.Whensetto1,itindicatesthatthe
routeristhemasterduringtheDatabaseExchangeprocess.
Otherwise,therouteristheslave.
DDsequencenumber
UsedtosequencethecollectionofDatabaseDescriptionPackets.
Theinitialvalue(indicatedbytheInitbitbeingset)should
beunique.TheDDsequencenumberthenincrementsuntilthe
completedatabasedescriptionhasbeensent.
Therestofthepacketconsistsofa(possiblypartial)listofthe
linkstatedatabase'spieces.EachLSAinthedatabaseisdescribed
byitsLSAheader.TheLSAheaderisdocumentedinSectionA.4.1.
Itcontainsalltheinformationrequiredtouniquelyidentifyboth
theLSAandtheLSA'scurrentinstance.

MoyStandardsTrack[Page196]
RFC2328OSPFVersion2April1998
A.3.4TheLinkStateRequestpacket
LinkStateRequestpacketsareOSPFpackettype3.Afterexchanging
DatabaseDescriptionpacketswithaneighboringrouter,aroutermay
findthatpartsofitslinkstatedatabaseareoutofdate.The
LinkStateRequestpacketisusedtorequestthepiecesofthe
neighbor'sdatabasethataremoreuptodate.MultipleLinkState
Requestpacketsmayneedtobeused.
ArouterthatsendsaLinkStateRequestpackethasinmindthe
https://www.ietf.org/rfc/rfc2328.txt

151/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

preciseinstanceofthedatabasepiecesitisrequesting.Each
instanceisdefinedbyitsLSsequencenumber,LSchecksum,andLS
age,althoughthesefieldsarenotspecifiedintheLinkState
RequestPacketitself.Theroutermayreceiveevenmorerecent
instancesinresponse.
ThesendingofLinkStateRequestpacketsisdocumentedinSection
10.9.ThereceptionofLinkStateRequestpacketsisdocumentedin
Section10.7.
0123
01234567890123456789012345678901
+++++++++++++++++++++++++++++++++
|Version#|3|Packetlength|
+++++++++++++++++++++++++++++++++
|RouterID|
+++++++++++++++++++++++++++++++++
|AreaID|
+++++++++++++++++++++++++++++++++
|Checksum|AuType|
+++++++++++++++++++++++++++++++++
|Authentication|
+++++++++++++++++++++++++++++++++
|Authentication|
+++++++++++++++++++++++++++++++++
|LStype|
+++++++++++++++++++++++++++++++++
|LinkStateID|
+++++++++++++++++++++++++++++++++
|AdvertisingRouter|
+++++++++++++++++++++++++++++++++
|...|

MoyStandardsTrack[Page197]
RFC2328OSPFVersion2April1998
EachLSArequestedisspecifiedbyitsLStype,LinkStateID,and
AdvertisingRouter.ThisuniquelyidentifiestheLSA,butnotits
instance.LinkStateRequestpacketsareunderstoodtoberequests
forthemostrecentinstance(whateverthatmightbe).

https://www.ietf.org/rfc/rfc2328.txt

152/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page198]
RFC2328OSPFVersion2April1998
A.3.5TheLinkStateUpdatepacket
LinkStateUpdatepacketsareOSPFpackettype4.Thesepackets
implementthefloodingofLSAs.EachLinkStateUpdatepacket
carriesacollectionofLSAsonehopfurtherfromtheirorigin.
SeveralLSAsmaybeincludedinasinglepacket.
LinkStateUpdatepacketsaremulticastonthosephysicalnetworks
thatsupportmulticast/broadcast.Inordertomaketheflooding
procedurereliable,floodedLSAsareacknowledgedinLinkState
Acknowledgmentpackets.IfretransmissionofcertainLSAsis
necessary,theretransmittedLSAsarealwayssentdirectlytothe
neighbor.FormoreinformationonthereliablefloodingofLSAs,
consultSection13.
0123
01234567890123456789012345678901
+++++++++++++++++++++++++++++++++
|Version#|4|Packetlength|
+++++++++++++++++++++++++++++++++
|RouterID|
+++++++++++++++++++++++++++++++++
|AreaID|
+++++++++++++++++++++++++++++++++
|Checksum|AuType|
+++++++++++++++++++++++++++++++++
|Authentication|
+++++++++++++++++++++++++++++++++
|Authentication|
+++++++++++++++++++++++++++++++++
|#LSAs|
+++++++++++++++++++++++++++++++++
||
+++
|LSAs|
+++
|...|

https://www.ietf.org/rfc/rfc2328.txt

153/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page199]
RFC2328OSPFVersion2April1998
#LSAs
ThenumberofLSAsincludedinthisupdate.
ThebodyoftheLinkStateUpdatepacketconsistsofalistofLSAs.
EachLSAbeginswithacommon20byteheader,describedinSection
A.4.1.DetailedformatsofthedifferenttypesofLSAsaredescribed
inSectionA.4.

MoyStandardsTrack[Page200]
RFC2328OSPFVersion2April1998
A.3.6TheLinkStateAcknowledgmentpacket
LinkStateAcknowledgmentPacketsareOSPFpackettype5.Tomake
thefloodingofLSAsreliable,floodedLSAsareexplicitly
acknowledged.Thisacknowledgmentisaccomplishedthroughthe
https://www.ietf.org/rfc/rfc2328.txt

154/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

sendingandreceivingofLinkStateAcknowledgmentpackets.
MultipleLSAscanbeacknowledgedinasingleLinkState
Acknowledgmentpacket.
Dependingonthestateofthesendinginterfaceandthesenderof
thecorrespondingLinkStateUpdatepacket,aLinkState
Acknowledgmentpacketissenteithertothemulticastaddress
AllSPFRouters,tothemulticastaddressAllDRouters,orasa
unicast.ThesendingofLinkStateAcknowledgementpacketsis
documentedinSection13.5.ThereceptionofLinkState
AcknowledgementpacketsisdocumentedinSection13.7.
TheformatofthispacketissimilartothatoftheDataDescription
packet.ThebodyofbothpacketsissimplyalistofLSAheaders.
0123
01234567890123456789012345678901
+++++++++++++++++++++++++++++++++
|Version#|5|Packetlength|
+++++++++++++++++++++++++++++++++
|RouterID|
+++++++++++++++++++++++++++++++++
|AreaID|
+++++++++++++++++++++++++++++++++
|Checksum|AuType|
+++++++++++++++++++++++++++++++++
|Authentication|
+++++++++++++++++++++++++++++++++
|Authentication|
+++++++++++++++++++++++++++++++++
||
++
||
+AnLSAHeader+
||
++

MoyStandardsTrack[Page201]
RFC2328OSPFVersion2April1998
||
++
||
+++++++++++++++++++++++++++++++++
|...|
EachacknowledgedLSAisdescribedbyitsLSAheader.TheLSA
headerisdocumentedinSectionA.4.1.Itcontainsallthe
informationrequiredtouniquelyidentifyboththeLSAandtheLSA's
currentinstance.

https://www.ietf.org/rfc/rfc2328.txt

155/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page202]
RFC2328OSPFVersion2April1998
A.4LSAformats
ThismemodefinesfivedistincttypesofLSAs.EachLSAbeginswith
astandard20byteLSAheader.ThisheaderisexplainedinSection
A.4.1.SucceedingsectionsthendiagramtheseparateLSAtypes.
EachLSAdescribesapieceoftheOSPFroutingdomain.Everyrouter
originatesarouterLSA.Inaddition,whenevertherouteris
electedDesignatedRouter,itoriginatesanetworkLSA.Othertypes
ofLSAsmayalsobeoriginated(seeSection12.4).AllLSAsare
thenfloodedthroughouttheOSPFroutingdomain.Theflooding
algorithmisreliable,ensuringthatallroutershavethesame
collectionofLSAs.(SeeSection13formoreinformationconcerning
thefloodingalgorithm).ThiscollectionofLSAsiscalledthe
linkstatedatabase.
Fromthelinkstatedatabase,eachrouterconstructsashortestpath
treewithitselfasroot.Thisyieldsaroutingtable(seeSection
11).Forthedetailsoftheroutingtablebuildprocess,see
Section16.

https://www.ietf.org/rfc/rfc2328.txt

156/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page203]
RFC2328OSPFVersion2April1998
A.4.1TheLSAheader
AllLSAsbeginwithacommon20byteheader.Thisheadercontains
enoughinformationtouniquelyidentifytheLSA(LStype,LinkState
ID,andAdvertisingRouter).MultipleinstancesoftheLSAmay
existintheroutingdomainatthesametime.Itisthennecessary
todeterminewhichinstanceismorerecent.Thisisaccomplishedby
examiningtheLSage,LSsequencenumberandLSchecksumfieldsthat
arealsocontainedintheLSAheader.
0123
01234567890123456789012345678901
+++++++++++++++++++++++++++++++++
|LSage|Options|LStype|
+++++++++++++++++++++++++++++++++
|LinkStateID|
+++++++++++++++++++++++++++++++++
|AdvertisingRouter|
+++++++++++++++++++++++++++++++++
|LSsequencenumber|
+++++++++++++++++++++++++++++++++
|LSchecksum|length|
+++++++++++++++++++++++++++++++++

LSage
ThetimeinsecondssincetheLSAwasoriginated.
Options
Theoptionalcapabilitiessupportedbythedescribedportionof
theroutingdomain.OSPF'soptionalcapabilitiesaredocumented
inSectionA.2.
LStype
ThetypeoftheLSA.EachLSAtypehasaseparateadvertisement
format.TheLSAtypesdefinedinthismemoareasfollows(see
Section12.1.3forfurtherexplanation):

MoyStandardsTrack[Page204]
RFC2328OSPFVersion2April1998

https://www.ietf.org/rfc/rfc2328.txt

157/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

LSTypeDescription
___________________________________
1RouterLSAs
2NetworkLSAs
3SummaryLSAs(IPnetwork)
4SummaryLSAs(ASBR)
5ASexternalLSAs

LinkStateID
Thisfieldidentifiestheportionoftheinternetenvironment
thatisbeingdescribedbytheLSA.Thecontentsofthisfield
dependontheLSA'sLStype.Forexample,innetworkLSAsthe
LinkStateIDissettotheIPinterfaceaddressofthe
network'sDesignatedRouter(fromwhichthenetwork'sIPaddress
canbederived).TheLinkStateIDisfurtherdiscussedin
Section12.1.4.
AdvertisingRouter
TheRouterIDoftherouterthatoriginatedtheLSA.For
example,innetworkLSAsthisfieldisequaltotheRouterIDof
thenetwork'sDesignatedRouter.
LSsequencenumber
DetectsoldorduplicateLSAs.SuccessiveinstancesofanLSA
aregivensuccessiveLSsequencenumbers.SeeSection12.1.6
formoredetails.
LSchecksum
TheFletcherchecksumofthecompletecontentsoftheLSA,
includingtheLSAheaderbutexcludingtheLSagefield.See
Section12.1.7formoredetails.
length
ThelengthinbytesoftheLSA.Thisincludesthe20byteLSA
header.

MoyStandardsTrack[Page205]
RFC2328OSPFVersion2April1998
A.4.2RouterLSAs
RouterLSAsaretheType1LSAs.Eachrouterinanareaoriginates
arouterLSA.TheLSAdescribesthestateandcostoftherouter's
links(i.e.,interfaces)tothearea.Alloftherouter'slinksto
theareamustbedescribedinasinglerouterLSA.Fordetails
concerningtheconstructionofrouterLSAs,seeSection12.4.1.
0123
01234567890123456789012345678901
+++++++++++++++++++++++++++++++++
|LSage|Options|1|
+++++++++++++++++++++++++++++++++
|LinkStateID|
https://www.ietf.org/rfc/rfc2328.txt

158/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

+++++++++++++++++++++++++++++++++
|AdvertisingRouter|
+++++++++++++++++++++++++++++++++
|LSsequencenumber|
+++++++++++++++++++++++++++++++++
|LSchecksum|length|
+++++++++++++++++++++++++++++++++
|0|V|E|B|0|#links|
+++++++++++++++++++++++++++++++++
|LinkID|
+++++++++++++++++++++++++++++++++
|LinkData|
+++++++++++++++++++++++++++++++++
|Type|#TOS|metric|
+++++++++++++++++++++++++++++++++
|...|
+++++++++++++++++++++++++++++++++
|TOS|0|TOSmetric|
+++++++++++++++++++++++++++++++++
|LinkID|
+++++++++++++++++++++++++++++++++
|LinkData|
+++++++++++++++++++++++++++++++++
|...|

MoyStandardsTrack[Page206]
RFC2328OSPFVersion2April1998
InrouterLSAs,theLinkStateIDfieldissettotherouter'sOSPF
RouterID.RouterLSAsarefloodedthroughoutasingleareaonly.
bitV
Whenset,therouterisanendpointofoneormorefully
adjacentvirtuallinkshavingthedescribedareaasTransitarea
(Visforvirtuallinkendpoint).
bitE
Whenset,therouterisanASboundaryrouter(Eisfor
external).
bitB
Whenset,therouterisanareaborderrouter(Bisforborder).
#links
ThenumberofrouterlinksdescribedinthisLSA.Thismustbe
thetotalcollectionofrouterlinks(i.e.,interfaces)tothe
area.
Thefollowingfieldsareusedtodescribeeachrouterlink(i.e.,
interface).Eachrouterlinkistyped(seethebelowTypefield).
TheTypefieldindicatesthekindoflinkbeingdescribed.Itmay
bealinktoatransitnetwork,toanotherrouterortoastub
network.Thevaluesofalltheotherfieldsdescribingarouter
linkdependonthelink'sType.Forexample,eachlinkhasan
associated32bitLinkDatafield.Forlinkstostubnetworksthis
fieldspecifiesthenetwork'sIPaddressmask.Forotherlinktypes
theLinkDatafieldspecifiestherouterinterface'sIPaddress.
https://www.ietf.org/rfc/rfc2328.txt

159/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Type
Aquickdescriptionoftherouterlink.Oneofthefollowing.
Notethathostroutesareclassifiedaslinkstostubnetworks
withnetworkmaskof0xffffffff.

MoyStandardsTrack[Page207]
RFC2328OSPFVersion2April1998

TypeDescription
__________________________________________________
1Pointtopointconnectiontoanotherrouter
2Connectiontoatransitnetwork
3Connectiontoastubnetwork
4Virtuallink

LinkID
Identifiestheobjectthatthisrouterlinkconnectsto.Value
dependsonthelink'sType.Whenconnectingtoanobjectthat
alsooriginatesanLSA(i.e.,anotherrouteroratransit
network)theLinkIDisequaltotheneighboringLSA'sLink
StateID.Thisprovidesthekeyforlookinguptheneighboring
LSAinthelinkstatedatabaseduringtheroutingtable
calculation.SeeSection12.2formoredetails.

TypeLinkID
______________________________________
1Neighboringrouter'sRouterID
2IPaddressofDesignatedRouter
3IPnetwork/subnetnumber
4Neighboringrouter'sRouterID

LinkData
Valueagaindependsonthelink'sTypefield.Forconnectionsto
stubnetworks,LinkDataspecifiesthenetwork'sIPaddress
mask.Forunnumberedpointtopointconnections,itspecifies
theinterface'sMIBII[Ref8]ifIndexvalue.Fortheotherlink
typesitspecifiestherouterinterface'sIPaddress.This
latterpieceofinformationisneededduringtheroutingtable
buildprocess,whencalculatingtheIPaddressofthenexthop.
SeeSection16.1.1formoredetails.

https://www.ietf.org/rfc/rfc2328.txt

160/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page208]
RFC2328OSPFVersion2April1998
#TOS
ThenumberofdifferentTOSmetricsgivenforthislink,not
countingtherequiredlinkmetric(referredtoastheTOS0
metricin[Ref9]).Forexample,ifnoadditionalTOSmetrics
aregiven,thisfieldissetto0.
metric
Thecostofusingthisrouterlink.
AdditionalTOSspecificinformationmayalsobeincluded,for
backwardcompatibilitywithpreviousversionsoftheOSPF
specification([Ref9]).Withineachlink,andforeachdesiredTOS,
TOSTOSspecificlinkinformationmaybeencodedasfollows:
TOSIPTypeofServicethatthismetricrefersto.Theencodingof
TOSinOSPFLSAsisdescribedinSection12.3.
TOSmetric
TOSspecificmetricinformation.

MoyStandardsTrack[Page209]
RFC2328OSPFVersion2April1998
A.4.3NetworkLSAs
NetworkLSAsaretheType2LSAs.AnetworkLSAisoriginatedfor
eachbroadcastandNBMAnetworkintheareawhichsupportstwoor
morerouters.ThenetworkLSAisoriginatedbythenetwork's
DesignatedRouter.TheLSAdescribesallroutersattachedtothe
network,includingtheDesignatedRouteritself.TheLSA'sLink
StateIDfieldliststheIPinterfaceaddressoftheDesignated
Router.
https://www.ietf.org/rfc/rfc2328.txt

161/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Thedistancefromthenetworktoallattachedroutersiszero.This
iswhymetricfieldsneednotbespecifiedinthenetworkLSA.For
detailsconcerningtheconstructionofnetworkLSAs,seeSection
12.4.2.
0123
01234567890123456789012345678901
+++++++++++++++++++++++++++++++++
|LSage|Options|2|
+++++++++++++++++++++++++++++++++
|LinkStateID|
+++++++++++++++++++++++++++++++++
|AdvertisingRouter|
+++++++++++++++++++++++++++++++++
|LSsequencenumber|
+++++++++++++++++++++++++++++++++
|LSchecksum|length|
+++++++++++++++++++++++++++++++++
|NetworkMask|
+++++++++++++++++++++++++++++++++
|AttachedRouter|
+++++++++++++++++++++++++++++++++
|...|

NetworkMask
TheIPaddressmaskforthenetwork.Forexample,aclassA
networkwouldhavethemask0xff000000.

MoyStandardsTrack[Page210]
RFC2328OSPFVersion2April1998
AttachedRouter
TheRouterIDsofeachoftheroutersattachedtothenetwork.
Actually,onlythoseroutersthatarefullyadjacenttothe
DesignatedRouterarelisted.TheDesignatedRouterincludes
itselfinthislist.Thenumberofroutersincludedcanbe
deducedfromtheLSAheader'slengthfield.

https://www.ietf.org/rfc/rfc2328.txt

162/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page211]
RFC2328OSPFVersion2April1998
A.4.4SummaryLSAs
SummaryLSAsaretheType3and4LSAs.TheseLSAsareoriginated
byareaborderrouters.SummaryLSAsdescribeinterarea
destinations.Fordetailsconcerningtheconstructionofsummary
LSAs,seeSection12.4.3.
Type3summaryLSAsareusedwhenthedestinationisanIPnetwork.
InthiscasetheLSA'sLinkStateIDfieldisanIPnetworknumber
(ifnecessary,theLinkStateIDcanalsohaveoneormoreofthe
network's"host"bitsset;seeAppendixEfordetails).Whenthe
destinationisanASboundaryrouter,aType4summaryLSAisused,
andtheLinkStateIDfieldistheASboundaryrouter'sOSPFRouter
ID.(Toseewhyitisnecessarytoadvertisethelocationofeach
ASBR,consultSection16.4.)OtherthanthedifferenceintheLink
StateIDfield,theformatofType3and4summaryLSAsis
identical.
0123
01234567890123456789012345678901
+++++++++++++++++++++++++++++++++
|LSage|Options|3or4|
+++++++++++++++++++++++++++++++++
|LinkStateID|
+++++++++++++++++++++++++++++++++
|AdvertisingRouter|
+++++++++++++++++++++++++++++++++
|LSsequencenumber|
+++++++++++++++++++++++++++++++++
|LSchecksum|length|
+++++++++++++++++++++++++++++++++
|NetworkMask|
+++++++++++++++++++++++++++++++++
|0|metric|
+++++++++++++++++++++++++++++++++
|TOS|TOSmetric|
+++++++++++++++++++++++++++++++++
|...|
https://www.ietf.org/rfc/rfc2328.txt

163/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page212]
RFC2328OSPFVersion2April1998
Forstubareas,Type3summaryLSAscanalsobeusedtodescribea
(perarea)defaultroute.Defaultsummaryroutesareusedinstub
areasinsteadoffloodingacompletesetofexternalroutes.When
describingadefaultsummaryroute,thesummaryLSA'sLinkStateID
isalwayssettoDefaultDestination(0.0.0.0)andtheNetworkMask
issetto0.0.0.0.
NetworkMask
ForType3summaryLSAs,thisindicatesthedestination
network'sIPaddressmask.Forexample,whenadvertisingthe
locationofaclassAnetworkthevalue0xff000000wouldbe
used.ThisfieldisnotmeaningfulandmustbezeroforType4
summaryLSAs.
metric
Thecostofthisroute.Expressedinthesameunitsasthe
interfacecostsintherouterLSAs.
AdditionalTOSspecificinformationmayalsobeincluded,for
backwardcompatibilitywithpreviousversionsoftheOSPF
specification([Ref9]).ForeachdesiredTOS,TOSspecific
informationisencodedasfollows:
TOSIPTypeofServicethatthismetricrefersto.Theencodingof
TOSinOSPFLSAsisdescribedinSection12.3.
TOSmetric
TOSspecificmetricinformation.

MoyStandardsTrack[Page213]
RFC2328OSPFVersion2April1998
A.4.5ASexternalLSAs
ASexternalLSAsaretheType5LSAs.TheseLSAsareoriginatedby
ASboundaryrouters,anddescribedestinationsexternaltotheAS.
FordetailsconcerningtheconstructionofASexternalLSAs,see
https://www.ietf.org/rfc/rfc2328.txt

164/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Section12.4.3.
ASexternalLSAsusuallydescribeaparticularexternaldestination.
FortheseLSAstheLinkStateIDfieldspecifiesanIPnetwork
number(ifnecessary,theLinkStateIDcanalsohaveoneormoreof
thenetwork's"host"bitsset;seeAppendixEfordetails).AS
externalLSAsarealsousedtodescribeadefaultroute.Default
routesareusedwhennospecificrouteexiststothedestination.
Whendescribingadefaultroute,theLinkStateIDisalwayssetto
DefaultDestination(0.0.0.0)andtheNetworkMaskissetto0.0.0.0.
0123
01234567890123456789012345678901
+++++++++++++++++++++++++++++++++
|LSage|Options|5|
+++++++++++++++++++++++++++++++++
|LinkStateID|
+++++++++++++++++++++++++++++++++
|AdvertisingRouter|
+++++++++++++++++++++++++++++++++
|LSsequencenumber|
+++++++++++++++++++++++++++++++++
|LSchecksum|length|
+++++++++++++++++++++++++++++++++
|NetworkMask|
+++++++++++++++++++++++++++++++++
|E|0|metric|
+++++++++++++++++++++++++++++++++
|Forwardingaddress|
+++++++++++++++++++++++++++++++++
|ExternalRouteTag|
+++++++++++++++++++++++++++++++++
|E|TOS|TOSmetric|
+++++++++++++++++++++++++++++++++
|Forwardingaddress|
+++++++++++++++++++++++++++++++++

MoyStandardsTrack[Page214]
RFC2328OSPFVersion2April1998
|ExternalRouteTag|
+++++++++++++++++++++++++++++++++
|...|

NetworkMask
TheIPaddressmaskfortheadvertiseddestination.For
example,whenadvertisingaclassAnetworkthemask0xff000000
wouldbeused.
bitE
Thetypeofexternalmetric.IfbitEisset,themetric
specifiedisaType2externalmetric.Thismeansthemetricis
consideredlargerthananylinkstatepath.IfbitEiszero,
thespecifiedmetricisaType1externalmetric.Thismeans
thatitisexpressedinthesameunitsasthelinkstatemetric
(i.e.,thesameunitsasinterfacecost).
metric
https://www.ietf.org/rfc/rfc2328.txt

165/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Thecostofthisroute.Interpretationdependsontheexternal
typeindication(bitEabove).
Forwardingaddress
Datatrafficfortheadvertiseddestinationwillbeforwardedto
thisaddress.IftheForwardingaddressissetto0.0.0.0,data
trafficwillbeforwardedinsteadtotheLSA'soriginator(i.e.,
theresponsibleASboundaryrouter).
ExternalRouteTag
A32bitfieldattachedtoeachexternalroute.Thisisnot
usedbytheOSPFprotocolitself.Itmaybeusedtocommunicate
informationbetweenASboundaryrouters;theprecisenatureof
suchinformationisoutsidethescopeofthisspecification.
AdditionalTOSspecificinformationmayalsobeincluded,for
backwardcompatibilitywithpreviousversionsoftheOSPF
specification([Ref9]).ForeachdesiredTOS,TOSspecific
informationisencodedasfollows:
TOSTheTypeofServicethatthefollowingfieldsconcern.The
encodingofTOSinOSPFLSAsisdescribedinSection12.3.

MoyStandardsTrack[Page215]
RFC2328OSPFVersion2April1998
bitE
Forbackwardcompatibilitywith[Ref9].
TOSmetric
TOSspecificmetricinformation.
Forwardingaddress
Forbackwardcompatibilitywith[Ref9].
ExternalRouteTag
Forbackwardcompatibilitywith[Ref9].

https://www.ietf.org/rfc/rfc2328.txt

166/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page216]
RFC2328OSPFVersion2April1998
B.ArchitecturalConstants
SeveralOSPFprotocolparametershavefixedarchitecturalvalues.
Theseparametershavebeenreferredtointhetextbynamessuchas
LSRefreshTime.Thesamenamingconventionisusedforthe
configurableprotocolparameters.TheyaredefinedinAppendixC.
Thenameofeacharchitecturalconstantfollows,togetherwithits
valueandashortdescriptionofitsfunction.
LSRefreshTime
Themaximumtimebetweendistinctoriginationsofanyparticular
LSA.IftheLSagefieldofoneoftherouter'sselforiginated
LSAsreachesthevalueLSRefreshTime,anewinstanceoftheLSA
isoriginated,eventhoughthecontentsoftheLSA(apartfrom
theLSAheader)willbethesame.ThevalueofLSRefreshTimeis
setto30minutes.
MinLSInterval
Theminimumtimebetweendistinctoriginationsofanyparticular
LSA.ThevalueofMinLSIntervalissetto5seconds.
MinLSArrival
ForanyparticularLSA,theminimumtimethatmustelapse
betweenreceptionofnewLSAinstancesduringflooding.LSA
instancesreceivedathigherfrequenciesarediscarded.The
valueofMinLSArrivalissetto1second.
MaxAge
ThemaximumagethatanLSAcanattain.WhenanLSA'sLSage
fieldreachesMaxAge,itisrefloodedinanattempttoflushthe
LSAfromtheroutingdomain(SeeSection14).LSAsofageMaxAge
arenotusedintheroutingtablecalculation.Thevalueof
MaxAgeissetto1hour.
CheckAge
WhentheageofanLSAinthelinkstatedatabasehitsa
multipleofCheckAge,theLSA'schecksumisverified.An
incorrectchecksumatthistimeindicatesaseriouserror.The
valueofCheckAgeissetto5minutes.

MoyStandardsTrack[Page217]
RFC2328OSPFVersion2April1998

https://www.ietf.org/rfc/rfc2328.txt

167/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MaxAgeDiff
Themaximumtimedispersionthatcanoccur,asanLSAisflooded
throughouttheAS.Mostofthistimeisaccountedforbythe
LSAssittingonrouteroutputqueues(andthereforenotaging)
duringthefloodingprocess.ThevalueofMaxAgeDiffissetto
15minutes.
LSInfinity
Themetricvalueindicatingthatthedestinationdescribedbyan
LSAisunreachable.UsedinsummaryLSAsandASexternalLSAsas
analternativetoprematureaging(seeSection14.1).Itis
definedtobethe24bitbinaryvalueofallones:0xffffff.
DefaultDestination
TheDestinationIDthatindicatesthedefaultroute.Thisroute
isusedwhennoothermatchingroutingtableentrycanbefound.
ThedefaultdestinationcanonlybeadvertisedinASexternal
LSAsandinstubareas'type3summaryLSAs.Itsvalueisthe
IPaddress0.0.0.0.ItsassociatedNetworkMaskisalsoalways
0.0.0.0.
InitialSequenceNumber
ThevalueusedforLSSequenceNumberwhenoriginatingthefirst
instanceofanyLSA.Itsvalueisthesigned32bitinteger
0x80000001.
MaxSequenceNumber
ThemaximumvaluethatLSSequenceNumbercanattain.Itsvalue
isthesigned32bitinteger0x7fffffff.

MoyStandardsTrack[Page218]
RFC2328OSPFVersion2April1998
C.ConfigurableConstants
TheOSPFprotocolhasquiteafewconfigurableparameters.These
parametersarelistedbelow.Theyaregroupedintogeneral
functionalcategories(areaparameters,interfaceparameters,etc.).
Samplevaluesaregivenforsomeoftheparameters.
Someparametersettingsneedtobeconsistentamonggroupsof
routers.Forexample,allroutersinanareamustagreeonthat
area'sparameters,andallroutersattachedtoanetworkmustagree
onthatnetwork'sIPnetworknumberandmask.
Someparametersmaybedeterminedbyrouteralgorithmsoutsideof
thisspecification(e.g.,theaddressofahostconnectedtothe
routerviaaSLIPline).FromOSPF'spointofview,theseitemsare
https://www.ietf.org/rfc/rfc2328.txt

168/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

stillconfigurable.
C.1Globalparameters
Ingeneral,aseparatecopyoftheOSPFprotocolisrunforeach
area.Becauseofthis,mostconfigurationparametersare
definedonaperareabasis.Thefewglobalconfiguration
parametersarelistedbelow.
RouterID
Thisisa32bitnumberthatuniquelyidentifiestherouter
intheAutonomousSystem.OnealgorithmforRouterID
assignmentistochoosethelargestorsmallestIPaddress
assignedtotherouter.Ifarouter'sOSPFRouterIDis
changed,therouter'sOSPFsoftwareshouldberestarted
beforethenewRouterIDtakeseffect.Beforerestartingin
ordertochangeitsRouterID,theroutershouldflushits
selforiginatedLSAsfromtheroutingdomain(seeSection
14.1),ortheywillpersistforuptoMaxAgeminutes.
RFC1583Compatibility
ControlsthepreferencerulesusedinSection16.4when
choosingamongmultipleASexternalLSAsadvertisingthe
samedestination.Whensetto"enabled",thepreference
rulesremainthosespecifiedbyRFC1583([Ref9]).Whenset
to"disabled",thepreferencerulesarethosestatedin

MoyStandardsTrack[Page219]
RFC2328OSPFVersion2April1998
Section16.4.1,whichpreventroutingloopswhenAS
externalLSAsforthesamedestinationhavebeenoriginated
fromdifferentareas.Setto"enabled"bydefault.
Inordertominimizethechanceofroutingloops,allOSPF
routersinanOSPFroutingdomainshouldhave
RFC1583Compatibilitysetidentically.Whentherearerouters
presentthathavenotbeenupdatedwiththefunctionality
specifiedinSection16.4.1ofthismemo,allroutersshould
haveRFC1583Compatibilitysetto"enabled".Otherwise,all
routersshouldhaveRFC1583Compatibilitysetto"disabled",
preventingallroutingloops.
C.2Areaparameters
Allroutersbelongingtoanareamustagreeonthatarea's
configuration.Disagreementsbetweentworouterswillleadto
aninabilityforadjacenciestoformbetweenthem,witha
resultinghindrancetotheflowofroutingprotocolanddata
traffic.Thefollowingitemsmustbeconfiguredforanarea:
AreaID
Thisisa32bitnumberthatidentifiesthearea.TheArea
IDof0.0.0.0isreservedforthebackbone.Ifthearea
representsasubnettednetwork,theIPnetworknumberofthe
subnettednetworkmaybeusedfortheAreaID.
Listofaddressranges
AnOSPFareaisdefinedasalistofaddressranges.Each
https://www.ietf.org/rfc/rfc2328.txt

169/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

addressrangeconsistsofthefollowingitems:
[IPaddress,mask]
DescribesthecollectionofIPaddressescontained
intheaddressrange.Networksandhostsare
assignedtoanareadependingonwhethertheir
addressesfallintooneofthearea'sdefining
addressranges.Routersareviewedasbelongingto
multipleareas,dependingontheirattached
networks'areamembership.

MoyStandardsTrack[Page220]
RFC2328OSPFVersion2April1998
StatusSettoeitherAdvertiseorDoNotAdvertise.Routing
informationiscondensedatareaboundaries.
Externaltothearea,atmostasinglerouteis
advertised(viaasummaryLSA)foreachaddress
range.Therouteisadvertisedifandonlyifthe
addressrange'sStatusissettoAdvertise.
Unadvertisedrangesallowtheexistenceofcertain
networkstobeintentionallyhiddenfromother
areas.StatusissettoAdvertisebydefault.
Asanexample,supposeanIPsubnettednetworkistobeits
ownOSPFarea.Theareawouldbeconfiguredasasingle
addressrange,whoseIPaddressistheaddressofthe
subnettednetwork,andwhosemaskisthenaturalclassA,B,
orCaddressmask.Asingleroutewouldbeadvertised
externaltothearea,describingtheentiresubnetted
network.
ExternalRoutingCapability
WhetherASexternalLSAswillbefloodedinto/throughoutthe
area.IfASexternalLSAsareexcludedfromthearea,the
areaiscalleda"stub".Internaltostubareas,routingto
externaldestinationswillbebasedsolelyonadefault
summaryroute.Thebackbonecannotbeconfiguredasastub
area.Also,virtuallinkscannotbeconfiguredthroughstub
areas.Formoreinformation,seeSection3.6.
StubDefaultCost
Iftheareahasbeenconfiguredasastubarea,andthe
routeritselfisanareaborderrouter,thenthe
StubDefaultCostindicatesthecostofthedefaultsummary
LSAthattheroutershouldadvertiseintothearea.
C.3Routerinterfaceparameters
Someoftheconfigurablerouterinterfaceparameters(suchasIP
interfaceaddressandsubnetmask)actuallyimplypropertiesof
theattachednetworks,andthereforemustbeconsistentacross
alltheroutersattachedtothatnetwork.Theparametersthat
mustbeconfiguredforarouterinterfaceare:

https://www.ietf.org/rfc/rfc2328.txt

170/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page221]
RFC2328OSPFVersion2April1998
IPinterfaceaddress
TheIPprotocoladdressforthisinterface.Thisuniquely
identifiestherouterovertheentireinternet.AnIP
addressisnotrequiredonpointtopointnetworks.Sucha
pointtopointnetworkiscalled"unnumbered".
IPinterfacemask
Alsoreferredtoasthesubnet/networkmask,thisindicates
theportionoftheIPinterfaceaddressthatidentifiesthe
attachednetwork.MaskingtheIPinterfaceaddresswiththe
IPinterfacemaskyieldstheIPnetworknumberofthe
attachednetwork.Onpointtopointnetworksandvirtual
links,theIPinterfacemaskisnotdefined.Onthese
networks,thelinkitselfisnotassignedanIPnetwork
number,andsotheaddressesofeachsideofthelinkare
assignedindependently,iftheyareassignedatall.
AreaID
TheOSPFareatowhichtheattachednetworkbelongs.
Interfaceoutputcost
Thecostofsendingapacketontheinterface,expressedin
thelinkstatemetric.Thisisadvertisedasthelinkcost
forthisinterfaceintherouter'srouterLSA.Theinterface
outputcostmustalwaysbegreaterthan0.
RxmtInterval
ThenumberofsecondsbetweenLSAretransmissions,for
adjacenciesbelongingtothisinterface.Alsousedwhen
retransmittingDatabaseDescriptionandLinkStateRequest
Packets.Thisshouldbewellovertheexpectedroundtrip
delaybetweenanytworoutersontheattachednetwork.The
settingofthisvalueshouldbeconservativeorneedless
retransmissionswillresult.Samplevalueforalocalarea
network:5seconds.
InfTransDelay
TheestimatednumberofsecondsittakestotransmitaLink
StateUpdatePacketoverthisinterface.LSAscontainedin
theupdatepacketmusthavetheirageincrementedbythis
amountbeforetransmission.Thisvalueshouldtakeinto
accountthetransmissionandpropagationdelaysofthe

MoyStandardsTrack[Page222]
RFC2328OSPFVersion2April1998
interface.Itmustbegreaterthan0.Samplevaluefora
localareanetwork:1second.
RouterPriority
An8bitunsignedinteger.Whentworoutersattachedtoa
networkbothattempttobecomeDesignatedRouter,theone
withthehighestRouterPrioritytakesprecedence.Ifthere
isstillatie,therouterwiththehighestRouterIDtakes
precedence.ArouterwhoseRouterPriorityissetto0is
ineligibletobecomeDesignatedRouterontheattached
https://www.ietf.org/rfc/rfc2328.txt

171/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

network.RouterPriorityisonlyconfiguredforinterfaces
tobroadcastandNBMAnetworks.
HelloInterval
Thelengthoftime,inseconds,betweentheHelloPackets
thattheroutersendsontheinterface.Thisvalueis
advertisedintherouter'sHelloPackets.Itmustbethe
sameforallroutersattachedtoacommonnetwork.The
smallertheHelloInterval,thefastertopologicalchanges
willbedetected;however,moreOSPFroutingprotocol
trafficwillensue.SamplevalueforaX.25PDNnetwork:30
seconds.Samplevalueforalocalareanetwork:10seconds.
RouterDeadInterval
Afterceasingtoheararouter'sHelloPackets,thenumber
ofsecondsbeforeitsneighborsdeclaretherouterdown.
Thisisalsoadvertisedintherouter'sHelloPacketsin
theirRouterDeadIntervalfield.Thisshouldbesome
multipleoftheHelloInterval(say4).Thisvalueagain
mustbethesameforallroutersattachedtoacommon
network.
AuType
Identifiestheauthenticationproceduretobeusedonthe
attachednetwork.Thisvaluemustbethesameforall
routersattachedtothenetwork.SeeAppendixDfora
discussionofthedefinedauthenticationtypes.
Authenticationkey
Thisconfigureddataallowstheauthenticationprocedureto
verifyOSPFprotocolpacketsreceivedovertheinterface.
Forexample,iftheAuTypeindicatessimplepassword,the

MoyStandardsTrack[Page223]
RFC2328OSPFVersion2April1998
Authenticationkeywouldbeaclear64bitpassword.
AuthenticationkeysassociatedwiththeotherOSPF
authenticationtypesarediscussedinAppendixD.
C.4Virtuallinkparameters
Virtuallinksareusedtorestore/increaseconnectivityofthe
backbone.Virtuallinksmaybeconfiguredbetweenanypairof
areaborderroutershavinginterfacestoacommon(nonbackbone)
area.Thevirtuallinkappearsasanunnumberedpointtopoint
linkinthegraphforthebackbone.Thevirtuallinkmustbe
configuredinbothoftheareaborderrouters.
AvirtuallinkappearsinrouterLSAs(forthebackbone)asif
itwereaseparaterouterinterfacetothebackbone.Assuch,
ithasalloftheparametersassociatedwitharouterinterface
(seeSectionC.3).Althoughavirtuallinkactslikean
unnumberedpointtopointlink,itdoeshaveanassociatedIP
interfaceaddress.ThisaddressisusedastheIPsourcein
OSPFprotocolpacketsitsendsalongthevirtuallink,andis
setdynamicallyduringtheroutingtablebuildprocess.
Interfaceoutputcostisalsosetdynamicallyonvirtuallinks
tobethecostoftheintraareapathbetweenthetworouters.
TheparameterRxmtIntervalmustbeconfigured,andshouldbe
wellovertheexpectedroundtripdelaybetweenthetworouters.
https://www.ietf.org/rfc/rfc2328.txt

172/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Thismaybehardtoestimateforavirtuallink;itisbetterto
erronthesideofmakingittoolarge.RouterPriorityisnot
usedonvirtuallinks.
Avirtuallinkisdefinedbythefollowingtwoconfigurable
parameters:theRouterIDofthevirtuallink'sotherendpoint,
andthe(nonbackbone)areathroughwhichthevirtuallinkruns
(referredtoasthevirtuallink'sTransitarea).Virtuallinks
cannotbeconfiguredthroughstubareas.
C.5NBMAnetworkparameters
OSPFtreatsanNBMAnetworkmuchlikeittreatsabroadcast
network.Sincetheremaybemanyroutersattachedtothe
network,aDesignatedRouterisselectedforthenetwork.This
DesignatedRouterthenoriginatesanetworkLSA,whichlistsall
routersattachedtotheNBMAnetwork.

MoyStandardsTrack[Page224]
RFC2328OSPFVersion2April1998
However,duetothelackofbroadcastcapabilities,itmaybe
necessarytouseconfigurationparametersintheDesignated
Routerselection.Theseparameterswillonlyneedtobe
configuredinthoseroutersthatarethemselveseligibleto
becomeDesignatedRouter(i.e.,thoserouter'swhoseRouter
Priorityforthenetworkisnonzero),andthenonlyifno
automaticprocedurefordiscoveringneighborsexists:
Listofallotherattachedrouters
ThelistofallotherroutersattachedtotheNBMAnetwork.
EachrouterislistedbyitsIPinterfaceaddressonthe
network.Also,foreachrouterlisted,thatrouter's
eligibilitytobecomeDesignatedRoutermustbedefined.
WhenaninterfacetoaNBMAnetworkcomesup,therouter
sendsHelloPacketsonlytothoseneighborseligibleto
becomeDesignatedRouter,untiltheidentityofthe
DesignatedRouterisdiscovered.
PollInterval
Ifaneighboringrouterhasbecomeinactive(HelloPackets
havenotbeenseenforRouterDeadIntervalseconds),itmay
stillbenecessarytosendHelloPacketstothedead
neighbor.TheseHelloPacketswillbesentatthereduced
ratePollInterval,whichshouldbemuchlargerthan
HelloInterval.SamplevalueforaPDNX.25network:2
minutes.
C.6PointtoMultiPointnetworkparameters
OnPointtoMultiPointnetworks,itmaybenecessaryto
configurethesetofneighborsthataredirectlyreachableover
thePointtoMultiPointnetwork.Eachneighborisidentifiedby
itsIPaddressonthePointtoMultiPointnetwork.Designated
RoutersarenotelectedonPointtoMultiPointnetworks,sothe
DesignatedRoutereligibilityofconfiguredneighborsis
undefined.
Alternatively,neighborsonPointtoMultiPointnetworksmaybe
dynamicallydiscoveredbylowerlevelprotocolssuchasInverse
https://www.ietf.org/rfc/rfc2328.txt

173/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

ARP([Ref14]).

MoyStandardsTrack[Page225]
RFC2328OSPFVersion2April1998
C.7Hostrouteparameters
HostroutesareadvertisedinrouterLSAsasstubnetworkswith
mask0xffffffff.Theyindicateeitherrouterinterfacesto
pointtopointnetworks,loopedrouterinterfaces,orIPhosts
thataredirectlyconnectedtotherouter(e.g.,viaaSLIP
line).Foreachhostdirectlyconnectedtotherouter,the
followingitemsmustbeconfigured:
HostIPaddress
TheIPaddressofthehost.
Costoflinktohost
Thecostofsendingapackettothehost,intermsofthe
linkstatemetric.However,sincethehostprobablyhas
onlyasingleconnectiontotheinternet,theactual
configuredcostinmanycasesisunimportant(i.e.,will
havenoeffectonrouting).
AreaID
TheOSPFareatowhichthehostbelongs.

MoyStandardsTrack[Page226]
RFC2328OSPFVersion2April1998
D.Authentication
AllOSPFprotocolexchangesareauthenticated.TheOSPFpacket
header(seeSectionA.3.1)includesanauthenticationtypefield,
and64bitsofdataforusebytheappropriateauthenticationscheme
https://www.ietf.org/rfc/rfc2328.txt

174/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

(determinedbythetypefield).
Theauthenticationtypeisconfigurableonaperinterface(or
equivalently,onapernetwork/subnet)basis.Additional
authenticationdataisalsoconfigurableonaperinterfacebasis.
Authenticationtypes0,1and2aredefinedbythisspecification.
Allotherauthenticationtypesarereservedfordefinitionbythe
IANA(iana@ISI.EDU).Thecurrentlistofauthenticationtypesis
describedbelowinTable20.

AuTypeDescription
___________________________________________
0Nullauthentication
1Simplepassword
2Cryptographicauthentication
AllothersReservedforassignmentbythe
IANA(iana@ISI.EDU)
Table20:OSPFauthenticationtypes.

D.1Nullauthentication
Useofthisauthenticationtypemeansthatroutingexchanges
overthenetwork/subnetarenotauthenticated.The64bit
authenticationfieldintheOSPFheadercancontainanything;it
isnotexaminedonpacketreception.WhenemployingNull
authentication,theentirecontentsofeachOSPFpacket(other
thanthe64bitauthenticationfield)arechecksummedinorder
todetectdatacorruption.

MoyStandardsTrack[Page227]
RFC2328OSPFVersion2April1998
D.2Simplepasswordauthentication
Usingthisauthenticationtype,a64bitfieldisconfiguredon
apernetworkbasis.Allpacketssentonaparticularnetwork
musthavethisconfiguredvalueintheirOSPFheader64bit
authenticationfield.Thisessentiallyservesasa"clear"64
bitpassword.Inaddition,theentirecontentsofeachOSPF
packet(otherthanthe64bitauthenticationfield)are
checksummedinordertodetectdatacorruption.
Simplepasswordauthenticationguardsagainstrouters
inadvertentlyjoiningtheroutingdomain;eachroutermustfirst
beconfiguredwithitsattachednetworks'passwordsbeforeit
canparticipateinrouting.However,simplepassword
authenticationisvulnerabletopassiveattackscurrently
widespreadintheInternet(see[Ref16]).Anyonewithphysical
accesstothenetworkcanlearnthepasswordandcompromisethe
securityoftheOSPFroutingdomain.
D.3Cryptographicauthentication
https://www.ietf.org/rfc/rfc2328.txt

175/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Usingthisauthenticationtype,asharedsecretkeyis
configuredinallroutersattachedtoacommonnetwork/subnet.
ForeachOSPFprotocolpacket,thekeyisusedto
generate/verifya"messagedigest"thatisappendedtotheend
oftheOSPFpacket.Themessagedigestisaonewayfunctionof
theOSPFprotocolpacketandthesecretkey.Sincethesecret
keyisneversentoverthenetworkintheclear,protectionis
providedagainstpassiveattacks.
Thealgorithmsusedtogenerateandverifythemessagedigest
arespecifiedimplicitlybythesecretkey.Thisspecification
completelydefinestheuseofOSPFCryptographicauthentication
whentheMD5algorithmisused.
Inaddition,anondecreasingsequencenumberisincludedin
eachOSPFprotocolpackettoprotectagainstreplayattacks.
Thisprovideslongtermprotection;however,itisstill
possibletoreplayanOSPFpacketuntilthesequencenumber
changes.Toimplementthisfeature,eachneighbordatastructure
containsanewfieldcalledthe"cryptographicsequencenumber".
Thisfieldisinitializedtozero,andisalsosettozero

MoyStandardsTrack[Page228]
RFC2328OSPFVersion2April1998

0123
01234567890123456789012345678901
+++++++++++++++++++++++++++++++++
|0|KeyID|AuthDataLen|
+++++++++++++++++++++++++++++++++
|Cryptographicsequencenumber|
+++++++++++++++++++++++++++++++++
Figure18:UsageoftheAuthenticationfield
intheOSPFpacketheaderwhenCryptographic
Authenticationisemployed
whenevertheneighbor'sstatetransitionsto"Down".Wheneveran
OSPFpacketisacceptedasauthentic,thecryptographicsequence
numberissettothereceivedpacket'ssequencenumber.
Thisspecificationdoesnotprovidearolloverprocedureforthe
cryptographicsequencenumber.Whenthecryptographicsequence
numberthattherouterissendinghitsthemaximumvalue,the
routershouldresetthecryptographicsequencenumberthatitis
sendingbackto0.Afterthisisdone,therouter'sneighbors
willrejecttherouter'sOSPFpacketsforaperiodof
RouterDeadInterval,andthentherouterwillbeforcedto
reestablishalladjacenciesovertheinterface.However,itis
expectedthatmanyimplementationswilluse"secondssince
reboot"(or"secondssince1960",etc.)asthecryptographic
sequencenumber.Suchachoicewillessentiallyprevent
rollover,sincethecryptographicsequencenumberfieldis32
bitsinlength.
TheOSPFCryptographicauthenticationoptiondoesnotprovide
confidentiality.
https://www.ietf.org/rfc/rfc2328.txt

176/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Whencryptographicauthenticationisused,the64bit
AuthenticationfieldinthestandardOSPFpacketheaderis
redefinedasshowninFigure18.Thenewfielddefinitionsare
asfollows:

MoyStandardsTrack[Page229]
RFC2328OSPFVersion2April1998
KeyID
Thisfieldidentifiesthealgorithmandsecretkeyusedto
createthemessagedigestappendedtotheOSPFpacket.Key
Identifiersareuniqueperinterface(orequivalently,per
subnet).
AuthDataLen
Thelengthinbytesofthemessagedigestappendedtothe
OSPFpacket.
Cryptographicsequencenumber
Anunsigned32bitnondecreasingsequencenumber.Usedto
guardagainstreplayattacks.
ThemessagedigestappendedtotheOSPFpacketisnotactually
consideredpartoftheOSPFprotocolpacket:themessagedigest
isnotincludedintheOSPFheader'spacketlength,althoughit
isincludedinthepacket'sIPheaderlengthfield.
EachkeyisidentifiedbythecombinationofinterfaceandKey
ID.Aninterfacemayhavemultiplekeysactiveatanyonetime.
Thisenablessmoothtransitionfromonekeytoanother.Eachkey
hasfourtimeconstantsassociatedwithit.Thesetimeconstants
canbeexpressedintermsofatimeofdayclock,orintermsof
arouter'slocalclock(e.g.,numberofsecondssincelast
reboot):
KeyStartAccept
Thetimethattherouterwillstartacceptingpacketsthat
havebeencreatedwiththegivenkey.
KeyStartGenerate
Thetimethattherouterwillstartusingthekeyforpacket
generation.
KeyStopGenerate
Thetimethattherouterwillstopusingthekeyforpacket
generation.
KeyStopAccept
Thetimethattherouterwillstopacceptingpacketsthat
havebeencreatedwiththegivenkey.

MoyStandardsTrack[Page230]
RFC2328OSPFVersion2April1998

https://www.ietf.org/rfc/rfc2328.txt

177/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

Inordertoachievesmoothkeytransition,KeyStartAcceptshould
belessthanKeyStartGenerateandKeyStopGenerateshouldbeless
thanKeyStopAccept.IfKeyStopGenerateandKeyStopAcceptare
leftunspecified,thekey'slifetimeisinfinite.Whenanewkey
replacesanold,theKeyStartGeneratetimeforthenewkeymust
belessthanorequaltotheKeyStopGeneratetimeoftheold
key.
Keystorageshouldpersistacrossasystemrestart,warmor
cold,toavoidoperationalissues.Intheeventthatthelast
keyassociatedwithaninterfaceexpires,itisunacceptableto
reverttoanunauthenticatedcondition,andnotadvisableto
disruptrouting.Therefore,theroutershouldsenda"last
authenticationkeyexpiration"notificationtothenetwork
managerandtreatthekeyashavinganinfinitelifetimeuntil
thelifetimeisextended,thekeyisdeletedbynetwork
management,oranewkeyisconfigured.
D.4Messagegeneration
AfterbuildingthecontentsofanOSPFpacket,the
authenticationprocedureindicatedbythesendinginterface's
Autypevalueiscalledbeforethepacketissent.The
authenticationproceduremodifiestheOSPFpacketasfollows.
D.4.1GeneratingNullauthentication
WhenusingNullauthentication,thepacketismodifiedas
follows:
(1)TheAutypefieldinthestandardOSPFheaderissetto
0.
(2)ThechecksumfieldinthestandardOSPFheaderissetto
thestandardIPchecksumoftheentirecontentsofthe
packet,startingwiththeOSPFpacketheaderbut
excludingthe64bitauthenticationfield.This
checksumiscalculatedasthe16bitone'scomplementof
theone'scomplementsumofallthe16bitwordsinthe
packet,exceptingtheauthenticationfield.Ifthe

MoyStandardsTrack[Page231]
RFC2328OSPFVersion2April1998
packet'slengthisnotanintegralnumberof16bit
words,thepacketispaddedwithabyteofzerobefore
checksumming.
D.4.2GeneratingSimplepasswordauthentication
WhenusingSimplepasswordauthentication,thepacketis
modifiedasfollows:
(1)TheAutypefieldinthestandardOSPFheaderissetto
1.
(2)ThechecksumfieldinthestandardOSPFheaderissetto
thestandardIPchecksumoftheentirecontentsofthe
packet,startingwiththeOSPFpacketheaderbut
https://www.ietf.org/rfc/rfc2328.txt

178/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

excludingthe64bitauthenticationfield.This
checksumiscalculatedasthe16bitone'scomplementof
theone'scomplementsumofallthe16bitwordsinthe
packet,exceptingtheauthenticationfield.Ifthe
packet'slengthisnotanintegralnumberof16bit
words,thepacketispaddedwithabyteofzerobefore
checksumming.
(3)The64bitauthenticationfieldintheOSPFpacket
headerissettothe64bitpassword(i.e.,
authenticationkey)thathasbeenconfiguredforthe
interface.
D.4.3GeneratingCryptographicauthentication
WhenusingCryptographicauthentication,theremaybe
multiplekeysconfiguredfortheinterface.Inthiscase,
amongthekeysthatarevalidformessagegeneration(i.e,
thathaveKeyStartGenerate<=currenttime<
KeyStopGenerate)choosetheonewiththemostrecent
KeyStartGeneratetime.Usingthiskey,modifythepacketas
follows:
(1)TheAutypefieldinthestandardOSPFheaderissetto
2.

MoyStandardsTrack[Page232]
RFC2328OSPFVersion2April1998
(2)ThechecksumfieldinthestandardOSPFheaderisnot
calculated,butisinsteadsetto0.
(3)TheKeyID(seeFigure18)issettothechosenkey's
KeyID.
(4)TheAuthDataLenfieldissettothelengthinbytesof
themessagedigestthatwillbeappendedtotheOSPF
packet.WhenusingMD5astheauthenticationalgorithm,
AuthDataLenwillbe16.
(5)The32bitCryptographicsequencenumber(seeFigure18)
issettoanondecreasingvalue(i.e.,avalueatleast
aslargeasthelastvaluesentouttheinterface).The
precisevaluestouseinthecryptographicsequence
numberfieldareimplementationspecific.Forexample,
itmaybebasedonasimplecounter,orbebasedonthe
system'sclock.
(6)Themessagedigestisthencalculatedandappendedto
theOSPFpacket.Theauthenticationalgorithmtobe
usedincalculatingthedigestisindicatedbythekey
itself.Inputtotheauthenticationalgorithmconsists
oftheOSPFpacketandthesecretkey.WhenusingMD5as
theauthenticationalgorithm,themessagedigest
calculationproceedsasfollows:
(a)The16byteMD5keyisappendedtotheOSPFpacket.
(b)Trailingpadandlengthfieldsareadded,as
https://www.ietf.org/rfc/rfc2328.txt

179/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

specifiedin[Ref17].
(c)TheMD5authenticationalgorithmisrunoverthe
concatenationoftheOSPFpacket,secretkey,pad
andlengthfields,producinga16bytemessage
digest(see[Ref17]).
(d)TheMD5digestiswrittenovertheOSPFkey(i.e.,
appendedtotheoriginalOSPFpacket).Thedigestis
notcountedintheOSPFpacket'slengthfield,but

MoyStandardsTrack[Page233]
RFC2328OSPFVersion2April1998
isincludedinthepacket'sIPlengthfield.Any
trailingpadorlengthfieldsbeyondthedigestare
notcountedortransmitted.
D.5Messageverification
WhenanOSPFpackethasbeenreceivedonaninterface,itmust
beauthenticated.Theauthenticationprocedureisindicatedby
thesettingofAutypeinthestandardOSPFpacketheader,which
matchesthesettingofAutypeforthereceivingOSPFinterface.
IfanOSPFprotocolpacketisacceptedasauthentic,processing
ofthepacketcontinuesasspecifiedinSection8.2.Packets
whichfailauthenticationarediscarded.
D.5.1VerifyingNullauthentication
WhenusingNullauthentication,thechecksumfieldinthe
OSPFheadermustbeverified.Itmustbesettothe16bit
one'scomplementoftheone'scomplementsumofallthe16
bitwordsinthepacket,exceptingtheauthenticationfield.
(Ifthepacket'slengthisnotanintegralnumberof16bit
words,thepacketispaddedwithabyteofzerobefore
checksumming.)
D.5.2VerifyingSimplepasswordauthentication
WhenusingSimplepasswordauthentication,thereceivedOSPF
packetisauthenticatedasfollows:
(1)ThechecksumfieldintheOSPFheadermustbeverified.
Itmustbesettothe16bitone'scomplementofthe
one'scomplementsumofallthe16bitwordsinthe
packet,exceptingtheauthenticationfield.(Ifthe
packet'slengthisnotanintegralnumberof16bit
words,thepacketispaddedwithabyteofzerobefore
checksumming.)
(2)The64bitauthenticationfieldintheOSPFpacket
headermustbeequaltothe64bitpassword(i.e.,
authenticationkey)thathasbeenconfiguredforthe
interface.

https://www.ietf.org/rfc/rfc2328.txt

180/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page234]
RFC2328OSPFVersion2April1998
D.5.3VerifyingCryptographicauthentication
WhenusingCryptographicauthentication,thereceivedOSPF
packetisauthenticatedasfollows:
(1)Locatethereceivinginterface'sconfiguredkeyhaving
KeyIDequaltothatspecifiedinthereceivedOSPF
packet(seeFigure18).Ifthekeyisnotfound,orif
thekeyisnotvalidforreception(i.e.,currenttime<
KeyStartAcceptorcurrenttime>=KeyStopAccept),the
OSPFpacketisdiscarded.
(2)IfthecryptographicsequencenumberfoundintheOSPF
header(seeFigure18)islessthanthecryptographic
sequencenumberrecordedinthesendingneighbor'sdata
structure,theOSPFpacketisdiscarded.
(3)Verifytheappendedmessagedigestinthefollowing
steps:
(a)Thereceiveddigestissetaside.
(b)Anewdigestiscalculated,asspecifiedinStep6
ofSectionD.4.3.
(c)Thecalculatedandreceiveddigestsarecompared.If
theydonotmatch,theOSPFpacketisdiscarded.If
theydomatch,theOSPFprotocolpacketisaccepted
asauthentic,andthe"cryptographicsequence
number"intheneighbor'sdatastructureissetto
thesequencenumberfoundinthepacket'sOSPF
header.

MoyStandardsTrack[Page235]
RFC2328OSPFVersion2April1998
E.AnalgorithmforassigningLinkStateIDs
TheLinkStateIDinASexternalLSAsandsummaryLSAsisusually
settothedescribednetwork'sIPaddress.However,ifnecessaryone
ormoreofthenetwork'shostbitsmaybesetintheLinkStateID.
ThisallowstheroutertooriginateseparateLSAsfornetworks
havingthesameaddress,yetdifferentmasks.Suchnetworkscan
occurinthepresenceofsupernettingandsubnet0s(see[Ref10]).
Thisappendixgivesonepossiblealgorithmforsettingthehostbits
https://www.ietf.org/rfc/rfc2328.txt

181/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

inLinkStateIDs.Thechoiceofsuchanalgorithmisalocal
decision.Separateroutersarefreetousedifferentalgorithms,
sincetheonlyLSAsaffectedaretheonesthattherouteritself
originates.Theonlyrequirementonthealgorithmsusedisthatthe
network'sIPaddressshouldbeusedastheLinkStateIDwhenever
possible;thismaximizesinteroperabilitywithOSPFimplementations
predatingRFC1583.
ThealgorithmbelowisstatedforASexternalLSAs.Thisisonly
forclarity;theexactsamealgorithmcanbeusedforsummaryLSAs.
SupposethattherouterwishestooriginateanASexternalLSAfora
networkhavingaddressNAandmaskNM1.Thefollowingstepsarethen
usedtodeterminetheLSA'sLinkStateID:
(1)DeterminewhethertherouterisalreadyoriginatinganAS
externalLSAwithLinkStateIDequaltoNA(insuchanLSAthe
routeritselfwillbelistedastheLSA'sAdvertisingRouter).
Ifnot,theLinkStateIDissetequaltoNAandthealgorithm
terminates.Otherwise,
(2)Obtainthenetworkmaskfromthebodyofthealreadyexisting
ASexternalLSA.CallthismaskNM2.Therearethentwocases:
oNM1islonger(i.e.,morespecific)thanNM2.Inthiscase,
settheLinkStateIDinthenewLSAtobethenetwork
[NA,NM1]withallthehostbitsset(i.e.,equaltoNAor'ed
togetherwithallthebitsthatarenotsetinNM1,whichis
network[NA,NM1]'sbroadcastaddress).
oNM2islongerthanNM1.Inthiscase,changetheexisting
LSA(havingLinkStateIDofNA)toreferencethenew
network[NA,NM1]byincrementingthesequencenumber,

MoyStandardsTrack[Page236]
RFC2328OSPFVersion2April1998
changingthemaskinthebodytoNM1andinsertingthecost
ofthenewnetwork.ThenoriginateanewLSAfortheold
network[NA,NM2],withLinkStateIDequaltoNAor'ed
togetherwiththebitsthatarenotsetinNM2(i.e.,
network[NA,NM2]'sbroadcastaddress).
Theabovealgorithmassumesthatallmasksarecontiguous;this
ensuresthatwhentwonetworkshavethesameaddress,onemaskis
morespecificthantheother.Thealgorithmalsoassumesthatno
networkexistshavinganaddressequaltoanothernetwork's
broadcastaddress.Giventhesetwoassumptions,theabovealgorithm
alwaysproducesuniqueLinkStateIDs.Theabovealgorithmcanalso
berewordedasfollows:WhenoriginatinganASexternalLSA,tryto
usethenetworknumberastheLinkStateID.Ifthatproducesa
conflict,examinethetwonetworksinconflict.Onewillbeasubset
oftheother.Forthelessspecificnetwork,usethenetworknumber
astheLinkStateIDandforthemorespecificusethenetwork's
broadcastaddressinstead(i.e.,flipallthe"host"bitsto1).If
themostspecificnetworkwasoriginatedfirst,thiswillcauseyou
tooriginatetwoLSAsatonce.
Asanexampleofthealgorithm,consideritsoperationwhenthe
followingsequenceofeventsoccursinasinglerouter(RouterA).

https://www.ietf.org/rfc/rfc2328.txt

182/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

(1)RouterAwantstooriginateanASexternalLSAfor
[10.0.0.0,255.255.255.0]:
(a)ALinkStateIDof10.0.0.0isused.
(2)RouterAthenwantstooriginateanASexternalLSAfor
[10.0.0.0,255.255.0.0]:
(a)TheLSAfor[10.0.0,0,255.255.255.0]isreoriginatedusinga
newLinkStateIDof10.0.0.255.
(b)ALinkStateIDof10.0.0.0isusedfor
[10.0.0.0,255.255.0.0].
(3)RouterAthenwantstooriginateanASexternalLSAfor
[10.0.0.0,255.0.0.0]:

MoyStandardsTrack[Page237]
RFC2328OSPFVersion2April1998
(a)TheLSAfor[10.0.0.0,255.255.0.0]isreoriginatedusinga
newLinkStateIDof10.0.255.255.
(b)ALinkStateIDof10.0.0.0isusedfor
[10.0.0.0,255.0.0.0].
(c)Thenetwork[10.0.0.0,255.255.255.0]keepsitsLinkStateID
of10.0.0.255.

https://www.ietf.org/rfc/rfc2328.txt

183/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page238]
RFC2328OSPFVersion2April1998
F.Multipleinterfacestothesamenetwork/subnet
Thereareatleasttwowaystosupportmultiplephysicalinterfaces
tothesameIPsubnet.Bothmethodswillinteroperatewith
implementationsofRFC1583(andofcoursethismemo).Thetwo
methodsaresketchedbrieflybelow.Anassumptionhasbeenmadethat
eachinterfacehasbeenassignedaseparateIPaddress(otherwise,
supportformultipleinterfacesismoreofalinklevelorARPissue
thananOSPFissue).
Method1:
RuntheentireOSPFfunctionalityoverbothinterfaces,sending
andreceivinghellos,flooding,supportingseparateinterface
andneighborFSMsforeachinterface,etc.Whendoingthisall
otherroutersonthesubnetwilltreatthetwointerfacesas
separateneighbors,sinceneighborsareidentified(onbroadcast
andNBMAnetworks)bytheirIPaddress.
Method1hasthefollowingdisadvantages:
(1)Youincreasethetotalnumberofneighborsandadjacencies.
(2)Youlosethebidirectionalitytestonbothinterfaces,since
bidirectionalityisbasedonRouterID.
(3)Youhavetoconsiderbothinterfacestogetherduringthe
DesignatedRouterelection,sinceifyoudeclarebothtobe
DRsimultaneouslyyoucanconfusethetiebreaker(whichis
RouterID).
Method2:
RunOSPFoveronlyoneinterface(callittheprimary
interface),butincludeboththeprimaryandsecondary
interfacesinyourRouterLSA.
Method2hasthefollowingdisadvantages:
(1)Youlosethebidirectionalitytestonthesecondary
interface.
(2)Whentheprimaryinterfacefails,youneedtopromotethe
secondaryinterfacetoprimarystatus.

MoyStandardsTrack[Page239]
RFC2328OSPFVersion2April1998
G.DifferencesfromRFC2178
ThissectiondocumentsthedifferencesbetweenthismemoandRFC
2178.Alldifferencesarebackwardcompatible.Implementationsof
thismemoandofRFCs2178,1583,and1247willinteroperate.
https://www.ietf.org/rfc/rfc2328.txt

184/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

G.1Floodingmodifications
Threechangeshavebeenmadetothefloodingprocedurein
Section13.
Thefirstchangeistostep4inSection13.NowMaxAgeLSAsare
acknowledgedandthendiscardedonlywhenbotha)thereisno
databasecopyoftheLSAandb)noneofrouter'sneighborsare
instatesExchangeorLoading.Inallothercases,theMaxAge
LSAisprocessedlikeanyotherLSA,installingtheLSAinthe
databaseandfloodingitouttheappropriateinterfaceswhenthe
LSAismorerecentthanthedatabasecopy(Step5ofSection
13).ThischangealsoaffectsthecontentsofTable19.
Thesecondchangeistostep5ainSection13.TheMinLSArrival
checkismeantonlyforLSAsreceivedduringflooding,and
shouldnotbeperformedonthoseLSAsthattherouteritself
originates.
Thethirdchangeistostep8inSection13.Confusionbetween
routersastowhichLSAinstanceismorerecentcancausea
disastrousamountoffloodinginalinkstateprotocol(see
[Ref26]).OSPFguardsagainstthisproblemintwoways:a)the
LSagefieldisusedlikeaTTLfieldinflooding,toeventually
removeloopingLSAsfromthenetwork(seeSection13.3),andb)
routersrefusetoacceptLSAupdatesmorefrequentlythanonce
everyMinLSArrivalseconds(seeSection13).However,thereis
stillonecaseinRFC2178wheredisagreementsregardingwhich
LSAismorerecentcancausealotoffloodingtraffic:
respondingtooldLSAsbyrefloodingthedatabasecopy.For
thisreason,Step8ofSection13hasbeenamendedtoonly
respondwiththedatabasecopywhenthatcopyhasnotbeensent
inanyLinkStateUpdatewithinthelastMinLSArrivalseconds.

MoyStandardsTrack[Page240]
RFC2328OSPFVersion2April1998
G.2Changestoexternalpathpreferences
ThereisstillthepossibilityofaroutingloopinRFC2178
whenbotha)virtuallinksareinuseandb)thesameexternal
routeisbeingimportedbymultipleASBRs,eachofwhichisina
separatearea.Tofixthisproblem,Section16.4.1hasbeen
revised.TochoosethecorrectASBR/forwardingaddress,intra
areapathsthroughnonbackboneareasarealwayspreferred.
However,intraareapathsthroughthebackbonearea(Area0)and
interareapathsarenowofequalpreference,andmustbe
comparedsolelybasedoncost.
Thereasoningbehindthischangeisasfollows.Whenvirtual
linksareinuse,anintraareabackbonepathforoneroutercan
turnintoaninterareapathinarouterseveralhopscloserto
thedestination.Hence,intraareabackbonepathsandinterarea
pathsmustbeofequalpreference.Wecansafelycomparetheir
costs,preferringthepathwiththesmallestcost,duetothe
calculationsinSection16.3.
https://www.ietf.org/rfc/rfc2328.txt

185/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

ThankstoMichaelBriggsandJeremyMcCooeyoftheUNH
InterOperabilityLabforpointingoutthisproblem.
G.3Incompleteresolutionofvirtualnexthops
OneofthefunctionsofthecalculationinSection16.3isto
determinetheactualnexthop(s)forthosedestinationswhose
nexthopwascalculatedasavirtuallinkinSections16.1and
16.2.AftercompletionofthecalculationinSection16.3,any
pathscalculatedinSections16.1and16.2thatstillhave
unresolvedvirtualnexthopsshouldbediscarded.
G.4Routingtablelookup
TheroutingtablelookupalgorithminSection11.1hasbeen
modifiedtoreflectcurrentpractice.The"bestmatch"routing
tableentryisnowalwaysselectedtobetheoneprovidingthe
mostspecific(longest)match.Supposeforexamplearouteris
forwardingpacketstothedestination192.9.1.1.Aroutingtable
entryfor192.9.1/24willalwaysbeabettermatchthanthe
routingtableentryfor192.9/16,regardlessoftherouting
tableentries'pathtypes.Notehoweverthatwhenmultiplepaths

MoyStandardsTrack[Page241]
RFC2328OSPFVersion2April1998
areavailableforagivenroutingtableentry,thecalculations
inSections16.1,16.2,and16.4alwaysyieldthepathshaving
themostpreferentialpathtype.(Intraareapathsarethemost
preferred,followedinorderbyinterarea,type1externaland
type2externalpaths;seeSection11).

https://www.ietf.org/rfc/rfc2328.txt

186/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

MoyStandardsTrack[Page242]
RFC2328OSPFVersion2April1998
SecurityConsiderations
AllOSPFprotocolexchangesareauthenticated.OSPFsupports
multipletypesofauthentication;thetypeofauthenticationinuse
canbeconfiguredonapernetworksegmentbasis.OneofOSPF's
authenticationtypes,namelytheCryptographicauthentication
option,isbelievedtobesecureagainstpassiveattacksandprovide
significantprotectionagainstactiveattacks.Whenusingthe
Cryptographicauthenticationoption,eachrouterappendsa"message
digest"toitstransmittedOSPFpackets.Receiversthenusethe
sharedsecretkeyandreceiveddigesttoverifythateachreceived
OSPFpacketisauthentic.
ThequalityofthesecurityprovidedbytheCryptographic
authenticationoptiondependscompletelyonthestrengthofthe
messagedigestalgorithm(MD5iscurrentlytheonlymessagedigest
algorithmspecified),thestrengthofthekeybeingused,andthe
correctimplementationofthesecuritymechanisminall
communicatingOSPFimplementations.Italsorequiresthatall
partiesmaintainthesecrecyofthesharedsecretkey.
NoneoftheOSPFauthenticationtypesprovideconfidentiality.Nor
dotheyprotectagainsttrafficanalysis.Keymanagementisalsonot
addressedbythismemo.
Formoreinformation,seeSections8.1,8.2,andAppendixD.
Author'sAddress
JohnMoy
AscendCommunications,Inc.
1RobbinsRoad
Westford,MA01886
Phone:9789521367
Fax:9783922075
EMail:jmoy@casc.com

MoyStandardsTrack[Page243]
RFC2328OSPFVersion2April1998

https://www.ietf.org/rfc/rfc2328.txt

187/188

3/2/2015

https://www.ietf.org/rfc/rfc2328.txt

FullCopyrightStatement
Copyright(C)TheInternetSociety(1998).AllRightsReserved.
Thisdocumentandtranslationsofitmaybecopiedandfurnishedto
others,andderivativeworksthatcommentonorotherwiseexplainit
orassistinitsimplementationmaybeprepared,copied,published
anddistributed,inwholeorinpart,withoutrestrictionofany
kind,providedthattheabovecopyrightnoticeandthisparagraph
areincludedonallsuchcopiesandderivativeworks.However,this
documentitselfmaynotbemodifiedinanyway,suchasbyremoving
thecopyrightnoticeorreferencestotheInternetSocietyorother
Internetorganizations,exceptasneededforthepurposeof
developingInternetstandardsinwhichcasetheproceduresfor
copyrightsdefinedintheInternetStandardsprocessmustbe
followed,orasrequiredtotranslateitintolanguagesotherthan
English.
Thelimitedpermissionsgrantedaboveareperpetualandwillnotbe
revokedbytheInternetSocietyoritssuccessorsorassigns.
Thisdocumentandtheinformationcontainedhereinisprovidedonan
"ASIS"basisandTHEINTERNETSOCIETYANDTHEINTERNETENGINEERING
TASKFORCEDISCLAIMSALLWARRANTIES,EXPRESSORIMPLIED,INCLUDING
BUTNOTLIMITEDTOANYWARRANTYTHATTHEUSEOFTHEINFORMATION
HEREINWILLNOTINFRINGEANYRIGHTSORANYIMPLIEDWARRANTIESOF
MERCHANTABILITYORFITNESSFORAPARTICULARPURPOSE.

MoyStandardsTrack[Page244]

https://www.ietf.org/rfc/rfc2328.txt

188/188

Das könnte Ihnen auch gefallen