user107398: I've tried to look for an answer to this online and haven't found any. My question is: how does bitcoin establish a peer to peer network. Establishing a centralized network with a server in the middle between all clients is trivial. However, establishing a fully peer to peer network isn't that easy. This is mostly due to NATs and Firewalls. How does bitcoin core get around NATs and Firewalls. Does it use holepunching, and, if so, is there a central server that dynamically updates public and private Ip/ports? I guess I would just like to know how the peer to peer network is established.

user208: The Bitcoin P2P protocol is an application-specific layer over TCP/IP.
If a node does not have an open port by themselves, they can only make outgoing connections. Node software uses things like UPnP to request NATs to open ports, but if that fails, a node's connections will be unidirectional.

107398: <p>I've tried to look for an answer to this online and haven't found any. My question is: how does bitcoin establish a peer to peer network. Establishing a centralized network with a server in the middle between all clients is trivial. However, establishing a fully peer to peer network isn't that easy. This is mostly due to NATs and Firewalls. How does bitcoin core get around NATs and Firewalls. Does it use holepunching, and, if so, is there a central server that dynamically updates public and private Ip/ports? I guess I would just like to know how the peer to peer network is established.</p>
 208: <p>The Bitcoin P2P protocol is an application-specific layer over TCP/IP.</p>
<p>If a node does not have an open port by themselves, they can only make outgoing connections. Node software uses things like UPnP to request NATs to open ports, but if that fails, a node's connections will be unidirectional.</p>
