I2P: The Private Layer of the Web

Enki
10 Nov 2022

I2P: The Private Layer of the Web


When most people think of the “Dark Web” or “Dark Net” the first thing that comes to mind is probably Tor. Tor is basically a household name now; love it or hate it, most people have heard of it.

As you may or may not know, there are a small handful of different privacy focused networks out there. Each one with different ideas on how privacy on the internet should work. I2P or The Invisible Internet Project’s approach is to act as a fully encrypted and private layer of the internet.

This post is not going to be a “why one is better than the other” type post. Each network has its own use cases with their own set of pluses and minuses. This post is simply going to try and explain what I2P is in a broad sense, with some comparison to Tor. I’ll cover things like how to host a site and set up an outproxy in another post. As with most of my posts, this will assume that you do have some basic networking knowledge, but I do try and keep it as accessible as I can. Moving on.

A brief history

Routing

Tor Network Structure Refresh


I’ll start off with a refresher on Tor. There are enough similarities between the networks that without diving too deep it helps with some comparisons. Tor has various elements to its network. A basic Tor connection takes a minimum of three different kinds of nodes. An entry node, a relay, and an exit. The first node is your entry node. Keep in mind, any relay node can act as an entry node, the only difference being that the entry is the only node that knows who you really are.

Relay nodes are the ones that pass your traffic along to exit nodes after a few hops. The exit node communicates with your destination and can forward traffic out of the network. Exit nodes serve as a source for your destination server. This is part of how Tor keeps your traffic anonymous. Exit nodes also send the traffic back to you.

Directory servers are critical for maintaining Tor network. They store the identity of the nodes on the network. The directory servers are hard coded into the Tor browser and when you fire up the Tor browser these directory servers choose your entry, relay, and exit to form a circuit. At the time of writing, there are only 10 directory servers. You can see them here. The other purpose of these servers is to maintain the health of the network by monitoring the activity of nodes and replacing unhealthy nodes with healthy ones to maintain the stability of the network.

It’s also worth noting that relay servers technically have two categories: the “advertised relay nodes” ; these are the relays that are publicly available in the list that the directory servers maintain. Then there are “Bridge nodes”. These are private relays as they are not listed in directory servers. They exist purely for government blocks. In theory, you can block the nodes on the public list, but you can’t block what you can’t find, therefore bridge nodes exist. It’s hard to gauge the number of bridges out there, but it's estimated to be in the 2k range. You can see that here.

That's Tor in a nutshell. On to I2P

I2P Software


When you install I2P, you get software that has everything with it, you need to connect to the network and host with. Every “node” in I2P is also a router, so there is no distinct difference from a server and pure client like with Tor.

This leads to I2P to be almost completely decentralized. They say “almost” due to the need of what they call “Reseed Servers” this is how you make your first connections and join the network. These servers help with what’s called the DHT (Distributed Hash Table) bootstrap problem. There is no reliable method to get out of running at least one permanent bootstrap node that non-network users can find to get their foothold in the network. Once you're connected to the network, you only discover peers by making “exploratory” tunnels. But to make your initial connections, you need to get your peers from somewhere. This model contrasts with Tors directory servers a great deal.

Floodfill routers or peers are I2P’s directory servers that store the directory or the Network Database (netDB for short). Floodfill servers are untrusted and varying. Any router can be set to act as a floodfill router. To increase reliability of the netDB floodfill is automatically turned on only on high bandwidth routers (this has to be manually configured). In addition to having high bandwidth, a router must also pass health checks like outbound message queue time and job lag before floodfill is automatically turned on. It is estimated that only 6% of the network are floodfill routers.

The netDB that I2P uses is a specialized distributed database. It only contains a few types of data, the big two being Router contact info (RouterInfos) and Destination contact info (Lease Sets). Each bit of data is signed by the host and is verified by anyone who chooses to store the site in their own local copy of the netDB. It also stores liveliness data of a site, this allows bad entries to be dropped, newer entries replace older ones.

Tunnels (or circuits on the Tor network) are how routers communicate and route traffic. I2P builds virtual “Tunnels” between routers for communication; they are temporary and unidirectional. For a basic connection you need at least four tunnels, two outbound, two inbound. Each tunnel has a set amount of hops that is set in router settings, with a maximum of seven hops. The amount of hops per tunnel of course affects things like latency, throughput, reliability and anonymity. A user can fine tune the amount of hops based on need. Three hops is recommended for most users, as it's a fair balance of anonymity and speed. Peers are selected by a continuous polling and ranking performance, rather than trusting claimed capacity.

I could spend several more pages covering the specifics of I2P, but I’ll leave you with a link to the main documentation if you want to take a deeper look at the network and how it works.

To sum up


In conclusion, I would say that I2P has a lot of potential. While Tor is designed to act as an anonymizing proxy for the Vanilla Internet, I2P is specifically designed to make an anonymous network for hidden services and P2P applications. It's not perfect (Name a solution that is though… I’ll wait) but it's a good attempt at an anonymized network layer.

I think it's far more flexible than Tor and while it currently is more technically involved to use than Tor at the moment I hope that will be eventually overcome. The need to install something plus configuring a proxy on a separate browser from your primary browser can be daunting to some, vs Tor’s just installing a browser and off you go. Although Firefox plugins like “I2P In Private Browsing” does a good job managing I2P via containers for Firefox eliminating the need to have a separate browser or do any extra configuration. This makes it far more accessible in my opinion.

I2P does have a fair amount of self awareness when it comes down to what the network could be vulnerable to. Outside unforeseen software vulnerabilities that could jeopardize the network, a few of the attacks they talk about and try to mitigate include: Brute force, timing attacks, DOS attacks, Intersection attacks and syble attacks to name a few. If you want to learn more about these potential issues and how they try and mitigate, them here is the official page.

I2P is a smaller network that's not as battle tested as Tor, but its optimization for hidden services and its more P2P nature is very appealing. Also, Monero and Bitcoin support I2P now for node communication. Along with a few other privacy focused cryptos joining the network. I personally hope to see more Bitcoin and Monero users to enable I2P on their nodes.
I hope this helps answer some questions about I2P and encourages you to learn more and start exploring how you can use I2P to help you maintain at least a modicum of privacy in an ever surveilled world. Furthermore, I'll leave some links below to get you started. Have fun exploring and tinkering!

Until next time.



Network Metrics

Nostr Logo