Is Web Protocol Peer to Peer?

WebRTC is a peer-to-peer communication protocol. I wonder if it's really peer-to-peer if it requires a web server? For example, to create a β€œroom” you need to create in apprtc.appspotot.com or https://hello.firefox.com/something ,

+6
source share
2 answers

This is a real P2P protocol in which it can establish direct serverless communication between two arbitrary parties on the Internet. Once communication is established, neither party is required.

This is due to several caveats:

  • Two peers must first find each other. This signaling step is deliberately excluded from the WebRTC specification because WebRTC is not browser specific and can be used by any number of different devices in different circumstances. Each peer group will have its own context and will require different detection methods. You will probably also need an intermediary that controls the flow of information according to some business rule.

    You can use another P2P protocol to set this initial alarm phase; for example, you can simply send UDP packets on your local subnet if the other peer is on the same subnet. You can also use carrier pigeons for your signaling; although this is probably impractical. The most practical way to do this on a shared Internet browser is to use a centralized message broker.

  • It is not possible to establish direct connections between two arbitrary peers. Sometimes this is hindered by the realities of network topology, for example. non-permissible firewalls or NAT routers. In this case, it is physically impossible for the two peers to communicate using P2P, and a third-party relay is required; this is included in the WebRTC specification as a TURN server.

So, WebRTC is a complete P2P protocol, but it should work with simple network realities that sometimes or perhaps often require server support.

+12
source

According to your tags (Chrome and FF) this question is browser oriented.

If you want to initiate a call using WebRTC:

  • you need to download your web page (WebRTC application) from the server (it may be optional if you have already downloaded it to your computer).
  • Both browsers must exchange information (codecs, ICE candidates ...), also known as SDP. This step is required and you must use the server. But you can use any other technology (Xaqron comment).
  • If browsers are behind NAT, they need a STUN server to retrieve their public IP addresses.
  • If one of the two browsers is behind a restrictive NAT or firewall, you should use a media relay, also known as a TURN server.

In conclusion, if you want to exchange multimedia or data with WebRTC in P2P, you must use some servers. Typically, media will be exchanged in P2P, but sometimes media will be transmitted by the TURN server if one or both browsers are behind a restrictive NAT, firewall ....

+2
source

Source: https://habr.com/ru/post/984625/


All Articles