Getting Gigabit Networking on a Raspberry Pi 2, 3 and B+

tl;dr You can get Gigabit networking working on any current Raspberry Pi (A+, B+, Pi 2 model B, Pi 3 model B), and you can increase the throughput to at least 300+ Mbps (up from the standard 100 Mbps connection via built-in Ethernet).

I received a shipment of some Raspberry Pi 2 model B computers for a project I'm working on (more on that to come!), and as part of my project, I've been performing a ton of benchmarks on every aspect of the 2, B+, and A+ Pis I have on hand—CPU, disk (microSD), external SSD, external HDD, memory, and networking.

I've tested the onboard LAN port (rated as 10/100 Fast Ethernet, and driven through the onboard USB 2.0 bus), and a few different 802.11n WiFi cards, and the raw throughput speeds ranged from ~45 Mbps with the 802.11n cards (with a very strong signal) to ~94 Mbps with the onboard LAN.

I then purchased a TRENDnet USB 3.0 Gigabit adapter from Amazon to test on my Pi. After configuring the interface by editing /etc/network/interfaces and adding a line for the new eth1 adapter, I ran standard iperf benchmarks on all the interfaces and found the following results:

  • Internal LAN (10/100): 94.4 Mbits/sec (11.8 MB/sec)
  • USB 802.11n WiFi: 44.5 Mbits/sec (5.6 MB/sec)
  • USB Gigabit LAN (10/100/1000): 321 Mbits/sec (40 MB/sec)

(These were as measured on a Pi 3—the model 2 and B+ have slight speed differences which I'll enumerate in a chart below).

Or, in a nice graphical format (note that this chart is slightly out of date as of early 2016):

Raspberry Pi Network Interface Speed Comparison - Internal LAN WiFi Gigabit

For certain use cases, this more-than-doubled bandwidth can be extremely beneficial (e.g. streaming full-res HD video, streaming and processing large amounts of data, etc.). However, for many real-world use cases, the Pi's other subsystems (CPU and disk I/O especially, since I/O is on a single, shared USB 2.0 bus) will limit the available bandwidth.

If you're hungry for faster networking, and you can't wait until the Raspberry Pi 4 (or whatever starts including Gigabit Ethernet), know that you can more-than-double the built-in bandwidth capacity.

Here's an additional graph, comparing speeds between the B+/A+ and the model 2/3 (the onboard LAN has been dramatically improved, and I double-checked these results to confirm the increased download bandwidth!):

Raspberry Pi 2 and model B+ network throughput speed comparisons

Real-world implications

In working on building a high-performance cluster of Raspberry Pi 3s for my Dramble cluster, I wanted to see just how scalable I could make the Nginx load balancer (which was also acting as a reverse proxy cache).

After making sure the Nginx configuration could support thousands of requests per second on the 4-core Pi, I discovered that I was easily able to saturate the onboard 10/100 LAN at about 95 Mbps serving cached content at around 1800 requests/second.

Switching to a Gigabit adapter almost doubled the throughput, and I was able to serve about 5000 requests/second at a rate of 200 Mbps!

So, if you need the raw throughput increase, using a USB 3.0 Gigabit adapter will definitely take you further than using onboard LAN—at the cost of slightly higher total power consumption and an unsightly dongle hanging off the Pi :)

Further reading:

Comments

Hi there,
Good post.
Have you tried teaming USB 3.0 Gigabit adapter's on the pi2?
Wayne

Yes; please see the second graph, which includes benchmarks for both the B+ and Pi 2 model B.

I don't think you understood his comment. He was talking about using LAN teaming, using two USB3.0 gigabit adapters banded together on a single Rpi2 for an overall bandwidth of 2gbps. Maybe you should test this against the Odroid C1's integrated gigabit LAN controller to see what is faster. The C1 wouldn't require the extra hardware/power/costs so it might already be a win.

Ah, I see. Misread the comment.

In that case, I don't think it would do much of anything—we're hitting USB 2.0's maximum real-world bus throughput way before even the first 1 Gbps adapter is saturating it's bandwidth.

I used the same adapter on my MacBook Air with USB 3.0 and was able to get about 960 Mbps, so I know the limit isn't the adapter :)

2x gigabit usb teamed together might reach the 480Mbps usb root's throughput (enough to handle 2x USB 2.0 at 30MB/s or 240Mbps each)

It might, but given that the bottleneck is clearly not in the GigE/USB3 adapter, it seems unlikely that loading the RPi with another active USB device would result in more throughput. My guess is that two adapters would actually be slower.

It would be a fun practical example but the author is right. Bonding two usb network interfaces would be mooted because they would be sharing the same usb bus. Just one USB adapter sounds like it is already maxing out the one use bus on the pi. I believe the pi mentioned shares the only USB bus with the network Port and the four USB ports.

Have you tested copying the test files to different file system?
Probably you can provide a comparison for transfer speed to ext4/ntfs partition?

Hi!

Do you know how to configure the ethernet adapter in Openelec (Kodi)? Because there is not /etc/network/interfaces file anymore so I don't know where to add the new interface. I've been searching what is the new file to configure ethernet interfaces but i couldn't find anything..

I am curious as how exactly you edited the file. I am getting ready to do this same thing but I'm not very Linux savy. I've been learning but still don't understand alot of it. Just want to know what the extra line is. Thank you.

What is the difference between "Gigabit - Download" and "Gigabit - Iperf", what is the huge difference attributed to?

The iperf metric is simply measuring raw network throughput—how fast can the interface send or receive packets? The download is also measuring how fast the system can accept the packets, transfer them to a storage system, write to disk, etc.

Very useful info, kudos for taking the time to publish it.

On a related note, I have a Pi 2 connected to a gigabit switch and a Mac connected to the same switch. I know my throughput should be around the 11MB/s mark (since the Pi 2 has only a 100Mb port), but doing a netcopy (nc) between the computers always averages 2.6MB/s, only maxing at 6MB/s occasionally.

Any idea why, or what tools/articles I can use to find out where the slow down is occurring?

Thanks

Try running the iperf benchmark instead of doing a file copy between the two; if you do a file copy, a lot of the USB bus' bandwidth gets sapped by the filesystem read/write operations, and that reduces the amount of throughput the Pi can devote to the network connection.

In real world use (e.g. anything that involves files on the server, and can't be cached in RAM, throughput through any network interface tops out around 4-6 MB/sec.

Are you transfering to the SD Card? That could be part of it. Also, what else is plugged into the Pi? That will make a difference.

Can you tell precisely how did you add the line for the new adapter, transcribing the all editing? How can you know for sure that the raspbian will recognize the new adapter as "eth1"? Thanks!

Unfortunately, 222 Mbps is not really fast... Wonder why the designers chose to use a 10/100 instead of a 10/100/1000...

Main reason is cost. The primary goal of the Pi is to produce a low-cost computer for learning -- their goal on each release is to hit the $35 price point. Presently that means USB 2.0 bus, which limits the I/O to 480Mbs.

Hello, thanks you for sharing your experience.

A question, but the raspberry2 not have only an usb2 port with limited bandwidth?

Thanks.

The Pi 2 has one USB 2.0 bus shared with four USB 2.0 ports. So if you tried adding two Gigabit ethernet interfaces, they'd have to share that maximum throughput.

Say one were to have an external drive connected to the pi, and a USB Ethernet cable. Would the ~speed of a file off of that external drive over the network be limited to around 111mbps? (222mbps/2, due to the fact that both the ethernet and usb drive is sharing the same bus).

Thanks!

Yes, more or less; all the ports share the same USB bus, and it's theoretical limit is ~480 Mbps, but in the real world that's more like 200-250 Mbps total.

so theoretically, if you did not use a gigabit controller, you could team up a usb wifi dongle and the onboard ethernet to get slightly higher throughput than just the ethernet alone? (they are all going through the same usb controller, but since you've proven you can get double the bandwidth out of the bus by using a gigabit dongle, so the usb bus itself is capable of a higher capacity)

or would the overhead used by combining the NICs negate limit the throughput anyway?

I'm not sure, since I haven't tested, but since everything's on one bus, it would probably still max out around the same total throughput; and the more USB devices, the more contention in the controller, so total maximum throughput could decrease (but only a very small amount) the larger the number of devices.

Very good article Jeff,
Will PI 2 board Ethernet port support GigE Cameras?

Thanks tons for this post mate! I am looking at setting up ownCloud on my Pi2 and I was pretty much sold on doing so until I saw it only had a 10/100 ethernet connection. My home connection is in excess of 100/100mbps and I wasn't prepared to take a bottleneck... Your post breathed new life into my plan!

I would suggest the Orange Pi Plus (or Banana Pi) over the RPi2B as not only does it have a native 10/100/1000 LAN port but a SATA port as well. Would be perfect for cloud storage.

Funny you mention that—I actually just received an Orange Pi Plus for testing in the mail. I'll be blogging about performance comparison with Rasbperry Pi soon!

What is the theoretical transfer speed of the MicroSD chip in the RPi2? Could you be saturating that point?

Hi, i hardly try to find the network devices on my Raspberry Pi 2 , which i use with OSMC(Kodi), got a clue for me, where to find it ?

Greetings
Thomas from Germany

Hey Jeff, Thanks for submitting the article and all the comments. Some really useful learning information.

For the people submitting media player requests, the author of this article states pretty clearly that he is performing theoretical tests for another project involving a cluster of Raspberry Pi devices. I came here from a Google search on measuring network performance for a Raspberry Pi based media centre.

I would not expect to find the answer to your environment specific requirements. This isn't an attack, just to help people not live in false hope :).

Hi Jeff. Great job you did! This is what I was looking for. I'm streaming a usb webcam with mjpg-streamer on a RPi and the LAN speed is the bottlneck to achieve a decent framerate. I have a question: Have you connected the "USB 3.0 to Ethernet adapter" to a dual usb Y-cable getting power from 2 ports of the RPi (as it's a power hungry USB 3.0 device) or you just plugged it into a single port? Can you also guide me through the process of what line should I add to the configuration file? Many thanks.

Nope, just plugged directly into the port on the Pi itself, and this provided enough power.

Thanks Jeff. Do I just have to change eth0 to eth1 in /etc/network/interfaces or is there anything else I have to change?

Hi Jeff, thats a great Tip to expande the Lan up to 1 Gbit. Please explain for me by a smal howto, what i have to do for
"/etc/network/interfaces and adding a line for the new eth1 adapter" !
Which entry must be added to the file? Seeking many months for a solution as you describe it. I use the Raspi as VPN tunnel to be accessible externally and i need much more than 100 mbits. :-)

Thanks

Frank

I found some additional information here: http://www.dxsdata.com/2015/06/openelec-configure-static-ip-via-ssh-cons...

The network details are saved under /storage/.cache/connman
You will need to allow the OpenELEC box to see the device (and may even need to have it acquire a DHCP address) first. Then you will be able to edit the entry as needed to match your desired network configuration.

Hi Jeff!

Thanks for the article, it's great! Was really convinced so I went out and bought a pi after reading it.
I've been trying to mimic your setup though I can't seem to break 16MB/s so I wanted to ask if you had to install any drivers for the USB Gigabit adapter or was it just plug and play? Because I did the latter and it seems to work perfectly (aside from the fact that it's only running on 16MB/s lol).

Well Damn.

So, I bought the same TRENDnet USB 3.0 Gigabit adapter from Amazon, thinking hey, $10 to cut my transfer time in half, no problem.

Plugged it into my Pi2 OpenElec setup, it was auto discovered and added as eth1 with no issues.

Copied a 3Gb movie from another machine to the external hard drive plugged into the Pi, and sadly got the exact same (if not slightly worse) transfer speeds.

Any thoughts? Was the doubled network speed cut in half by sharing the USB bus with the External HDD?

Was the doubled network speed cut in half by sharing the USB bus with the External HDD?

Unfortunately, that's exactly the problem. You only have one USB bus on the entire Pi, so all it's bandwidth is split up between the LAN and all four USB ports.

Did you do full duplex tests with iperf?

Yes; the same tests resulted in ~960 Mbps between my Macs or between my Mac and an ODROID-C2.

Nice, I am going to setup a PI3 + USB Gbit in the next few weeks to just download data from the internet and store it on NFS shares (same Gbit switch), so full duplex performance was a worry of mine.