UDP打洞可能吗?
我正在尝试查看某个 NAT 后面是否可以进行 UDP 打洞,但我发现当 NAT 后面的计算机将 UDP 数据包发送到两个不同的 IP 到同一端口,同时绑定到同一端口时, NAT 分配两个不同的外部端口号。那么在这个特定的 NAT 后面,我相信 UDP 打洞是不可能的,这是正确的吗?
谢谢
I'm trying to see if UDP hole punching is possible behind a certain NAT, but I've found that when the computer behind the NAT sends out UDP packets to two different IPs to the same port while being bound to the same port, the NAT assignes two different external port numbers. So behind this particular NAT, I believe UDP hole punching is impossible, is this correct?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
未必。路由器可能愿意响应 IGD。
Not necessarily. The router might be willing to respond to IGD.
这意味着你的 NaT 是对称的,如果你的 NaT 是对称的,它会为每个连接提供不同的外部端口。并且不可能从两种方式连接打孔,但仍然可以连接 p2p。但只有当代理端使用圆锥形 Nat 时才有可能。搜索那个。
但是,如果两个位置使用 Symetric NaT,则无法使用 Udp Hole Punching 连接 p2p 连接。
4:a:圆锥曲线=> b:对称---------不可能/但可能连接单向握手
但是您仍然可以使用端口预测方法。这意味着您必须猜测可以在连接中使用哪个端口并尝试连接它( Tcp Hole Punch )
对于 Conic NaT 可以查看关于 UDP Hole Punching 请检查 https://github.com/turapulku/NaT-Traversal-UDP-Hole-punch.git
仍在开发中,但目前正在开发中我希望它有帮助
it's mean your NaT Symetric, And if your NaT is Symetric it's given different External ports for each connection.And it's not possible to connect Hole punching from two way but it's still possible to connect p2p. But only possible if agent side using conic Nat. Search for that.
But if two locations using Symetric NaT there is no way to connect p2p connection with Udp Hole Punching.
4: a:Conic => b:symetric --------- not possible / but possible to connect one way handshake
But You can still use port prediction methods. it's mean you must guess wich port can be use in connection and try to connect it ( Tcp Hole Punch )
For Conic NaT can See About UDP Hole Punching Please Check Sample in https://github.com/turapulku/NaT-Traversal-UDP-Hole-punch.git
That's still developing but for now it's i hope it's helpful
您可以使用此网站来确认此特定 NAT 的行为。
http://nattest.net.in.tum.de/test.php
它将检查您的 NAT 类型并测试 UDP/TCP 打洞是否可行。
但由于您已经知道端口分配是随机的,因此 UDP 打洞是不可能的。使用 UPnP 是另一种方法,但在嵌套 NAT 后面不起作用。
You can use this web site to confirm the behavior of this particular NAT.
http://nattest.net.in.tum.de/test.php
It will check your NAT type and test if UDP/TCP hole punching is possible.
But since you already knew the port assignment is random, the UDP hole punching is not possible. Using UPnP to is another way, but does not work behind nested NATs.