1

Conceptually I am unable to comprehend that how 2 devices, which are connected to their respective Wifi networks (for example) are able to establish a peer to peer connection, even with intermediate temporary server in between.

E.g. Computer A's public IP is 1.1.1.1 & private IP is 192.x.x.x. Computer B's public IP is 2.2.2.2 & private IP is 192.y.y.y. Without any firewall etc. (general case), how will they make a direct socket connection among them?
Will appreciate if you can explain in slightly layman's term.


Context: I am studying a server, which intends to provide WebRTC in the browser. Using Google's STUN server, they are able to exchange media in many cases. But conceptually I am unclear, on what takes place in between.

enter image description here

iammilind
  • 68,093
  • 33
  • 169
  • 336
  • Does this answer your question? [How does WebRTC work?](https://stackoverflow.com/questions/12708252/how-does-webrtc-work) – ishan shah Nov 12 '19 at 09:15

1 Answers1

1

WebRTC uses a process called ICE for establishing the connection. Its a suite of techniques for NAT holepunching that mostly rely on the STUN protocol. The formal description is in RFC 5245 (updated by a newer version)

This presentation from the IETF 92 is one of the best slide decks I've seen so far.

Community
  • 1
  • 1
Philipp Hancke
  • 15,855
  • 2
  • 23
  • 31