Follow
Subscribe via Email!

Enter your email address to subscribe to this platform and receive notifications of new posts by email.

Tor Network Routing and How Encrypted Relays Shield Web Traffic

The Tor network protects internet privacy by directing traffic through a series of encrypted volunteer relays, preventing eavesdroppers from linking users to their destinations.
A laptop screen displaying the purple Tor Project logo and onion icon beside a keyboard.

The Tor network is an open-source overlay system built to protect personal privacy by routing internet traffic through volunteer-run computers around the globe. Created to resist network spying and traffic analysis, the routing protocol separates sender data from target web addresses by wrapping messages in successive encryption keys. When someone sends web requests through the system, middle nodes pass packets along without any single machine knowing both the original source and the final destination [1]. This multi-hop relay design stops internet providers and tracking firms from linking browsing habits to specific home IP addresses.

What Is the Tor Network?

At its core, the software handles web traffic at the Transmission Control Protocol stream level by packaging data into encrypted virtual circuits. Connections stay private. Rather than connecting straight to a remote web server, user applications route traffic through a local SOCKS proxy interface that packages data into encrypted virtual circuits and sends streams through the relay path. Standalone installations listen on TCP port 9050, while the bundled Tor Browser package listens on port 9150 to keep setup simple for daily browsing [2]. Because the design focuses strictly on TCP communication, it supports web browsers, instant messaging clients, and remote shell programs, while peer-to-peer file-sharing clients that depend on UDP fail on the path [4].

Many different groups rely on this setup for daily digital safety. Journalists talk with confidential whistleblowers, human rights monitors file reports from restrictive regions, and domestic abuse survivors reach counseling resources without leaving local traces. Newsrooms like The Guardian, The New Yorker, and ProPublica run SecureDrop platforms on the network so sources can submit sensitive files safely. Andrew Lewman pointed out that user variety creates the foundation of privacy in the Tor network, because millions of lawful users make it much harder for intelligence agencies to single out any individual traveler [2].

Can a single static circuit keep browsing secret indefinitely? Static connections let eavesdroppers reconstruct browsing habits. Client software systematically rebuilds its circuits roughly every ten minutes by selecting three fresh volunteer relays. Consequently, tracking systems have little time to match incoming requests with outgoing packets [1].

Diagram illustrating how the Tor network routes initial user traffic through an encrypted relay circuit.
Diagram showing how Tor initiates an encrypted circuit through volunteer relays. (Credit: The Tor Project)

Origins of Onion Routing at Naval Research Laboratory

The mathematical principles behind onion routing took shape during the mid-1990s at the United States Naval Research Laboratory. Mathematician Paul Syverson and computer scientists Michael G. Reed and David Goldschlag built the initial framework at the Naval Research Laboratory to protect American intelligence personnel communicating over open military channels. By nesting cryptographic keys in the application layer of the network stack, their model ensured that intermediate routing machines could forward data without inspecting origins or destination addresses [2]. That laboratory research proved that encrypted relays could shield user identity effectively. This breakthrough laid the groundwork for an open-source privacy system that could serve both government analysts and civilian users.

Paul Syverson later partnered with Massachusetts Institute of Technology graduates Roger Dingledine and Nick Mathewson to build a public version [2]. On September 20, 2002, Roger Dingledine announced the pre-alpha release of tor-0.0.0.tar.gz on the SEUL developer list, inviting volunteers to compile the program, run the onion proxy on port 9051, and route Mozilla web traffic through early test nodes [8].

In 2004, the Naval Research Laboratory released the Tor code under a free license. The Electronic Frontier Foundation soon funded Dingledine and Mathewson to sustain development [2]. On December 22, 2006, Dingledine, Mathewson, and five colleagues incorporated The Tor Project as a 501(c)(3) nonprofit in Winchester, Massachusetts, securing early financial backing from Google, Internews, Human Rights Watch, Cambridge University, and Stichting NLnet [6]. In 2010, Freedom House evaluated Tor alongside circumvention tools like Ultrasurf, Hotspot Shield, and Freegate in China, as the growing network expanded toward serving four million daily users by November 2013 [2].

Three Layers of Circuit Encryption

Connecting to the Tor network through an onion circuit requires building a path step by step through three distinct computers. When a user launches a connection, the client software queries a directory of active volunteer nodes and selects an entry guard, a middle relay, and an exit node, negotiating separate secret keys with each server using public key cryptography [1]. Data traveling through the path resembles an onion wrapped in three concentric layers [4].

The entry guard is the only machine on the circuit that sees the user’s real internet address, peeling the outer cryptographic layer and forwarding data to the middle relay without learning what website the user visits. The middle relay strips the second encryption layer to reveal the identity of the exit node. Because this middle server never interacts with the original client or the final destination, it acts as a blind buffer between both ends, preventing compromised nodes from discovering both the client address and the destination server. Even if an adversary compromises that middle relay, the attacker cannot identify either endpoint of the transmission [1]. This separation shields identity.

Diagram showing the second step of routing traffic across intermediate relays in an onion circuit.
Diagram illustrating the second step of routing data through intermediate relays. (Credit: The Tor Project)

When data reaches the exit node, that server peels the final encryption layer and passes the request to the target website, where traffic appears to originate from the exit node rather than the real user [2, 4]. Data leaving the exit node stays unencrypted unless the destination site uses HTTPS [4]. Similar relay designs appear in commercial tools like oblivious HTTP gateway systems built to shield application requests.

Why the Tor Network Relies on Volunteer Relays

A central strength of the Tor network is that no single company, cloud provider, or government owns its routing nodes. The distributed infrastructure relies on more than 7,000 volunteer relays operating in dozens of countries, where private citizens, university departments, and non-profit collectives run servers at their own expense to defend free speech online [1, 2]. If a single business operated the whole system, authorities could pressure that firm into turning over connection logs [4]. Volunteer diversity prevents centralized vulnerabilities, ensuring that no single legal jurisdiction can force all node operators to disclose routing paths, thereby protecting users who operate in restrictive political climates [1]. Diversity creates safety.

Public relays are easy for state censors to identify and block, creating barriers for people in heavily monitored countries. National firewalls in China, Russia, Saudi Arabia, Iran, and Venezuela regularly block known relay IP addresses, prompting developers to introduce unlisted entry nodes called bridges that evade static filtering [4]. Pluggable transports like Snowflake disguise traffic as ordinary peer-to-peer web calls, helping users slip past deep packet inspection firewalls [5].

Running thousands of volunteer servers brings real operational friction that developers work to solve. In an academic study published in the Journal of Information Processing, researchers T. G. Kale, S. Ohzahata, C. Wu, and T. Kato demonstrated how heavy bulk file transfers create severe bottlenecks for light web browsing on shared TCP circuits [7]. The Tor Project tracks these bandwidth patterns through its Metrics Portal, providing open data on relay counts and traffic volumes [6]. These public measurements help computer scientists test better queuing methods that keep the overlay usable for daily web browsing [1].

Diagram illustrating the third step of establishing an exit relay to the destination website.
Diagram showing traffic leaving the final exit relay toward the destination server. (Credit: The Tor Project)

Onion Services and Hidden Web Publishing

While onion routing was designed to hide the location of web visitors, engineers found the same math could protect servers. First specified in 2003 and deployed on the Tor network in 2004, these setups were originally named hidden services and are now called onion services. An onion service creates a cryptographic address ending in the .onion domain, letting clients connect via a distributed hash table without exposing server IP addresses [2].

Connections to onion services never pass through an exit node. Traffic travels between the user’s circuit and the service’s introduction relay inside the overlay, maintaining six layers of end-to-end encryption so readers under strict government censorship can access reporting from publishers like The New York Times safely [2, 4]. The newspaper launched an onion site at https://www.nytimes3xbfgragh.onion/, and Facebook built an official mirror at https://www.facebookcorewwwi.onion. These addresses let users in censored areas access content without alerting domestic spying tools [4]. The connection stays inside the encrypted network.

Public discussions of onion services often highlight illicit trade on dark web platforms. In legal filings during the Silk Road trial of Ross William Ulbricht, federal prosecutors recognized that Tor serves recognized legitimate purposes, demonstrating that criminal abuse of encrypted routing does not invalidate the legal utility of the underlying technology [2, 4]. While law enforcement conducts targeted work like coordinated operations dismantling malicious online infrastructure, protecting open encryption remains fundamental for online civil liberties.

Surveillance camera positioned above an individual using a laptop computer.
Surveillance monitoring during personal computer usage in an online privacy context. (Credit: ImageFlow / Shutterstock via TechRadar)

How the Tor Network Handles Traffic Analysis

Despite multi-layered encryption, onion routing cannot counter every theoretical spying method. The system defends against traffic analysis, where snoopers track packet headers to learn who talks to whom. Even when message payloads are encrypted, headers disclose IP addresses, packet volumes, and transmission timing. What happens if an adversary watches both ends of a circuit at the same moment? In an end-to-end timing correlation attack, an observer monitoring both the user’s connection and the destination website uses statistical timing comparisons to confirm that traffic entering the network matches packets leaving the exit node [1].

Intelligence agencies have dedicated substantial effort toward testing these surveillance boundaries. Secret files released by Edward Snowden in 2013 revealed that the National Security Agency and British signals agency GCHQ made repeated attempts to break the anonymity of the system, testing various passive and active attack methods. In a presentation titled Tor Stinks, NSA staff conceded: “We will never be able to de-anonymize all Tor users all the time”. The agency noted that passive cable taps had negligible success because it operated very few exit nodes. Finding little success against the core network, analysts targeted bugs in local browser software [3].

One campaign, codenamed EgotisticalGiraffe, targeted vulnerabilities in older Firefox versions bundled inside Tor Browser. Mozilla Corporation patched the flaw in Firefox 17. Roger Dingledine pointed out that browser exploits proved the onion routing protocol remained sound, remarking: “Infecting the laptop, phone, or desktop is still the easiest way to learn about the human behind the keyboard” [3]. Intelligence services also utilized the system for their own operations, with GCHQ deploying Shadowcat to maintain secure server connections to remote hosts over the Tor network [2].

Funding Models Supporting Open Anonymity

In 2012, The Tor Project received 80% of its $2 million budget from United States government research grants. Federal support flowed from the State Department, the National Science Foundation, DARPA within the Department of Defense, and the Broadcasting Board of Governors to help overseas citizens evade domestic censorship [3, 6]. Federal agencies supported the software because strong anonymity tools protect diplomatic personnel while fostering digital access in authoritarian states [3]. Maintaining software for the Tor network requires long-term institutional support [6].

By June 2024, the government share fell to 35% of a $7.3 million budget as non-profit groups and private donors expanded their support. Major gifts arrived from the Ford Foundation, Open Society Foundations, the Alfred P. Sloan Foundation, the Heising-Simons Foundation, the Zcash Foundation, Jack Dorsey, and Craig Newmark, while Mullvad VPN contributed 19% of the budget in 2024 after collaborating on the Mullvad Browser [5, 6]. Sweden also contributed funding through SIDA, the Swedish International Development Cooperation Agency, while donations to the Bug Smash Fund supply unrestricted money to repair bugs [6].

Tor Network Routing and How Encrypted Relays Shield Web Traffic — The Guardian image
(Credit: The Guardian)

In December 2015, former Electronic Frontier Foundation leader Shari Steele became executive director, while co-founder Roger Dingledine focused on research and board duties. The organization appointed a new board in July 2016, adding computer scientists and legal experts including Bruce Schneier, Cindy Cohn, Matt Blaze, and Gabriella Coleman, before formally merging with the Tails operating system project in September 2024 to align engineering resources. Budget pressures during the 2020 pandemic led the group to reduce 13 staff positions, leaving 22 employees [6].

Alternative Research Networks Built After Tor

Academic researchers treat onion routing as an active area of experimentation. Computer scientists present new routing models and defense concepts at the annual Privacy Enhancing Technologies Symposium. For example, researchers F. Rochet and O. Pereira designed the Waterfilling circuit algorithm to distribute traffic more evenly without hurting throughput. By spreading connections over a wider selection of relays, the Waterfilling algorithm forces attackers to compromise far more nodes before attempting traffic correlation, proving that open network metrics help developers improve routing strategies over time [7].

Another research initiative addressing Tor’s limitations is Riffle, an experimental anonymity network developed at MIT and EPFL. According to MIT writer Larry Hardesty, researchers at MIT and the Qatar Computing Research Institute identified structural weaknesses in onion routing. To protect against rogue nodes, Riffle uses an anytrust security model. Under the Riffle anytrust framework, user communication remains completely confidential as long as at least one server in the participating group remains honest, even if every other intermediate machine colludes with an eavesdropper [10].

Riffle achieves this resistance by pairing two distinct cryptographic protocols, using Hybrid Shuffle for sending messages with mathematical verifiability and multi-server Private Information Retrieval for fetching content without exposing user queries. If a malicious server alters data, the system triggers an accusation protocol that exposes the compromised node. While these mathematical checks introduce extra latency, lead researchers designed Riffle to complement Tor rather than replace it, focusing on anonymous file sharing while the Tor network continues to provide responsive everyday web browsing [10].

Sources
  1. WEBSITE The Tor Project. (2015, March 1). Tor: Overview. Tor Project. [Article Link]
  2. WEBSITE Wikipedia contributors. (n.d.). Tor (network). Wikipedia, The Free Encyclopedia. [Article Link]
  3. ONLINE NEWS Ball, J., Greenwald, G., & Schneier, B. (2013, October 4). NSA and GCHQ target Tor network that protects anonymity of web users. The Guardian. [Article Link]
  4. ONLINE NEWS Porup, J. M. (2024, June 14). What is Tor Browser? Software for protecting your identity online. CSO Online. [Article Link]
  5. ONLINE NEWS Castro, C. (2023, April 6). Mullvad browser: The privacy of Tor, with the perks of a VPN. TechRadar. [Article Link]
  6. WEBSITE Wikipedia contributors. (n.d.). The Tor Project. Wikipedia, The Free Encyclopedia. [Article Link]
  7. WEBSITE The Tor Project. (n.d.). Tor research resources and data archives. Tor Project Research. [Article Link]
  8. WEBSITE Dingledine, R. (2002, September 20). Pre-alpha: Run an onion proxy now! SEUL Archives. [Article Link]
  9. WEBSITE Wikipedia contributors. (n.d.). Riffle (anonymity network). Wikipedia, The Free Encyclopedia. [Article Link]
  10. ONLINE NEWS Thomson, I. (2016, July 13). Meet Riffle, the next-gen anonymity network that hopes to trounce Tor. The Register. [Article Link]
Leave a Comment

Related Posts
Total
0
Share