The Maximum Number of Hops an Onion Message Can Travel
Onions, or “onion routing,” is a technique used by the Tor network to anonymize internet traffic. It allows users to send data through multiple nodes before it reaches its final destination, making it difficult for anyone to trace the origin and location of the data. But have you ever wondered how many hops an onion message can travel? In this article, we’ll dive into the specifications of the Onion routing protocol and explore what’s known about the maximum number of hops.
Onion Messages: A Brief Overview
Before we dive into the technical details, let’s quickly review what onion messages are. An onion message is a block of data that is encrypted using multiple layers of encryption and then compressed to make it easier to transmit through the network. When an onion message is sent, it breaks down into smaller packets called “onion fragments,” which are then routed through the Tor network.
Onion Routing Protocol
The Onion routing protocol is based on a series of nodes that route data from the sender to the destination. Each node has a specific role: relay nodes help forward packets to their next hop, while onion routers (also known as “onion users”) encrypt and decrypt packets at each node. The relay nodes act like a giant network of mail carriers, routing data through multiple nodes before it reaches its final destination.
The Onion Message Structure
An onion message consists of the following components:
- Headers: These contain information about the sender, receiver, and other relevant metadata.
- Payload: This is the actual data being sent.
- Onion fragments: These are compressed packets that make up the onion message.
- Encryption keys: These are used to encrypt the payload before it’s encrypted again.
Maximum Number of Hops
According to the specifications for the Onion routing protocol, an onion message can travel through at most 5 hops (nodes) before being dropped. This is known as a “max hop limit.” Beyond this point, the data will be lost forever due to a lack of sufficient entropy (randomness).
The maximum number of hops is determined by the following factors:
- The number of relay nodes required to route the onion message
- The encryption and decryption algorithms used to encrypt and decrypt the payload
In practice, onion messages can travel through more than 5 hops because they are often broken down into smaller packets that are then reassembled at each node. However, this still means that an onion message can only be transmitted a limited number of times before it’s lost.
Conclusion
The maximum number of hops an onion message can travel is determined by the Onion routing protocol specifications and the factors mentioned above. While onion messages can be transmitted through more than 5 hops due to packet reassembly, this limit means that data can only be transmitted a finite number of times before it’s lost forever. Understanding these limitations is essential for developers building applications using the Tor network.
References
- [1] Lightning Network – Onions (
- [2] Onion Routing Protocol (