| The development of network technology has increased the demand for IPv4 addresses.The emergence of NAT technology has alleviated the serious shortage of IPv4 addresses,but it has also led to the difficulty and complexity of direct P2 P communication between Internet hosts.The purpose of designing a P2 P system based on NAT traversal is to solve the needs of direct communication between terminals in certain P2 P applications or scenarios,and to provide the underlying basic framework for upper-layer services.The P2 P system is based on NAT traversal.Through the mapping and filtering rules of the NAT device,it finds a way to allow external messages to pass through the NAT device,thereby establishing a P2 P connection between terminals and ensuring the security of the entire traversal process.This paper studies the NAT traversal scheme based on two evaluation indicators,the traversal success rate and the traversal time,and considers the impact of NAT interference on the traversal of incremental symmetric NAT.Aiming at the UDP traversal of incremental symmetric NAT,this paper proposes a method combining hole punching technology and port prediction to improve the success rate of traversal by means of port reservation,interference detection,and retry optimization,while considering the application of multi-connection traversal.To simplify the redundant steps of repeated multiple single-connection traversal times,and shorten the traversal time.For TCP traversal,this paper proposes a method of combining TCP simultaneous opening and port prediction to solve the problem of establishing P2 P connections in the same scenario.In order to compare and analyze the traversal effects of the improved scheme and the existing schemes,this paper studies NAT interference and proposes a mathematical model based on the Poisson process,through which the NAT interference generated during the traversal process is simulated.Under different NAT interference conditions,the improved scheme and the existing scheme are compared and tested.NAT traversal breaks the security protection of NAT devices against internal hosts to some extent.This article analyzes the overall framework of the P2 P system,and designs and implements the security of the NAT traversal process and P2 P data transmission,so as to ensure the robustness and safety of the P2 P system. |