By exploring the temporary UDP(user datagram protocol) port-mapping time window on NAT(network address translation) devices, the principal of using UDP to work through NAT devices was presented. A detection and handshaking server was proposed to solve the detection of dynamically mapped UDP ports. With packet reflecting service implemented at detection and handshaking server, port-mapping characteristics of NAT device and the external mapped UDP ports can be discovered. The procedures of the discovery process and the procedures of completing a peer to peer connection were presented. The implementation can benefit a broad range of applications like voice over IP, real-time video, file-sharing and peer to peer based distributed computing.