使用两个眩晕服务器确定NAT映射行为

发布于 2025-02-11 17:08:46 字数 577 浏览 0 评论 0原文

是否可以使用两个眩晕服务器确定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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

余生共白头 2025-02-18 17:08:46

我将尝试在同一主机上的不同端口上设置两个眩晕服务器。

因此,您总共需要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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文