[noob] UDP holes without success!

Network topology

A - NAT A -- Server -- NAT B - B

A,B were the hosts. Server is the company's host.
NAT A , NAT B for the two telecommunications pathways, but take different routes to the Server.

A 100.100.100.100:6666 A 58.61.99.4:4000 through NAT
B 200.200.200.200:6666 B 183.39.189.98:4000 through NAT

1)A, B are bound to the local PORT, global socketfd, and then log on Server.
2)Exchange address information of each other NAT A / NAT B.
3)A try to NAT B message......
4)Tell Server to B to A information... B A NAT A correctly received information, and transmitting....
5)A tried again to NAT B information.........

Now
5) This step A sent out information but B does not receive information.

Then
I performed the 3-5 these three steps again, found that NAT A has changed the public after the PORT changed.... (not binding on the same Mody, again in the interval 5S shortly.).

Code with online substantially the same..... Do not know why, and great advice!

Started by Nathaniel at February 11, 2016 - 7:48 PM

Nat is divided into Symmetic and Cone, see your description may be Symmetic, the NAT had better give up the hole

You can ask to the management module of Linux system

Posted by Reuben at February 15, 2016 - 7:49 PM

Thanks for your reply! What is the specific way NAT I am not very clear,

My current NAT A here is the company intranet, is provided with a firewall, but do port mapping, reserved ports do,
NAT B this is the ordinary family network, directly connected to router, dial-up cats!

Posted by Nathaniel at February 16, 2016 - 8:06 PM

Your server's iptables how to set the port mapping

Posted by Reuben at February 20, 2016 - 8:47 PM

The server is a Windows host, is written in VC program.

Now I'm in the A B two client and server connected to the heart, to keep port constant.


Now is: (do not know whether the Telecom Access Issues)
NAT A ip:port in B host Ping.
NAT B ip:port is able to ping in the A host.

Posted by Nathaniel at January 01, 2017 - 6:24 PM

Recent studies found that A is also a side of the host binding local the same port to connect to the server (server two program), the NAT A are respectively connected to different port! (the Internet said this is the symmetric NAT? Do not know is not true)

Posted by Nathaniel at January 02, 2017 - 6:13 PM

Extract H3C website introduction:
Symmetric NAT
Symmetric NAT, all to a specific destination IP and port number of the request is sent from the same network IP and port number, will be mapped to the same IP and port number. If you use the same host the same source address and port number to send packets, but sent to different destination, NAT will use a different mapping. In addition, only the received data network host can turn to the intranet host sends a packet.

I did a test:
The local A host in two program clientA clientB is bound to the same port 2000, the server to open the two procedures SA, SB binding ports 4000 and 5000 respectively,
Then clientA clientB is respectively connected with the SA, SB, found through NAT after the two session ports are not the same!
Is not that I now A host in the NAT is a symmetric version of NAT?
If indeed the symmetric NAT, I give up! Because the company servers in Beijing, to test the client in Shenzhen, the 2 Telecommunications Pathways.

Posted by Nathaniel at January 13, 2017 - 7:06 PM