How to make chat between p2p clients behind double NAT?

  • Option 1: All machines with NAT support UPnP.
  • Option 2: Only one side can enable UPnP.
  • Option 3: UPnP is not available to anyone.

Language / development platform: Qt C ++ (QtCreator + MinGW, Windows).

Closed due to the fact that the issue is too general for the participants αλεχολυτ , Denis Bubnov , user194374, aleksandr barakin , kmv 13 Feb '17 at 13:50 .

Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • one
    In any case, you need a signaling server so that customers can learn about each other. If at least one of the machines supports UPnP - no problem. It starts as a server and the second connects to it. Another thing, if UPnP is not. Here you need to punch nat (NAT hole panching). If only on both sides of something that is different from the sympathetic Nata, everything is quite possible. - KoVadim
  • Can you give an example (C ++ or C ++ Qt code) or a request for UPnP, or a request for a STUN server? Because Google is full of abstract reasoning, but there is no code, alas. I have already been using this question for more time than many people on the site are programming. And, as you think, I don’t know anything about signal servers, STUNs, TURNs, ICEs, etc. Help the code, and do not fill yourself a reputation on the site, unsubscribing muddy abstraction. - aversilov
  • one
    Yes, Google is full. But it is difficult to find something if you do not know what. Here is a description of how UPnP works - habrahabr.ru/post/279969 . It also describes NAT-PMP, which is an order of magnitude simpler (a pair of UDP requests and a port is open). If you want ready - miniupnp.free.fr/libnatpmp.html - ready lib. But if you need a complete solution, look at tox . - KoVadim
  • It requires a minimalistic code, not a library-bad-combine (as the American cattle used to, to shove an elephant-like "100500-in-1 solution" everywhere). You can write at least five or six days of C ++ or C ++ Qt code (or at least designate an algorithm with a pseudocode) how programmatically to even request UPnP "service" if it is not chopped off on the router. The article you referred to loomed me for a long time before my eyes and was annoyed by the fact that they just go into general reasoning - most likely, precisely because of the inability to write code. And the author, right there, notice, the user AlexandrDP broke off (see) and others too. - aversilov
  • Or, if it is not a pity, show a bit of different options for circumventing the incident to which the user AlexandrDP pointed to the author, and who (according to my insider information, and I have access to the statistics of providers, at least, of Ukraine - with its 45 million. population) closes up to 80-90% of cases of private use of the Internet: this refers to the situation of being behind virtually double NAT. And in such a bundle of two NATs the second that looks out, UPnP usually does not support, as does NAT-PMP. Do a good deed: give a sample code, how to break through? Maybe a tunnel, ICMP or DNS? - aversilov

0