Skip to main content
ExplainerOnion RoutingExplainer· 4 min read· in Technology

How the Tor Protocol's Three-Node Circuit Isolates Identity from Destination

By wrapping data in nested layers of encryption and routing it through three independent servers, the Tor network ensures no single machine can link a user's IP address to the website they are visiting.

By Naina Verma

Privacy Advocates 60%Law Enforcement 20%Network Administrators 20%
Privacy Advocates
View the protocol as an essential tool for human rights, free expression, and protection against mass surveillance.
Law Enforcement
Argue that the absolute anonymity provided by the three-node circuit complicates investigations and shields illicit activity.
Network Administrators
Focus on the operational challenges of managing Tor traffic, often blocking Exit relay IP addresses to prevent abuse.

Perspectives this story doesn't cover

  • Exit relay operators facing legal liability
  • Internet Service Providers

At a glance

  • The Tor protocol routes traffic through three independent servers to separate a user's identity from their destination.
  • Data is wrapped in three layers of encryption, which are peeled off one by one at each node.
  • The Entry Guard knows the user's IP address but not the destination, while the Exit relay knows the destination but not the user.
  • All data is standardized into 512-byte cells to prevent adversaries from tracking packets based on their size.

When a user opens the Tor Browser and navigates to a website, their internet service provider sees only an encrypted connection to a random server, while the destination website sees traffic arriving from an entirely different machine. The link between the human at the keyboard and the server hosting the content is mathematically severed.[2]

This separation is not achieved by trusting a commercial virtual private network to keep no logs. Instead, it relies on "onion routing," a protocol originally developed by the US Naval Research Laboratory in the 1990s and detailed in the seminal 2004 USENIX paper by computer scientists Roger Dingledine, Nick Mathewson, and Paul Syverson.[1][4]

The architecture forces every piece of data through a circuit of exactly three volunteer-operated servers, known as relays. "The design of Tor is intended to prevent attackers from linking communication partners, or from linking multiple communications to or from a single user," the 2004 USENIX paper states.[1]

To understand the isolation, consider the encryption process before the data ever leaves the user's device. The Tor client software selects three relays from a directory of approximately 8,000 global nodes: an Entry Guard, a Middle relay, and an Exit relay.[2][6]

Traffic routes through three distinct relays, ensuring no single node knows both the sender and the destination.

The client then encrypts the data three times, utilizing 128-bit AES encryption and 1024-bit RSA keys for identity verification, using the public keys of the chosen relays in reverse order. The innermost layer is encrypted for the Exit relay, the middle layer for the Middle relay, and the outermost layer for the Entry Guard.[1][5]

This nested encryption resembles the layers of an onion. When the packet, fixed at exactly 512 bytes to prevent traffic analysis based on size, leaves the user's computer, it travels to the Entry Guard.[1][7]

The Entry Guard is the only node in the circuit that knows the user's actual IP address. However, because the data is still wrapped in two layers of encryption, the Entry Guard cannot read the payload or know the final destination. It only knows it must forward the 512-byte cell to the Middle relay.[4][5]

The Entry Guard is the only node in the circuit that knows the user's actual IP address.

Upon receiving the packet, the Middle relay strips off its layer of encryption. The Middle relay knows the identity of the Entry Guard and the Exit relay, but it is entirely blind to both the user's IP address and the website being accessed. It serves as the cryptographic air gap.[2][6]

Finally, the packet arrives at the Exit relay. The Exit relay removes the final layer of encryption, revealing the actual destination, such as a web server. The Exit relay sends the traffic to the open internet.[5]

Each relay in the circuit only possesses the cryptographic key to remove a single layer of encryption.

Crucially, the Exit relay knows what data is being requested and where it is going, but it has no idea who requested it. The traffic appears to originate from the Exit relay's own IP address.[2][4]

"Tor provides a distributed network of servers... so no single point can link you to your destination," the Electronic Frontier Foundation explained in its 2012 anonymity guide.[3]

This three-node architecture fundamentally shifts the trust model. A traditional VPN requires absolute trust in the provider, who can see both the user and the destination. Tor requires only that at least one of the three relays in the circuit is honest and not colluding with the others.[1][6]

The protocol also rotates these circuits automatically. By default, the Tor client builds a new circuit every 10 minutes for new connections, meaning a user browsing for an hour will route traffic through six entirely different paths. This limits the window of exposure if a circuit happens to be compromised by an adversary controlling multiple nodes.[2]

However, this privacy comes with a strict performance penalty. Because every 512-byte cell must be encrypted three times, routed across the globe to three different servers, and decrypted at each hop, the latency is inherently high.[1][7]

Volunteer operators donate bandwidth to run the relays that make up the Tor network.

Furthermore, the Exit relay represents a vulnerability if the underlying traffic is not independently encrypted. If a user connects to an unencrypted HTTP website, the Exit relay can read the plaintext data, even though it does not know the user's identity.[3][5]

The protocol's reliance on volunteer relays means its capacity is permanently constrained by the bandwidth those volunteers donate. The mathematical guarantee of anonymity holds firm, but it dictates that the network will always trade speed for the certainty that identity and destination remain isolated.[2][7]

Terms to know

Entry Guard
The first node in a Tor circuit, which knows the user's IP address but cannot read the encrypted data or know the final destination.
Middle Relay
The second node in the circuit, which only knows the identity of the Entry Guard and the Exit relay, serving as a cryptographic air gap.
Exit Relay
The final node in the circuit, which decrypts the last layer of encryption and forwards the traffic to its final destination on the open internet.
Onion Routing
A technique for anonymous communication over a computer network where messages are encapsulated in layers of encryption, analogous to layers of an onion.
Cell
The standardized 512-byte packet of data used by the Tor protocol to prevent adversaries from tracking traffic based on packet size.

Sources

Source coverage

7 outlets

3 viewpoints surfaced

Privacy Advocates 60%Law Enforcement 20%Network Administrators 20%
  1. [1]USENIX

    Tor: The Second-Generation Onion Router

    Read on USENIX
  2. [2]The Tor ProjectPrivacy Advocates

    What protections does Tor provide?

    Read on The Tor Project
  3. [3]Electronic Frontier FoundationPrivacy Advocates

    How to Help Protect Your Online Anonymity Using Tor

    Read on Electronic Frontier Foundation
  4. [4]Georgetown Law Technology ReviewLaw Enforcement

    Onion Routing and Tor

    Read on Georgetown Law Technology Review
  5. [5]Firewalls Don't Stop DragonsNetwork Administrators

    How Onion Routing Works

    Read on Firewalls Don't Stop Dragons
  6. [6]HackerNoon

    How does Tor *really* work? I read the whitepaper so you don't have…

    Read on HackerNoon
  7. [7]Factlen Editorial Team

    Synthesis by Factlen editorial team

    Read on Factlen Editorial Team

Comments

Stay informed

Every angle. Every day.

Get Technology stories with full source coverage and perspective breakdowns delivered to your inbox.