Tribler/app-to-app-communicator

Blockchain Engineering - Group 1 - Connection is not working on mobile data?

Opened this issue · 7 comments

Hey there,

We are currently working on the Trustchain Android app. In one of our demos, @synctext noticed that it was not possible to connect with a peer that is on mobile data. We have raised an issue (#58) on our repository and investigated this issue.

We first compared the source code of both repository to see whether we have accidentally removed something when merging both apps. Then we have cloned this repo and changed the IP address of the host.

After changing the IP address of the host and launching the modified version of this app, we have noticed that we were not able to connect with peers that are on mobile data.

We were wondering whether it is possible to connect to peers that are on mobile data with this app? Or is there something else that we need to modify to make it work on one of our device?

Kind regards,
@TimBuckers, @ClintonCao, @Michieldoesburg, @boninggong, and @laurensWe

We've further tested the current functionalities and it seems like the app can't make connections when mobile data is used instead of a wifi network. The next four cases were tested:

Host using Eduroam, connecting peer using Eduroam: Working connection.
Host using Eduroam, connecting peer using mobile data: Can't connect.
Host using mobile data, connecting peer using Eduroam: Can't connect.
Host using mobile data, connecting peer using mobile data: Can't connect.

Probably something of the mobile data networks are blocking requests for sending data.

Hello,

I'm not a 100% sure what your exact problem is. But could it be that you are trying to connect to a punctured peer (A UDP Connection) with a TCP Connection. The current app on the upstream repo does this. The IP and Port just get passed to the TrustChainActivity but this tries to setup a TCP connection. The App2App activity has indeed punched a hole in the NAT that could be used but only with a UDP connection.

The TrustChainActivity also seems to ignore the port but that is an easy fix.

Hello @JLauriks,

Thanks for your great remarks, that was one of the things which were broken in our overlay of the trustchain android. At the tests, we performed like Clinton stated we assumed that we have a public IP when we use 3g or 4g but this is of course not the case due to the NAT blocking of the cellular ISP. So we were not yet fully aware of the real functioning of the NAT traversal and NATs themselves.

After that, we set up our own bootstrap phone with the right port forwarding at our routers at home, due to the failure of the bootstrap phone of our professor. Now we were able to find one another but the dots will stay orange when not on the same network and will stay in the outgoing side of the App-To-App communicator. This when we use the latest version of this repo. It seems therefore that the puncture seems to have trouble over different closed networks. Could you maybe elaborate on this, because it seems therefore that the trouble is still in the latest version of this App-To-App repo.

Kind Regards,
Laurens

To be clear on the issue we are running in to: we have 3 phones on mobile data which can connect with the bootstrap server but cannot connect to each other (which makes sense because the port of the bootstrap phone's router is open). As can be seen in the images, the bootstrap server introduces our phones to each other but they do not receive each other's packets, and thus never connect.

We suspect this is because of NAT-firewalls restraints mobile network carriers apply.

Vodafone niet. Enige unpredictable NAT provider op 3G en 4G.