Home > Software engineering >  NAT penetration problem about p2p communication protocol (UDP)
NAT penetration problem about p2p communication protocol (UDP)

Time:10-23

I'm doing a p2p communication software, using UDP protocol, the principle is like this:

S, A and B, respectively, login to the server due to A and B are in Intranet, log on to the server, the network IP and port mapping network outside IP and port,

And then S the address and port of A and B (after A and B of the router mapping outside network IP and port) to each other, then A and B to the other party each other's IP and port to send data, send A times A second, until received each other's data, even made contact, stop,

But I found that the result is: A and B will never accept less than the other side of the data, the hair is hair of, to the other party to send A times A second (each other through the router mapping network IP and port), but always don't get the data of the other party, don't get to each other,

What's the problem? I send data is simple, just a dozen bytes, and to the other party only after the router mapping of the network of IP and port to send, don't send it the original network IP and port (right?)

My two computers, is the both sides of communication: A and B, A router is in the room with broadband Internet access to the Internet, is A mobile phone 4 g Internet do hot spots, and then the computer connected to the mobile phone hot on the Internet, at that moment, the mobile phone can play the role of A router?

There went wrong? Why not accept each other's data? (for a second time, in fact, after sending a is to play the hole, the other should be able to receive the data, but has not received).

CodePudding user response:

I wonder: am I in the communication of two computers, one is inside the router via broadband Internet access, one is using a mobile phone as a hot spot on the Internet, this two routers, is one of the so-called "symmetrical NAT"? If so, it is really cannot penetrate succeeded, but rarely the router NAT types should be?

CodePudding user response:

Ok, penetrate not successful reason I found myself,

I downloaded a NAT types of software, found a cell phone 4 g hotspot, open the computer connected to the hot spot of the online, the router NAT types are Symmetric type, which is symmetrical, the router is unable to penetrate a success,

With the house router connected to the broadband Internet access, NAT types are the Port Restricted Cone type, this type, if A and B are of this type, still can penetrate A success, but is A Symmetric type, one is the Port Restricted Cone type, it is impossible to penetrate succeeded,

But I want to ask: if life, this kind of Symmetric type of router is overmuch, the p2p communication is greatly restricted? The success rate is greatly reduced?

CodePudding user response:

Come to pick up points,,

CodePudding user response:

Help junction post + points

CodePudding user response:

The server forwarding will be needed

CodePudding user response:

CodePudding user response:

CodePudding user response:

I am also looking at something in this respect, also is met a symmetric NAT directly, how couldn't get through, is according to the online port try guessing method, but the efficiency is very low, it is said that the success rate is not high also, everyone have a good idea to learn each other!

CodePudding user response:

Skype is how to penetrate the success? It is often use mobile phones, and mobile phones are mostly symmetrical,
  • Related