TCP or UDP for lots of connections?
<p>I want to create a P2P network with the following characteristics:</p>

<ul>
<li>low latency is not really important</li>
<li>loosing packages is okay</li>
<li>the nodes would only send tiny amounts of data around</li>
<li>there will be no NAT/firewall issues, every node has an open port on its public ip</li>
<li>every node is connected to every other node</li>
</ul>

<p>Usually I would use TCP for anything not time-critical but the last requirements causes the nodes to have lots of open connections for a long time. If I remember correctly, using TCP to connect to 1000 servers would mean I had to use 1000 ports to handle these connections. UDP on the other hand, would only require a single port for each node.</p>

<p>So my question is: Is TCP able to handle the above requirements in a network with e.g. 1000 nodes without tweaking the system? Would UDP be better suited in this case? Is there anything else that would be a deal-breaker for either protocol?</p>