Starting Jami on my laptop has a sensible impact on my LAN:
Latence of pings to the router increases by 10x.
Percentage of sirq (System IRQ?) in top on the router reaches more than 30% while staying at 0% usually. And the ksoftirqd process consumes a lot of CPU.
My wife starts shouting at me and ask to stop my Jami client
After a few minutes, the network traffic calms down and WiFi can be used again.
The explanations I have modeled:
I have defined a lot (a few hundred of thousands!) of firewall rules on the router to block some IP addresses (bad actors and advertising). I’ve been using these rules for years and the LAN has always been reliable. The router has enough CPU and memory to accommodate normal traffic with these rules.
When Jami starts, it tries to establish may connections at first.
This burst of connection requests overwhelm the router, with impact on LAN users.
If I look at what Jami shows of its network activity, in Settings > General > Troubleshoot, just after launch I see Jami requesting and establishing a lot of connections. But this display is quite cryptic when you try to understand what’s actually happening. Here is an example anonymised to keep privacy of contacts:
First, one can see multiple lines for the same contact with identical devices GUID. My assumption is that there is one line by discussion/swarm by contact.
Secondly that can’t be captured in a single picture, this list of contacts fluctuates in time. After a few seconds, some contacts disappear while new ones appear, switching again and again. My own contact can have tens of lines, and then only one a few seconds later. Some contacts have such a behaviour too.
And then, after a few minutes, the Channels number that is 0 in the screen capture, gets a number and the list stabilizes. What is the meaning of this number is a mystery. Is it the number of P2P sessions opened and established?
Can someone explain what is the algorithm used by Jami to create sessions when it starts?
Does it try to connect to all contacts in all swarms up-front?
What are the steps of a connection (Try to find address with ICE, then TURN, then…)?
Why does my own contact appears in the list and Jami tries to connect to itself?
What would be the tools and the steps to debug and understand what happens at Jami launch?
Can the developers improve this troubleshoot panel to display more precise information? Or at least explain how to use it? I just discover while writing that you can click on the Channels number and a popup with URLs (git://, msg:// and swarm:// prefixed by a number) appears and that the Connected has a tip with the IP address!
I think this part of the software (sessions establishment) must be improved. I didn’t feel such impact on the network with older versions and I must not be alone, particularly for people who use old equipment.
The same phenomenon happens if I resume the laptop from sleep. Jami starts again staurating the WiFi and no other network application can work. For instance, I was unable to access this web site to add this post. I had to quit Jami for the Web page to display immediately in the browser.
This time, I opened the View Logs window too and I watch endless lines of
[1778113990.637|5664|ice_transport.cpp :832 ] [ice:0x7f3be8018350] ICE transport is not running
[1778113990.637|5664|ice_transport.cpp :832 ] [ice:0x7f3bb8117240] ICE transport is not running
[1778113990.638|5664|ice_transport.cpp :832 ] [ice:0x7f3be00de930] ICE transport is not running
[1778113990.638|5664|ice_transport.cpp :832 ] [ice:0x7f3b80036260] ICE transport is not running
[1778113991.617|5664|ice_transport.cpp :832 ] [ice:0x7f3b600cb170] ICE transport is not running
[1778113991.617|5664|ice_transport.cpp :832 ] [ice:0x7f3bc8189a20] ICE transport is not running
[1778113991.617|5664|ice_transport.cpp :832 ] [ice:0x7f3be8018350] ICE transport is not running
Before I quit Jami, the Troubleshoot windows did not display any established connectons after a few minutes wait.
This behaviour is more and more intriguing.
7. If a peer appears in multiple discussions, does Jami connect multiple times to the same peer as the Channels number seems to relate?
8. Why does Jami need to send so much data to establish sessions?
The following two captures are from KDE network bandwidth monotor. The first one shows what happens when Jami starts, and the second one when I quit it.
This is a rare issue. Most people should not put too much pressure on the network and WIFI when using Jami. Currently, the more common problem encountered is that Jami generates a lot of traffic when it is online for a long time, but this time is measured in months, and it is not much when distributed to a specific moment.
Just not to be misleading. When I write LAN, it does not mean that Jami is used on LAN-only, like documented in the link you shared. I have a bridge to the Internet and all my contacts are on the Internet.
And this Jami behaviour is almost reproducible at will. I know another contact where it happens too, and both of us don’t keep our computer online for months.
This is an interesting investigation. I cannot contribute as I do not have enough conversations open to see any impact but will follow closely as I’m working on writing a jami client for my phone…
I’m not sur it would help with this problem. The way I understand it is that my router is saturated by all the connections/packets that Jami is bursting at launch. Depending on the way that Jami communicates with the proxy (I don’t think it will open only 1 connection with the proxy), the burst of packet will still exist and the proxy (i.e. the router) will still have to open all the connections. And drown under the wave…
What would really help for all user is to get a general (1 mille-high view) understanding of the algorithms used by Jami. That’s something that is not found into the documentation. And i would help answering some questions like:
Why does Jami send so many packets at launch? OK, it must resolve the IP addresses of the contacts, but it can do it with a single connection to the resolver. What else happen?
Does Jami open a connection with all the contacts in my address book up-front? Even with those I never talked to or those I haven’t talk to for years, in swarms I don’t use anymore?
Why are some many network packets exchanged? The volume of the exchange is impressing. What’s happening?
If a contact is present in multiple swarms, does it open a Channel for each swarm where this contact is a member? Is it the explanation for the Channels number we see in the Troubleshoot window?
etc.
If the users don’t have to consider Jami as a black box, they can better use it. There would be less complaints in this forum and more positive experiences.
A friend of mine suggested that this might be a bufferbloat issue, so I recommend you investigate this aspect.
I have many contacts, but I’ve never encountered a problem like yours.
I’ve enabled SQM on my router this weekend. It helps a bit but this does not explain why Jami has to burst these waves of packets, particularly when the laptop resumes from sleep.
Tonight, I had more time to investigate the traffic on the Wi-Fi with tcpdump and wireshark. Here is what I saw, after capturing the network packets on my laptop, for 1 minute when starting Jami.
One can see that multi-megabytes were exchanged with some destinations, even if I did no actions on Jami, just letting it start and run for ~1 minute. It’s no surprise that users are seeing their data plans skyrocket.
In my mind, Jami is not a fair player on my network where my firewall is filtering on many IP rules. Now I can see what happens, but I still don’t have an explanation why Jami is behaving like this.