title: udp hole punch and port restricted cone NAT
body: <p>I would like to understand how udp hole punching works when two hosts each behind the port restricted cone NAT establish connection.</p>
  
  <p>As I understood, it happens in several stages and involves three hosts.</p>
  
  <p>Host A and host B are behind the port restricted cone NAT.</p>
  
  <p>Host C is a server that can receive packets from the hosts A and B.</p>
  
  <ol>
  <li>A sends a packet to C.</li>
  <li>C receives packet from A and determines A's external address:port pair</li>
  <li>B sends a packet to C.</li>
  <li>C receives packet from B and determines B's external address:port pair</li>
  <li>C sends the external address:port of B to A</li>
  <li>C sends the external address:port of A to B</li>
  <li>A sends packet_1 to B's external address</li>
  <li>B sends packet_2 to A's external address</li>
  </ol>
  
  <p>The questions are:</p>
  
  <p>How can A behind the restricted cone NAT receive a packet from B which is also behind the 
  restricted cone NAT?</p>
  
  <p>The port restricted cone NAT do not allow packets, in which the source address:port pair does not match the destination address:port pair of packets sent by it, to be received. Why do other packets sent between A and B arrive to A and to B?</p>
  
  <p>Is it because the port restricted cone NAT considers packet_2 as the response from B?</p>
  
  <p>So packet_1 will be lost but packet_2 arrives to B. Am I right?</p>
  
  <p>Thank you in advance.</p>