关于CWMP基础(二)----TR069通信流程
2026/7/10 12:56:58 网站建设 项目流程

    1.通信流程图

      1. 建立TCP连接
      2. SSL初始化,进行加密建立安全机制
      3. 由CPE端发起HTTP请求,发送Inform报文,开始建立CWMP连接。Inform中使用Eventcode字段描述发送Inform请求的原因 如 6 CONNECTION REQUEST ,表示ACS要求建立连接。
      4. 如果ACS通过CPE的请求,则连接建立。
      5. 如果CPE无别的请求则发送一个空报文。满足HTTP报文请求/响应报文交互规则。
      6. ACS查询CPE上设置的ACS URL的值
      7. CPE将所需要获取的值返回给ACS。
      8. ACS发现CPE的ACS URL是本机URL的值,于是发起Set请求,要求将CPE的ACS URL设置为备用ACS的URL的值。
      9. 设置成功,CPE发送响应报文。
      10. ACS无别的请求发送空报文。
      11. CPE发送关闭连接

      2.简单的报文实例

      POST/acs/xx HTTP/1.1Host:acs.avsystem.com:10301User-Agent:xxx CPE-0.21.3.31(3.6.13)Authorization:Digest username="",realm="ACSRealm",algorithm=MD5,nonce="JVwsZqxc3qEyTday/kL6C0H+BhQLbZCu",uri="/acs/xxx",qop=auth,nc=0000000a,cnonce="65da02d074fa0db3",response="a4dfe2ee1670802d4f1e12f330724fc7"Content-Type:text/xml;charset=utf-8SOAPAction:cwmp:Inform Content-Length:2970<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns:cwmp="urn:dslforum-org:cwmp-1-0"><soap:Header><cwmp:ID soap:mustUnderstand="1">haU761yJla</cwmp:ID></soap:Header><soap:Body><cwmp:Inform><DeviceId><Manufacturer>xxx</Manufacturer><OUI>C074AD</OUI><ProductClass>XXXX</ProductClass><SerialNumber>XXXXXXX</SerialNumber></DeviceId><Event soap-enc:arrayType="cwmp:EventStruct[1]"><EventStruct><EventCode>6CONNECTION REQUEST</EventCode><CommandKey></CommandKey></EventStruct></Event><MaxEnvelopes>1</MaxEnvelopes><CurrentTime>2021-04-06T17:05:44</CurrentTime><RetryCount>0</RetryCount><ParameterList soap-enc:arrayType="cwmp:ParameterValueStruct[11]"><ParameterValueStruct><Name>Device.GatewayInfo.ManufacturerOUI</Name><Value xsi:type="xsd:string"></Value></ParameterValueStruct><ParameterValueStruct><Name>Device.GatewayInfo.ProductClass</Name><Value xsi:type="xsd:string"></Value></ParameterValueStruct><ParameterValueStruct><Name>Device.GatewayInfo.SerialNumber</Name><Value xsi:type="xsd:string"></Value></ParameterValueStruct><ParameterValueStruct><Name>Device.DeviceInfo.HardwareVersion</Name><Value xsi:type="xsd:string">1.3A</Value></ParameterValueStruct><ParameterValueStruct><Name>Device.DeviceInfo.SoftwareVersion</Name><Value xsi:type="xsd:string">0.0.0.0</Value></ParameterValueStruct><ParameterValueStruct><Name>Device.DeviceInfo.ProvisioningCode</Name><Value xsi:type="xsd:string"></Value></ParameterValueStruct><ParameterValueStruct><Name>Device.ManagementServer.ConnectionRequestURL</Name><Value xsi:type="xsd:string">http://X.X.X.X:7547/4LUa1m6SgD5GBzaR</Value></ParameterValueStruct><ParameterValueStruct><Name>Device.ManagementServer.ParameterKey</Name><Value xsi:type="xsd:string">n/a</Value></ParameterValueStruct><ParameterValueStruct><Name>Device.LAN.IPAddress</Name><Value xsi:type="xsd:string">192.168.131.X</Value></ParameterValueStruct><ParameterValueStruct><Name>Device.LAN.MACAddress</Name><Value xsi:type="xsd:string">00:00:00:00:00</Value></ParameterValueStruct><ParameterValueStruct><Name>Device.DeviceSummary</Name><Value xsi:type="xsd:string">Device:1.3[](Baseline:1,UDPConnReq:1,GatewayInfo:1,LAN:1,Time:1,IPPing:1,TraceRoute:1,Download:1,Upload:1,MemoryStatus:1),VoiceService:1.0[1](Endpoint:1,SIPEndpoint:1)</Value></ParameterValueStruct></ParameterList></cwmp:Inform></soap:Body></soap:Envelope>
      • 当建立连接后,CPE发送请求,并发送Inform报文通知。(Eventcode表示请求原因 如:connect request)
      HTTP/1.1200OK Date:Tue,06Apr202109:05:44GMT Set-Cookie:AVSSESSIONID=8FbL3sKSb9CFE4BrPp6WmmL_jZb81lXKOmCByV0ja-wILFtvXN_Zgg;Path=/Expires:Thu,01Jan197000:00:00GMT Content-Type:text/xml;charset="UTF-8"Content-Length:459<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"xmlns:cwmp="urn:dslforum-org:cwmp-1-0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header><cwmp:ID soap:mustUnderstand="1">haU761yJla</cwmp:ID></soap:Header><soap:Body><cwmp:InformResponse><MaxEnvelopes>1</MaxEnvelopes></cwmp:InformResponse></soap:Body></soap:Envelope>POST/acs/xx HTTP/1.1
      • ACS收到请求后,发送Inform报文响应。
      <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"xmlns:cwmp="urn:dslforum-org:cwmp-1-0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header><cwmp:ID soap:mustUnderstand="1">haU761yJla</cwmp:ID></soap:Header><soap:Body><cwmp:InformResponse><MaxEnvelopes>1</MaxEnvelopes></cwmp:InformResponse></soap:Body></soap:Envelope>POST/acs/xx HTTP/1.1Host:acs.avsystem.com:10301User-Agent:xxxx CPE-0.21.3.31(3.6.13)Cookie:AVSSESSIONID=8FbL3sKSb9CFE4BrPp6WmmL_jZb81lXKOmCByV0ja-wILFtvXN_Zgg Authorization:Digest username="",realm="ACSRealm",algorithm=MD5,nonce="JVwsZqxc3qEyTday/kL6C0H+BhQLbZCu",uri="/acs/grandstream",qop=auth,nc=0000000b,cnonce="65da02d074fa0db3",response="1a89bfd8e8d89377bc9a961769644ef5"Content-Type:text/xml;charset=utf-8Content-Length:0
      • CPE发送空报文无别的请求,满足HTTP报文的请求/响应的交互规则。
      HTTP/1.1200OK Date:Tue,06Apr202109:05:45GMT Content-Type:text/xml;charset="UTF-8"Content-Length:406<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"xmlns:cwmp="urn:dslforum-org:cwmp-1-0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header><cwmp:ID soap:mustUnderstand="1">47ed9304</cwmp:ID></soap:Header><soap:Body><cwmp:GetRPCMethods/></soap:Body></soap:Envelope>POST/acs/xxx HTTP/1.1
      • ACS响应获取getRPCMethods的请求
      <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns:cwmp="urn:dslforum-org:cwmp-1-0"><soap:Header><cwmp:ID soap:mustUnderstand="1">47ed9304</cwmp:ID></soap:Header><soap:Body><cwmp:GetRPCMethodsResponse><MethodList soap-enc:arrayType="xsd:string[18]"><string>GetRPCMethods</string><string>GetParameterNames</string><string>GetParameterValues</string><string>SetParameterValues</string><string>SetParameterAttributes</string><string>GetParameterAttributes</string><string>AddObject</string><string>DeleteObject</string><string>Reboot</string><string>FactoryReset</string><string>Download</string><string>Upload</string><string>ScheduleInform</string><string>GetQueuedTransfers</string><string>GetAllQueuedTransfers</string><string>ScheduleDownload</string><string>CancelTransfer</string><string>ChangeDUState</string></MethodList></cwmp:GetRPCMethodsResponse></soap:Body></soap:Envelope>
      • CPE请求,发送GetRPCMethods的响应
      HTTP/1.1200OK Date:Tue,06Apr202109:05:45GMT Content-Type:text/xml;charset="UTF-8"Content-Length:566<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"xmlns:cwmp="urn:dslforum-org:cwmp-1-0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header><cwmp:ID soap:mustUnderstand="1">72518d29</cwmp:ID></soap:Header><soap:Body><cwmp:GetParameterValues><ParameterNames soap-enc:arrayType="xsd:string[1]"><string>Device.ManagementServer.PeriodicInformInterval</string></ParameterNames></cwmp:GetParameterValues></soap:Body></soap:Envelope>POST/acs/xxxx HTTP/1.1Host:acs.avsystem.com:10301User-Agent:xxxx CPE-0.21.3.31(3.6.13)Cookie:AVSSESSIONID=8FbL3sKSb9CFE4BrPp6WmmL_jZb81lXKOmCByV0ja-wILFtvXN_Zgg Authorization:Digest username="",realm="ACSRealm",algorithm=MD5,nonce="JVwsZqxc3qEyTday/kL6C0H+BhQLbZCu",uri="/acs/grandstream",qop=auth,nc=0000000d,cnonce="428822b01d33404d",response="7598a61391e704feb7973476224382ce"Content-Type:text/xml;charset=utf-8SOAPAction:Content-Length:737
      • ACS响应,发送getParameterValues的值。
      <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns:cwmp="urn:dslforum-org:cwmp-1-0"><soap:Header><cwmp:ID soap:mustUnderstand="1">72518d29</cwmp:ID></soap:Header><soap:Body><cwmp:GetParameterValuesResponse><ParameterList soap-enc:arrayType="cwmp:ParameterValueStruct[1]"><ParameterValueStruct><Name>Device.ManagementServer.PeriodicInformInterval</Name><Value xsi:type="xsd:unsignedInt">86400</Value></ParameterValueStruct></ParameterList></cwmp:GetParameterValuesResponse></soap:Body></soap:Envelope>
      • CPE回复ACS的结果
      HTTP/1.1204No Content Date:Tue,06Apr202109:05:45GMT
      • CPE请求关闭连接

      需要专业的网站建设服务?

      联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

      立即咨询