Tor Onion Routing vs I2P Garlic Routing Explained

While both Tor and the Invisible Internet Project (I2P) provide anonymous networking through layered encryption, Tor uses traditional onion routing, whereas I2P uses an evolved mechanism called garlic routing. The primary difference lies in how data is packaged and how network paths are established: Tor sends individual messages through bidirectional circuits primarily designed for accessing the open internet, while I2P bundles multiple messages into encrypted “cloves” and routes them through separate unidirectional tunnels optimized for an internal peer-to-peer network.

Tor and Onion Routing

Tor relies on onion routing, a technique where data is wrapped in multiple layers of encryption like the layers of an onion. A Tor client builds a circuit typically consisting of three nodes: an entry/guard node, a middle relay, and an exit node.

I2P and Garlic Routing

Garlic routing is an extension of onion routing developed by I2P. Instead of treating each message individually, garlic routing bundles multiple discrete messages into a single encrypted container called a “garlic,” where individual messages are referred to as “cloves.”

Key Architectural Differences

  1. Traffic Analysis Defense: Because I2P bundles multiple cloves into one garlic packet and uses separate inbound and outbound paths, it makes timing attacks and traffic analysis significantly more difficult for an adversary compared to Tor’s bidirectional streams.
  2. Bandwidth and Performance: Tor operates with lower latency, making it better suited for interactive web browsing. I2P’s packet-switched architecture and tunnel construction introduce slightly higher latency but provide robust peer-to-peer file sharing and decentralized internal communication.
  3. Tunnel Management: Tor circuits are centralized around directory authorities that maintain the network state. I2P operates on a fully distributed network database (NetDB) using a modified Kademlia Distributed Hash Table (DHT) to build and maintain its garlic tunnels.