title: What's so hard about p2p Hole Punching?
body: <p>I am trying to experiment with some p2p networking. Upon doing some research, one of the biggest obstacle I learnt is <strong>"What if a client is behind a NAT/Firewall"</strong>, later on I discovered about Hole Punching but that it is not always guaranteed to work.
  <br/>
  <br/>
  As far a I understand, I don't understand why it might fail, This is what I know so far:
  <hr/>
  <img src="https://i.stack.imgur.com/MlnEe.jpg" alt="enter image description here"><br/>
  Based on the diagram above, this is how I understand how a successful connection can be established. </p>
  
  <ol>
  <li><strong>Alice</strong> joins the network <strong>(1)</strong> by creating connection to a directory-server. When this happens, <strong>Alice's</strong> NAT creates a mapping from her public ip to her local ip. </li>
  <li>The directory server receives the connection and store <strong>Alice's</strong> public <code>ip:port</code> in the directory</li>
  <li><strong>Bob</strong> does the same <strong>(2)</strong>, Joins the network and publishes his <code>ip:port</code> in the directory</li>
  <li><strong>Alice</strong> wants to communicate with <strong>bob</strong>. So she looks up <strong>Bob's</strong> <code>ip:port</code> from the directory.  <strong>(3)</strong></li>
  <li><strong>Alice</strong> sends data on <strong>Bob's</strong> <code>ip:port</code> which she got from the server. <strong>(5)</strong></li>
  <li>Since <strong>Bob</strong> also has a mapping from is <code>ip:port</code> to his local <code>ip:port</code>, the NAT simply forwards any data received on <strong>Bob's</strong> public <code>ip:port</code> to his computer.</li>
  <li>Same works for <strong>Alice</strong>
  <hr/>
  I hope I was clear in my explanation of what I understand. My question is, what is so hard or unreliable about this? i must be clearly missing something. Can you explain me what it is?</li>
  </ol>