In peer-to-peer environments, peers are often located behind routers which complicates the connection set-up to them. NatTrav provides a common platform for traversal techniques which are used to establish connectivity in these cases.
As NatTrav development was stopped quite a while ago, please consider looking at more production-ready libraries like STUN (https://sourceforge.net/projects/stun/).
For educational purposes, I still strongly recommend to have a look at both library and...