3

What happens to the packets that the exit node sends/receives from the desired web server?

Does each response packet get routed back through the Tor circuit (encrypting on the way) individually? If so, does the client need to send acknowledgement of receipt of these packets back to the original web server (routed back through the Tor circuit again)?

Or does the exit node simply complete the normal communication with the desired web server and then send the (entire) received data back through the Tor circuit somehow?

If this is the case, does each relay receive all the data and then send all that data to the next node only once it has received everything, too?

1

Tor works like a chain of proxies, where each proxy only knows about the next hop and the previous hop.

Simplifying a lot, when your computer sends data using Tor, your tor client will encrypt the payload, and forward it to another node. The next node does the same, and after a few iterations your packet reaches the exit node, is fully decrypted, and sent to the destination webserver.

The webserver sends the packet to the exit node, because the exit node was the computer that connected to the webserver. The exit node uses a table (seems like the NAT table, but with more information) to decide where to send the response. So it will encrypt the packet again, and send it to the next node, which will do the same, until the packet reaches your computer, are decrypted locally, and sent to the application.

The intermediate nodes don't have to wait for all the data before sending it to the next hop, or downloading files several MB big would be a hassle. Instead, they have a limited buffer space, and every time the buffer fills (or a timeout occurs), they encrypt it and send it ahead.

Your application will think the remote server is your tor client, so it only have to acknowledge the packet transfer until the first node. The destination webserver thinks the exit node is the client, and all intermediate nodes will acknowledge the packets between them, as there's a point-to-point connection between then.

  • Doesn't nodes rather decrypt (than encrypt) the payload to send it to the next node? – David 天宇 Wong Jan 8 '15 at 14:50
0

Remember that Tor does not merely proxy HTTP; it works at a lower level and proxies arbitrary TCP connections, which means the node cannot possibly know when it has "all the data", because there could always be more.

Even HTTP 1.1 allows multiple requests per connection, and you have HTTPS with the TLS handshake involving several roundtrips, and then there are protocols that are designed for multiple commands & responses (e.g. SMTP or IMAP), and then there are protocols where both sides can send data at any time at all (e.g. SSH or IRC)...

Therefore continuously exchanging individual pieces is the only way that makes sense.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.