I read some of the answers on the forum trying to understand how a server talks back to client through TOR, and from what I understand nodes keep a record for a while of the next and previous node to forward the data. If a particular node is a part of many circuits, would it keep data for each circuit?

2 Answers 2


In the same way that a TCP response knows how to route a response back to the originating host, Tor maintains streams.

When the exit node sends a TCP request to a service, the service responds and the exit node attaches that response to the appropriate Tor StreamID that originally made the request. This is then routed back using the exact same path of the original request because each node will keep a circuit "open" (meaning keep a copy of the encryption keys for that circuit). The nodes do keep the circuit keys until either they expire after a certain period of time, or the client issues a "DESTROY" command to the circuit.1

  • Does that mean only the exit node knows the StreamID?
    – ellis
    Commented Jun 5, 2015 at 22:11
  • Please forgive me for the noob question. What does the "copy of the encryption key" mean? I understand how asymmetric and symmetric encryption work. Does the circuit use any of them when returning the data?
    – ellis
    Commented Jun 5, 2015 at 22:14
  • 1
    There for various keys but I was talking about the forward and backward keys. This area of the Tor spec shows how circuits are generated and should answer your question. gitweb.torproject.org/torspec.git/tree/tor-spec.txt#n1021
    – Lizbeth
    Commented Jun 8, 2015 at 17:24

right in the same way it have received the request to let some packet out : the tunnel is not destroyed right after firing the packet out - it works both ways, so if the response is received - it is just sent back through already built tunnel

You must log in to answer this question.

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