-1

I would like to understand how udp hole punching works when two hosts each behind the port restricted cone NAT establish connection.

As I understood, it happens in several stages and involves three hosts.

Host A and host B are behind the port restricted cone NAT.

Host C is a server that can receive packets from the hosts A and B.

  1. A sends a packet to C.
  2. C receives packet from A and determines A's external address:port pair
  3. B sends a packet to C.
  4. C receives packet from B and determines B's external address:port pair
  5. C sends the external address:port of B to A
  6. C sends the external address:port of A to B
  7. A sends packet_1 to B's external address
  8. B sends packet_2 to A's external address

But I can't do it。it's the window,Who can tell me why?

sebenalern
  • 2,515
  • 3
  • 26
  • 36
Yuming
  • 1
  • 1

1 Answers1

0

in the golang Only

net.ListenUDP() 's UDPConn can use the method WriteToUDP()

net.DialUDP 's UDPConn can't //

Sorry my English is very poor。

I think maybe nobody can read this。

囧TZ

Yuming
  • 1
  • 1