WebRTC is a peer-peer communication protocol. I wonder, is it really peer-peer if it does require a web server? For example, to create a "room" one has to create it at apprtc.appspot.com or https://hello.firefox.com/something.
WebRTC being P2P is just as P2P as SIP is. Or H. 323. The only difference is that you get to choose your own signaling and your own client.
Audio and video in WebRTC works by using codecs. These are known algorithms that are used to compress and decompress audio and video data. There are different codecs you can use in WebRTC and I won't get into it now. Audio and video also gets interesting because it is sent with low latency in mind.
WebRTC uses Session Description Protocol (SDP) to describe the parameters of the peer-to-peer connection.
WebRTC video streaming doesn't work through http.
It is a true P2P protocol in that it can establish direct server-less communication between two arbitrary parties on the internet. Once the communication is established, no 3rd party is needed.
This comes with a few caveats though:
The two peers first need to find one another. This signalling step is purposefully omitted from the WebRTC specification, since the WebRTC protocol is not specific to browsers and can be used by any number of different devices in different circumstances. Each group of peers will have their own context and will require different discovery methods. You will probably also want a middleman which controls the flow of information according to some business rule.
You could use some other P2P protocol to establish this initial signalling phase; for instance you could just broadcast UDP packets on your local subnet if the other peer is on the same subnet. You could also use carrier pigeons for your signalling; though this is likely impractical. The most practical way for this over the general internet within a browser is to use a central message broker of some kind or another.
It is not always possible to establish direct connections between two arbitrary peers. Sometimes this is hindered by network topology realities, e.g. non-permissive firewalls or NAT routers. In this case it is physically impossible for the two peers to communicate in a P2P manner and a third party relay is required; this is included in the WebRTC specification in the form of a TURN server.
So, WebRTC is a full P2P protocol at heart, but it needs to work with simple networking realities which sometimes, or maybe often, requires a server's helping hand.
According to your tags (Chrome & FF), this question is focused on browsers.
If you want to initiate a call with WebRTC :
To conclude, if you want to exchange media or data with WebRTC in P2P, you should use some servers. Usually the media will be exchange in P2P, however sometimes the media will be relayed by a TURN server if one or both browsers are behind a restrictive NAT, a firewall....
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With