14

I bought a small gigabit ethernet USB adapter, which works fine OOTB in a Raspberry Pi 3, but only at 100mbits/s. How can I make it run at full speed?

ethtool:

# ethtool eth1
Settings for eth1:
Supported ports: [ TP MII ]
Supported link modes:   10baseT/Half 10baseT/Full
                        100baseT/Half 100baseT/Full
                        1000baseT/Half 1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes:  10baseT/Half 10baseT/Full
                        100baseT/Half 100baseT/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes
Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                     100baseT/Half 100baseT/Full
Link partner advertised pause frame use: Symmetric
Link partner advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: MII
PHYAD: 32
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: g
Current message level: 0x00007fff (32767)
               drv probe link timer ifdown ifup rx_err tx_err tx_queued intr tx_done rx_status pktdata hw wol
Link detected: yes

lshw:

*-network:2
   description: Ethernet interface
   physical id: 4
   logical name: eth1
   serial: 💩💩💩💩
   size: 100Mbit/s
   capacity: 1Gbit/s
   capabilities: ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
   configuration: autonegotiation=on broadcast=yes driver=r8152 driverversion=v1.08.8 duplex=full ip=192.168.1.5 link=yes multicast=yes port=MII speed=100Mbit/s

lsmod

Module                  Size  Used by
rpcsec_gss_krb5        23752  0
brcmfmac              222874  0
brcmutil                9092  1 brcmfmac
cfg80211              543027  1 brcmfmac
cdc_ether               6354  0
rfkill                 20851  1 cfg80211
r8152                  37460  0
bcm2835_gpiomem         3940  0
uio_pdrv_genirq         3923  0
uio                    10204  1 uio_pdrv_genirq
fixed                   3285  0
snd_bcm2835            24427  0
snd_pcm                98501  1 snd_bcm2835
snd_timer              23968  1 snd_pcm
snd                    70032  3 snd_timer,snd_bcm2835,snd_pcm
joydev                  9988  0
uinput                  9125  0
ipv6                  408971  32

First think I noticed is that 1000 is indeed supported, but not advertised. Maybe because the fallback from USB 3 to USB 2 falls back to 100mbits/s as well?

I tried

# ethtool -s eth1 speed 1000 duplex full

But no luck.

The adapter brand is "rankie" (easy to find at amazon).

Also, the adapter is connected to a gigabit switch. My NAS is connected to that switch and is running at 1000mbits/s without issues, so I doubt that is the issue.

Finally, the Ethernet adapter is the only USB device connected to the PI, so even if I don't expect a full 1000mbps, I was expecting to get somewhere to the USB2.0 speed

  • 1
    Surely the Pi3 like all Pi models is USB2 (Ethernet hangs off the Pi USB bus) – joan Jan 14 '18 at 17:31
  • sure, I dont expect to get the full gigabit Ethernet speed, but I've seen benchmarks showing at least 200mbps on USB Ethernet adapters. netbeez.net/blog/raspberry-pi-3-iperf – santiagozky Jan 14 '18 at 17:39
  • 3
    Be sure the switch you are connecting to is recognizing the adapter. Auto-negotiation may be failing. I did similar testing (sadly without keeping notes) and recall that I had to physically disconnect and reconnect the port after configuring the port speed using ethtool. Interestingly, even without configuring the speed, using USB3 adapters increased RPi throughput from ~94 Mbps to ~113 Mbps. I've read of people getting close to 300 Mbps using properly configured USB3 adapters. The USB2 bus supports far higher throughput than 100Mbps, though you won't get 1Gbps. – bobstro Jan 14 '18 at 17:46
  • The Pi 3 USB is 2.0 but the Rankie adapter is advertised as being 3.0 compatible. I suspect that the network speed is downgraded when attached to a 2.0 port. – BobT Jan 14 '18 at 17:49
  • 3
    Care to enlighten me on lshw's output? – Ghanima Jan 14 '18 at 18:29
29

Answering my own question, the problem was simpler than I thought.

Turns out I was using a cheap cable I had laying around at home. It doesn't even has the usual 8 wires, just 4 of them, which makes it incapable of being used for Gigabit Ethernet connections (Fast ethernet needs only 4 wires while Gigabit needs all 8 of them).

I switched to a proper Cat 5e cable and that solved the issue. Now ethtool reports 1000mbps and using iperf I get over 300mbps!

  • If you look at the conector of the cheap cable, does it have 4 or 8 pin connected to the cable? If it only has 4, it is something to look out for when buying a new cable in the future. – Ferrybig Jan 15 '18 at 8:38
  • Yes, it only has 4 wires in it. It never occur to me that it might lack half the wires. I don't think I bought that wire, Im pretty sure it came with some other gadget I bought at some point. Anyway, I'll be more vigilant next time! – santiagozky Jan 15 '18 at 12:00
  • I edited my response to add more detail – santiagozky Jan 15 '18 at 12:03
  • This is why cables are marked with 5e etc. – Thorbjørn Ravn Andersen Jan 15 '18 at 16:58
  • 2
    @santiagozky The cable you're describing is technically CAT3. There was a period of time before Gigbit Ethernet became ubiquitous that phone cables were terminated with an RJ-45 to substitute as Ethernet cabling, since houses were already wired with phone lines. This was also sometimes used to deliver DSL connections without installing new hardware. Your CAT3 could be leftover from an older 10/100 device, or from an old DSL modem, etc. Note that two-pair cables were also an upgrade from old phone lines because they could support two separate phone lines (each only required one pair). – thanby Jan 15 '18 at 19:06
8

The USB2 bus support speeds far higher than 100 Mbps, so you should indeed expect to see better speeds. USB2 network adapters cap out at 100 Mbps (IME), but backward-compatible USB3 gigabit adapters can use the capabilities of the USB2 bus to achieve higher than 100 Mbps.

I did similar testing using dual USB adapters on a RPi 3B. Your network switch may not be recognizing the speed switch made with ethtool. Try physically disconnecting and reconnecting the cable to force a capability re-negotiation with the switch after changing the port speed on the RPi. If that works, you need to figure out how to force the speed switch on initial connect.

Unfortunately, I screwed up when testing, and neglected to modify the port speeds on the RPi. I intend to repeat testing after reconfiguring speeds using ethtool in the future. As a data point, I did the same testing on an Asus Tinkerboard which also only provides USB2 ports alongside a GBE port. With a USB3 GBE adapter plugged into the USB2 port and connecting to a 3rd device over the GBE port, I was able to get 308 Mbps throughput in a routed configuration. If nothing else, this shows that the USB2 bus can support > 100 Mbps.

Even without setting the port speed manually, my throughput speeds using 2 USB3 GBE adapters on a RPi 3B improved from ~94 Mbps to ~113 Mbps, a roughly 20% gain.

  • 1
    "Try physically disconnecting and reconnecting the cable". the horror!! kidding aside. Found the issue and feel bad about it. I was using a Cat5 cable. found a 5e somewhere at home and got 305 Mbits/sec (with iperf)! – santiagozky Jan 14 '18 at 18:12
  • Hah! I got bit by that too, forgot about it. I hate it when I don't take notes on things like this. – bobstro Jan 14 '18 at 19:39
  • 1
    There is a difference between the achieved bandwidth and the advertised link. In theory you could create a USB 1.1 device with a 10GBit ethernet port and the link should report as 10GBit, just transferring data at that speed will not be possible. – PlasmaHH Jan 15 '18 at 10:20
  • Yes, there's a difference, but that doesn't mean you can't get more than 100 Mbps through a RPi. We've already clarified that the USB2 bus isn't going to support 1 Gbps but that 300 Mbps+ is realistic. – bobstro Jan 15 '18 at 14:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.