TR069-STUN

article/2025/10/18 21:38:46

        该模块依据TR-111实现STUN Server功能,基站设备(CPE)作为STUN Client,向STUN Server发送BINDING-REQUEST,CPE通过BINDING-RESPONSE响应消息获取设备是否在NAT之后,以及NAT类型。

        如果设备在NAT之后,CPE上报Inform(4 VALUE CHANGE)消息通知ACS(HeMS)基站设备在NAT之后,并在SOAP报文中携带CPE在公网的IP&Port。ACS获取到CPE公网IP&Port后,在ACS主动连接CPE场景时通过发送UDP Connection Request(多包)叫起CPE,CPE收到UDP Connection Request后,延续TR-069协议的原有流程,发送Inform(6 CONNECTION REQUEST)消息与ACS建立连接。

        TR-111相关的主要流程包括绑定发现&保持、绑定超时发现、绑定变更通知、ACS发起TR-069会话。

1.Binding discovery / maintenance from the primary source port

         上图是CPE周期进行Binding discovery和Binding maintenance,从primary source port发送Binging Reques的消息流图。

2. Binding Request from secondary source port for binding timeout discovery

        

3.  Binding changenotificationnot authenticated by the ACS

 

4. ACS initiate a TR-069 session(UDP Connection Request) 

        

         上图是ACS通过发送UDP Connection Request发起TR-069 session

        ACS必须从与STUN Server相同的源IP地址和端口发送UDP Connection Request消息。一个UDP Connection Request消息必须是单独的一个UDP包。ACS应该发送多次UDP Connection Request消息,以减少消息丢失的可能性,由于UDP消息不可靠性, ACS发送给同一CPE的多个UDP Connection Request消息的内容(包括消息ID,时间戳和cnonce等)必须完全相同。

        ​​​​​​​5. TR-111扩展的STUN数据模型

Name

Type

Write

Description

Default

ManagementServer.

object

-

This object contains parameters relating to the

CPE’s association with an ACS.

UDPConnectionRequestAddress

string(256

-

Address and port to which an ACS MAY send aUDP Connection Request to the CPE.

This parameter is represented in the form of anAuthority element as defined in [2-7]. The value

MUST be in one of the following two forms:host:porthostWhen STUNEnable is true, the “host” and “port”portions of this parameter MUST represent the

public address and port corresponding to the NAT

binding through which the ACS can send UDPConnection Request messages (once this

information is learned by the CPE through the useof STUN).

When STUNEnable is false, the “host” and “port”portions of the URL MUST represent the local IPaddress and port on which the CPE is listening forUDP Connection Request messages.

The second form of this parameter MAY be usedonly if the port value is equal to “80”.

UDPConnectionRequestAddressNotification-

Limit

unsignedInt

W

The minimum time, in seconds, between ActiveNotifications resulting from changes to the UDPConnectionRequestAddress

(if Active Notificationis enabled).

STUNEnable

boolean

W

Enables or disables the use of STUN by the CPE.

This applies only to the use of STUN inassociation with the ACS to allow UDPConnection Requests.

STUNServerAddress

string

W

Host name or IP address of the STUN server forthe CPE to send Binding Requests if STUN isenabled via STUNEnable.

If empty and STUNEnable is true, the CPE MUSTuse the address of the ACS extracted from thehost portion of the ACS URL.

STUNServerPort

unsignedInt

[0:65535]

W

Port number of the STUN server for the CPE tosend Binding Requests if STUN is enabled via

STUNEnable.

By default, this SHOULD be the equal to thedefault STUN port, 3478.

STUNUsername

string(256)

W

If non-empty, the value of the STUN USERNAMEattribute to be used in Binding Requests (only ifmessage integrity has been requested by the

STUN server).

If empty, the CPE MUST NOT send STUNBinding Requests with message integrity.

STUNPassword

string(256)

W

The value of the STUN Password to be used incomputing the MESSAGE-INTEGRITY attribute tobe used in Binding Requests (only if messageintegrity has been requested by the STUN server).

When read, this parameter returns an emptystring, regardless of the actual value.

STUNMaximumKeepAlivePeriod

int[-1:]

W

If STUN Is enabled, the maximum period, inseconds, that STUN Binding Requests MUST besent by the CPE for the purpose of maintainingthe binding in the Gateway. This appliesspecifically to Binding Requests sent from theUDP Connection Request address and port.

A value of -1 indicates that no maximum period isspecified.

STUNMinimumKeepAlivePeriod

unsignedInt

W

If STUN Is enabled, the minimum period, inseconds, that STUN Binding Requests may besent by the CPE for the purpose of maintainingthe binding in the Gateway. This limit applies onlyto Binding Requests sent from the UDP

Connection Request address and port, and onlythose that do not contain the BINDING-CHANGEattribute. This limit does not apply toretransmissions following the procedures definedin [2-5].

NATDetected

boolean

-

When STUN is enabled, this parameter indicateswhether or not the CPE has detected addressand/or port mapping in use.

A true value indicates that the received MAPPEDADDRESS

in the most recent Binding Responsediffers from the CPE’s source address and port.

When STUNEnable is false, this value MUST befalse.


http://chatgpt.dhexx.cn/article/rKsTpYAc.shtml

相关文章

TR069 测试

对于需要测试TR069的用户,可以使用一个免费的测试平台。 测试方法可以参考下面的流程: TR069智能云平台提供了完全免费的终端自动配置系统. 1.首先登录到http://39.106.195.193:9090/acscloud 注册您的用户 2.注册成功后,在您的设备端配置ACS…

TR069协议与商业应用5——TR069协议架构设计

声明:原创作品,严禁用于商业目的。 如有任何技术问题,欢迎和我交流:19826269205(微信同号)。 腾讯课堂链接 B站免费视频部分 文章目录 1. TR069(CWMP)程序设计思想2. 架构分析3. T…

TR069协议

TR069( Technical Report 069)全称是“ CPE广域网管理协议(CWMP),用于远程终端管理,是 CPE 和 ACS之间沟通的通讯协定。CPE 可以借着这个协定完成服务开通、功能设定、档案上传下载、系统检测 等等初始化及…

TR069浅析

何为TR069? TR069, 全称“Technical Report 069”是由DSL Forum修订的一份技术规范,该规范是应用层的管理协议,命名为“CPE广域网管理协议”。 TR069定义了一套全新的网管体系结构,包括管理模型,交互接口及基本的管理…

TR069

tr069简介 全称是“用户终端设备广域网管理协议(CWMP) 用于远程终端管理,比如远程的配置阿什么的(对远程的设备进行配置等管理) 1. TR069协议网络架构 ACS为自动配置服务器,负责对终端设备CPE进行管理…

CWMP协议(TR069协议)学习

文中借鉴了一些大神的整理,后面会贴上链接,如侵删 目录 一、概念(来自百度百科) 二、网络元素 三、基本功能 四、CWMP协议栈 五、远程调用方法(RPC)详细的RPC方法定义请参见TR-069 六、inform的事件…

TR069是什么鬼

一,TR069是什么 1,概念 搞嵌入式或通信设备的,或多或少都会听说TR069。那他是什么鬼? TR069,就是CPE广域网管理协议。 它用于ACS和CPE之间的自动协商交互,能够实现终端的自动配置。( ACS&#x…

TR069协议详解

一、关于TR069协议 TR069, 全称“Technical Report 069”是由DSL Forum(一个非盈利性的全球行业联盟,致力于发展宽带网络范, 其成员包括通讯、设备、计算机、网络和服务提供商等行业的领先厂商,现已更名为“Broadband Forum”)修…

TR-069协议介绍

一、概念 关于TR-069 ①协议命名 TR-069, 全称“Technical Report 069”是由DSL Forum(一个非盈利性的全球行业联盟,致力于发展宽带网络范)。其成员包括通讯、设备、计算机、网络和服务提供商等行业的领先厂商,现已更名为“Broadband Forum…

apache多个php版本fcgi,apache使用mod_proxy_fcgi实现多版本php共存

2019-08-02 apache使用mod_proxy_fcgi实现多版本php共存 首先配置php 安装你想用的php版本,找到你的php-fpm.conf配置文件 将listen换成你想要的端口 比如listen 127.0.0.1:9099 注意,如果你的fpm系变量配置文件在php-fpm.d的www.conf下面,请…

搭建nginx+fcgi并使用Holer实现内外网访问

1、环境搭建 本文使用了ubuntu20.04系统进行搭建。 1.1搭建nginx服务器 到Nginx的官网(http://nginx.org/en/download.html)上去下载最新的源码包,本文使用的是nginx-1.20.0.tar.gz (1)执行tar -zxvf nginx-1.20.0.tar.gz 命令解压文件到当…

web服务选择lighttpd,采用fcgi组件技术扩展处理业务层

目录 一、简介fcgi:web和web服务器间数据传输的桥梁... 2 二、源码编译配置ARM Lighttpd Fastcgi C.. 3 【1】交叉编译。源文件都从官网下载。 Fcgi lighttpd zlib. 3 【2】配置服务器server.document-root"/www" fastcgi.server "bin-path&quo…

Nginx运行FastCGI程序(ngx_http_fastcgi_module模块、fcgi库、spwan-fcgi进程管理器)

一、什么是CGI 通用网关接口(Common Gateway Interface、CGI)描述了客户端和服务器程序之间传输数据的一种标准,可以让一个客户端,从网页浏览器向执行在网络服务器上的程序请求数据。 CGI 独立于任何语言的,CGI 程序可…

php运行方式fpm fcgi,php如何从fpm-fcgi切换运行模式到cli

在使用一个php爬虫的时候提示一定要用cli环境 我查看了当前php版本信息如下: 我打印 PHP_SAPI 显示 fpm-fcgi 如何才能变成 cli 服务器环境是linux+nginx 补充:我能不能理解为cli一定是要命令行模式? 刚刚在命令行里测试了PHP_SAPI 输出了cli 问:能不能http模拟调用实现cli…

spwan-fcgi和fcgi 关系

spwan-fcgi: 举个例子: spawn-fcgi -a 127.0.0.1 -p 10000 -f ./login spwan-fcgi.c: main 函数 会执行参数解析过程 获得 ip 端口 和 执行文件的路径。 bind_socket 函数会执行 sockt 的 绑定监听过程, 函数 fcgi_spawn_connection 会通过系统调用d…

nginx+spawn-fcgi+demo+fcgi库函数

由于项目中用到了nginxFastCGI相关内容,所以这段时间学习了一下,顺便记下相关内容。 我是在远程工作机上实验的,有个缺点就是没有root权限,所以有些步骤我就没做了,比如make install(nginx)、添…

【fcgi-2.4.0】移植fcgi-2.4.0到armv7平台

源码下载链接 Index of /lookaside/extras/fcgi/fcgi-2.4.0.tar.gz/d15060a813b91383a9f3c66faf84867e (fedoraproject.org)https://src.fedoraproject.org/lookaside/extras/fcgi/fcgi-2.4.0.tar.gz/d15060a813b91383a9f3c66faf84867e/下载fcgi-2.4.0.tar.gz 解压源码 tar …

程序异常捕获库 - CrashRpt

CrashRpt.dll用来在应用程序出现异常crash时,捕获到错误,并收集出错信息:MiniDump文件、硬件信息、系统信息、出错信息、进程信息、服务信息、驱动信息、启动信息、软件列表、端口信息、磁盘分区、WinSock LSP、IE插件、网卡信息。 1、使用方…

CrashRpt.dll用来在应用程序出现异常crash

欢迎加入我们的QQ群,无论你是否工作,学生,只要有c / vc / c 编程经验,就来吧!158427611 欢迎加入我们的QQ群,无论你是否工作,学生,只要有c / vc / c 编程经验,就来吧&a…

crashRpt使用方法

从官网上下载crashRpt的源码,按说明编译出相应的lib和dll 1 在编译crashRpt的时候,在环境变量中设置 crashrptDirD:\work\AIW\WebMicaps\WebMicapsServer\src\CrashRpt,以简化编译 2 在主程序运行的工作目录下要拷贝crashRpt编译后生成…