Определение
OSPFroutingprotocolisatypicallink-stateroutingprotocol,generallyusedinthesameroutingdomain.Here,theroutingdomainreferstoanautonomoussystem(AutonomousSystem),orAS,whichreferstoagroupofnetworksthatexchangeroutinginformationwitheachotherthroughaunifiedroutingpolicyorroutingprotocol.InthisAS,allOSPFroutersmaintainthesamedatabasedescribingthestructureofthisAS.Thedatabasestoresthestatusinformationofthecorrespondinglinksintheroutingdomain.OSPFroutersusethisdatabasetocalculateitsOSPFroutingtable.of.
Asalinkstateroutingprotocol,OSPFtransmitslinkstatemulticastdataLSA(LinkStateAdvertisement)toallroutersinacertainarea,whichisdifferentfromthedistancevectorroutingprotocol.Therouterrunningthedistancevectorroutingprotocolpassespartoralloftheroutingtabletoitsneighboringrouters.
Intermsofthesecurityofinformationexchange,OSPFstipulatesthatanyinformationexchangebetweenrouterscanbeauthenticatedorauthenticatedwhennecessary,toensurethatonlytrustedrouterscantransmitoptions.Roadinformation.OSPFsupportsmultipleauthenticationmechanismsandallowsdifferentauthenticationmechanismstobeusedbetweenareas.OSPFoptimizestheapplicationoflinkstatealgorithmsinbroadcastnetworks(suchasEthernet)inordertousehardwarebroadcastcapabilitiesasmuchaspossibletotransmitlinkstatemessages.Usuallyanodeinthetopologydiagramofalinkstatealgorithmrepresentsarouter.IfKroutersareallconnectedtotheEthernet,whenthelinkstateisbroadcast,thenumberofpacketsabouttheseKrouterswillreachthesquareofK.Forthisreason,OSPFallowsanodetorepresentabroadcastnetworkinthetopologydiagram.Allroutersoneachbroadcastnetworksendlinkstatusmessagestoreportthelinkstatusoftheroutersinthenetwork.
Как работи
OSPFsimplymeansthattwoadjacentroutersbecomeneighborsintheformofsendingmessages,andtheneighborsthensendlinkstateinformationtoeachothertoformanadjacency,andthenEachcalculatestherouteaccordingtotheshortestpathalgorithm,putsitintheOSPFroutingtable,andcomparestheOSPFroutewithotherroutesandaddsittotheglobalroutingtable.Thewholeprocessusesfivetypesofmessages,threestages,andfourtables.
Пет вида съобщения
Hellomessage:establishandmaintainneighborrelationships.
DBDmessage: Изпратете информация за заглавката на състоянието на връзката.
LSRmessage:SendthelinkstateheaderinformationneededfromDBDtoneighbors,requestingcompleteinformation.
LSUmessage:SendthecompleteinformationcorrespondingtotheheaderinformationoftheLSRrequesttotheneighbor.
LSACK:AcknowledgethemessageafterreceivingtheLSUmessage.
Три етапа
Neighbordiscovery:TheneighborrelationshipisformedbysendingHellomessages.
Routeannouncement:Neighborssendlinkstateinformationtoformanadjacencyrelationship.
Routingcalculation:Calculatetheroutingtablebasedontheshortestpathalgorithm.
Четири маси
Neighbortable:Themainrecordformstheneighborrelationshiprouter.
Linkstatedatabase: Recordlinkstateinformation.
OSPFroutingtable:извлечено отбазата данниstatedlink.
Globalroutingtable:OSPFroutingiscomparedwithothers.
Работен процес
(1) Knowitsownlink
Eachrouterknowsitsownlink,thatis,thenetworkdirectlyconnectedtoit.
(2) Търсене на съседи
DifferentfromRIP,afterOSPFprotocolruns,itdoesnotbroadcastroutinginformationtothenetworkimmediately,butfirstsearchesforthelinkstatusthatcanbeexchangedwithitselfinthenetworkInformationperipheralrouter.Routersthatcanexchangelinkstateinformationareneighborstoeachother.
(3)Createalinkstateddatapacket
Oncetherouterhasestablishedaneighborrelationship,itcancreatealinkstatedatapacket.
(4)Предаване на информация за състоянието на връзката
TherouterfloodstheLSAdescribingthelinkstatetoneighbors,andfinallyformsalinkstatedatabasecontainingcompletenetworklinkstateinformation.
(5) Изчисляване на маршрути
EachrouterintheroutingareacanusetheSPFalgorithmtoindependentlycalculateroutes.
Основното предимство на протокола OSPF
(1)OSPFissuitableforawiderangeofnetworks:ThereisnolimitonthenumberofhopsforroutingintheOSPFprotocol,sotheOSPFprotocolcanbeusedinInmanyoccasions,italsosupportsawidernetworkscale.Aslongasitisinamulticastnetwork,theOSPFprotocolcansupportdozensofrouterstoworktogether.
(2)Multicast-triggeredupdate:AftertheconvergenceoftheOSPFprotocoliscompleted,itwillsendtopologychangeinformationtootherroutersinatriggeredmanner,whichcanreducetheutilizationofnetworkbandwidth;atthesametime,itcanreduceSmallinterference,especiallywhenusingthemulticastnetworkstructure,whensendingoutinformation,itdoesnotcauseothereffectsonotherdevices
(3)Fastconvergencespeed:Ifthenetworkstructurechanges,theOSPFprotocolsystemwillSendoutnewpacketsasquicklyaspossible,sothatthenewtopologywillquicklyspreadtotheentirenetwork;moreover,OSPFusesshort-periodHELLOpacketstomaintainneighborstatus.
(4)Takethecostasthemetricvalue:WhentheOSPFprotocolisdesigned,theinfluenceofthelinkbandwidthontheroutemetricvalueisconsidered.TheOSPFprotocolusesthecostvalueasthestandard,andlinkcostandlinkbandwidthhaveaninverserelationship.Thehigherthebandwidth,thelowerthecost.Inthisway,OSPFroutingismainlybasedonbandwidthfactors.
(5)TheOSPFprotocolisdesignedtoavoidroutingloops:Undertheshortestpathalgorithm,thelinkstateintherouteisreceived,andthenthepathisgenerated,sothatnoloopwilloccur.
(6)Extensiveapplication:ItiswidelyusedontheInternet,andtherearealotofapplicationexamplesinothers.ProvethatthisisoneofthemostwidelyusedIGPs.
OSPFarea
ThepurposeofdividingtheareainOSPFistocontroltherangeoflinkstateinformationLSAflooding,reducethesizeofthelinkstatedatabaseLSDB,andimprovethescalabilityofthenetworkToachieverapidconvergence.
Whenthenetworkcontainsmultipleareas,theOSPFprotocolhasspecialregulations,thatis,theremustbeanArea0,whichisusuallycalledthebackbonearea(BackboneArea).WhendesigninganOSPFnetwork,oneisverygood.Themethodistostartfromthebackboneareaandthenexpandtootherareas.Thebackboneareaisatthecenterofallotherareas,thatis,allareasmustbephysicallyorlogicallyconnectedtothebackbonearea.ThereasonforthisdesignideaisthattheOSPFprotocolmustimporttheroutinginformationofallareasintothebackbonearea,andthentheroutinginformationfromThebackboneareaisdistributedtootherareas.
OSPF разделя областите на няколко вида.
Backbonearea:Asacentralentity,otherareasareconnectedtoit.Thenumberofthebackboneareais0.Inthisarea,alltypesofLSAsareallowedtobeissued.
Standardarea:Thedefaultareatypeexceptthebackbonearea.Inthistypeofarea,alltypesofLSAsareallowedtobepublished.
Stubarea:STUBarea.ThistypeofareadoesnotacceptroutinginformationaboutASoutside,thatis,itdoesnotaccepttype5ASexternalLSAs.Whenroutingtothenetworkoutsidetheautonomoussystem,therouterusesthelackForprovincialrouting(0.0.0.0),thestubareacannotcontaintheautonomoussystemborderrouterASBR.
Completelystubarea:ThistypeofareadoesnotacceptroutinginformationabouttheoutsideoftheAS,anddoesnotacceptsummaryroutesfromotherareasintheAS,thatis,type3,type4,andtype5LSAsarenotaccepted,ThecompletelystubareacannotcontaintheautonomoussystemborderrouterASBR.