qTox / qTox

qTox is a chat, voice, video, and file transfer IM client using the encrypted peer-to-peer Tox protocol.
https://qtox.github.io/
GNU General Public License v3.0
4.76k stars 1.05k forks source link

Communication and node discovery seems not working as expected #5341

Closed rbalchev closed 5 years ago

rbalchev commented 6 years ago
Brief Description

Steps to reproduce.

  1. We have two windows computers in the same network behind NAT, and IPv6 enabled.
  2. The computers are located in the same network. And have internet access.
  3. Try chat, file transfer.
  4. Add Android and make the same thing.

Expected result: Since this system have to be decentralized, this means that during file transfer - I have to have near LAN speeds ~1gbps. If I turn off internet connection (by keeping local) - the service should work between these two computers.

Actual result: However - I'm experiencing ISP speeds 10mbps - since I have non-symmetric internet 120mbs-down/12.5mbps upload. This means that these two PCs are not communicating through LAN. If I turn off internet connection but keep LAN - I should have a service - guess what - no service??

Thanks,

This opens few important questions: User-related:

  1. Do I configure something wrong?
  2. Is dual-stack IPv6, IPv4 is related somehow to this behavior.
  3. Firewall is stopped on both machines, because of the test.

Technology related:

  1. Are we using supernodes?
  2. Why the hell the traffic between two notes, requires an internet connection.
  3. Both IPv4/IPv6 stack is accessible locally during internet connection is down.

I didn't review the privacy, encryption etc. But don't you think that if two computers are on the same network, the speeds have to to be similar to network speed. If we have to traffic outside of network - outside notes are ok but in LAN case? - why?

rbalchev commented 6 years ago

Also, I can help with hosting nodes, and testing and a little development.

Thanks,

anthonybilinski commented 6 years ago

However - I'm experiencing ISP speeds 10mbps - since I have non-symmetric internet 120mbs-down/12.5mbps upload. This means that these two PCs are not communicating through LAN.

I'm not totally convinced by that, it could also be that file transfer handling by qTox or Toxcore is slower than network allows, which I think may be the case.

If I turn off internet connection but keep LAN - I should have a service - guess what - no service

What do you mean by "no service" in this case? The two computers on the LAN can't see each other? What I would expect is that the two Tox instances will each see themselves as offline (because they only consider themselves as online if they see a certain number of other nodes), but will see their peer on the LAN as online, and will be able to communicate with the peer on the LAN like normal.

Are the two Windows computers both running qTox? If so, is settings -> advanced -> enable LAN discovery checked? I believe the android clients disable LAN discovery to save battery, but may also have an option to enable it.

Technical questions:

  1. Are we using supernodes?

There are a kind of supernodes called "TCP relays" that are used if you have settings -> advanced -> enable UDP unchecked. These are volunteer nodes, listed here https://nodes.tox.chat/, and are typically used by either those using TCP proxies like Tor, or mobile clients to save on battery (DHT chatter), or people behind extremely difficult routers that don't allow UDP hole punching to form a connection.

Normal connections don't use TCP relays, and direct p2p is used even if both parties are behind NATs.

  1. Why the hell the traffic between two notes, requires an internet connection.

It shouldn't / doesn't. I use qTox to talk to qTox on an isolated network routinely. There must be some configuration problem or some other solvable issue. Note that the two nodes must be on the same subnet as well to automatically discover each other so that their broadcast discover packets will be seen.

I can help with hosting nodes,

Bootstrap nodes (normal nodes that are hardcoded in clients) and TCP relays (as described above) can both be run using Toxcore's tox-bootstrapd: https://wiki.tox.chat/users/runningnodes (usually both are run at the same time with a single server).

and testing and a little development.

That would be appreciated!

rbalchev commented 6 years ago

Ok, during the weekend I'll have time to play again with the software, I'll keep you updated.

PS: Tox project is an incredible idea. Thanks,

anthonybilinski commented 5 years ago

Going to close to cleanup the issue, feel free to comment it you have more questions.