Patent ID: 8204066

Claim:
A method for establishing a connection channel between two network terminal devices by predicting a port number of a NAT (Network Address Translation) equipment according to results of inquiring a STUN (Simple Traversal of UDP (User Datagram Protocol) over NAT) server twice and then traversing the NAT equipment to establish the connection channel, said method being applicable to a network system comprising a STUN server, a SIP (Session Initiation Protocol) server and at least a first and a second private network, wherein the first private network comprises at least one first NAT equipment and at least one first network terminal device and the second private network comprises at least one second NAT equipment and at least one second network terminal device, the first NAT equipment being a symmetric NAT equipment, in which the first network terminal device is connected to the second network terminal device through the first NAT equipment and the second NAT equipment sequentially, the method comprising steps of: the first network terminal device sequentially sending a first inquiry packet and a second inquiry packet to the STUN server via the first NAT equipment, and then acquiring two endpoint mappings of the first NAT equipment used respectively in the two inquiry packets from the STUN server, wherein the two endpoint mappings include a starting base NAT mapping of the first NAT equipment used in the first inquiry packet and a bound base NAT mapping of the first NAT equipment used in the second inquiry packet and, after acquiring the starting base NAT mapping and before acquiring the bound base NAT mapping, the first network terminal device periodically sends a hole punching request via an endpoint in the first NAT equipment to the second NAT equipment, so as to maintain the same endpoint in the first NAT equipment to be in an open status without being closed; the first network terminal device delivering the starting and bound base NAT mappings to the second network terminal device via the SIP server; the second network terminal device calculating a range of port numbers of the first NAT equipment that might have been used when the first network terminal device sent the hole punching request, according to the starting and bound base NAT mappings and a port differential of the first NAT equipment, wherein each of the first and second network terminal devices is installed with a user agent which can acquire the port differential of a corresponding one of the first and second NAT equipments from the STUN server through a STUN protocol, and deliver the acquired port differential to the other user agent through an ICE (Interactive Connectivity Establishment) protocol; and the second network terminal device sending port-prediction packets to the calculated port numbers of the first NAT equipment sequentially until a response packet is received from the first network terminal device and a connection channel is established with the first network terminal device.