I have a couple of questions related to Tor circuits.

  1. Let's say that there is a circuit that was used and marked "dirty" and has also expired (no active TCP stream). Can this circuit ever be used again? Is there a way to how one might do that?

  2. How does Tor handle a client creating a lot of circuits? Can this also lead to an attack if the client is actually an adversary?

1 Answer 1

  1. At the protocol level there is no concept of a "dirty circuit". A circuit is created, extended, and eventually destroyed. Once it's completely destroyed it can't be used again, but you can create another circuit with the same path.

    For the standard tor implementation, tor won't assign new streams to dirty circuits, but you can attach streams to dirty circuits that aren't yet closed using the control protocol. If the circuit is closed, you cannot attach a stream to this circuit. Note that tor clients multiplex circuits over a single TCP connection to the guard relay, so even if a circuit closes, there will likely still be a TCP connection.

  2. You can make a tor client generate many circuits, and you can do this easily with tor's control protocol. Relays use a denial-of-service mitigation system to prevent a client (or specifically an IP address) from generating too many circuits through it. This means that you could create many circuits through different entry relays without triggering the denial-of-service mitigation system, but you cannot make many circuits through a single entry relay. Circuit creation is significantly less expensive for relays than it used to be, and the circuit creation crypto is handled in a different thread than the rest of the relay. While it wouldn't be good if a client (or many clients) generated huge numbers of circuits, it's not clear if this would significantly harm network performance or not, or how many clients would be required to harm the network.

  • This was really helpful. Are there any resources where I can read about these protocols in Tor circuits? Dec 29, 2020 at 18:11
  • The original Tor paper still gives a good introduction, but the Tor protocol specification document gives the current protocol design information. It contains more information than you probably want, but may be useful to get the general ideas of the different cell types and how circuits are built.
    – Steve
    Dec 29, 2020 at 19:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .