Antox / Antox

Android client for Project Tox - Secure Peer to Peer Messaging
GNU General Public License v3.0
870 stars 195 forks source link

Traffic Problem #6

Open srkunze opened 9 years ago

srkunze commented 9 years ago

My girlfriend uses Antox for a three days now and her tablet needed 183MB for Antox alone. She said she needs 20MB per month for the messenger app of Facebook.

One message takes about 0.03 MB she said (from the stats). How come and how can we reduce the amount of traffic used?

She said she now disallowed the execution of the background job. So, we will see how this performs now. However, is there a way, we can reduce the traffic even further?

Liryna commented 9 years ago

I had the same problem, it have literally drain my battery. (16% in less than a hour)

subliun commented 9 years ago

Try disabling UDP in settings and see if that helps. I had it on by default because there were some issues with TCP relays earlier.

rigid commented 9 years ago

i can confirm this. 28MB in 24 hours despite I just created an account without actually using it...

srkunze commented 9 years ago

@subliun We give it a try. Something else, we can do in Tox directly? Compression?

dcharles525 commented 9 years ago

TCP uses much less data and battery, but I haven't tested Antox on the new tox4j wrapper.

srkunze commented 9 years ago

Concerning her tablet traffic consumption we have some numbers to share:

TCP: sending 1 message: 0.05MB, receiving 1 message: 0.01MB UDP: more and variable

Still much.

(message war reasonable short like 10 words or so, longer messages of course took more traffic).

Kolargol00 commented 9 years ago

I'm experiencing this too: huge data usage on wifi in the range of 10Mb to 50MB per hour while I'm not using the app at all. I'm running version 0.22 from the nightly builds with "wifi-only" enabled and UDP enabled. I'll try with UDP disabled to see if it makes a difference. Is there any number/log I can report to help you guys diagnose this?

markwinter commented 9 years ago

Disabling UDP will help, and there was an update yesterday that may help things further with regards to battery and data usage, but otherwise you will need to open an issue on the toxcore repo as that is the source of the high bandwidth issues

Kolargol00 commented 9 years ago

Thanks! I've installed the latest build from F-Droid (By the way, you might want to put a build number in the version string, it's a bit confusing now with everything being v0.22). I'll have a look at irungentoo/toxcore#1251.

srkunze commented 8 years ago

@subliun Can this be closed when push notifications are implemented?

LuccoJ commented 8 years ago

@srkunze Push notifications aren't a solution for F-Droid users, at least unless something else than GCM notifications is meant by that term. I do wish that Antox remain fully free software, without linking against proprietary libraries, at least as a working option. I'm sure this could be mitigated in other ways, as many IM clients that have no GCM nofification support (like the XMPP client Conversations for instance) manage to not consume any such amount of bandwidth and battery. The distributed nature of Tox makes it trickier, but I wouldn't say impossible.

wiiaam commented 8 years ago

GCM (Google Cloud Messaging), or push notifications, work by leaving a socket running that is constantly connected to Google's servers. This means that instead of every application through on your phone drawing power by staying constantly connected to a server, it can communicate through Push messages (meaning all applications are sharing one socket, requiring less data/battery). Due to the decentralized nature of Tox (your Tox client does not connect to a single server, instead a bunch of nodes), and that push notifications require the installation of google play services, this platform cannot be used.

LuccoJ commented 8 years ago

@wilam That's not entirely true: it COULD be used, by running a server that would basically act as a bridge between Tox and GCM. This would have potentially huge security implications (the server would be the one logged into your Tox profile, not you), though, as well as well as nullifying the decentralized nature of Tox.

ameenross commented 8 years ago

@LuccoJ: in other words, true.

I wonder if it would be viable to implement push notifications in TCP mode though? I'm pretty sure that the TCP node you're connected to doesn't login to the network on your behalf. What I don't know is whether the TCP node knows about your incoming messages... If it does, it could inform you using the open TCP connection

wiiaam commented 8 years ago

@LuccoJ The reason why I say it is not possible is because doing this would go against the decentralized nature of Tox

LuccoJ commented 8 years ago

@wiiam Then you mean to say it is not desirable, which I may agree with, but insofar as being possible, it might be and it is actually what the maintainer currently leans towards doing.

notorand-it commented 8 years ago

It's a P2P protocol. To my raw understanding his means that you (try to) relay also messages that are not meant to you. If your 3G/4G connection can accept incoming connections (which is usually false), then you can be asked to relay stuff that it is not yours. This is the "tax" you have to pay if you want to go decentralized. If you go centralized, then you have the bare minimum traffic at the cost of centralization and SPoFs!

srkunze commented 8 years ago

@notorand-it True to some extend.

From what I gather here is that there need to be a compromise. So, most people don't have an issue with paying the tax as long as they aren't on mobile.

LuccoJ commented 8 years ago

@notorand-it

It's a P2P protocol. To my raw understanding his means that you (try to) relay also messages that are not meant to you.

No, that's not what it means. "Peer to peer", in itself, means just what it says on the tin: that the communication happens directly between the peers involved. So in a sense, it's the opposite of what you said. However, the Tor network has a concept of "relays" to help with NAT and to make bandwidth use less intense. But you are not a relay by default.

notorand-it commented 8 years ago

@LuccoJ To my understanding P2P (implementations) works also when your incoming traffic is blocked. To do this you need some nodes who has incoming traffic working to "relay" your incoming traffic for you. If neither you nor your communication partner can accept incoming connections, then a relay is needed in order to allow both you and your partner to connect and it will do "the trick".

LuccoJ commented 8 years ago

@notorand-it That's correct about Tox: as I said, it can use relays, in "TCP mode" (its normal mode of operation is UDP).

But that is by no means a general characteristic of P2P systems: in fact, there are a huge number of P2P systems where the inability to receive incoming traffic severely impairs or even makes it completely impossible to use the system.

"Pure" P2P does not have relays; relays are introduced, making P2P less "pure" (it's no longer "peer to peer", it's "peer to relay to peer") to get around NAT limitations.

xavierle commented 8 years ago

can we expect something better now ?

Kengur8 commented 7 years ago

Still no news about changing this?

notorand-it commented 7 years ago

@LuccoJ As there's no guarantee that your (mobile) IP connection can actually and effectively receive incoming traffic (no matter whether it's TCP or UDP), relays are the only things that allow the so called P2P protocols to work all the time. Pure P2P communication can only happen with free (as in freedom) connections on either side. For example, your home wifi router will hardly forward incoming traffic to your device, unless explicitly configured do to so. And your ISP can still be blocking it!

Antox seems to be aimed at mobile devices, the mobile data networks are based upon non-free data links (that read GGSN/SAE) so, I'd say that relays are mandatory for almost any P2P implementation.

Security and privacy are as strong as their weakest link. The relays, very likely, are the weakest links in my opinion as they are (possibly hostile) unknown devices on (possibly hostile) unknown networks.

This is why I personally think that P2P communication networks are interesting and yet useless as far as security and privacy.

So, @Kengur8 , don't expect too much from this project as well as all other P2P projects. If the software detects it can act as a relay, it will do so and will thus boost you data usage. No matter whether it's Antox or any other P2P communication software.