linux - UDP打洞,服务器收到的端口号有可能是本机绑定的端口号吗?
伊谢尔伦
伊谢尔伦 2017-04-17 15:22:55
0
3
395

最近在做关于P2P控制软件,在UDP打洞的过程中遇到问题。

  1. 服务器收到的来自A、B的IP是外网的IP,但是端口号居然和A、B绑定的端口号一样!有这种可能吗?我觉得这点(就是服务器收到来自客户端的包,比如A bind的是5678,发送到服务器,它要经过NAT转换,然后到达服务器,服务器收到该包的端口不应该是5678)肯定有问题,但不知道是什么问题,所以A、B相互发送数据包是不通的。

  2. 本机连接是一个路由器,TPLink

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(3)
Peter_Zhu

It’s the same, what’s the problem? Who stipulates that they cannot be the same?

You can use the program here to first determine the NAT type (software download on Google Code). Not all NATs can successfully drill holes (experimental report).

刘奇

It means that the server receives the packet from the client. For example, A bind is 5678 and is sent to the server. It needs to be converted by NAT and then reaches the server. The port where the server receives the packet should not be 5678

Why shouldn’t it be 5678?

黄舟

NAT is divided into two categories: basic NAT and NAPT.
The port the server received the packet on is 5678, probably because you are using basic NAT

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!