Previously mentioned the LAN video monitoring environment, then how to expand the LAN environment to the public network environment. The stun protocol is a good solution.
If you want to use the LAN's video server as a public network server, you must map the streaming media server of the LAN to the public network environment. But most of the cases, your LAN router is not allowed, only allowed out, that is, if you do not hit the "wall", you will not be able to use the LAN streaming media server as a public network streaming media server. The effect of the stun protocol is to get the channel through.
Stun implementation principle: First, the public network stun server must have dual network card, for data exchange. Streaming media server display as a client, through the LAN IP to the public network STUN server to send STUN packets, STUN server received from the local area network streaming media server sent packets, will send a feedback to the port sent over, if the streaming media server can receive this feedback, It means that two-way communication has been established successfully, which can be used for public network access by the streaming media server of LAN.
From the effect of monitoring software display feedback, the quality is barely possible. Note that the IP address of the test end is 192.168.1.13 and the IP address of the streaming media server is 17.1.2.2. As for why streaming media data is transmitted between 53 and 13, that is the role of the stun protocol. When stun the tunnel through, in fact, LAN streaming media server network segment of the router into an external server, access to a router of a stun hit the port, the router will directly from the streaming media server's corresponding port data sent out.
Test software from: https://code.google.com/p/teaonly-projects/(not open source, test version), grab kits for Wireshark. If you use the mobile phone's tcpdump tool to carry on the analysis of the handset, it is more convenient to understand (UDP and stun packets between the 17.1.2.2 and 192.168.1.53 transmission.