What is STUN used for?

There an option to use STUN (disabled by default) and add a STUN server in Jami settings.

What is a STUN server in Jami and what is the difference between a STUN server and a TURN server?

Here’s an oversimplified explanation.

STUN servers are just used to find people. Once you’ve found them, you can communicate directly. You know you want to communicate with me but don’t know my IP? I don’t know yours either? Well we both know Joe - so we both tell him our IPs and he hooks us up.

If the NAT situation is so strict that you cannot communicate directly, then you can at least connect by piping your communications through a server. That’s what TURN is. Expensive bandwidth-wise and best avoided, but better than being unreachable…

1 Like

Ok, then what is bootstrap used for? I assumed TURN was used to connect and pip communications between two devices and be bandwidth heavy, and boostrap used to find people like a up to date phonebook on Jami users IP addresses.

The bootstrap is how you and I come to know Joe in the first place.
If we’re new to this world, we know nobody. No way into the network. Need that first connection, Joe. This also lets us build our own independent networks if we want (e.g. on Mars).

Read more at the official blog post:

1 Like

Ok so let me get this strait,

Bootstrap is used for establishing that first connection with others when we first create our accounts, restore our accounts or launch Jami app from being offline.

Turn is the IP address phone book of others to find other peers

Stun is kinda like a VPN between two peers were all bandwidth goes through the stun server

That’s my understanding, yes.

Only issue is, you were right, I switched STUN and TURN, my bad. I corrected my earlier post.

ICE tries to find the best path to connect peers. It tries all possibilities in parallel and chooses the most efficient option that works. ICE first tries to make a connection using the host address obtained from a device’s operating system and network card. If that fails (which it will for devices behind NATs), ICE obtains an external address using a STUN server and, if that fails, traffic is routed through a TURN relay server.

In other words, a STUN server is used to get an external network address and TURN servers are used to relay traffic if direct (peer-to-peer) connection fails.

Every TURN server supports STUN. A TURN server is a STUN server with additional built-in relaying functionality. ICE also copes with the complexities of NAT setups. In reality, NAT hole-punching may require more than just a public IP:port address.


1 Like

In jami is stun not needed.
Because the dht do the same

it’s only used in SIP, as M1K4 said, the DHT already get the public ip. And STUN is not shown in account settings for Jami accounts

1 Like

On Android, STUN is showing as an option for my Jami account which I can able and set it to a STUN server