Latest / CyberPodcast / Tor Performance vs Security: What Really Needs to Improve | Paper Breakdown #18 | CyberPodcast
Transcript
- 0:00Welcome to this technical explainer.
- 0:02Today we're doing something really exciting.
- 0:04We are literally popping the hood on the Tor network.
- 0:07We're going to look way past the standard high level summaries
- 0:10and conduct A rigorous under the hood examination of Tors
- 0:13architecture. We'll explore its specific
- 0:15security models, it's data flow mechanics, and most importantly,
- 0:18the actual physical performance bottlenecks that dictate how
- 0:21this anonymity network functions out in the real world.
- 0:24OK, let's dive right in. Here's our agenda for today.
- 0:27We'll start with the network architecture, then move to
- 0:30circuits and data flows, queuing and traffic management, the
- 0:33security model, performance impact, and finally, structural
- 0:36weaknesses and challenges. Section 1.
- 0:39Tor network architecture. The big picture.
- 0:42Before we get completely lost dissecting microscopic TCP
- 0:46streams, we really need a bird's eye view, right?
- 0:48When a client wants to connect to a destination server on the
- 0:51Internet anonymously, they don't just send data directly.
- 0:54No way. Instead, they connect through
- 0:56this huge decentralized web of volunteer operated notes.
- 1:00As you can see mapped out here, the path always enters through
- 1:03an entry guard, bounces through an intermediate onion router,
- 1:06and finally pops out through an exit router before hitting the
- 1:09actual destination. This structured web that is the
- 1:12absolute foundational backbone of tours anonymity.
- 1:16Now, just to keep our computer science terminology razor sharp
- 1:19for the rest of this explainer, let's rigorously define those
- 1:22core components you just saw. First, we have the OP or Onion
- 1:27proxy. This is just the client
- 1:29application running on your local machine.
- 1:31Like the Tor browser itself, its main job is fetching network
- 1:34info and constructing those pathways.
- 1:36On the flip side, we have the OR or Onion router.
- 1:40These are the actual volunteer relay nodes that physically pass
- 1:43your data along. So the entire network literally
- 1:46relies on this dynamic back and forth between O PS and O Rs,
- 1:50Section 2 circuits and data flows.
- 1:53A user's journey. All right, zooming in a bit to
- 1:56follow a user's data hop by hop. When your onion proxy builds a
- 2:01circuit, it does so in a strict 3 hop sequence.
- 2:04First up, it connects to the entry guard, second, it extends
- 2:07that connection to a middle router, and 3rd, it connects to
- 2:10the exit router. Now, what's absolutely vital
- 2:13here is the cryptography. The user's data is encrypted in
- 2:16layers, literally like an onion using Diffie Hellman handshakes.
- 2:20Each hop along the circuit only holds the cryptographic key to
- 2:23peel off a single layer of that encryption.
- 2:25So think about it. The entry guard knows your IP
- 2:27address, but has zero idea what you're accessing.
- 2:30The exit router knows exactly what you're accessing, but not
- 2:33who you are. And that middle router?
- 2:35It just separates the two. This step by step cryptographic
- 2:38stripping is exactly what mathematically separates your
- 2:40identity from your destination. But you know, advanced
- 2:44encryption alone isn't really enough if an attacker can just
- 2:47sit back and analyze the shape and size of the data being sent.
- 2:51And that brings us to a really crucial technical detail.
- 2:55All data in Tor is rigidly standardized into fixed sized
- 2:59cells of exactly 512 bytes. By forcing every bit of traffic
- 3:03into these uniform blocks, Tor completely prevents basic
- 3:06traffic analysis. If an attacker is watching the
- 3:09network, they just see this continuous monotonous stream of
- 3:12identical 512 byte pieces. They can't easily correlate,
- 3:16say, a large incoming file with a large outgoing file, simply
- 3:19because everything is chopped down to the exact same uniform
- 3:23size. Section 3.
- 3:25Queuing and traffic management. The micro level.
- 3:28OK, stepping away from the clean theory of cryptography, we have
- 3:31to confront the very messy reality of network congestion.
- 3:35Tor's tiered buffer architecture is actually a massive
- 3:38performance bottleneck. Here's how it works.
- 3:41When a 512 byte cell arrives, it drops right into the operating
- 3:44systems kernel TCP receive buffer.
- 3:47Tor then pulls it into a 32 KB input buffer.
- 3:50After the router does its thing decrypting or encrypting the
- 3:52cell, it drops it onto a specific circuit queue.
- 3:54A scheduler then pulls from these circuit queues, places the
- 3:57cells into a 32 byte output buffer, and finally pushes it
- 4:00back to the kernel TCP send buffer to transmit to the next
- 4:03node. Basically it's a wildly complex
- 4:06multi tiered queuing system managing thousands of cells all
- 4:09at exactly the same time. And man, all that complexity
- 4:13introduces a massive structural headache.
- 4:15Fundamentally, different types of application traffic are
- 4:17forced to share the exact same overarching TCP connections
- 4:20between onion routers. So you might have a circuit used
- 4:23for heavy continuous file sharing like BitTorrent
- 4:25multiplexed onto the exact same OR to OR TCP connection as a
- 4:29circuit that's just being used for simple lightweight web
- 4:31browsing. Tor uses a label switching
- 4:33design, which basically means multiple independent user
- 4:36circuits are all funneled through single shared TCP pipes.
- 4:39Researchers actually call this the cross circuit interference
- 4:42problem. To put that into perspective,
- 4:45imagine a highway. Your interactive traffic, like a
- 4:48quick Http://web request, is a fast sports car.
- 4:52Now imagine bulk traffic like a massive BitTorrent download as a
- 4:55slow moving heavy truck. Because they are sharing the
- 4:58exact same single lane TCP highway between routers, the
- 5:02fast interactive traffic inevitably gets stuck behind a
- 5:05giant backlog of bulk data packets just sitting in the
- 5:08kernel's TCP buffers. Even if Tor's application layer
- 5:11desperately tries to prioritize your web browsing, once the data
- 5:14hits the colonel's TCP buffer, that sports car is trapped
- 5:17behind the truck. No way around it.
- 5:20Section 4, the security model protection and limits.
- 5:23So what does this all mean for your actual safety?
- 5:27Well, the absolutely crucial point here is that Tor is
- 5:29designed purely to protect against what's called a local
- 5:32active adversary. This means it defends against an
- 5:35attacker who can only watch or control a small fraction of the
- 5:38network, say your local Wi-Fi provider or maybe a handful of
- 5:41compromised routers. It is strictly not designed to
- 5:44defend against a global adversary who can monitor all
- 5:47traffic entering and exiting the network simultaneously.
- 5:50If a global attacker can watch both the entry and the exit of
- 5:53your circuit, they can simply use timing correlation to match
- 5:55up the traffic patterns and completely shatter your
- 5:58anonymity. Because Tor assumes this local
- 6:01adversary model, the main advanced threats we look at
- 6:03includes selective denial of service attacks, where malicious
- 6:06routers intentionally drop legitimate traffic just to force
- 6:10you on to compromise search X. Then there's side channel
- 6:12analysis, which looks at the timing or queue data we were
- 6:15just discussing. And finally, a ton of the
- 6:17system. Or AS level attacks, where
- 6:19massive global telecom providers might monitor both ends of a
- 6:22circuit as your traffic naturally routes across
- 6:24different Internet backbones. Section 5.
- 6:27Performance impact? The real data.
- 6:31So what does all this micro level architecture actually mean
- 6:35when you sit down and try to download a file?
- 6:38Looking at this cumulative distribution function for
- 6:40download times, we see a dramatic drop.
- 6:43The median download time for a standard 5 megabyte file
- 6:47plummeted from an excruciating 144 seconds back in 2009 down to
- 6:51just 14 seconds in 2015. That is a massive, highly
- 6:56tangible improvement. But take a look at the long tail
- 6:59on that 2015 curve. At the 75th percentile and
- 7:02above, download times still jump to over 25 seconds.
- 7:06The variance is huge, which means your actual day-to-day
- 7:09user experience remains highly unpredictable.
- 7:12So why the massive variance? Honestly, it boils down to
- 7:15volunteer hardware heterogeneity.
- 7:18If we look at the observed bandwidth distribution across
- 7:20all Tor routers, it reveals an incredibly steep curve.
- 7:24Get this over 60% of the routers in the network offer less than
- 7:27one MB per second of capacity. Only about 10% offer more than
- 7:3120 megabytes per second. And because a single Tor circuit
- 7:34requires 3 routers to function, your speed is fundamentally
- 7:37constrained by the slowest link in your specific chain.
- 7:40If your circuit randomly selects even one of these low bandwidth
- 7:43nodes, your performance is going to drop off a Cliff.
- 7:46Section 6 Structural Weaknesses and challenges the future.
- 7:51Zooming all the way back out to the macro level, the biggest
- 7:54overarching systemic issue threatening the network is just
- 7:58a stark numbers game. We have millions of daily users
- 8:01routing their Internet traffic over roughly 6000 volunteer
- 8:05onion routers. This incredibly unbalanced
- 8:08client to router ratio puts an enormous, relentless stress on
- 8:12the network's queuing capacity we talked about earlier.
- 8:14Tor is an absolutely essential tool, but its underlying
- 8:17infrastructure simply hasn't scaled at the same mathematical
- 8:20rate as its massive user base. To sum it all up, Tor absolutely
- 8:25must solve these core structural weaknesses to remain viable long
- 8:29term. First, the overhead of its
- 8:31centralized design where every single client has to constantly
- 8:34download an updated network consensus consumes massive
- 8:37amounts of bandwidth. 2nd, that wildly unbalanced client to
- 8:41router ratio we just looked at. And 3rd, the extreme resource
- 8:45heterogeneity of volunteer hardware, which directly causes
- 8:48that unpredictable latency. And remember, performance isn't
- 8:51just about user convenience here.
- 8:53In anonymity networks, performance issues directly
- 8:55impact security. If Tor is too slow, users leave.
- 8:59If users leave, the overall anonymity set shrinks, meaning
- 9:02the users who do remain have far less mathematical cover to
- 9:05actually hide within. Which really brings us to the
- 9:08ultimate technical paradox of low latency anonymous
- 9:12communication. Cantor mathematically and
- 9:15physically scale to accommodate millions of new users without
- 9:19completely redesigning the underlying TCP transport
- 9:22protocols that currently keep it anonymous.
- 9:24It is a deeply complex, fascinating balance between
- 9:27scale, speed, and absolute privacy, and it's a structural
- 9:32challenge that the brightest minds and network engineering
- 9:34are literally still trying to solve today.
- 9:37Thanks for joining me on this explainer.
- 9:39I hope you found it as interesting as I did.