<div dir="ltr"><div class="gmail_quote"><div>Hi Gordon and Matthias,<br><br></div><div>I've split your discussion from the original thread "Running exit-node in Germany" and created a new one.<br><br></div><div>
I fully agree with you that the Raspberry Pi is the perfect device to let others run a Tor Relay Node very easily. What follows is a long mail about my experiences and more thoughts about the Pi as relay.<br></div><div>


<br></div>On Thu, Aug 1, 2013 at 5:29 PM, Gordon Morehouse <span dir="ltr"><<a href="mailto:gordon@morehouse.me" target="_blank">gordon@morehouse.me</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



Matthias Redies:<br>
<div>> Ok that is good to know. Right know I will probably run it on 1-1.5 Mbps<br>
> and later on 3-4 Mbps. What is the maximum your raspberry is capable to<br>
> do? Please let me know if you publish your tutorial.<br>
<br>
</div>I had it pushing about 1.5Mbps and crashing only about once a week<br>
before I started having TCP connect floods and had to take it offline<br>
until I could pay attention for a while.  I'm still tuning it.  It<br>
crashed much, much more often before some basic tuning, though.<br></blockquote><div><br>I'm running a relay node on a Raspberry Pi at my VDSL home 
connection for several weeks now (provider "Deutsche Telekom", 
connection is 50mbps down, 10 up) and I didn't run into such issues so far.<br><br></div><div>There're
 already several howtos out there which describe how to setup a relay 
node on the Raspberry Pi. I used this German one as starting point: <a href="http://blog.weezerle.de/2013/01/11/raspberry-pi-als-tor-server/">http://blog.weezerle.de/2013/01/11/raspberry-pi-als-tor-server/</a><br>


<br></div><div>My current configuration has only the following two non-default options:<br><br>  DisableDebuggerAttachment 0<br>  AvoidDiskWrites 1<br><br></div><div>(Plus, I run it as relay only by disabling the socks proxy with "SocksPort 0".)<br>



</div><div><br></div><div>Here's my node:<br><a href="https://atlas.torproject.org/#details/5AB2F49A1B79148E3A8F52808A00451DA00841B1" target="_blank">https://atlas.torproject.org/#details/5AB2F49A1B79148E3A8F52808A00451DA00841B1</a><br>



<a href="http://globe.rndm.de/#/relay/5AB2F49A1B79148E3A8F52808A00451DA00841B1" target="_blank">http://globe.rndm.de/#/relay/5AB2F49A1B79148E3A8F52808A00451DA00841B1</a><br><br></div><div>As you can see, it forwards on average between 2-4mbps (256-512 kB/sec) and there're peaks as high as 5.5mbps (~700 kB/s). The throughput varies depending on the day of week and time of day and therefore I believe the low average isn't the Raspberry's fault. I guess, if I set a higher advertised value, then I would see a more constant throughput closer to the peak value. Currently, it's set to 10mbps:<br>
<br>  RelayBandwidthRate 1024 KB<br>  RelayBandwidthBurst 1024 KB<br><br></div><div>(Note that the Pi is definitely not able to forward 10mbps of Tor traffic, but it would be great to max it out 24/7.)<br></div><div><br></div>
<div></div><div>The logged throughput is also consistent with what I saw with the console traffic monitor "nload" (suggested command line options for nicer units and less refreshes: nload -u K -U G -t 3000). I guess, I saw even higher peaks there. Monitoring everything with "arm" is also nice but far too CPU intensive.<br>
<br></div><div>More information about my setup:<br></div><div>- I have the B revision with 512 MB memory<br></div><div>- running stock Raspbian<br></div><div>- installed "tor" package 0.2.3.25-1 from the Raspbian repository<br>
</div><div>- CPU is overclocked using "raspi-config" to 950 MHz<br><br></div><div>Before I overclocked the Pi, I saw a similar average throughput.<br><br></div><div>When you search for "rasp" at Tor Atlas or Globe (e.g. <a href="http://globe.rndm.de/#/search/query=rasp">http://globe.rndm.de/#/search/query=rasp</a>) , you can see that there're already more than 40 devices running. My node performs quite well compared to others and I would argue that it's in the top 5 among all Raspberry Pi nodes so far.<br>



</div><div><br></div><div>To track down possible CPU problems, we should also compare the openssl benchmark results. The Raspberry Pi wiki has some reference values: <a href="http://elinux.org/RPi_Performance#Results_3" target="_blank">http://elinux.org/RPi_Performance#Results_3</a></div>
<div><br>I've attached the summary output of "openssl speed" for my overclocked Pi (950 MHz) to this mail. As you can see, the numbers are higher than the reference one (I guess probably due to overclocking and different OpenSSL version).<br>
<br></div><div>I've also attached the log of notices of the last 4 days (unfortunately no longer logs available). Within four days there was only one "Your computer is too slow to handle this many circuit creation requests!" warning and one "Failed to hand off onionskin.". In general I would say, I haven't seen any serious issues so far.<br>
</div><div></div></div><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
And my plan is to publish my results to the entire list, because at $35,<br>
Raspberry Pis can make *great* relays for slower home broadband, but<br>
they need a little tender loving care first.  :)<br>
<br></blockquote><div><br></div><div>I totally agree with you. Recently, there has been
 quite some buzz about the OnionPi howto (<a href="http://learn.adafruit.com/onion-pi/overview">http://learn.adafruit.com/onion-pi/overview</a>) but its main goal wasn't 
providing a long-running relay node. In my opinion, this should get addressed separately and made as simple as possible for novices. My guess is that many people want to contribute bandwidth, but they do not want to deal with Linux specifics (and definitely do not want to get into any trouble with the police). They need a plug-and-forget solution: attach the Pi to the router and leave it running in the closet for months. If it has to be restarted, Tor Weather can send them an email.<br>
<br></div><div>What do you think about documenting the setup of the relay in the Tor wiki?<br></div><div><br><a href="https://trac.torproject.org/projects/tor/wiki" target="_blank">https://trac.torproject.org/projects/tor/wiki</a><br>
<br></div><div>I'm not very familiar with the Tor Project yet, but to me it looks like the wiki will be the best place. Other people can contribute as well and it will be visible enough. It would be good if there's an always up-to-date wiki page which could become the reference for new users.<br>
</div><div>


<br></div><div>The idea of the Raspberry Pi as relay node could be even further expanded:<br></div><div>- Matthias already mentioned that there should be a specific image for it. I agree!<br></div><div>- New users would prefer a simple webinterface to configure the relay (basically a Vidalia as webinterface :-)<br>
</div><div>- Such a webinterface should also show statistics e.g., "Your node has forwarded 1 TB in the last 4 weeks." This will show people that their contribution made a difference and it will make them happy and more confident about it. Eventually, they'll convince others to run a relay as well.<br>
<br></div><div>I won't have the time to realize these ideas, but maybe others want to jump in. Further work and testing could be coordinated on this mailing list?<br></div><div><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

I hope to have something up in a week or two, I need to watch it for a<br>
while and continue to tweak, and maybe develop a solution for the TCP<br>
storms that can bring down a lot of consumer routers, before publishing<br>
for all.<br></blockquote><div><br></div>I run a regular Linux PC as router which forwards all the traffic of the
 Pi. The machine has more than enough CPU power and therefore I haven't 
seen any issues there. Since the two months that I run the relay node on the Pi, my Linux PC router has frozen twice (which didn't happen before). But I'm not sure that it can be related to the forwarding of the relay node traffic.<br>
<br>For a broader adaption it's definitely necessary 
to look into the behavior of the most popular routers e.g., the ones 
given out by the major providers. These things could be documented on the Tor Wiki as well.<br><br></div><div></div></div><div class="gmail_quote">Best regards,<br>Michael<br></div></div>