Analysis of NAT penetration in WEBRTC

Source: Internet
Author: User

Said Nat before the penetration of a few about the concept of WEBRTC, may have been the same as the author of the WEBRTC concept of the wrong understanding of the classmate. WebRTC (Network real-time communication) It is a Web browser to support real-time voice dialogue or video dialogue technology, it provides us with video conferencing core technology, including audio and video capture, codec, network transmission, display and other functions, and also support cross-platform: Windows,linux,mac, Android,ios. 1, the realization principle of WEBRTC WEBRTC is based on peer-to network communication, may have classmates do not know what peer-to, in this simple explanation is peer-to point of communication. The following is a comparison with the traditional connection method: The general our traditional connection method, are server-mediated mode:
    • Similar http protocol: client? server (of course, the arrows returned by the server here simply represent the return request data).
    • When we are doing instant messaging, we transmit text, pictures, recordings and so on: Client A server? Client B.
And the point-to-point connection exactly the data channel once formed, the middle is not through the service side, the data directly from one client to another client: Client A? Client B ... Client A? Client C ... (can be interconnected between countless clients.) The advantages of using peer-to: can greatly reduce the pressure on the server, we do not have the service side is necessary to obtain the data of the two communications. Speaking of which, people think that WEBRTC really do not need to serve the end of it? This is one of the misunderstandings, strictly speaking, WEBRTC simply does not require server transit data. There are at least two things that you have to use server 1. Exchange metadata (signaling) between browsers must pass server 2. In order to traverse NAT and firewall 1th, it is very well understood that when a and b need to establish a peer-to connection, at least the server to coordinate to control the connection to start building. And when the connection is broken, the server is also required to tell the other end that the peer-to connection is disconnected. The data we use to control the state of the connection is called signaling, and the channel connected to the server WebRTC is the signaling channel

As shown, the complete peer-to-peer connection is the first to send a signaling signaling to the server, and then the underlying call WEBRTC from the server to obtain the signaling, from the signaling to obtain the basic information of the end user, and then the media communication connection. 2.NAT related concepts and Principles of NAT (Network address translation, net addresses translation) is simply to solve the problem of IPV4 under the lack of IP address of a technology. For example, usually we are under a router, and the routers assigned to us are usually 191.168.0.21, 191.168.0.22 if there are n devices, May be assigned to 192.168.0.N, and this IP address is obviously an intranet IP address, such a router's public address corresponds to the address of N intranet, through this use a small number of public IP address to represent more private IP address, will help to slow down the availability of IP address space depletion. NAT technology protects the security of the intranet address, so this raises the question of how NAT blocks access to the extranet address when I use peer-to-peer connectivity, and we have to use NAT to penetrate. So we have the following ideas:
We use a public network IP server, a, B are sent to the public network Ip/port contract, the public network server can be learned that a, B ip/port, and because a, b active to the public network IP server contracted, so the public network server can penetrate NAT A,nat b send packet to A, a, a.
So as long as the public network IP will b ip/port sent to A,a Ip/port issued to B. So the next time a and B message each other, it will not be blocked by Nat.

WEBRTC's nat/Firewall traversal technology, is based on the above-mentioned one of the ideas to achieve. The ice framework is used in WEBRTC to ensure that the rtcpeerconnection can achieve NAT traversal. About the ICE protocol framework, the author provides connection address: Https://developer.mozilla.org/zh-CN/docs/Web/API/WebRTC_API/Protocols, interested students can go to understand. However, the author here specifically explains the SDP protocol, which is the session Description protocol sessions Description Protocol (SDP) is a protocol that describes the content of multimedia connections, such as resolution, format, encoding, cryptographic algorithms, etc. So both sides can understand each other's data at the time of data transmission. Essentially, the metadata for these descriptive contentis not the media stream itself。

Analysis of NAT penetration in WEBRTC

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.