Implement "Randomization" of I2P Hops (tunnel length) #16761

Open
opened 2026-02-22 03:23:51 -05:00 by deekerman · 7 comments
Owner

Originally created by @absolutep on GitHub (Apr 9, 2025).

Suggestion

Implement "Randomization" of I2P Hops (tunnel length) in I2P settings, as shown in image below

Image

Use case

It helps in evading a patternicity attack by "Randomizing" the hops pattern.

For example,

Source A >> H >> M >> Y >> Destination B

Destination B >> C >> J >> W >> L >> Source A

Extra info/examples/attachments

In the context of I2P and specifically i2pd, inbound and outbound variance refer to the random variation in the number of hops used in I2P tunnels. This feature is designed to enhance anonymity by making it harder to predict the exact path of data transmission.

Inbound and Outbound Variance Explained

  • Inbound Length Variance: This parameter allows for a random number of hops to be added or subtracted from the inbound tunnel length. The default value is 0, meaning no variance is applied by default. However, it can be set between -3 and 3, which means the actual number of hops in an inbound tunnel can vary by up to three hops more or less than the configured length[1].

  • Outbound Length Variance: Similar to the inbound variance, this parameter introduces randomness in the number of hops for outbound tunnels. Like inbound variance, it can also be set between -3 and 3, allowing for a dynamic adjustment of the tunnel length to improve anonymity[1].

Purpose of Variance

The purpose of introducing variance in tunnel lengths is to make it more difficult for an attacker to identify patterns in the network traffic, which could potentially compromise user anonymity. By randomly adjusting the number of hops, the system makes it harder to trace the path of data packets.

Configuration

These settings can be adjusted in the i2pd configuration files, specifically in the tunnels.conf file for tunnel configurations. However, the exact syntax and options available might depend on the version of i2pd being used[1][3].

Citations:
[1] https://i2pd.readthedocs.io/en/latest/user-guide/tunnels/
[2] https://geti2p.net/en/docs/api/streaming
[3] https://i2pd.readthedocs.io/en/latest/user-guide/configuration/
[4] https://www.nrel.gov/docs/legosti/old/654.pdf
[5] https://i2pplus.github.io/changelog.html
[6] https://i2pgit.org/lbt/i2p.www/-/blob/dns-application/pots/docs.pot
[7] https://github.com/anquanscan/sec-tools
[8] https://www.reddit.com/r/i2p/comments/tst4o7/whats_inboundoutboundquantity_parameter/

Originally created by @absolutep on GitHub (Apr 9, 2025). ### Suggestion Implement "Randomization" of I2P Hops (tunnel length) in I2P settings, as shown in image below ![Image](https://github.com/user-attachments/assets/8b7e76d4-e149-449c-b8b5-2c0b3903b458) ### Use case It helps in evading a _patternicity attack_ by "Randomizing" the hops pattern. For example, Source A >> H >> M >> Y >> Destination B Destination B >> C >> J >> W >> L >> Source A ### Extra info/examples/attachments In the context of I2P and specifically i2pd, **inbound and outbound variance** refer to the random variation in the number of hops used in I2P tunnels. This feature is designed to enhance anonymity by making it harder to predict the exact path of data transmission. ### Inbound and Outbound Variance Explained - **Inbound Length Variance**: This parameter allows for a random number of hops to be added or subtracted from the inbound tunnel length. The default value is 0, meaning no variance is applied by default. However, it can be set between -3 and 3, which means the actual number of hops in an inbound tunnel can vary by up to three hops more or less than the configured length[1]. - **Outbound Length Variance**: Similar to the inbound variance, this parameter introduces randomness in the number of hops for outbound tunnels. Like inbound variance, it can also be set between -3 and 3, allowing for a dynamic adjustment of the tunnel length to improve anonymity[1]. ### Purpose of Variance The purpose of introducing variance in tunnel lengths is to make it more difficult for an attacker to identify patterns in the network traffic, which could potentially compromise user anonymity. By randomly adjusting the number of hops, the system makes it harder to trace the path of data packets. ### Configuration These settings can be adjusted in the i2pd configuration files, specifically in the `tunnels.conf` file for tunnel configurations. However, the exact syntax and options available might depend on the version of i2pd being used[1][3]. Citations: [1] https://i2pd.readthedocs.io/en/latest/user-guide/tunnels/ [2] https://geti2p.net/en/docs/api/streaming [3] https://i2pd.readthedocs.io/en/latest/user-guide/configuration/ [4] https://www.nrel.gov/docs/legosti/old/654.pdf [5] https://i2pplus.github.io/changelog.html [6] https://i2pgit.org/lbt/i2p.www/-/blob/dns-application/pots/docs.pot [7] https://github.com/anquanscan/sec-tools [8] https://www.reddit.com/r/i2p/comments/tst4o7/whats_inboundoutboundquantity_parameter/
Author
Owner

@glassez commented on GitHub (Apr 9, 2025):

These settings can be adjusted in the i2pd configuration files, specifically in the tunnels.conf file for tunnel configurations.

So what does qBittorrent have to do with it when it comes to i2pd settings, which the user is supposed to be able to configure at his discretion via configuration file?

@glassez commented on GitHub (Apr 9, 2025): > These settings can be adjusted in the i2pd configuration files, specifically in the `tunnels.conf` file for tunnel configurations. So what does qBittorrent have to do with it when it comes to i2pd settings, which the user is supposed to be able to configure at his discretion via configuration file?
Author
Owner

@absolutep commented on GitHub (Apr 9, 2025):

So what does qBittorrent have to do with it when it comes to i2pd settings, which the user is supposed to be able to configure at his discretion via configuration file?

SAM protocol settings are not provided only I2CP settings are provided.
So, most likely scenario is qBittorrent is handling SAM protocol settings.
Just like they handle Hops and Quantity, presently :-

Image

BiglyBT has already implemented it

Image

@absolutep commented on GitHub (Apr 9, 2025): > So what does qBittorrent have to do with it when it comes to i2pd settings, which the user is supposed to be able to configure at his discretion via configuration file? SAM protocol settings are not provided only I2CP settings are provided. So, most likely scenario is qBittorrent is handling SAM protocol settings. Just like they handle Hops and Quantity, presently :- ![Image](https://github.com/user-attachments/assets/8992b580-3f3d-46e3-ba60-b0ed897e4f50) ### BiglyBT has already implemented it ![Image](https://github.com/user-attachments/assets/eb300e51-37f1-476e-8456-30177e96f636)
Author
Owner

@glassez commented on GitHub (Apr 9, 2025):

SAM protocol settings are not provided only I2CP settings are provided.
So, most likely scenario is qBittorrent is handling SAM protocol settings.

I don't understand it. qBittorrent simply provides the user with the settings that libtorrent provides. If libtorrent supports this and has the appropriate settings, then we could add their support to qBittorrent. If not, then you should contact them so that they implement it first.

@glassez commented on GitHub (Apr 9, 2025): > SAM protocol settings are not provided only I2CP settings are provided. > So, most likely scenario is qBittorrent is handling SAM protocol settings. I don't understand it. `qBittorrent` simply provides the user with the settings that `libtorrent` provides. If `libtorrent` supports this and has the appropriate settings, then we could add their support to `qBittorrent`. If not, then you should contact them so that they implement it first.
Author
Owner

@absolutep commented on GitHub (May 6, 2025):

@glassez please check this PR for implementing variance tunnels by @ljpf

https://github.com/arvidn/libtorrent/pull/7942

@absolutep commented on GitHub (May 6, 2025): @glassez please check this PR for implementing variance tunnels by [@ljpf](https://github.com/ljfp) https://github.com/arvidn/libtorrent/pull/7942
Author
Owner

@glassez commented on GitHub (May 6, 2025):

@glassez please check this PR for implementing variance tunnels by @ljpf

arvidn/libtorrent#7942

I have a rather superficial knowledge of I2P, so I can hardly help with related jobs except for some general aspects.

@glassez commented on GitHub (May 6, 2025): > [@glassez](https://github.com/glassez) please check this PR for implementing variance tunnels by [@ljpf](https://github.com/ljfp) > > [arvidn/libtorrent#7942](https://github.com/arvidn/libtorrent/pull/7942) I have a rather superficial knowledge of I2P, so I can hardly help with related jobs except for some general aspects.
Author
Owner

@xavier2k6 commented on GitHub (May 25, 2025):

ANNOUNCEMENT!

For anybody coming across this "Feature Request" & would like/love to see a potential implementation in the future!
Here are some options available to you:

  1. Please select/click the 👍 &/orreactions in the original/opening post of this ticket.

  2. Please feel free (If you have the "skillset") to create a "Pull Request" implementing what's being requested in this ticket.
    (new/existing contributors/developers are always welcome)


DO:

  • Provide constructive feedback.
  • Display how other projects implemented same/similar etc.

DO NOT:

  • Add a "Bump", "me too", "2nd/3rd" etc. or "criticizing" comment(s).
    (These will be disregarded/hidden as "spam/abuse/off-topic" etc. as they don't provide anything constructive.)
@xavier2k6 commented on GitHub (May 25, 2025): ## ANNOUNCEMENT! For anybody coming across this **_"Feature Request"_** & would like/love to see a potential implementation in the future! **Here are some options available to you:** 1. Please select/click the 👍 **&/or** ❤ `reactions` in the original/opening post of this ticket. 2. Please feel free _(If you have the "skillset")_ to create a **_"Pull Request"_** implementing what's being requested in this ticket. **_(new/existing contributors/developers are always welcome)_** ____ **DO:** * Provide constructive feedback. * Display how other projects implemented same/similar etc. **DO NOT:** * Add a "Bump", "me too", "2nd/3rd" etc. or "criticizing" comment(s). **(These will be disregarded/hidden as "spam/abuse/off-topic" etc. as they don't provide anything constructive.)**
Author
Owner

@absolutep commented on GitHub (Jan 15, 2026):

This https://github.com/arvidn/libtorrent/pull/7942 has been merged in libtorrent, so I think qBitorrent can implement it now

@absolutep commented on GitHub (Jan 15, 2026): This https://github.com/arvidn/libtorrent/pull/7942 has been merged in libtorrent, so I think qBitorrent can implement it now
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/qBittorrent#16761
No description provided.