Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Providers have a lot of clients and small pool of public (white) IP addresses therefore they assign one public IP on to one active client.

It can be done in various ways. This process is called NAT - network address translation. There are two big type of NAT - symmetric and asymmetric.

 

 Both can translates IP address and ports. One assigns IP for a long time but second do it for each request.

There are two servers - STUN and TURN. First is necessary for discovering your public IP address if you have gray address.

For example - you send some special message to the STUN and it responses with your NAT.

In order that establish connection between peers in the Internet you must:

  1. discover public IP address via STUN server
  2. if your NAT is dynamic thus STUN server doesn't help you and you must use TURN server that can transmit your data over the net
  3. create RTCPeerConnection and etc (see Our signal server on Java paragraph)

There are many public STUN/TURN servers - https://gist.github.com/zziuni/3741933.

Also there are many open source java implementation of STUN/TURN protocols and servers.

I'm using a public google stun server for demo app. It doesn't support TURN mode but work fine for my local provider.

To sum up for our webrtc scheme you need to two servers - STUN and TURN.

 

Our signal server on Java