What is Signaling ?
It is a process of coordinating communication. In order for a webRTC application to set up a 'call', it's client needs to exchange information:
- Session control messages used to open or close communication
- Error messages
- Key data, used to establish secure communications
- Network data, such as a host's IP address and port as seen by the outside world
This signaling process needs a way for clients to pass messages back and froth. This is not there in the WebRTC APIs. It should be built by you.
Why is signaling not defined by WebRTC ?
Because to avoid redundancy and to maximize compatibility with established technologies, signaling methods and protocols.
Now what is STUN & TURN ?
A TURN server is a network entity in charge of relaying media in a VOIP related protocols. This includes SIP, H.323, WebRTC and other protocols. Traversal Using Relays around NAT(TURN) is a protocol that assists in traversal of network address translators or firewalls for multimedia applications. It may be used with the Transmission Control Protocol and User Datagram Protocol
STUN (Simple Traversal of UDP through NATs (Network Address Translation)) is a protocol for assisting devices behind a NAT firewall or router with their packet routing. Basically, it allows all clients on a LAN, behind a firewall/router, to set up phone calls to a VoIP provider located outside of the local network.
How does it work? The client, usually inside a private network, sends a binding request to a STUN server on the public Internet. The STUN server responds with a success response that contains the IP address and port number of the client, as observed from the server’s perspective.