NatCheck Measurements

This page contains the description of the NatCheck Measurements performed over the Tribler network.

The objective is to compare NATs and firewalls characteristics as seen from inside and outside. For this purpose two classes of measurements will be performed on each Tribler peer encountered:

  • measurements from inside
  • measurements from outside

The results will then be compared and analysed.

Measurements from inside

Tribler has been equipped with an internal NAT-check functionality which performs a simple check of the NAT/firewall type and of the duration of a given mapping in the NAT/firewall when not used for a while (i.e. after how long a mapping in a NAT/firewall expires if there is no communication going through). We call this value NAT timeout. The NAT type check is done by using a simplified version of the STUN protocol and requires the assistance of some STUN servers, while the timeout check requires the assistance of a timeout server.

A peer's NAT-check functionality can only be activated by a special superpeer, and, once the peer has collected the results, it sends them back to the superpeer which made the request. The superpeer writes down this information in a log file.

The superpeer and the peers communicate via overlay messages, while the peers and the servers communicate via simple UDP sockets.

Measurements from outside

Measurement strategy

The idea is to synchronize the measurements form inside with those from outside. In order to do so, the superpeer that activates the internal NAT-check can activate the external NAT-check at the same time.


The data from the first class of measurements is somewhat more precise, because it has been obtained from the peer themselves. However it requires the active cooperation of the peers (they have to be equipped with a special functionality). The data from the second class of measurement, instead, is obtained by external observations of a specific peer's behaviour. It is therefore less precise, but it does not require the explicit cooperation of the observed peer.