My node may run for several days without issues. Sent and received traffics are almost identical.
Once it gets “HSDir” mark, very soon memory consumption rises from about 1GB to 3-5Gb, it shows incoming and outgoing traffics disbalance (~35000/~7000 or ~8000/~39000 instead) which may last for several hours. As soon as I do systemctl restart tor my node return to normal state, traffic drops and later I watch HSDir mark disappeared.
HSDir absolutely wasn’t the case.
In my /etc/tor/torrc there were #RelayBandwidthRate 100 MB #RelayBandwidthBurst 100 MB
because I thought it was 100 MBit/s
which I changed to
RelayBandwidthRate 25 MB
RelayBandwidthBurst 30 MB
also I changed my connection from 100 MBit/s to 300 MBit/s
Now traffic consumption jumps and falls but doesn’t cause connection collapse as it was before.
But I’m still curious how incoming and outgoing hills can be split in time ?
Those “mountains” (green and blue) were caused by tor. Please, explain what is going on and how is it even possible if tor should work as a mediator and not as a traffic consumer or traffic generator.
There are the beginnings of discussions about this on the mailing list also. There appears to be an attack circulating in the wild, some malicious nodes are issuing DoS attacks by flooding directory fetches over the network. This causes a disproprotionate upload to download. Even after DirCache 0 is set, there is then a 2:1 download to upload as the unanswered directory fetch requests continue to flood the relay.
So far tor devs have been completely silent about it.
My concern is that it’s purpose is less DoS than deanonymizing by introducing trackable delays in packets and is being used at targeted relays to backtrace connections.
Unfortunately, DirCache 0 also disables Guard.
If anyone knows how to wake up a dev to this, please do so.
There are the beginnings of discussions about this on the mailing list also. There appears to be an attack circulating in the wild, some malicious nodes are issuing DoS attacks by flooding directory fetches over the network. This causes a disproprotionate upload to download. Even after DirCache 0 is set, there is then a 2:1 download to upload as the unanswered directory fetch requests continue to flood the relay.
So far tor devs have been completely silent about it.
My concern is that it’s purpose is less DoS than deanonymizing by introducing trackable delays in packets and is being used at targeted relays to backtrace connections.
Unfortunately, DirCache 0 also disables Guard.
If anyone knows how to wake up a dev to this, please do so.
What is the dev supposed to do once you’ve woken them up?
I have a little more experience with the attack now.
It seems intended to generate large disproportionate upload data.
Affected relays send between 4:1 and 8:1 upload to download when attacked.
When DirCache 0 is added and the attacked relay told to reload, this immediately switches from 8:1 to 1:2 as the repeated incoming unfilled directory requests continue to hammer the relay
This seems to continue for between 15 minutes and an hour after DirCache 0 is adopted then stops.
This is at least a DoS attack, possibly an (effective) deanonymizing attack as well. One that is through existing tor connections from other “valid” relays. This isn’t something a clever firewall rule will be able to address.
As a first step a rate limiting on directory requests. A small table of each relay that has requested directory data with the timestamp of the last request. There are from 2k - 20k connections for a relay, this is not a difficult task. If there are more than a certain number of requests in period time, they stop being honored.
I would like to see excessive rate-limit detections logged with both the offending relay’s hash AND IP so that an external script can add the offending IP address to the firewall blacklist, and so that offending relays can be reported.
This much is evident from Tor Metrics section “Bandwith spent serving directory requests”:
Perhaps the attacker is trying make relays hit their monthly traffic limits (those that have such limits) and at the same time render them unusable because RelayBandwithRate is constantly maximized, causing Tor to throttle traffic. I don’t think DirCache 0 helps here because your relay could be just an intermediary - the directory download could be routed through any number of relay.
If “some malicious nodes are issuing DoS attacks by flooding directory fetches over the network” developers should distinguish those malicious nodes and remove them from the tor-network. Otherwise who should do that ? Or let them destroy the net ?
For whatever it is worth, adding “DirCache 0” has solved my relay’s issue for the past year. Before that, it was subject to an overload of upload regularly.
This is great for your relay and is consistent with what I’ve seen - in most (but not all) cases, the attacks stop within an hour of implementing DirCache 0. But that setting also precludes any relay from being a guard. So right now the only sure-fired cure is one that if everyone did it would cripple the network.
I am more and more convinced this is part of an effort at deanonymizing and tracing connections. For example, when a tor node of mine connects to an affected guard relay: 00:00:00 [WARN] Guard _________ ($REDACTED) is failing an extremely large amount of circuits. This could indicate a route manipulation attack, extreme network overload, or a bug. Success counts are 83/292. Use counts are 140/140. 84 circuits completed, 19 were unusable, 4 collapsed, and 2 timed out. For reference, your timeout cutoff is 60 seconds.
This is quite concerning, where I am seeing more and more for certain nodes that all its upstream guards are under attack.
Sep 28 00:41:29.000 [notice] Heartbeat: DoS mitigation since startup: 1861 circuits killed with too many cells, 987158 circuits rejected, 172 marked addresses, 0 marked addresses for max queue, 63926 same address concurrent connections rejected, 0 connections rejected, 53 single hop clients refused, [DoSStreamCreationEnabled disabled], 34241 INTRODUCE2 rejected. Sep 28 06:41:29.000 [notice] Heartbeat: Tor's uptime is 13 days 12:00 hours, with 25876 circuits open. I've sent 16236.80 GB and received 16079.78 GB. I've received 2967413 connections on IPv4 and 0 on IPv6. I've made 500050 connections with IPv4 and 0 with IPv6.
After update to 0.4.9.13 ( Security Release 0.4.9.13 ) it became HSDir again. It is not facing such issue yet.
Uptime: 5 days 3 hours 1 minutes and 33 seconds
Fast Guard HSDir Running Stable V2Dir Valid