3.6 KiB
Opened 5 years ago
Last modified 5 years ago
#1788openenhancement
Optimizing throttling to make better use of router bandwidth within user-specified limits
Reported by:foibleOwned by: Priority: minor Milestone: undecided Component: router/general Version: 0.9.25 Keywords: performance, scaling, bandwidth, throttling, privacy, anonymity Cc:
Parent Tickets:
Sensitive: no
Description
I have noticed that I2P's total bandwidth use tends to vary considerably, roughly on a ten-minute cycle.[1] Considering this, it did not make sense to me, since in my case almost all bandwidth is used for participating traffic, and it is spread over hundreds of participating tunnels at once. The sheer number of tunnels should create something like a smooth average of total bandwidth usage.
When I looked at my router's graphs, this was clearly not the case, though. On average, every five minutes, my router's total and participating bandwidth usages switch between about 120% of my specified bandwidth limit and 60% of my specified bandwidth limit, with decent regularity.
Staring at the graphs for a long time, it occurred to me that this pattern might be produced if the router is throttling (rejecting due to b/w limit) new participating tunnel requests from other peers *too* aggressively. The result is that a helpful peer is only actually relaying about 75-80% of the bandwidth that they could be, on average (at least on my machine). Obviously, if we could gain even half of that "wasted" bandwidth, it would be a big win for the network.
There is already *some* flexibility in these rejections, judging by the different messages "Rejecting most tunnels: bandwidth limit" and "Rejecting tunnels: bandwidth limit," but I suspect that it might not be tuned quite right, and I have a very rough idea to improve this throttling:
What if the router rejects X% of incoming tunnel requests, where
X = ([percentage of b/w limit currently used] - 90) * 10
?
Or perhaps * 15 would be better? 8? Or even some compound or logarithmic function if we want to be fancy? Obviously these are arbitrary numbers, and they would need to be thought about, tested and tweaked, but I believe that giving the bandwidth throttling a bit more nuance, it may be possible to keep most routers successfully using 95%+ of their bandwidth limit, with far fewer "spikes."
Smoothing out the total bandwidth usage also improves anonymity, potentially significantly, as the adaptive throttling should tailor itself to complement i2p traffic initiated by the local user(s), as well. This makes something like the start of a download or upload much less noticeable, potentially, to an attacker that is able to observe and graph a router's bandwidth usage. Such adversaries are certainly a reasonable and significant part of our threat model, as ill-defined as that model may be.
What are your thoughts?