How jami connnection works, and about using it in China

Greetings everyone,

Glad to have found out such a interesting project, the concept is amazing!

I have read the post “Why Jami is distributed”, However I do have a few question regarding how the connection works, it’s complicated since I am using it in China. I am going to ignore TURN and name server, because they are really easy to block.

  1. Regarding the Opendht nodes. My understanding is that it works like this:
  |              |               |
node4----------node5-----------node6-------the great firewall------node7-----node8
              node001(my device)-----------one time connection-----node9(bootstrap)
              node002(friend's device)-----one time connection--------

After node 001 and 002 made the one time connection with node9, they will join the opendht network, and connect to the closer (latency or geoip related) nodes, like nodes 1-6. No further connection towards node9 will ever be initiated, unless my device disconnects from the dht network.

Is my understanding correct?

  1. Regarding how connection towards each other works. Assuming my understanding of 1 is correct, now I have established the connection like this:
  |              |              |
node4----------node5----------node6-------the great firewall------node7------node8
  |              |                                                  |
  ------------node001(my device)                                  node9(bootstrap)
  |              |                                                                                      
  ------------node002(friend's device)

Obviously if node001 and 002 are in the same private network, they’d connect to each other without a fuss, and I have tested and they would simply use local network to talk to each other.

Now if node001 and 002 are in difference private network, how would they connect to each other? I saw upnp as an option, what happens, when node001 is behind a gateway with upnp support, and node002 is behind double nat with a gateway that does not support upnp? In fact I have tried to use the video call function using mobile data from one device (I got a 100.*.*.* private IP behind ISP gateway) to connect to anther device on my home network without success.

EDIT: I have figured out the answer to this question, as long as one of the devices has upnp activated, the direct connection can be established. My connection problem was cause by the fact that Jami on Android only supports IGDv1 upnp, not IGDv2.

  1. The most important question for me: what if node001 has multiple public IP addresses, how will it communicate with other nodes? Assume the following scenario: node001 has 2 internet connections available, there is a load balancer at network gateway, any traffic to certain geographic areas will be routed using network A(public IP, the rest will use network B(public IP I have read in another blog post that the opendht network would store node information like IP addresses in the distributed network, if node001 connects to the bootstrap server using IP, but is also available (and is a much closer route to node002), what will happen when node001 tries to connect to node002?

  2. What exactly does the dhtproxy do? The blog post stated that it only notifies the node that something new happens, and the node should check it up. But I have tested, that if I disable bootstrap, the dhtproxy would still serve as a bootstrap. Quite confused here.

Thanks for everyone in advance for any help you provide, sorry if this seems like I have bombarded you with questions…

Bonjour et bienvenue :slight_smile:
Vous trouverez certainement une réponse à votre question en la postant ici Issues · savoirfairelinux / jami-project · GitLab
Belle journée

I am able to figure out question 3 as well. A painful experience.

For anyone who is wondering: the IP you used to connect to dhtproxy is the IP that is being logged in the dht network. So anyone who want to connect to you will use that, plus any other private IP that is available.

Thanks for the tip.

Although I think gitlab page is more for development related stuff, not really for questions.
I will refrain myself from going there to ask questions, unless there is something wrong that I need to report to the devs.