I am trying to experiment with some p2p networking. Upon doing some research, one of the biggest obstacle I learnt is "What if a client is behind a NAT/Firewall", later on I discovered about Hole Punching but that it is not always guaranteed to work.
As far a I understand, I don't understand why it might fail, This is what I know so far:

Based on the diagram above, this is how I understand how a successful connection can be established.
- Alice joins the network (1) by creating connection to a directory-server. When this happens, Alice's NAT creates a mapping from her public ip to her local ip.
- The directory server receives the connection and store Alice's public
ip:port
in the directory - Bob does the same (2), Joins the network and publishes his
ip:port
in the directory - Alice wants to communicate with bob. So she looks up Bob's
ip:port
from the directory. (3) - Alice sends data on Bob's
ip:port
which she got from the server. (5) - Since Bob also has a mapping from is
ip:port
to his localip:port
, the NAT simply forwards any data received on Bob's publicip:port
to his computer. - Same works for Alice
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?