Patent ID: 7543064

Claim:
A method of providing peer-to-peer connection among a plurality of host devices disposed behind corresponding network address translators, the method comprising: providing a plurality of STUN servers; for each host device to be connected, providing a first socket bound to a first private port and a second socket bound to a second private port; for each host device to be connected, sending a first STUN packet through the first socket to a first STUN server of the plurality of STUN servers via a public port of the corresponding network address translator, the public port having a public port number identified by the first STUN server; for each host device to be connected, sending a second group of STUN packets through the second socket to the plurality of STUN servers via one or more public ports of the corresponding network address translator, the second group of STUN packets being equal in number to the STUN servers, the one or more public ports being different from the public port for the first socket, each of the one or more public ports having a public port number identified by the STUN servers; and for each host device to be connected, calculating a predicted public port number of the corresponding network address translator for the second socket, based on the public port numbers of the public ports for the first socket and the second socket, the predicted public port number to be used for peer-to-peer connection between the second socket of the host device and other host devices.