使用两个眩晕服务器确定NAT映射行为
是否可以使用两个眩晕服务器确定NAT的映射行为? 在这里。
映射行为有三种类型:
独立于端点的映射:NAT重用从同一内部IP地址发送的后续数据包的端口映射,并将端口(X:X)发送到任何外部IP地址和端口。具体而言,x1':x1'等于x2':x2':x2'对于所有y
。 x)到同一外部IP地址,无论外部端口如何。具体而言,x1':x1'等于x2':x2',并且仅当y2等于y1时。
地址和端口依赖性映射:NAT重用从相同的内部IP地址发送的后续数据包的端口映射,而端口(x:x)仍在相同的外部IP地址和端口时,映射仍在积极的。具体而言,x1':x1'等于x2':x2',并且仅在y2:y2等于y1:y1时。
因此,从理论上讲,如果您向公共IP地址询问两个不同的眩晕服务器,并且获得相同的IP:端口,您应该有一个独立于端点的映射吗?但是您如何区分其他两种类型?
is it possible to determine the mapping behaviour of a NAT using two STUN servers? something like here.
There are three types of mapping behaviour:
Endpoint-Independent Mapping:The NAT reuses the port mapping for subsequent packets sent from the same internal IP address and port (X:x) to any external IP address and port. Specifically, X1′:x1′ equals X2′:x2′ for all Y.
Address-Dependent Mapping: The NAT reuses the port mapping for subsequent packets sent from the same internal IP address and port (X:x) to the same external IP address, regardless of the external port. Specifically, X1′:x1′ equals X2′:x2′ if and only if, Y2 equals Y1.
Address and Port-Dependent Mapping:The NAT reuses the port mapping for subsequent packets sent from the same internal IP address and port (X:x) to the same external IP address and port while the mapping is still active. Specifically, X1′:x1′ equals X2′:x2′ if and only if, Y2:y2 equals Y1:y1.
So in theory if you ask two different STUN servers for your public IP address and you get the same IP:port, you should have an Endpoint-Independent Mapping right? but how do you differentiate the other two types?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我将尝试在同一主机上的不同端口上设置两个眩晕服务器。
因此,您总共需要3个眩晕服务器:同一主机上的两个,另一个在另一个主机上。
如果您获得3个不同的候选人,则必须是地址和端口依赖的映射; 2表示依赖地址; 1-端点依赖性; 0 -UDP可能被阻止。
但是,需要对这种方法进行彻底的测试,我相信可能会有一些依赖浏览器的惊喜(请参阅您提供的文章中的
esser50k
评论)。I would try setting up two stun servers on different ports on the same host.
So you will need 3 stun servers in total: two on the same host and one on other.
If you get 3 different candidates, it must be address and port dependent mapping; 2 means address-dependent; 1 - endpoint-dependent; 0 - udp is probably blocked.
But this approach needs to be tested thoroughly, I believe there might be some browser-dependent surprises (see
esser50k
comment in the article you provided).