ultra_ping icon indicating copy to clipboard operation
ultra_ping copied to clipboard

Problem in NAT environment

Open wangyu- opened this issue 7 years ago • 1 comments

Hi, thanks for the amazing tool.

After several tests, I found it requires public IP for both client and server, otherwise the packet loss will be always 100%.

I have checked the code, looks like the reason is: For receiving packet, the server creates a listening socket ; but for sending packets back, the server tries to establish a "connection" to client use another socket. If there is no public IP for client, the latter procedure will fail.

The solution is easy, just send packets back with the same socket used for receiving. This is the way most other udp programs (such as netcat) do, it only requires public IP for server.

I am not familiar with the code and Python. I cant create a pull request right now. Nowadays NAT is quite common, I really hope this problem can be fixed. Thank you.

wangyu- avatar May 19 '18 02:05 wangyu-

Hi there! Thanks for using it. I'm glad it's useful.

I'm afraid I'm pretty busy with other things at the moment, so I don't think I'll have time to fix this any time soon. If you do end up creating a pull request, though, I'd be very happy to accept it :) So I'll leave the issue open for the time being.

mrahtz avatar May 21 '18 13:05 mrahtz