Can the Tor-network benefit from client routers?

Rob van der Hoeven
Fri May 13 2016

Lately I started running Tor on an OpenWrt router (see my previous article). This turned out to be quite a nice experience - Tor on the router has many benefits for Tor-network clients.

Moving Tor from your computer(s) to the router can change the Tor-network landscape. Routers have the most direct Internet connection and they run 24/7. This opens up the opportunity to donate bandwidth to the Tor-network, and while a single router can probably donate little bandwidth there's strength in numbers. In this article I will do some calculations that will hopefully convince you that the potential bandwidth contribution of routers running Tor-firmware is very interesting.

The bandwidth of the Tor network

Can many low-bandwidth client routers make a significant contribution to the bandwidth of the Tor-network? To answer this question we must first look at the current bandwidth of the network, and how it is used. Thanks to the Tor metrics project we have data about the bandwidth of the Tor network:

Total relay bandwidth

In this graph the bandwidth is the sum of both incoming and outgoing traffic of all relays in the Tor-network. The advertised bandwidth is the sum of the bandwidth each relay claims it can provide. The bandwidth history is the sum of the bandwidth that is reported to have been used.

I think we all agree that the graph shows some impressive numbers. But without understanding the way the Tor-network works you might get the wrong picture. From the clients perspective the bandwidth history is not ~75 Gbit/s but ~12 GBit/s. Why is that? To understand this we need to look at the bandwidth a single client uses:

Client --> OR1 --> OR2 --> OR3 --> Server

One client uses the bandwidth of three onion routers, and for each onion router the client uses both upload and download bandwidth. For a client to upload 1 MB of data, roughly 6 MB of Tor-network bandwidth is needed.

Potential Tor router bandwidth

In order to get an idea of the average bandwidth a Tor router can contribute to the Tor-network I use data from Akamai. As you probably know, Akamai is a firm that operates a huge content delivery network. Every quarter they publish a lengthy report with metrics on the observed download speed in different countries. This report contains two metrics of interest: Average connection speed, and Average peak connection speed.

Most publications about the speed of the Internet only mention the average connection speed, which does not represent the connection speed of the users. This has to do with the way Akamai measures it. For Akamai, the average connection speed is the average speed of a http file download. If you request a web-page however, many parallel downloads are taking place which all share the same connection. So, the average speed in the Akamai report is only a fraction of the real speed of the Internet connection. The average peak connection speed only uses the maximum observed download speed of an IP address. This is most likely the speed with no parallel downloads, and thus best represents the speed of the Internet connection.

To get a good idea about the bandwidth of Tor-network users we cannot simply use the average peak Internet connection speed of 32 Mbit/s mentioned on the Akamai website. The Tor metrics show that most Tor users are living in relatively rich countries with good Internet speeds. Therefore I decided to calculate the bandwidth using the data of the 10 counties with the most Tor users.

Top 10 countries: 2016-02-11 to 2016-05-11

Country         Mean daily users     Avg download speed(Mbit/s)
United States   364015  (19.38 %)    61.5
Russia          214670  (11.43 %)    60.0
Germany         187220   (9.97 %)    51.3
France          112798   (6.01 %)    43.2
United Kingdom   84199   (4.48 %)    56.8
Italy            54166   (2.88 %)    32.0
Spain            53045   (2.82 %)    59.9
Brazil           49302   (2.62 %)    30.3
Japan            47675   (2.54 %)    82.9
Canada           42031   (2.24 %)    54.9
               1209121  (64.37 %)    55.6 (weighted)

Weighted Avg download speed:

   364015 * 61.5 
 + 214670 * 60.0 
 + 187220 * 51.3 
 + 112798 * 43.2 
 +  84199 * 56.8 
 +  54166 * 32.0 
 +  53045 * 59.9
 +  49302 * 30.3
 +  47675 * 82.9
 +  42031 * 54.9
 67191202.8 / 1209121 = 55.6 Mbit/s

Mean daily users all countries: 1209121 / 0.6437 = 18800000

As you can see, taking the global distribution of Tor users into account leads to a much higher average download speed. What I find interesting is that this speed is rapidly improving as the next graph shows:

Average peak connection speed of Tor top 10 countries

(Graph made with: Akamai data visualization)

Until now I have only talked about the download speed. What about the upload speed? Most Internet connections are asymmetric having an upload speed which is typically 1/10 of the download speed. This upload speed becomes the limiting factor for the bandwidth a Tor router can contribute to the Tor-network. On average I think one Tor router can contribute 5 Mbit/s in both directions, a total of 10 Mbit/s.

There's one question left to answer: does this bandwidth contribution hurts the normal Internet use of the user? Well, not for downloading because it only uses 1/10 of the download speed. For uploading I looked at my Internet statistics: My peak average daily upload speed was 60 Kbit/s. Many days had a much lower daily average. I think that users who are not doing much uploading will probably not notice the sharing of the upload bandwidth.

Some calculations

Now we have an idea about the average bandwidth contribution of a single Tor router we can start some calculations.

First: How many Tor routers are needed to provide the same advertised bandwidth of the current Tor-network?

170000 Mbit/s / 10 Mbit/s = 17000 routers 
17000/1880000 = 0.9% of the Tor users

Second: How many Tor routers are needed to provide the same observed bandwidth of the current Tor-network?

75000 Mbit/s / 10 Mbit/s = 7500 routers
7500/1880000 = 0.4% of the Tor users

Wow, it only takes a very small percentage of Tor users donating bandwidth to provide the same bandwidth that the Tor-network has today. Even better, if the number of Tor users increase so does the donated bandwidth.

Of course, at the moment there is no "Tor router", and the Tor software is not ready to make use of bandwidth donated by clients. I hope this article convinces you that having an official "Tor router" would not only benefit the Tor users, but it will also create new opportunities to expand and strengthen the Tor-network. What do you think?

Comments: 0