BGP文档格式.docx
- 文档编号:17534302
- 上传时间:2022-12-07
- 格式:DOCX
- 页数:19
- 大小:167.79KB
BGP文档格式.docx
《BGP文档格式.docx》由会员分享,可在线阅读,更多相关《BGP文档格式.docx(19页珍藏版)》请在冰豆网上搜索。
ConnectIntheConnectstate,thelocalrouteriswaitingfortheTCPsessiontobecompleted.Ifitissuccessful,thelocalroutersendsanOpenmessagetothepeerandtransitionstotheOpenSentstate.
ShouldtheTCPconnectionattemptfail,thelocalrouterresetstheConnectRetrytimerandtransitionstotheActivestate.
IftheConnectRetrytimerreaches0whilethelocalrouterisintheConnectstate,thetimerisresetandanotherconnectionattemptismade.ThelocalrouterremainsintheConnectstate.
ActiveIntheActivestate,thelocalrouteristryingtoinitiateaTCPsessionwithitspeer.Ifthesessionestablishessuccessfully,anOpenmessageissentandthelocalroutertransitionstotheOpenSentstate.IftheTCPsessionfailstoestablish,thelocalrouterinitiatesanothersession,setstheConnectRetrytimerto0,andtransitionsbacktotheConnectstate.
AttemptsbytheremoteroutertoconnectfromanunexpectedIPaddressforthesessioncausesthelocalroutertorefusetheconnection.ThelocalrouterremainsintheActivestateandresetstheConnectRetrytimer.
OpenSentTheOpenSentstateisreacheduponasuccessfulTCPestablishment.ThelocalroutersendsaBGPOpenmessageandwaitsforanOpenmessagefromtheremotepeer.
WhenavalidOpenmessageisreceived,thelocalrouterbeginstosendKeepalivemessagestotheremoterouter.TheBGPpeersnegotiatethesessionparametersandthelocalroutertransitionstotheOpenConfirmstate.
ShouldaTCPdisconnectbereceivedwhileinthisstate,thelocalrouterterminatestheBGPsession,resetstheConnectRetrytimer,andtransitionsbacktotheActivestate.
OpenConfirmWhenthelocalrouterreceivesavalidOpenmessagefromtheremotepeer,theOpenConfirmstateisreached.ThelocalroutersendsKeepalivemessagestothepeerandwaitsforaKeepalivemessageinreturn.
EstablishedTheEstablishedstateisachievedwhenaKeepalivemessageisreceivedwhileintheOpenConfirmstate.Thisisthefinalstateofapeerrelationshipanddesignatesafullyoperationalconnection.
TwoBGPpeerscanexchangeroutinginformationonlywhentheEstablishedstateisreached.AllotherBGPpeeringstatesdesignateanonfunctionalsession.
2.BGPCommonMessagesHeader
Intheprevioussection,wediscussedsomeBGPmessagetypesthatwereexchangedbetweentwopeers.Intotal,BGPdefinesfourmessagestypes:
Open,Update,Notification,andKeepalive.
Eachmessagecontainsa19-octetfixed-sizeheader:
Marker(16octets)Thisfieldissettoall1stodetectalossofsynchronization.AnOpenmessagewithauthenticationconfiguredcontainstheauthenticationdataforthesession.
Length(2octets)ThetotallengthoftheBGPmessageisencodedinthisfield.Possiblevaluesrangefrom19to4096.
Type(1octet)ThetypeofBGPmessageislocatedinthisfield.Fourtypecodeshavebeendefined:
◆1foranOpenmessage
◆2foranUpdatemessage
◆3foraNotificationmessage
◆4foraKeepalivemessage
3.TheOpenMessage
TheOpenmessageisthefirstpacketBGPsendstoapeeraftertheTCPconnectionhasbeenestablished.Itallowsthetwopeerstonegotiatetheparametersofthepeersession.TheseparametersincludetheBGPversion,theholdtimeforthesession,authenticationdata,refreshcapabilities,andsupportformultipleNetworkLayerReachabilityInformation(NLRI).
ThemessageformatisshowninFigure8.7.AfterthecommonBGPheader,theremainingfieldsincludethefollowing:
Version(1octet)Thisfieldcontainsthecurrentversionofthepeer.Thedefaultvalueis4andissetautomatically.
LocalAutonomousSystem(2octets)Thesender’sASvalueisencodedinthisfield.
HoldTime(2octets)Thesenderplacesitsproposedhold-timevaluehere,andthetwopeersnegotiatethisvaluetothelowerofthetwoproposals.ThedefaultvaluefortheJUNOSsoftwareis90seconds,withapossiblerangebetween6and65,535seconds.
Eachpeerdividesthenegotiatedholdtimeby3tocalculatetheKeepalivetimerforthesession.
BGPIdentifier(4octets)ThelocalRouterIDofthepeerisencodedinthisfield.Thisuniquelyidentifiestheroutertothenetwork.
OptionalParametersLength(1octet)ThisfieldspecifiesthetotallengthoftheOptionalParametersfield.Avalueof0indicatesthatnoparametersareincludedinthemessage.
OptionalParameters(Variable)Thisvariable-lengthfieldencodesanyoptionalparametersusedbythelocalpeer.Possibilitiesincludesupportforrouterefresh,authentication,andvariousNLRI.Eachparameterisencodedina(Type,Length,Value)triple.Theparameter’stypeandlengthfieldsare1octeteachandarefollowedbyavariable-lengthvaluefield.
4.TheUpdateMessage
RoutinginformationissentandwithdrawninBGPusingtheUpdatemessage.Ifneeded,eachmessagecontainsinformationpreviouslyadvertisedbythelocalrouterthatisnolongervalid.Thesamemessagemayalsocontainnewinformationadvertisedtotheremotepeer.
EachUpdatecontainsasinglesetofBGPattributesandallroutesusingthoseattributes.ThisformatreducesthetotalnumberofpacketsrouterssendbetweenBGPpeerswhenexchangingroutingknowledge.
TheabovefigureshowstheformatoftheUpdatemessage.ThefollowingfieldsfollowthecommonBGPheader:
UnfeasibleRoutesLength(2octets)ThisfieldspecifiesthelengthoftheWithdrawnRoutesfieldthatfollows.Avalueof0designatesthatnoroutesarebeingwithdrawnwiththisUpdate.
WithdrawnRoutes(Variable)Thisfieldliststheroutespreviouslyannouncedthatarenowbeingwithdrawn.Eachrouteisencodedasa(Length,Prefix)tuplewherethelengthisthenumberofbitsinthesubnetmaskandtheprefixistheIPv4NLRI.
TotalPathAttributesLength(2octets)ThisfieldspecifiesthelengthofthePathAttributesfieldthatfollows.Avalueof0designatesthatnoroutesarebeingadvertisedwiththismessage.
PathAttributes(Variable)Theattributesofthepathadvertisementarecontainedinthisfield.Eachattributeisencodedasa(Type,Length,Value)triple.
NetworkLayerReachabilityInformation(Variable)Thisfieldliststheroutesadvertisedtotheremotepeer.Eachrouteisencodedasa(Length,Prefix)tuplewherethelengthisthenumberofbitsinthesubnetmaskandtheprefixistheIPv4route.
5.TheNotificationMessage
WhenaBGPpeerdetectsanerrorwithinthesession,itsendsaNotificationmessagetotheremoterouterandimmediatelyclosesboththeBGPandTCPsessions.Theformatofthemessageisshownintheabovefigure.
InadditiontothecommonBGPheader,theNotificationmessagecontainsthefollowing:
ErrorCode(1octet)ThisfieldspecifiesthetypeofBGPerrorseenbythelocalrouter.Sixerrorcodeshavebeendefined:
◆1foraMessageHeaderError
◆2foranOpenMessageError
◆3foranUpdateMessageError
◆4forHoldTimeExpired
◆5foraFiniteStateMachineError
◆6foraCease
ErrorSubcode(1octet)Thisfieldcontainsmorespecificinformationabouttheerror.Forexample,withintheOpenMessageErrortypecode,AuthenticationFailureisapossiblesubcode.
Data(Variable)Thisfieldisusedtoassisttheadministratorintroubleshootingtheerror.Thecontentsofthefielddependonthespecificerrorcodeandsubcode.
OnecommonreasonforaNotificationmessageisinterventionbyauser.WhenyoumanuallyclearaBGPconnection,yougenerateaCease(ErrorCode6)Notificationmessageonthelocalrouter.TheBGPandTCPsessionsaretorndownandreestablished.Inaddition,aconfigurationchangethatalterstheparametersofanexistingsessionwillgenerateaCeasemessagebythelocalrouter.
6.TheKeepaliveMessage
ABGPKeepalivemessagecontainsonlythe19-octetmessageheaderandnootherdata.Thesemessagesareexchangedatone-thirdthenegotiatedhold-timevalueforthesession,ifnecessary.TheadvertisementofanUpdatemessagewithinthekeepaliveperiodresetsthetimerto0.Inshort,aKeepaliveissentonlyintheabsenceofothermessagesforaparticularsession.
ShouldthelocalrouternotreceiveaKeepaliveorUpdatemessagewithinthehold-timeperiod,aNotificationmessageofHoldTimeExpiredisgeneratedandthesessionistorndown.
7.RoutingInformationBases
EachBGProuterestablishesmemorylocationsinwhichtostoreroutingknowledge.ThesearecollectivelyknownasaRoutingInformationBase(RIB).ABGPpeermaintainsthreecategoriesofRIBs:
theAdjacency-RIB-In,theLocal-RIB,andtheAdjacency-RIB-Out.Let’sdiscusseachoftheseinfurtherdetail.
Adjacency-RIB-In
AnAdjacency-RIB-IntableiscreatedonthelocalrouterforeachestablishedBGPpeer.Allroutesreceivedfromthepeerareplacedintheappropriatememorytable.There’sonenotableexceptiontothisrule:
RoutescontaininganASPathloopareimmediatelydiscardedbythelocalrouter.
AfterreceivinganUpdatemessage,thelocalrouterimplementsanyappliedimportroutingpolicies.Thesepoliciesmayalterthevaluesofexistingattributes,addnewattributes,ordiscardspecificroutes.TherouterthenexaminesallAdjacency-RIB-Intablesforthebestpathadvertisementtoeachuniquedestination.We
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- BGP
![提示](https://static.bdocx.com/images/bang_tan.gif)