Garlic routing[1] is a variant of onion routing that encrypts multiple messages together to make it more difficult[2] for attackers to perform traffic analysis and to increase the speed of data transfer.[3]
Michael J. Freedman defined "garlic routing" as an extension of onion routing, in which multiple messages are bundled together. He called each message a "bulb", whereas I2P calls them "garlic cloves". All messages, each with their own delivery instructions, are exposed at the endpoint. This allows the efficient bundling of an onion routing "reply block" with the original message.
Garlic routing is one of the key factors that distinguishes I2P from Tor and other privacy or encryption networks. The name alludes to the garlic plant, whose structure this protocol resembles. "Garlic routing" was first coined by Michael J. Freedman in Roger Dingledine's Free Haven Master's thesis Section 8.1.1 (June 2000), as derived from Onion Routing.[4] However, the garlic routing implementation in I2P differs from the design proposed by Freedman. The key difference is that garlic routing has unidirectional tunnels, whereas mainstream alternatives like Tor and Mixmaster use bidirectional tunnels.
One potential implementation of the Garlic Routing protocol is shown in the paper, Garlic Cast: Lightweight and Decentralized Anonymous Content Sharing.[5] The idea is to provide a resilient and low latency anonymous content sharing network based on garlic routing. The distinguishing benefit that makes the system different from traditional Tor networks is that it is designed around secure, fast communication. This is made possible by allowing the garlic cast system to use random walks to find proxies in the overlay network and then use the security-enhanced Information Dispersal Algorithm to deliver content in a secure and fast manner. Lastly, the garlic cast network is designed to be highly resistant to a wide range of attacks while still providing a high level of anonymity.[6]