WebRTC protocol

Introduction to webrtc protocol

MDN webrtc protocol

ICE

Interactive Connectivity Establishment (ICE) is a protocol framework that allows your browser to establish connections with peer browsers. In the actual network, there are many reasons that can cause the simple direct connection from the A to the B end to be unsatisfactory. This requires bypassing the firewall that prevents the connection from being established, assigning a unique address to your device (usually most of our devices do not have a fixed public address), and if the router does not allow direct connections from the host, you have to go through a server to forward data. ICE accomplishes this by using several techniques.

STUN

Session Traversal Utilities for NAT (STUN) (the last letter of the abbreviation is the first letter of NAT) is a function that allows the client behind the NAT to find out its own public network address and determine that the router blocks direct connections. A protocol for restricting methods.

The client obtains its own public network address information and whether it can be accessed (through the router) by sending a request to the STUN server on the public network.

NAT

Network Address Translation (NAT) is a protocol used to map a public IP address to your (private network) device. Under normal circumstances, the WAN port of the router has a public IP, and all devices connected to the LAN port of the router will be assigned an IP address of a private network segment (for example, 192.168.1.3). The IP of the private network device is mapped to the public network IP and unique port of the router. In this way, there is no need to assign a different public network IP to each private network device, but it can still be discovered by external network devices.

Some routers strictly limit the external connections of some private network devices. In this case, even if the STUN server recognizes the mapping of the public network IP and port of the private network device, it still cannot establish a connection with the private network device. In this case, it is necessary to turn to the TURN protocol.

TURN

Some routers use a "symmetric NAT" NAT model. This means that the router only accepts the previously established connection with the peer (that is, the next request to establish a new connection mapping).

Traversal Using Relays around NAT (TURN) bypasses "symmetric NAT" by relaying all data through the TURN server. You need to create a connection on the TURN server, and then tell all peer devices to send packets to the server, and the TURN server will forward the packets to you. Obviously this method is expensive, so it should only be used when there is no choice.

SDP

Session Description Protocol (SDP) is a protocol that describes the content of a multimedia connection, such as resolution, format, encoding, encryption algorithm, etc. Therefore, both ends can understand each other's data during data transmission. Essentially, these metadata describing content are not the media stream itself.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324813618&siteId=291194637