| With the continuous development of multimedia communication technology and Internet technology, the communication requirements between point becomes higher and higher. How to make two clients achieve stability and quick connect transmission between different networks has become a hot research topic. Especially in a complex and actual network environment, such research and related technology to achieve even more important.The exists of NATs is to solve the problem of shortage of IP addresses, and the propose of SIP provides technical standards of session connection establishment between two clients, however, NAT’s presence makes SIP information packets of the private network can not be routed over the public network.In order to achieve a reliable network connection traversal in real network structure and ensure SIP packet of information transfer b etween different LANs, the one hand, in stead of UDP protocol, this paper uses TCP to traverse NAT with simulating TCP three-way handshake. Since the unreliable nature of packet loss resulting of UDP once the network bandwidth is limited, use TCP can avoid NAT traversal is not success. On the other hand, in view of the more common symmetric NAT traversal network equipment is difficult to succeed in the actual network environment, on the theoretical basis of the original ICE framework, the paper focuses on a network traversal programs with improving the mechanism of ICE candidate address. Increase the symmetric NAT port classification mapping types and the relative port prediction capabilities so that to solve the problem of P2 P communication between two symmetric NATs. Try to avoid increasing the network load while using relay transmission, which helps improve the connection quality of service.Based on two proposed above and the PJSIP protocol library in this paper, implemented in PJSIP stack by adding port prediction function modules, and tested in a real network environment that shows the test results are as expected, the port hit rate consistent with theoretical value. |