The invention discloses a method for implementing UDP
hole punching, comprising the following steps: A. a
client side and a communication opposite side respectively acquire
public network IP addresses corresponding to self; B. the
client side initiates conversation to the communication opposite side to notice the
public network IP address corresponding to the
client side to the communication opposite side and simultaneously acquire the
public network IP address corresponding to the communication opposite side; and C. the
client side and the communication opposite side perform UDP
hole punching according to the public network IP addresses corresponding to the two sides. The invention actively initiates a
hole punching request to the communication opposite side through the
client side, the communication opposite side sends a hole
punching response to the
client side after receiving the hole
punching request, then the client side sends hole
punching identification to the communication opposite side, thus implementing UDP hole punching between the client side and the communication opposite side successfully, which not only shortens
time consuming in UDP hole punching, but also implements bandwidth resource occupied in transmission data in the UDP hole punching process, and satisfies the demands of immediate communication
system application, thereby improving network experience of users.