('TR069协议向导1.为什么需要TR069随着VoIP、IPTV等越来越多IP终端设备的普及(尤其在家庭中的普及),大量设备的配置和维护变得越来越困难,大大提高了网络产品运营商的成本,传统的基于SNMP的网管系统面对众多的终端设备时显得力不从心,限制了宽带接入市场的发展速度和规模。TR069定义了一套全新的网管体系结构,包括“管理模型”,“交互接口”,“管理参数”,在很大程度上减少了网络产品的运为成本。2.什么是TR069协议TR069是数字用户线(DSL)论坛(以改名为BroadbandForum)制定的一个面向终端设备的网管协议,称为“用户终端设备广域网管理协议(CWMP)”,DSL论坛的文档编号为TR069。3.TR069协议发展现状自2004年5月DSL论坛推出该协议以来,各大运营商纷纷部署基于TR069的终端设备。但从协议的发展情况看,TR069仍然处于不断完善的过程中。4.TR069协议网络架构ACS为自动配置服务器,负责对终端设备CPE进行管理。ACS与CPE间的接口为南向接口,ACS与管理系统间的接口为北向接口。TR069协议主要定义了南向接口。5.TR069的实现(协议栈)1)TR069协议基于TCP/IP;2)标准的Internet传输安全协议,SSL3.0ORTLS1.0,使用SSL/TLS并不强制要求,确保CPE和ACS之间基于证书的鉴权3)ACS与CPE间的消息传输使用HTTP1.14)消息的具体内容使用SOAP包进行封装,SOAP包是一个包含SOAPHead(SOAP头)和SOAPBody(SOAP体)组成的XML文档5)ACS与CPE之间通过TR069协议特有的RPC方法进行互操作。ACS远程调用CPE上的RPC函数,用来对CPE进行管理如:设置CPE参数、获取CPE参数、硬件升级、重启设备等;因此需要向CPE传输要调用的函数名及参数,这些内容包含在SOAP体中。ACS并不直接对设备本身的接口进行调用,ACS所调用的函数为TR069的标准函数(称作TR-069RPCMethods),CPE需要通过一个设备上的中间层解析出RPC方法,再由这个中间层调用设备自身的接口,这个中间层就是TR069Agent。CPE调用ACS的方法,用来向ACS上报状态信息,请求硬件镜像文件下载(用来升级硬件)等等。TR069协议的RPC函数(或称RPC方法),如下表:6.CPE函数参数(TR069协议的数据模型)网络架构上包含两种设备类型,因此包含两套数据模型:i.TR-106:DataModelTemplateforTR-069-EnabledDevices,[13]ii.TR-098:InternetGatewayDeviceDataModelforTR-069,[24]iii.TR-104:ProvisioningParametersforVoIPCPE,[25]EachParameterconsistsofaname-valuepair.ThenameidentifiestheparticularParameter,andhasahierarchicalstructuresimilartofilesinadirectory,witheachlevelseparatedbya“.”(dot).ThevalueofaParametermaybeoneofseveraldefineddatatypes(see[13]).参数名:使用由类似树型的点分层关系组织起来。树干为需要配置的对象,树叶为具体的配置参数,所有配置参数都具有是否可读写属性。如:InternetGatewayDevice.IPPingDiagnostics.Interface参数类型:基于SOAP的数据类型参数有只读、只写两种状态。且可扩展TR069协议就是一个基于TCP/IP,通过HTTP或者HTTPS发送SOAP消息来远程调用CPE或者ACSRPC方法,从而可以达到获取配置和业务信息,监控状态,故障诊断等目的的一种协议。7.详解TR069规则:CPE和ACS都可以发起会话,ACS发起的会话是异步的。A.建立连接CPE发起的连接:CPE必需满足如下任何一个条件的情况下向ACS地址发起连接,并调用ACS的Inform方法。•ThefirsttimetheCPEestablishesaconnectiontotheaccessnetworkoninitialinstallation•Onpower-uporreset•OnceeveryPeriodicInformInterval(forexample,every24-hours)•WhensoinstructedbytheoptionalScheduleInformmethod•WhenevertheCPEreceivesavalidConnectionRequestfromanACS(seesection3.2.2)•WhenevertheURLoftheACSchanges•WheneveraparameterismodifiedthatisrequiredtoinitiateanInformonchange.WheneverthevalueofaparameterthattheACShasmarkedfor“activenotification”viatheSetParameterAttributesmethodismodifiedbyanexternalcause(acauseotherthantheACSitself).Wheneveranunsuccessfullyterminatedsessionisretriedaccordingtothesessionretrypolicyspecifiedinsection3.2.1.1.…….ACS发起的连接:满足如下条件•TheConnectionRequestMUSTuseanHTTP1.1GETtoaspecificURLdesignatedbytheCPE.TheURLvalueisavailableasread-onlyParameterontheCPE.ThepathofthisURLvalueSHOULDberandomlygeneratedbytheCPEsothatitisuniqueperCPE.•TheConnectionRequestMUSTmakeuseofHTTP,notHTTPS.TheassociatedURLMUSTbeanHTTPURL.•NodataisconveyedintheConnectionRequestHTTPGET.AnydatathatmightbecontainedSHOULDbeignoredbytheCPE.•TheCPEMUSTusedigest-authenticationtoauthenticatetheACSbeforeproceeding—theCPEMUSTNOTinitiateaconnectiontotheACSduetoanunsuccessfullyauthenticatedrequest.•TheCPEMUSTacceptConnectionRequestsfromanysourcethathasthecorrectauthenticationparametersforthetargetCPE.•TheCPE’sresponsetoasuccessfullyauthenticatedConnectionRequestMUSTuseeithera“200(OK)”ora“204(NoContent)”HTTPstatuscode.TheCPEMUSTsendthisresponseimmediatelyuponsuccessfulauthentication,priortoitinitiatingtheresultingsession.ThelengthofthemessagebodyintheHTTPresponseMUSTbezero.•TheCPESHOULDrestrictthenumberofConnectionRequestsitacceptsduringagivenperiodoftimeinordertofurtherreducethepossibilityofadenialofserviceattack.IftheCPEchoosestorejectaConnectionRequestforthisreason,theCPEMUSTrespondtothatConnectionRequestwithanHTTP503statuscode(ServiceUnavailable).Inthiscase,theCPESHOULDNOTincludetheHTTPRetry-Afterheaderintheresponse.•IftheCPEsuccessfullyauthenticatesandrespondstoaConnectionRequestasdescribedabove,andifitisnotalreadyinasession,thenitMUST,within30secondsofsendingtheresponse,attempttoestablishasessionwiththepre-determinedACSaddress(seesection3.1)inwhichitincludesthe“6CONNECTIONREQUEST”EventCodeintheInform.Note–inpracticetheremightbeexceptionalcircumstancesthatwouldcauseaCPEtofailtomeetthisrequirementonrareoccasions.•IftheACSreceivesasuccessfulresponsetoaConnectionRequestbutafteratleast30secondstheCPEhasnotsuccessfullyestablishedasessionthatincludesthe“6CONNECTIONREQUEST”EventCodeintheInform,theACSMAYretrytheConnectionRequesttothatCPE.•If,oncetheCPEsuccessfullyauthenticatesandrespondstoaConnectionRequest,butbeforeitestablishesasessiontotheACS,itreceivesoneormoresuccessfullyauthenticatedConnectionRequests,theCPEMUSTreturnasuccessfulresponseforeachofthoseConnectionRequests,butMUSTNOTinitiateanyadditionalsessionsasaresultoftheseadditionalConnectionRequests,regardlessofhowmanyitreceivesduringthistime.•IftheCPEisalreadyinasessionwiththeACSwhenitreceivesoneormoreConnectionRequests,itMUSTNOTterminatethatsessionprematurelyasaresult.TheCPEMUSTinsteadtakeoneofthefollowingalternativeactions:•RejecteachConnectionRequestbyrespondingwithanHTTP503statuscode(ServiceUnavailable).Inthiscase,theCPESHOULDNOTincludetheHTTPRetry-Afterheaderintheresponse.•Followingthecompletionofthesession,initiateexactlyonenewsession(regardlessofhowmanyConnectionRequestshadbeenreceivedduringtheprevioussession)inwhichitincludestheCPEWANManagementProtocolv1.1TR-069Issue1Amendment2“6CONNECTIONREQUEST”EventCodeintheInform.Inthiscase,theCPEMUSTinitiatethesessionimmediatelyaftertheexistingsessioniscompleteandallchangesfromthatsessionhavebeenapplied.ThisrequirementholdsforConnectionRequestsreceivedanytimeduringtheintervalthattheCPEconsidersitselfinasession,includingtheperiodinwhichtheCPEisintheprocessofestablishingthesession.•TheCPEMUSTNOTrejectaproperlyauthenticatedConnectionRequestforanyreasonotherthanthosedescribedabove.IftheCPErejectsaConnectionRequestforanyofthereasonsdescribedabove,itMUSTNOTinitiateasessionwiththeACSasaresultofthatConnectionRequest.ACS发起的连接还必需依赖CPE之前已经和ACS建立过会话,因为只有这样ACS才能知道CPE的连接URL。B.EncodingSOAPOverHTTP•ASOAPrequestfromanACStoaCPEissentoveranHTTPresponse,whiletheCPE’sSOAPresponsetoanACSrequestissentoverasubsequentHTTPPOST.•WhenthereisaSOAPresponseinanHTTPRequest,orwhenthereisaSOAPFaultresponseinanHTTPRequest,theSOAPActionheaderintheHTTPRequestMUSThavenovalue(withnoquotes),indicatingthatthisheaderprovidesnoinformationastotheintentofthemessage.Thatis,itMUSTappearasfollows:SOAPAction:•WhenanHTTPRequestorResponsecontainsaSOAPEnvelope,theHTTPContent-TypeheaderMUSThaveatype/subtypeof“text/xml”.•AnemptyHTTPPOSTMUSTNOTcontainaSOAPActionheader.•AnemptyHTTPPOSTMUSTNOTcontainaContent-Typeheader.•AnHTTPresponsethatcontainsanyCPEWANManagementProtocolpayload(aSOAPrequesttotheCPE,asuccessfulSOAPresponsetotheCPE,oraSOAPfaultresponsecontainingaFaultelementdefinedinsection3.5)MUSTusetheHTTPstatuscode200(OK).BelowisanexampleHTTPResponsefromanACScontainingaSOAPRequest:HTTP/1.1200OKContent-Type:text/xml;charset="utf-8"Content-Length:xyzvalue Note–intheaboveexample,theXMLnamespaceprefixesusedareonlyexamples.Theactualnamespaceprefixvaluesarearbitrary,andareusedonlytorefertoanamespacedeclaration.Note–intheaboveexample,theCWMPnamespaceidentifier“urn:dslforum-org:cwmp-1-0”isonlyanexampleandisnotnecessarilytheversionthatisdefinedbythisspecification.C.TransactionSessionsForasequenceoftransactionsformingasinglesession,aCPESHOULDmaintainaTCPconnectionthatpersiststhroughoutthedurationofthesession.However,iftheTCPconnectioniscleanlyclosedafteranHTTPrequest/responseroundtrip,andifthesessionhasnototherwiseterminated(eithersuccessfullyorunsuccessfully)atthetimeofthelastHTTPresponse,theCPEMUSTcontinuethesessionbysendingthenextHTTPrequestinanewTCPconnection.Afterreceivinganauthenticationchallenge,theCPEMUSTsendthenextHTTPrequest(includingthe"Authorization"HTTPheader)inthesameTCPconnectionunlesstheACSspecificallyrequested,viaa"Connection:close"HTTPheader,thattheTCPconnectionbeclosed.3Inthelattercase,theCPEMUSThonortheACSrequest,closetheTCPconnection,andsendthenextHTTPrequest(includingthe"Authorization"HTTPheader)inanewTCPconnection.IftheCPEforanyreasonfailstoestablishaTCPconnection,failstosendanHTTPmessage,orfailstoreceiveanHTTPresponse,theCPEMUSTconsiderthesessionunsuccessfullyterminated.TheCPEMUSTwaitaminimumof30secondsbeforedeclaringafailuretoestablishaTCPconnection,orfailuretoreceiveanHTTPresponse.TheACSSHOULDmakeuseofasessioncookietomaintainsessionstateasdescribedin[7].TheACSMAYmakeuseofold-style“Netscape”cookiesaswellas,orinsteadof,thenew-stylecookiesof[7].TheACSSHOULDuseonlycookiesmarkedforDiscard,andSHOULDNOTassumethataCPEwillmaintainacookiebeyondthedurationofthesession.ToensurethatanACScanmakeuseofasessioncookie,aCPEMUSTsupporttheuseofcookiesasdefinedin[7]includingthereturnofthecookievalueineachsubsequentHTTPPOST,withtheexceptionthataCPEneednotsupportstorageofcookiesbeyondthedurationofasession.Inparticular,becausetheACSmightsendold-style,new-style,oramixtureofold-styleandnew-stylecookies,theCPEMUSTsupportthecompatibilityrequirementsofsection9.1of[7].TheCPEMUSTsupporttheuseofmultiplecookiesbytheACS,andMUSTmakeavailableatleast512bytesforstorageofcookies.Whenatransactionsessioniscompletedsuccessfullyorterminatedunsuccessfully,aCPEMUSTclosetheassociatedTCPconnectiontotheACSanddiscardallcookiesmarkedforDiscard.ACPEMUSTsupporttheuseofHTTPredirectionbytheACS.TheCPEandACSrequirementsassociatedwiththeuseofHTTPredirectionareasfollows:AlltransactionsessionsMUSTbeginwithanInformmessagefromtheCPEcontainedintheinitialHTTPPOST.ThisservestoinitiatethesetoftransactionsandcommunicatethelimitationsoftheCPEwithregardtomessageencoding.AnInformmessageMUSTNOToccurmorethanonceduringasessionThesessionceaseswhenboththeACSandCPEhavenomorerequeststosendandnoresponsesremainduefromeithertheACSortheCPE.Atsuchtime,theCPEMUSTclosetheconnection.NomorethanonetransactionsessionbetweenaCPEanditsassociatedACScanexistatatime.D.Authentication1.、如果CPE没有经过SSL/TLS认证,那么ACS必须使用HTTP对CPE进行认证,并且必须是摘要认证,如果经过SSL/TLS认证,则基本认证和摘要认证都可以。2、CPE必须支持基本认证和摘要认证3、CPE收到质询后,必须带认证头,而且以后的请求都必须带。4、HTTP认证的userid必须是如下两种格式中的一种:"-""-""-"5、userid是数字和字母的组合,如果不是需要使用RFC3986之URIpercentencoding进行转码.即如下形式符合:012345-0123456789012345-STB-0123456789012345-Set%2DTop%2DBox-01234567896、每个CPE的密码应该是唯一,此密码为共享密码,ACS和CPE应该都知道。7、ThissectionoutlinesrequirementsforuseofdigestauthenticationwithintheCPEWANManagementProtocol.TheCPEandtheACSMUSTsupporttheRFC2617“qop”optioncontainingthevalue“auth”.AccordingtoRFC2617,thismeansthattheHTTPclientMUSTuseanewstyledigestmechanismwhenthisoptionisprovidedtoitbytheHTTPserver.Whenusingdigestauthentication,foreachnewTCPconnectionopened,theACSSHOULDuseanewnoncevalueandtheCPESHOULDuseanewcnoncevalue.TheCPEandtheACSMUSTsupporttheMD5digestalgorithm.TheCPEMUSTadditionallysupporttheMD5-sessdigestalgorithm.E.UseofSOAPThefollowingdescribesthemappingofRPCmethodstoSOAPencoding:•TheencodingMUSTusethestandardSOAP1.1envelopeandserializationnamespaces:•Envelopenamespaceidentifier"http://schemas.xmlsoap.org/soap/envelope/"•Serializationnamespaceidentifier"http://schemas.xmlsoap.org/soap/encoding/"•AllelementsandattributesdefinedaspartofthisversionoftheCPEWANManagementProtocolareassociatedwiththefollowingnamespaceidentifier:•“urn:dslforum-org:cwmp-1-1”•ThenamespaceidentifierforCPEWANManagementProtocolversion1.nisalways“urn:dslforumorg:cwmp:1-n”,e.g.forv1.0itwas“urn:dslforum-org:cwmp:1-0”andforv1.42itwillbe“urn:dslforum-org:cwmp:1-42”.•ThedatatypesusedinAnnexAcorresponddirectlytothedatatypesdefinedintheSOAP1.1serializationnamespace.(Ingeneral,thetypesusedinAnnexAarerestrictedsubsetsofthecorrespondingSOAPtypes.)【http://schemas.stylusstudio.com/uddi3/ncad5bd9d/index.html】•Foranarrayargument,theargumentnamespecifiedinthetableinwhichthearrayisdefinedMUSTbeusedasthenameoftheoverallarrayelement.ThenameofthememberelementsofanarrayMUSTbethedatatypeofthearrayasspecifiedinthetableinwhichthearrayisdefined(excludingthebracketsandanylengthlimitationgiveninparentheses),andMUSTNOTbenamespacequalified.Forexample,anargumentnamedParameterList,whichisanarrayofParameterValueStructstructures,wouldbeencodedas:Asasecondexample,theMethodListarrayintheGetRPCMethodsResponsewouldbeencodedas:•TheRPCmethodsdefinedusethestandardSOAPnamingconventionwherebytheresponsemessagecorrespondingtoagivenmethodisnamedbyaddingthe“Response”suffixtothenameofthemethod.•ASOAPEnvelopeMUSTcontainexactlyoneBodyelement.•ACPEMUSTbeabletoacceptaSOAPrequestwithatotalenvelopesizeofatleast32kilobytes(32768bytes)withoutresultingina“ResourcesExceeded”response.•ACPEMUSTbeabletogenerateaSOAPresponseofanyrequiredlengthwithoutresultingina“ResourcesExceeded”response,i.e.thereisnomaximumCPESOAPresponselength.•AnACSMUSTbeabletoacceptaSOAPrequestwithatotalenvelopesizeofatleast32kilobytes(32768bytes)withoutresultingina“ResourcesExceeded”response.•AnACSMUSTbeabletogenerateaSOAPresponseofanyrequiredlengthwithoutresultingina“ResourcesExceeded”response,i.e.thereisnomaximumACSSOAPresponselength.•AfaultresponseMUSTmakeuseoftheSOAPFaultelementusingthefollowingconventions:Belowisanexampleenvelopecontainingafaultresponse:BelowisanexampleenvelopecontainingafaultresponseforaSetParameterValuesmethodcall:AfaultresponseMUSTonlybesentinresponsetoaSOAPrequest.AfaultresponseMUSTNOTbesentinresponsetoaSOAPresponseoranotherfaultresponse.Ifafaultresponsedoesnotfollowalloftheaboverequirements,theSOAPmessageMUSTbedeemedinvalidbytherecipient.TheconsequencesofinvalidSOAPontheCPEWANManagementProtocolsessionaredescribedinsection3.7.•Whenprocessingareceivedenvelope,bothACSandCPEMAYignore:(a)anyunknownXMLelements4andtheirsubelementsorcontent,(b)anyunknownXMLattributesandtheirvalues,(c)anyembeddedXMLcomments,and(d)anyXMLprocessinginstructions.AlternativelytheACSandCPEMAYexplicitlyvalidatethereceivedXMLandrejectanenvelopethatincludesunknownelements.Notethatthisprecludesextendingexistingmessagesbyincludingadditionalargumentswithoutchangingthenameofthemessage.•IfanRPCmethodrequiresreferencestoXMLSchemanamespaces(forexampleforthe“type”attribute,orforreferencestoXMLSchemadatatypes),thesereferencesMUSTbetothe2001versionsofthesenamespacedefinitions,specifically,http://www.w3.org/2001/XMLSchema-instanceandhttp://www.w3.org/2001/XMLSchema.TherecipientTheCPEWANManagementProtocoldefinesaseriesofSOAPHeaderelementsasspecifiedinTable4.F.CPEOperationi.SessionInitiation:CPE通过上面所说的发起连接,鉴权通过后,CPE向ACS发出Inform请求,当ACS响应一个InfromResponse后,CPE才认为会话建立。ii.IncomingRequests:在一个正常的会话当中,如果CPE接收了ACS的一个请求,则CPE必需在下一个发送给ACS的HTTPPOST中响应这个请求。iii.OutgoingRequests:如果CPE还有一个或者多个请求需要发送给ACS,那么CPE只有满足下面所有条件才可以发送下一个请求:•ThemostrecentlyreceivedHTTPresponsefromtheACSdidnotcontainaSOAPrequest.•TheACShasindicatedthatHoldRequestsisfalse(seesection3.5).ThisconditionismetifandonlyifthemostrecentlyreceivedHTTPresponsefromtheACScontainedoneofthefollowing:oASOAPenvelopewiththeHoldRequestsheadersettoavalueoffalse.oASOAPenvelopewithnoHoldRequestsheader.oNoSOAPenvelope(anemptyHTTPresponse).•Atanypriortimeduringthecurrentsession,theCPEhasnotsentanemptyHTTPPOSTatatimethattheACShadindicatedthatHoldRequestsisfalse(asdescribedabove).Whileinasession,ifanyoftheaboveconditionsarenotmetoriftheCPEhasnorequeststosendtotheACS,andifthemostrecentHTTPresponsefromtheACSdidnotcontainaSOAPrequest,theCPEMUSTsendanemptyHTTPPOST.OncetheCPEhassentanemptyHTTPPOSTwhenthemostrecentHoldRequestswasfalse(seesection3.5),theCPEMUSTNOTsendanyfurtherrequestsfortheremainderofthesession.Inthiscase,iftheCPEhasadditionalrequeststosendtotheACS,theCPEMUSTwaituntilasubsequentsessiontosendtheserequests.iv.SessionTermination:满足下面所有条件才能终止会话:1)TheACShasnofurtherrequeststosendtheCPE.TheCPEconcludesthisifandonlyifthemostrecentHTTPresponsefromtheACSwasempty.2)TheCPEhasnofurtherrequeststosendtotheACSandtheCPEhasissuedanemptyHTTPPOSTtotheACSwhileHoldRequestsisfalse(whichindicatestotheACSthattheCPEhasnofurtherrequestsfortheremainderofthesession).AsdefinedinTable6,ifthisconditionhasnotbeenmetbuttheCPEhasnofurtherrequestsorresponses,itMUSTsendanemptyHTTPPOST,whichwillthenfulfillthiscondition.3)TheCPEhasreceivedalloutstandingresponsemessagesfromtheACS.4)TheCPEhassentalloutstandingresponsemessagestotheACSresultingfrompriorrequests.还有一些非正常的情况下,需关闭会话,比如超时,收到了无效的SOAP格式,CPEHTTPPOSTInform时出现了非错误码8005,在这些以外情况下终止了会话,那么CPE必需在重试规则下重建会话G.EventsTheCPEMUSTattempttodelivereveryeventatleastonce.IftheCPEisnotcurrentlyinasessionwiththeACS,itMUSTattempttodelivereventsimmediately;otherwise,itMUSTattempttodeliverthemafterthecurrentsessionterminates.TheCPEMUSTreceiveconfirmationfromtheACSforittoconsideraneventsuccessfullydelivered.Formostevents,deliveryisconfirmedwhentheCPEreceivesasuccessfulInformResponse.Fourstandardeventtypes(KICKED,TRANSFERCOMPLETE,AUTONOMOUSTRANSFERCOMPLETE,REQUESTDOWNLOAD)indicatethatoneormoremethods(Kicked[sectionA.4.2.1],TransferComplete[sectionA.3.3.2],AutonomousTransferComplete[sectionA.3.3.3],RequestDownload[sectionA.4.2.2]respectively)willbecalledlaterinthesession,anditisthesuccessfulresponsetothesemethodsthatindicateseventdelivery一旦CPE成功的发送了某事件,那么他将不能再重复的发送改事件,同时ACS也要准备多次接收同一事件,因为有可能CPE由于收不到响应结果而重试。事件一次可以提交一个或多个。具体事件可以见因为版本TR069H.ACSOperationi.SessionInitiation:UponreceivingtheinitialInformrequestfromtheCPE,iftheACSwishestoallowtheinitiationofthesession,itMUSTrespondwithanInformresponse.IftheACSreceivesaninitialInformrequestfromtheCPEinwhichthenamespaceidentifierindicatesthattheCPEsupportsonlyv1.0oftheCPEWANManagementProtocol,theACSMUSTreverttov1.0fortheentiresession.ii.IncomingRequestsWhileinasession(afterthesessionwassuccessfullyinitiated,butbeforethesessionterminationcriteriadescribedin3.7.2.4havebeenmet),onreceptionofaSOAPrequestfromtheCPE,theACSMUSTrespondtothatrequestinthenextHTTPresponsesenttotheCPE.IftheACSwishestopreventtheCPEsendingrequestsduringsomeportionofthesession,itMAYdosobysettingtheHoldRequestsheadertotrueineachenvelopetransmittedtotheCPEuntiltheACSagainwishestoallowrequestsfromtheCPE.TheACSMUSTallowCPErequestsbeforecompletionofasession(thisMAYbedoneeitherexplicitlyviatheHoldRequestsheaderorimplicitlybysendinganemptyHTTPresponse).iii.OutgoingRequestsiv.SessionTermination:ACS满足下面所有条件才认为会话终止1)TheCPEhasnofurtherrequeststosendtheACS.TheACSconcludesthisifandonlyifithasreceivedanemptyHTTPPOSTfromtheCPEwhileHoldRequestsisfalse.2)TheACShasnofurtherrequeststosendtheCPEandthemostrecentHTTPresponsetheACSsenttotheCPEwasempty(whichindicatestotheCPEthattheACShasnofurtherrequests).3)TheACShassentalloutstandingresponsemessagestotheCPEresultingfrompriorrequests.4)TheACShasreceivedalloutstandingresponsemessagesfromtheCPE.IfalloftheabovecriteriahavebeenmetbeforetheACShassentitsfinalHTTPresponse,thefinalHTTPresponsefromtheACSMUSTbeempty.I.TransactionExamplesIntheexampleshowninFigure4,theACSfirstinitiatesafiledownload,andtheCPEsendsaTransferCompletelaterinthesamesession.NotethatthisscenariocouldoccuronlyifthefiledownloadisveryshortandtheCPEiscapableofperformingitinparallelwiththeongoingCPEWANManagementProtocolsession(whichaCPEisnotrequiredtodo).Toallowthispossibility,theACSsetsHoldRequestsequaltotrueuntilithascompletedsendingrequeststotheCPE.注意点:1.一旦ACS发送了一个空的HTTP响应,它必须使用HTTP状态码“204无内容”2.一旦CPE发送了一个空的HTTP请求,HTTP消息体的长度必须为03.CPE通过状态码“200(OK)”或“204(NOContent)”来响应一个经过正确认证的连接请求,同时HTTP响应中消息体的长度必须为04.如果ACS受到了一个连接请求的成功响应,但是在30S内CPE还是无法根据inform里面的“6CONNECTIONREQUEST”EventCode中包含的ACS地址成功连接,则ACS可以给CPE重新发送这个连接请求。5.如果一个HTTP请求报文或响应报文里面还有一个SOAP封装的(envelope),这个HTTP的content-type头必须包含一个“text/xml”的类型/子类型6.一个空的HTTPPOST不得包含SOAPAction头和content-type头。7.会话事务:会话必须由CPE发送的Inform请求开始,且在一个会话中不能出现多次Inform请求,除http认证401外。8.会话结束的条件是即没有发送的请求,也没有需要等待接受的响应。9.在同一时间只允许CPE和一个ACS交互',)