UPnP requires software support in your router. Even when routers have it, it sometimes shuts down due to security issues.
STUN uses a simple public server to detect the presence of NAT and real IP addresses. This is useful for other higher level protocols that do useful work.
Punching holes is an easy way to connect two computers. This requires a 3rd public computer to communicate between the two computers behind NAT. You can start your own server using a special protocol, and you can use STUN and existing STUN servers. (Only a few packages are required for configuration, the rest are peer-to-peer).
, NAT , . Bittorrent : , , .