Tải bản đầy đủ - 0 (trang)
Appendix D. Border Gateway Protocol 4 Basics of Operation

Appendix D. Border Gateway Protocol 4 Basics of Operation

Tải bản đầy đủ - 0trang

APathVectorProtocol

BGPisuniqueamongallthecurrentlyusedroutingprotocolsbecauseitrelieson

informationaboutthevector(direction)toadestinationandthepathtoa

destinationtopreventroutingloops.Allothercommonlyusedroutingprotocols,

suchasOpenShortestPathFirst(OSPF),IntermediateSystem-to-Intermediate

System(IS-IS),andEnhancedIGRP(EIGRP),relyonmetricsorcostscombined

withsomeleveloftopologyinformationtopreventroutingloops.Toillustrate,

lookatFigureD-1.

FigureD-1.PathVectorExample



SupposethatRouterAoriginatesarouteto10.1.1.0/24towardRouterB.Inthe

informationonhowtoreachthisdestination,RouterAnotesthatitisthefirst

routerinthepath.RouterBreceivesthisroute,addsitselftothepath,and

advertisesthedestinationtoRouterC.RouterCaddsitselftothepathand

advertisesittoRouterD.

Therefore,whenRouterDreceivestherouteto10.1.1.0/24,itseesthepathis

throughRoutersC,B,andA.RouterDlikewiseaddsitselftothepathand

advertisesitbacktoRouterA.WhenRouterAreceivesthisadvertisement,it

seesthatitisalreadyinthepathtothisdestinationandrejectstheroute.



This,essentially,ishowBGPworksexceptinsteadofindividualroutersmarking

theroutewithsomeinformation,eachautonomoussystem(AS)inthepathmarks

theroute.Anyrouterthatreceivestheroutecanverifywhetherthepathtothis

destinationisaloopbycheckingtheautonomoussystemslistedinthepathto

seeiftheAStheyareinisalreadylisted.

LookatFigureD-2foramoreconcreteexampleofhowthisworks.

FigureD-2.AS-BasedPathVectorExample



Inthiscase,RouterAoriginatesaroutefor10.1.1.0/24towardRouterB,which,

inturn,forwardstheroutetoRouterC.Whenitadvertises10.1.1.0/24,RouterA

addsitslocalASnumbertotheASpathattributeoftheroute.

RouterCforwardstheroutetoRouterDandaddsthatAS(AS2)totheAS-path.

RouterDthenforwardstheroutetoRouterE.

WhenRouterEreceivesthisroute,itexaminestheAS-pathandseesthattheAS

itisin,AS1,isalreadyintheAS-path.Becauseofthis,RouterEassumesthat

thisadvertisementrepresentsaloop(itdoesfromanASlevelview)anddiscards

theadvertisement.



PathDecision

BecauseBGPdoesnotrelyonametrictodeterminewhetherapathislooped,

themetricsitdoesusearemorepolicybased-thatis,networkadministratorscan

usethemtosetpoliciesforrouterstoemploywhenselectingapath.

BGPadvertisesonlythebestroutetoeachofitsneighbors(unlessBGP

multipathisconfigured,whichiscoveredinChapter8,"RoutingProtocols

Security").Followingarethesemetrics,listedfrommostimportanttoleast

important:

1. Administrativeweight

2. Localpreference

3. Locallyoriginatedroutes

4. ShortestAS-path

5. Lowestorigin

6. Multipleexitdiscriminator(MED)

7. Preferexternals

8. PaththroughnearestneighborbasedonInteriorGatewayProtocol(IGP)

metric

9. PaththroughneighborwiththelowestrouterID

Thesectionsthatfollowdiscusssomeofthesemetrics.



AdministrativeWeight

Theadministrativeweightisalocallyassignedmetric,notcarriedinBGPitself.

Therefore,itimpactsonlytheBGPbestpathoperationontherouterwherethe



weightisconfigured.Theadministrativeweightisnotusedinmanysituations

withinnormalBGPdeployments.



LocalPreference

Localpreferenceisgenerallysetbyaroutemapwhenadestinationnetwork

(prefix)isadvertisedorreceivedfromaBGPpeer.Thelocalpreferenceis

advertisedwiththeprefixthroughouttheAS.

ThelocalpreferencesetsapreferredexitpointforthisdestinationfromtheAS.



ASPathLength

ThepaththathastheshortestAS-pathlengthispreferredifallfactorsthathave

moreweightthanpathlengthareequal.



MED

TheMED,ormetric,isgenerallysetusingaroutemapwhenaprefixis

advertisedtoaneighboringAS.Thisiscarriedwiththeprefixwheneveritis

advertised,throughallautonomoussystems.TheMEDisconsideredahint

aboutwhichentrypointintoanAStheadministratorwouldliketrafficforthat

destinationtouse.ItisgenerallycheckedonlyiftheAS-pathsontworoutesare

notonlyequalinlength,butareidentical.Inotherwords,theMEDsoftwo

prefixeslearnedfromdifferentneighboringautonomoussystemswouldnotbe

considered.



LowestRouterID

Ifallelseisequal,thepaththroughtheneighborwiththelowestrouterIDis

preferred.ThisfinalmetriccanbecomeanissuewhenanAShastwo

connectionstoanotherAS.

NOTE



FormoreinformationontheBGPbestpathcalculation,pleasesee

http://www.cisco.com/warp/public/459/25.shtml.



Community

FromthediscussionofBGP'sbestpathalgorithmintheprecedingsection,you

canseethatBGPisdesignedtoeliminateloopedroutes.Considerpolicyasthe

guidingfactorindeterminingwhichpathtochooseamongtheremainingloopfreepaths.AcommunityisanotherexpressionofpolicywithinBGP.

Acommunityisastringofnumbersthattagsaprefix.Youcanthenusethistag

forthingslikethefollowing:

EntrypointcontrolBecausetheMED,inmanycases,isnotusedinpath

determination(becausetheASpathoftworoutesmustbethesameforthe

MEDtobecompared),asystemexistswherebyarouterthatisreceivinga

prefixwithagivencommunitystringsetsetsitslocalpreference.

SeeRFC1998formoreinformation.

Propagatingqualityofservice(QoS)informationTwoBGPpeerscould

makeanarrangementsothattaggingaprefixwithagivencommunity

stringresultsinthepacketsdestinedtotheadvertiseddestinationbeing

treateddifferently.

Communitiesaresetandcheckedusingroutemaps.(Seethesectiontitled

"RouteMaps,"laterinthisappendix,formoredetails.)



Operation

Mostadvancedroutingprotocolshavesomesystemofneighbordiscovery

(generallyahelloprotocol)sothatrouterscandiscoverneighborsandtrade

routinginformationreliably.BGPisanexceptionbecauseitrequiresthemanual

configurationofneighborrelationships;itdoesnotdiscoverneighbors

automatically.Likeotheradvancedroutingprotocols,though,BGPrequiresa

reliabletransportsystemtoensurethatpacketsarenotlostbetweenpeers.BGP

usesTransmissionControlProtocol(TCP)forreliabletransport.

WhenarouterthatisrunningBGP(aBGPspeaker)isconfiguredtobuilda

neighborrelationshipwithanotherBGPspeaker,itfirstbuildsaTCPconnection

overwhichtotransportinformation.(Port179isthewell-knownportforBGP.)

ThismeansthatInternetProtocol(IP)connectivitybetweenBGPspeakersmust

existbeforeyoucansetupaBGPsessionbetweenthetworouters.

Afteraneighborrelationshipissetupbetweentworouters,therouterstradefull

routinginformation(asallowedbyanyfiltersthatareapplied).Afterthis,BGP

speakerssendonlyincrementalupdatestoneighbors,advertisingorwithdrawing

prefixesasnecessary.



ExteriorBGP

BGPpeersintwodifferentautonomoussystemsautomaticallyformaneBGP

neighborrelationship.LookatFigureD-3foranoverviewofhoweBGPworks.

FigureD-3.eBGPPeers



RouterAisadvertisingthe10.1.1.0/24prefixthroughsomeInteriorGateway

Protocol(IGP)toRouterB,whichhasaneBGPneighborrelationshipwith

RouterC.ThisroutecanbeinjectedintoBGPbyRouterBinseveralways:

RedistributionRouterBcouldberedistributingroutesfromtheIGPused

betweenAandBintoBGP.Thiswillresultintheorigincodeforthe

redistributedroutesbeingmarkedas"incomplete."

networkstatementRouterBcouldhaveanetworkstatementconfigured

underrouterBGPthatmatches10.1.1.0/24.Unlikemanyotherrouting

protocols,anetworkstatementinBGPdoesnotindicatewhichinterfaces

torunBGPon,butratherwhichprefixestoadvertise.Ifarouterhasan

exactmatch(includingprefixlength)initsroutingtableforanetwork

statementunderrouterbgp,itwilladvertisethisprefix.Routesthatare

originatedusinganetworkstatementwillbemarkedwithanorigincodeof

IGP.

aggregate-addressstatementRouterAcouldbesummarizingthe

10.1.1.0/24networkintoalargerblockofIPaddressesthroughan

aggregate-addressstatementconfiguredunderrouterbgp.Routesthatare

originatedusingasummary-addressstatementwillbemarkedwithan

origincodeofIGP.

AfterRouterBhasdetermineditshouldadvertisethisprefixtoC,itsendsan

update.TheASpathfieldinthisupdatecontainsjustRouterB'sAS,becausethe

destinationoriginateswithinRouterBsAS.Thenexthopforthisrouteis

RouterB'sIPaddress.



RouterBmightormightnotinstallthisprefixinitsroutingtable,dependingon

otherroutesavailabletothisprefix,andsoon.



InteriorBGP

WhenaBGPspeakerisconfiguredwithaneighborinthesameAS,theserouters

becomeiBGPpeers.TounderstandiBGPbetter,lookatFigureD-4.

FigureD-4.iBGPPeers



InFigureD-4,RouterAisadvertising10.1.1.0/24asaneBGProutetoRouterB.

RouterB,inturn,isadvertisingthisroutethroughiBGPtoRouterC.

WhenthisprefixispassedtoRouterC,thenexthopisnotchanged(itremains

RouterA'sIPaddress),andtheASpathisnotchanged(becausetheprefixwas

notadvertisedacrossanASboundary).TheASpathnotchangingexplainsone

ofthemostsevererestrictionsofiBGP:iBGPpeerscannotadvertisearoute

learnedviaiBGPtoanotheriBGPneighbor.ThenetworkinFigureD-5addsa

fewmorerouterstoprovideyouwithabetterideaofwhyiBGPpeersmustbe

fullmesh.

FigureD-5.iBGPPeers



Here,RoutersBandC,RoutersBandD,andRoutersCandD,haveiBGP

peeringrelationships,butRoutersBandDdonot.IfiBGPpeerscouldadvertise

routeslearnedthroughiBGPtootheriBGPpeers,youcouldfollowthechainof

eventsthatwouldoccurwhen10.1.1.0/24wasadvertisedfromRoutersAtoB.

RouterBwouldadvertisethisprefixtoRouterC,whichwouldinturnadvertise

ittoRouterD.RouterDwouldadvertise10.1.1.0/24toeachofitspeers,

includingRouterE,whichwouldadvertiseittoRouterC.Atthispoint,Router

ChasreceivedtwoiBGPadvertisementsfor10.1.1.0/24:onethroughRouterB,

andonethroughRouterE.

WhichpathdoesRouterCchoose?BecausethenexthopandASpatharenot

changedwhenaprefixisadvertisedfromoneiBGPpeertoanother,RouterC

hasnowayofknowingthatthepathitislearningfromRouterEisaloop.

Topreventthissortofproblem,iBGPpeersarenotallowedtoadvertisearoute

learnedthroughiBGPtoanotheriBGPneighbor.Thepracticalapplicationofthis

ruleresultsinanother:iBGPpeersmustbefullymeshed.Therearewaysaround

thefullmeshruleiniBGP,buttheyarecoveredinChapter8,ratherthanhere.



TheNextHopAttribute

Asstatedpreviouslyinthechapter,thenexthopattributeintheadvertisedprefix

isnotchangedbetweeniBGPneighbors.Youcansetthenexthoptoanother

routerthantheadvertisingrouterwheneBGPisrunningacrossamultiaccess

network.Foranexample,lookatFigureD-6.

FigureD-6.NextHoponaMultiaccessNetwork



RouterCisadvertisingthe10.1.1.0/24networktoRouterBviaanIGP,and

RouterBisinturnadvertisingthisprefixtoRouterAviaeBGP.Becauseitdoes

notmakesenseinthissituationforthetraffictoflowfromRouterAtoB,then

overthesameEthernettoRouterC,RouterBadvertisesthenexthopasRouter

C.

Youcanusetheneighborpeer-addressnext-hopselfcommandtoalterthis

behavior.Inthisnetwork,ifRouterBwereconfiguredwithnext-hopself,

RouterAwouldsendtrafficdestinedto10.1.1.0/24toRouterB,whichwould,in



turn,forwardthetraffictoRouterC.



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Appendix D. Border Gateway Protocol 4 Basics of Operation

Tải bản đầy đủ ngay(0 tr)

×