Tải bản đầy đủ - 0 (trang)
Chapter 13. Delivering Cached and Streaming Media

Chapter 13. Delivering Cached and Streaming Media

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

ThenatureofcontentrequestsfromInternetuserstends

towardthe80/20axiominnetworkcomputing,where80

percentofclientrequestsarefor20percentofyourcontent.To

delivercontenttoyourusersinamoreefficientmanner,you

canconfigureyournetworktocachefrequentlyrequested

objectsincloserproximitytoyourusers.

InthisChapter,youwilllearnprimarilyhowtodeliver

unmanagedcontenttoyourinternalusersmoreefficiently.

Unmanagedcontentiscontentthatissourcedfromanorigin

serverthatyoudonotmanageyourself,suchasaserveronthe

Internet.However,youcanusemostoftheconceptsinthis

Chaptertodelivercontentthatyoumanage,suchascontent

fromanintranetHTTPorstreamingmediaserver.InChapter

14,"DistributingandRoutingManagedContent,"youwilllearn

strictlyhowtodeliveryourmanagedcontentmoreefficiently.

Asthenamesuggests,managedcontentiscontentthatyouor

anotherpersonorgroupinyourorganizationhasfullcontrol

overcreatingandmaintaining.



RedirectingApplicationRequests

Ciscocontentedgedeliveryprovidesredirectioncapabilities,

enablingtransparentdeliveryofcachedcontenttoyourclients.

Transparentredirectionisusefulincachingenvironments

becauseroutersorcontentswitchescandirectrequestsfor

contenttoacache,whichthencanfieldtherequestonbehalf

ofyourunknowingclients.Youcanconfiguretransparent

redirectionusingeitherofthefollowingmethods:

WebCacheControlProtocol

ContentSwitchredirection



IntroducingWebCacheControlProtocol

WebCacheControlProtocol(WCCP)isaCiscoproprietary

protocolaimedatoptimizingcontentdeliverybetweenclients

andCEs,byredirectingclientrequeststoappropriateCEs

transparently.WCCPdoesnotinspecttheURLorHTTPrequest

toclassifytrafficforredirection.Otherwise,delayedbinding

wouldberequiredbyWCCPtocompletetheTCPconnectionon

behalfoftheservertoallowtheclienttosendtheHTTPrequest

totheWCCProuter.Instead,theWCCProuterinspectspackets

onincomingoroutgoinginterfacesandmatchesthemagainst

servicegroupsthatyouconfigureforWCCPinspection.WCCP

definesservicegroupsbyportnumbersWCCPlooksnofurther

intothepayloadofthepacketthantheTCP/UDPpacketheader.

ToconfigureWCCPonyourrouter,firstyoumustspecifythe

versionthatyouwishtoenable,usingthecommand

ipwccpversion[1|2]



WCCPversion2includessomeenhancedfeaturesoverversion

1,includingsupportformultipleredundantrouters,improved

security,Layer2redirection,andredirectionofapplications

otherthanHTTPoverTCPport80.

Toconfigureaservicegrouponyourrouter,youcanusethe

command



ipwccp{web-cache|service-number|outbound-acl-check}[grou

address][redirect-listaccess-list][group-listaccess-list



WithWCCPversion2,youcanconfigureeitherwell-knownor

user-definedgroups,byspecifyingaservicenumberwithinthe

ipwccpcommand.Youcanusewell-knownservicegroupsfor

inspectingprotocolswhoseportsarepredefined(forexample,

inanRFC)andarethereforeknownbyboththeCEandWCCP

routerwithoutmanuallyconfiguringthedesiredports.For

example,asthenameindicates,youcanusethewell-known

servicegroupcalledweb-cache(service0)forcachingHTTP

port80objects.Incontrast,youmustconfiguretheportsofthe

user-definedservicegroups(services9097)ontheCEtheCEs

advertisetheportsyouconfiguretotherouterusingWCCP

signaling.Table13-1liststheavailableWCCPservicegroups.

Table13-1.AvailableWCCPServiceGroups

ServiceGroup

Name



Service

Group

Number



Description



DefaultPorts



Web-cache



0



HTTPprotocol



80



DNS



53



DNSprotocol



53



FTP-Native



60



FTP



21



HTTPS-Native



70



HTTPSprotocol



443



RTSP



80



RealTimeStreaming 554

Protocol(RTSP)



MMST



81



Microsoft'sMMS

protocoloverTCP



1755



MMSU



82



Microsoft'sMMS

protocoloverUser

DiagramProtocol

(UDP)



1755



WMT-RTSPU



83



Microsoft's

5005

implementationofthe

RTSPoverUDP



CIFS-cache



89



Supportscaching

139and445

CommonInternetFile

System(CIFS)traffic

onports139and445



User-Defined



90-97



Acustomprotocol

thatyouwantto

redirect



Youcandefineupto

eightportsperuserdefinedservice.



Custom-WebCache



98



Youcandefine

nonstandardportsfor

redirectingHTTP

traffic(withoutusing

uponeofyour"userdefined"service

groups)



Youcandefineupto

eightportsforthe

customwebcache

service.



Reverse-Proxy



99



Thewell-known

reverseproxy

protocol



80



Note



Thedifferencebetweenthereverse-proxyservice

andtheweb-cacheserviceisthatweb-cacheservice

usesthedestinationIPaddresstodeterminewhich

hashbuckettousewhendistributingclientrequests

acrossmultipleCEs.Whereas,reverse-proxyhashes

thesourceIPaddresstoselectanavailablehash

bucket.Youwilllearnabouthashbucketslaterin

thisChapter.



Otherparametersthatyoucanspecifyintheipwccpcommand

are

ForoutboundWCCP,theoutbound-acl-checkkeywords

enabletheroutertoprocessanyoutboundACLsbeforethe

WCCPoutboundconfigurationclassifiesthepackets.

Thegroup-addresskeywordenablesyoutoconfigurea

multicastaddressthattheWCCPv2clusterroutersandCEs

communicatewith.

Theredirect-listkeywordenablesyoutoconfigureanACL

tocontrolthetrafficthattherouterwillredirectwithinthe

servicegroupthatyouconfigure.

Thegroup-listkeywordenablesyoutoconfigureanACLto

restricttheCEsthattheroutercanlearnabout.

ToconfigureaMessageDigest5(MD5)passwordforthe

WCCProuterstoauthenticatemessagesreceivedfromthe

servicegroup,youcanusethepasswordkeyword.

ToenableWCCPonyourCE,youcanspecifytheWCCPversion



withthewccpversioncommand:

wccpversion2



ThenyoumustspecifytheWCCProutersthattheCEwill

communicatewith,byusingthecommand

wccprouter-listlist-numIP-Address1..IP-AddressN



Then,youassociatetheservicegroupthatyouconfiguredon

yourrouterwiththecommand



wccp[web-cache|service-numberservice-group]router-list-num

[l2-redirect][mask-assign]



Ifyouconfiguredauser-definedservicegrouponyourrouter,

youmustassociatetheportsonyourCEthatyouwantthe

WCCProutertoredirecttotheCE,withthecommand

wccpport-listlist-numport-num



Forexample,toenablethestandardweb-cacheservicegroup

onyourCE,youcanusethecommands

wccpversion2

wccprouter-list110.1.20.2

wccpweb-cacherouter-list-num1



RedirectingTrafficatLayer2andLayer3withWebCache

ControlProtocol

OnceyouenableWCCPonyourrouterwiththeipwccp

command,youcanenableLayer2or3trafficredirectiononthe

router'sinterfaces.WithLayer2redirection,theWCCProuter

rewritestheMACaddressintheEthernetframetoredirect

traffictransparentlytoadifferentdestinationIPaddress(that

is,theCE)thanspecifiedbythedestinationIPaddressintheIP

packetheader.NotallrouterplatformssupportLayer2

redirectiontheCatalyst6500MultilayerSwitchingFeatureCard

(MSFC)/PolicyFeatureCard(PFC)containshardware

accelerationforWCCPLayer2redirection.Thisfeatureis

negotiatedbetweendirectlyconnectedCiscoContentEngines

andtheMSFC/PFC.TheEthernetframeisforwardedtothe

transparentcache,whichinturnprocessestherequest.To

configureLayer2redirection,youcanconfigureyourCEswith

thel2-redirectkeywordinthewccpservice-numberrouterlist-numbercommandthatyoulearnedpreviouslyno

configurationisrequiredontheMSFC/PFC.

WCCPv2usesgenericroutingencapsulated(GRE)tunneling

withLayer3applicationredirection,whichleavestheoriginalIP

packetintact.TheWCCProuterencapsulatesthepacketwithan

additionalGREpacketheadercontainingthesourceIPasthe

WCCProuterandthedestinationIPastheCEdevice.WCCPv2

usesGREsothattheWCCProutercancommunicatedirectly

withtheCEoverIPwhileretainingtheoriginalpacketsofthe

client.ThisisbeneficialiftheCEisanynumberofLayer3hops

awayfromtheWCCProuter.



Note

Layer2redirectionprovidesamoreefficient

redirectionmechanismbyavoidingadditionalpacket

encapsulationandprocessingatLayer3.However,



yourCEsmustbevisibleatLayer2fromtheMSFC.



WithLayer3redirection,theclientsendsarequestforcontent

toanoriginserver,byfirstsendingaSYNsegmenttotheorigin

server.ThepacketcontainsthesourceIPoftheclientandthe

destinationoftheoriginserver.Inthecaseofredirectingweb

traffic,theWCCProuterinspectstheTCPheaderwithintheIP

packetforport80inthedestinationportfieldandmatchesthe

"web-cache"servicegroup.TheWCCProuterthenchoosesan

availableCEfortherequestandencapsulatestheIPpacketina

GREpacketwithitsinterfaceasthesourceaddressandthe

selectedCE'sIPaddressasthedestination.WhentheCE

receivesthepacket,itdecapsulatestheGREheaderand

respondsdirectlytotheclientwithaTCPSYN/ACKsegment,by

spoofingthesourceaddressoftheoriginserver.Thisway,the

clientisunawarethattheTCPresponsewassentbytheCE.The

clientthensendstheTCPACKpackettocompletetheTCP

handshakeandapplicationlayercontentrequesttotheorigin

server,whichtheWCCProuterforwardstotheCEovertheGRE

tunnel.TheCEthendecideswhetherornotthecontentis

cachedandproceedswiththetransaction.



InputRedirectionVs.OutputRedirection

YoucanenableyourWCCProutertoredirectpacketsasthey

eitherarriveorleavearouterinterface,usingtheinterface

configurationcommand:



ipwccp[web-cache|[service-numberservice-groupredirect[in



Youcanconfigureeitherinputoroutputredirectionwiththe

followingcommands:

InputRedirectionWithinputredirection,therouter

matchesincomingtrafficagainstaWCCPservicegroupthat

youconfigureandredirectsthetrafficimmediatelytothe

CE.TheWCCProuterdoesnotperformaroutingtable

lookupbeforematchingtraffic,evenwhenusingLayer3

redirection.Youmustconfigureinputredirectionifyou

decidetouseLayer2redirection.

Forexample,toconfigureinputredirectionforthewebcacheserviceonaninterface,youcanusethecommand

ipwccpweb-cacheredirectin



Note

WCCPclassifiesonlythefirstpacketofaflow

andredirectsthepackettotheCE.All

subsequenttrafficoftheflowisCiscoExpress

Forwarding(CEF)-switchedtotheCE.



OutputRedirectionWithoutputredirection,therouter

routestrafficfromitsincominginterfacestotheoutgoing

interfacethatyouconfigureforoutgoingredirection,and

thenmatchesthetrafficagainstitsconfiguredWCCPservice

groups.Forexample,toconfigureoutputredirectionforthe

web-cacheserviceonaninterface,youcanusethe

interfaceconfigurationcommand:

ipwccpweb-cacheredirectout



Outputredirectionislessefficientthaninputredirection

because

-TherouterperformsaCEFtrielookuptodeterminethe

next-hopaddressbasedonthedestinationIPaddressofthe

incomingtraffic.AvoidingtheseadditionalCEFlookupsfor

Layer3redirectioncanbebeneficialinhightraffic

environments.

-WCCPinspectstrafficfromallincominginterfacesthatare

routedtotheoutgoinginterface.WCCPusesthefastest

switchingpaththatyouconfigure(forexample,CEF

switching)forprocessingtrafficonoutgoinginterfaces.

However,WCCPstillimposesunnecessaryoverheadtothe

switchingpathwhenapplyingpoliciestoallyouroutgoing

trafficespeciallytotrafficfromincominginterfacesthatwill

nevercontainWCCPtraffic.Fortunately,youcanexclude

incominginterfacetrafficfrombeingclassifiedbyWCCPon

outgoinginterfacesbyusingipwccpredirectexcludein

onincominginterfaces.



WCCPLoadDistributionUsingHashBuckets

Toscaleyourcachingenvironment,youcaninstallmultipleCEs

anddistributerequestsacrossthemusingWCCP.TheWCCP

routerdistributestheincomingrequestsusinghashbucketsor

addressmaskassignments.

RecalltheIPaddresshashload-balancingmethodthatyou

learnedaboutpreviouslyinChapter10,"ExploringServerLoad

Balancing."Toselectanavailablerealserver,thecontentswitch

computesanumerichashvaluebasedonthesourceor

destinationIPaddressintheIPheaderoftherequest.The



contentswitchthendividesthehashedvaluebythenumberof

realsN,withtheremaindergivingtheresultantrealtoforward

therequestto.ThismechanismworksfineforanSLBwith

contentreplicatedacrossyourrealservers.However,youwant

toavoidreplicatingcontentacrossavailableCEs.Forexample,

usingsimpledestinationIPaddressloadbalancing,whena

cachefails,thehashvaluesaredividedbyN-1.Theremainder

ofthedivisionthenresultsinacache,differentfromtheone

receivingpreviousrequestsforthesamecontent,receivingthe

newrequest,causingasuddenredistributionofcontentacross

alloftheCEs.TheredistributionofcontentacrossCEsresultsin

majorburstsofcachedcontentmissesbyyourclients.

Thesolutiontothisproblemistheuseofaseriesofdata

structurescalledhashbucketsyoulearnedpreviouslyhowCEF

switchinguseshashbucketsinChapter3,"Introducing

Switching,Routing,andAddressTranslation."Whenthefirst

requestarrivesattheWCCProuter,theroutercomputesahash

onthevariousfieldsintheIPandTCPheaders,resultingina

rangeofpredeterminedvalues,usuallyapoolofCEsthatis

relativelylargerthanreasonable.Forillustrationpurposes,

assumethatthehashfunctionproducesa3-bitvalue.

Therefore,amaximumofeighthashbucketsareavailable.In

actuality,WCCPuses256hashbucketsrecallfromChapter3

thattheCEFload-sharingtableuses16hashbuckets(witha4bithashfunction).

WCCPintelligentlyassignstheavailableCEstothehashbuckets

basedonCEloadandavailability.CEswithalowerloadare

assignedtomorebucketsthanCEswithhigherloads.For

example,sayWCCPassignsthehashbucketsaccordingto

Figure13-1.Thehashfunctioncanthenproduceahashvalue

of5foranoriginatingTCPSYNsegmentofaflow.Because

bucketnumber5isassignedtoCE2,theroutersendsthe

requesttothatCEforthisandallsubsequentpacketsinthe

flow.Thisway,onlyCE2maintainsacopyoftherequestedfile,

thusavoidingfileduplicationacrossthepoolofcaches.



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

Chapter 13. Delivering Cached and Streaming Media

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

×