Anda di halaman 1dari 6

8/30/2015

AchieveOptimalRoutingandReduceBGPMemoryConsumptionCisco

AchieveOptimalRoutingandReduceBGPMemoryConsumption
DocumentID: 12512 Updated: Feb28,2008

Contents
Introduction
Prerequisites
Requirements
ComponentsUsed
Conventions
BackgroundInformation

BGPRouterReceivesCompleteBGPRoutingTable
BGPRouterConfiguredwithInboundAS_PATHFilterList
TroubleshootMemoryRelatedIssues
Conclusion
RelatedInformation

Introduction
Thisdocumentillustrateshowtoachieveahighdegreeofoptimalroutinginanenterprisenetworkconnectedto
multipleInternetserviceproviders(ISPs),whileminimizingthememoryrequirementsoftheBorderGateway
Protocol(BGP)routers.ThisisachievedbyusingAS_PATHfiltersforacceptingonlyroutesoriginatedfroman
ISPanditsdirectlyconnectedautonomoussystems,insteadofreceivingthefullBGProutingtablefromanISP.

Prerequisites
Requirements
Therearenospecificrequirementsforthisdocument.

ComponentsUsed
Thisdocumentisnotrestrictedtospecificsoftwareandhardwareversions.

Conventions
Formoreinformationondocumentconventions,refertotheCiscoTechnicalTipsConventions.

BackgroundInformation
Thissectionprovidesanetworkdiagramasanexample.Intheexample,youfilterincomingBGPupdatesat
Router1andRouter2toaccepttheroutesoftheISPandtheroutesofthedirectlyconnectedautonomous
system.Router1isacceptingroutesforISPAanditsdirectlyconnectedautonomoussystemC1.Similarly,
Router2isacceptingroutesforISPBandC2.Therestofthenetworks,whichdonotbelongtotheISPsand
http://www.cisco.com/c/en/us/support/docs/ip/bordergatewayprotocolbgp/1251241.html

1/6

8/30/2015

AchieveOptimalRoutingandReduceBGPMemoryConsumptionCisco

theircustomerautonomoussystem,followthedefaultroutepointingtowardISPAorISPB,dependingonthe
enterpriseroutingpolicy.

YoucanobservehowmemoryutilizationvarieswhenRouter1acceptsthecompleteBGProutingtableof
approximately100,000routesfromitsISP,ascomparedtowhenyouapplyinboundAS_PATHfiltersonRouter
1.
Note:Theactualnumberofprefixesthatmakeupafullfeedmayvary.Thevaluesinthisdocumentserveonly
asanexample.RouteserverscanprovideagoodideaofhowmanyprefixesmakeupafullBGPtable.(Formore
informationonrouteservers,refertoTraceroute.org .)

BGPRouterReceivesCompleteBGPRoutingTable
ThisistheconfigurationofRouter1:

Router1
hostnameR1
!
routerbgpXX
nosynchronization
neighbor157.x.x.xremoteas701
neighbor157.x.x.xfilterlist80ou
t
!
ipaspathaccesslist80permit^$
!
end

Theshowipbgpsummarycommandoutputshowsthat98,410prefixeshavebeenreceivedfromISPA(BGP
neighbor157.x.x.x):
R1#showipbgpsummary
BGProuteridentifier65.yy.yy.y,localASnumberXX
BGPtableversionis611571,mainroutingtableversion611571
98769networkentriesand146299pathsusing14847357bytesofmemory
http://www.cisco.com/c/en/us/support/docs/ip/bordergatewayprotocolbgp/1251241.html

2/6

8/30/2015

AchieveOptimalRoutingandReduceBGPMemoryConsumptionCisco

23658BGPpathattributeentriesusing1419480bytesofmemory
20439BGPASPATHentriesusing516828bytesofmemory
0BGProutemapcacheentriesusing0bytesofmemory
5843BGPfilterlistcacheentriesusing70116bytesofmemory
BGPactivity534001/1904280prefixes,2371419/2225120paths,scaninterval15secs
NeighborVASMsgRcvdMsgSentTblVerInQOutQUp/DownState/PfxRcd
165.yy.yy.a46xx9329628262876115710001:56:131
165.yy.yy.b46xx9329618557376115710001:56:121
165.yy.yy.c46xx95696998651646115711001:55:3947885
157.x.x.x470131397742625326115710000:07:2498410

Theshowiproutesummarycommandoutputshowsthat80,132BGProutesareinstalledintheroutingtable:
R1#showiproutesummary
IProutingtablenameisDefaultIPRoutingTable(0)
RouteSourceNetworksSubnetsOverheadMemory(bytes)
connected04256576
static0164144
eigrp605768720
bgpXX8013218622632025614326656
External:87616Internal:11138Local:0
internal854994056
Total8098618632632134415322152

ThiscommandshowstheamountofmemorytheBGPprocessoccupiesinRAM:
R1#showprocessesmemory|beginBGP
PIDTTYAllocatedFreedHoldingGetbufsRetbufsProcess
730678981156898167367081103600BGPRouter
7402968320419750112613881327064832BGPI/O
75008270540982400BGPScanner
70882248TotalBGP
77465892Totalallprocesses

TheBGPprocessisoccupyingapproximately71MBofmemory.

BGPRouterConfiguredwithInboundAS_PATHFilterList
Inthisexample,youapplytheinboundfilterlisttoacceptroutesoriginatedbyISPAanditsdirectlyconnected
autonomoussystems.Intheexample,ISPAisadvertisingadefaultroute(0.0.0.0)viaexternalBGP(eBGP),so
routesthatdonotpassthefilterlistfollowthedefaultroutetowardISPA.Thisistheconfigurationforsettingup
thefilterlist:

Router1
hostnameR1
!
routerbgpXX
nosynchronization
.
neighbor157.x.x.xremoteas701
neighbor157.x.x.xfilterlist80out
neighbor157.x.x.xfilterlist85in
!ThislinefiltersinboundBGPupdates.

!
ipaspathaccesslist80permit^$
ipaspathaccesslist85permit^701_[09]*$
!TheAS_PATHfilterlistfiltersISPandthe!directlyconnectedautonomoussystemrout
es.
http://www.cisco.com/c/en/us/support/docs/ip/bordergatewayprotocolbgp/1251241.html

3/6

8/30/2015

AchieveOptimalRoutingandReduceBGPMemoryConsumptionCisco

!
end

Thisshowipbgpsummarycommandoutputshows31,667prefixesreceivedfromISPA(neighbor
157.xx.xx.x):
R1#showipbgpsummary
BGProuteridentifier165.yy.yy.y,localASnumberXX
BGPtableversionis92465,mainroutingtableversion92465
36575networkentriesand49095pathsusing5315195bytesofmemory
4015BGPpathattributeentriesusing241860bytesofmemory
3259BGPASPATHentriesusing78360bytesofmemory
0BGProutemapcacheentriesusing0bytesofmemory
4028BGPfilterlistcacheentriesusing48336bytesofmemory
BGPactivity1735069/3741144prefixes,4596920/4547825paths,scaninterval15secs
NeighborVASMsgRcvdMsgSentTblVerInQOutQUp/DownState/PfxRcd
165.yy.yy.a463192266941787061924650017:31:041
165.yy.yy.b463192268141806986924650019:51:531
165.yy.yy.c4631910410691822703924650019:44:5217424
157.xx.xx.x470114452518456341924650019:51:3731667

Theshowiproutesummarycommandoutputshows27,129BGProutesintheroutingtable:
R1#showiproutesummary
IProutingtablenameisDefaultIPRoutingTable(0)
RouteSourceNetworksSubnetsOverheadMemory(bytes)
connected04256576
static0164144
eigrp631906896864
bgp631927129942423393925299332
External:19134Internal:17419Local:0
internal518602952
Total27647943523406085903868

ThememoryusedbytheBGPprocessisapproximately28MB,asshownhere:
R1#showprocessesmemory|includeBGP
PIDTTYAllocatedFreedHoldingGetbufsRetbufsProcess
7309007422241866445402811588000BGPRouter
740531523255623216068242478452832BGPI/O
750039041008982400BGPScanner
28132528TotalBGP
34665820Totalallmemory

TroubleshootMemoryRelatedIssues
TocheckthememoryusedbytheBGPprocess,usetheshowprocessesmemory|includebgpcommand.
Themostcommonissuesrelatedtoanoveruseofmemoryarelistedhere:
Memoryallocationfailure"%SYS2MALLOCFAIL".Formoreinformationaboutthiserrormessage,refertothe
documentTroubleshootingMemoryProblems.
RefusedTelnetsessions.
Nooutputfromsomeshowcommands.
"Lowonmemory"errormessages.
"UnabletocreateEXECnomemoryortoomanyprocesses"consolemessages.
Routerhanging,ornoconsoleresponse.Formoreinformation,refertothedocumentTroubleshootingHigh
http://www.cisco.com/c/en/us/support/docs/ip/bordergatewayprotocolbgp/1251241.html

4/6

8/30/2015

AchieveOptimalRoutingandReduceBGPMemoryConsumptionCisco

CPUUtilizationonCiscoRouters.
IfyourunBGPrelateddebugs,itusuallycausesexcessivememoryconsumption,whichcanalsoresultin
memoryerrorsduetoBGP.DebugsforBGPmustberunwithcautionandaretobeavoidediftheyarenot
required.
TostoreacompleteglobalBGProutingtablefromoneBGPpeer,itisbesttohaveaminimumof512MBor1
GBofRAMintherouter.If256MBofRAMisused,itisrecommendedthatyouusemoreroutefilters.Ifyouuse
512MBofRAM,moreInternetroutescanbeplacedintheroutingtablewithfewerroutefilters.OntheCatalyst
6500/6000receivingafullBGPtable,itisrecommendedtohaveMultilayerSwitchFeatureCard2(MSFC2)with
256MBofRAMtoavoidCiscobugIDCSCdt13244(registeredcustomersonly).Thememoryconsumptionby
BGProutesdependsonthenumberofattributes,suchasmultipathsupport,softreconfiguration,thenumberof
peers,andAS_PATH.FormoredetailsontheBGPmemoryrequirement,refertoRFC1774 .
CiscoExpressForwarding/distributedCiscoExpressForwarding(CEF/dCEF)switchingconsumesmemory,
dependingontheroutingtablesize.TherearetwomaincomponentsofCEF:
TheForwardingInformationBase(FIB)
Theadjacencytable
BothtablesarestoredinDRAMmemory.EnsurethatyourVersatileInterfaceProcessor(VIP)orlinecardalso
containssufficientfreeDRAM.The"%FIB3FIBDISABLE:Fatalerror,slot[#]:nomemory"and"%FIB3
NOMEM"errormessagesindicateinsufficientmemoryinthecards.
ItishighlyrecommendedtochecktheVIPorlinecardmemorybeforeenablingdCEF.Completethesestepsto
confirmthememory:
1. ConfigurecentralCEFbyissuingtheipcefcommandinglobalconfigurationmode.
AllowtimefortheFIBtabletobuild.
2. ReviewthesizeofthecentralFIBtablewiththeshowipcefsummarycommand.
3. DeterminewhethertheVIPorlinecardhassufficientavailableDRAMtostoreasimilarsizedFIBtable.
Issuetheshowcontrollervip[slot#]techcommand,andchecktheoutputoftheshowmemorysummary
command.
WhenrunningfullInternetBGProutes,itisbesttohaveatleast512MBor1GBofRAMontheVIPorlinecard.
FormoreinformationabouttroubleshootingmemoryrelatedissuesinvolvingCEF/dCEF,refertothedocument
TroubleshootingCiscoExpressForwardingRelatedErrorMessages.

Conclusion
Thischartillustratesthememorysavingsbyimplementingthefilterlist:

NoFiltering

NumberofPrefixes MemoryConsumed
98,410

70,882,248

AutonomousSystemFilter 31,667

28,132,528

WhentheBGProuterreceivesitsneighbors'fullBGProutingtable(98,410routes),therouterconsumes
approximately71MB.WiththeAS_PATHfiltersappliedtoinboundupdates,thesizeoftheBGProutingtableis
reducedto31,667routes,andthememoryconsumptionisapproximately28MB.Thisdecreaseinmemory
utilizationismorethan60percentwithoptimalrouting.
IfyoureviewtheASInternetGraph compiledbytheCooperativeAssociationforInternetDataAnalysis
(CAIDA),youcanseewhichISPshavethehighestdegreeofinterconnectivity(thoseclosesttothecenterofthe
chart).Withlessinterconnectivity,fewerroutespassthroughtheAS_PATHfilter,andtheBGPmemory
consumptionislower.However,itisimportanttonotethatwheneverAS_PATHfiltersareset,youneedto
configureadefaultroute(0/0).RoutesthatdonotpasstheAS_PATHfilterlistfollowthedefaultroute.

RelatedInformation
http://www.cisco.com/c/en/us/support/docs/ip/bordergatewayprotocolbgp/1251241.html

5/6

8/30/2015

AchieveOptimalRoutingandReduceBGPMemoryConsumptionCisco

UsingRegularExpressionsinBGP
LoadSharingwithBGPinSingleandMultihomedEnvironments:SampleConfigurations
HowtoUseHSRPtoProvideRedundancyinaMultihomedBGPNetwork
SampleConfigurationforBGPwithTwoDifferentServiceProviders(Multihoming)
BGPSupportPage
TechnicalSupportCiscoSystems

2015Ciscoand/oritsaffiliates.Allrightsreserved.

http://www.cisco.com/c/en/us/support/docs/ip/bordergatewayprotocolbgp/1251241.html

6/6

Anda mungkin juga menyukai