kramlegan
Posts: 6
Joined: Mon Feb 20, 2017 4:42 am

USB network adapter bridge question

Mon Feb 20, 2017 4:56 am

Scenario: I have created a network bridge between my modem and router to use cacti to capture network traffic so I can view my usage since my ISP does not provide it.

Problem: My USB adapter eth1 (Startech USB31000S) is only allowing half the speed through it.

For example when eth0 is plugged into the modem and eth1 into the router my down speed is 40Mbps and up is 2.5Mbps. Then if I switch the cables eth0 is in the router and eth1 is in the modem down is now 20Mbps and up is 5Mbps.

Here is my /etc/network/interfaces

Code: Select all

$ more interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

# The loopback network interface
auto lo br0
iface lo inet loopback

# Set up interfaces manually, avoiding conflicts with, e.g., network manager
iface eth0 inet dhcp

iface eth1 inet dhcp

# Bridge setup
iface br0 inet dhcp
  bridge_ports eth0 eth1

allow-hotplug wlan0
iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug wlan1
iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Here is my eth0 and eth1 settings;

Code: Select all

$ sudo mii-tool -v
negotiated 1000baseT-HD flow-control, link ok
  product info: vendor 00:01:f0, model 12 rev 3
  basic mode:   autonegotiation enabled
  basic status: autonegotiation complete, link ok
  capabilities: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
  advertising:  1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
  link partner: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
eth1: negotiated 1000baseT-FD flow-control, link ok
  product info: vendor 00:07:32, model 17 rev 5
  basic mode:   autonegotiation enabled
  basic status: autonegotiation complete, link ok
  capabilities: 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
  advertising:  1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
  link partner: 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
Here is my ifconfig

Code: Select all

$ifconfig -a
br0       Link encap:Ethernet  HWaddr 00:24:9b:1e:fd:04  
          inet addr:192.168.0.101  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::224:9bff:fe1e:fd04/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1090 errors:0 dropped:0 overruns:0 frame:0
          TX packets:329 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:177740 (173.5 KiB)  TX bytes:37079 (36.2 KiB)

eth0      Link encap:Ethernet  HWaddr b8:27:eb:a0:37:68  
          inet addr:169.254.189.171  Bcast:169.254.255.255  Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:21508 errors:0 dropped:0 overruns:0 frame:0
          TX packets:34730 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:11545887 (11.0 MiB)  TX bytes:39210718 (37.3 MiB)

eth1      Link encap:Ethernet  HWaddr 00:24:9b:1e:fd:04  
          inet addr:169.254.8.223  Bcast:169.254.255.255  Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:34601 errors:0 dropped:0 overruns:0 frame:0
          TX packets:21476 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:38426874 (36.6 MiB)  TX bytes:12022508 (11.4 MiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:76 errors:0 dropped:0 overruns:0 frame:0
          TX packets:76 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:9645 (9.4 KiB)  TX bytes:9645 (9.4 KiB)
Any help would be appreciated. Thanks in advance!

Ernst
Posts: 1334
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: USB network adapter bridge question

Mon Feb 20, 2017 9:18 am

I suggest you replace the ethernet cables, one of them could be faulty.

Did you notice this: "[eth0] negotiated 1000baseT-HD flow-control, link ok" ?
This link has negotiated Half Duplex.
The road to insanity is paved with static ip addresses

User avatar
rpdom
Posts: 17172
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: USB network adapter bridge question

Mon Feb 20, 2017 10:44 am

Ernst wrote:I suggest you replace the ethernet cables, one of them could be faulty.

Did you notice this: "[eth0] negotiated 1000baseT-HD flow-control, link ok" ?
This link has negotiated Half Duplex.
No it hasn't. It isn't running at 1000baseT either. It's a bug in mii-tool.

ethtool (which isn't installed by default) will give the correct values

Code: Select all

pi@raspi8:~ $ sudo mii-tool eth0
eth0: negotiated 1000baseT-HD flow-control, link ok

pi@raspi8:~ $ sudo ethtool eth0
Settings for eth0:
	Supported ports: [ TP MII ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/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: 1
	Transceiver: internal
	Auto-negotiation: on
	Supports Wake-on: pumbag
	Wake-on: d
	Current message level: 0x00000007 (7)
			       drv probe link
	Link detected: yes

kramlegan
Posts: 6
Joined: Mon Feb 20, 2017 4:42 am

Re: USB network adapter bridge question

Mon Feb 20, 2017 11:49 am

Both are showing full duplex

Code: Select all

$ ethtool eth0
Settings for eth0:
	Supported ports: [ TP MII ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/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 Receive-only
	Link partner advertised auto-negotiation: Yes
	Speed: 100Mb/s
	Duplex: Full
	Port: MII
	PHYAD: 1
	Transceiver: internal
	Auto-negotiation: on
Cannot get wake-on-lan settings: Operation not permitted
	Current message level: 0x00000007 (7)
			       drv probe link
	Link detected: yes
$ 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 
	                        1000baseT/Full 
	Advertised pause frame use: Symmetric
	Advertised auto-negotiation: Yes
	Link partner advertised link modes:  10baseT/Half 10baseT/Full 
	                                     100baseT/Half 100baseT/Full 
	                                     1000baseT/Half 1000baseT/Full 
	Link partner advertised pause frame use: Symmetric Receive-only
	Link partner advertised auto-negotiation: Yes
	Speed: 1000Mb/s
	Duplex: Full
	Port: MII
	PHYAD: 3
	Transceiver: internal
	Auto-negotiation: on
Cannot get wake-on-lan settings: Operation not permitted
	Current message level: 0x00000007 (7)
			       drv probe link
	Link detected: yes

epoch1970
Posts: 5131
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: USB network adapter bridge question

Mon Feb 20, 2017 12:00 pm

And also one is showing 100mbps and the other 1000mbps.
What happens if you swap the cables, not the adapters? Both your modem and router are giga?
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

kramlegan
Posts: 6
Joined: Mon Feb 20, 2017 4:42 am

Re: USB network adapter bridge question

Mon Feb 20, 2017 12:07 pm

The 1000mbps adapter is the USB to Ethernet.
100mbps onboard Ethernet adapter

When I flip the cables it is the behavior I am reporting. Either upload speed or download speed is cut in half.

I have also tried multiple cables with the same behavior.

epoch1970
Posts: 5131
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: USB network adapter bridge question

Tue Feb 21, 2017 8:34 am

kramlegan wrote:The 1000mbps adapter is the USB to Ethernet.
100mbps onboard Ethernet adapter

When I flip the cables it is the behavior I am reporting. Either upload speed or download speed is cut in half.

I have also tried multiple cables with the same behavior.
Sorry I should probably have seen what your setup was.
I have one bad news and one good news: your device is based on ASIX AX88179, and I have a Pi 3 with the same (potential) setup here; I could run a test and see if I get the same results.
The bad news is, I wonder if ASIX AX88179 isn't having a driver issue these days. I tried doing something with it recently, a bond IIRC, and it didn't behave as I expected at all.
I'm not sure, but perhaps a Realtek-based device would work better?

Tell me if you want me to run a test on my side.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

kramlegan
Posts: 6
Joined: Mon Feb 20, 2017 4:42 am

Re: USB network adapter bridge question

Tue Feb 21, 2017 11:49 am

If it wouldn't be too much of a hassle that would be great if you could check on your side.

Yesterday I built a second rpi just to rule out the onboard ethernet hardware. Now that all cables and hardware but the USB network adapter has been changed I think we can almost confirm that is the issue.

epoch1970
Posts: 5131
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: USB network adapter bridge question

Tue Feb 21, 2017 2:48 pm

kramlegan wrote:If it wouldn't be too much of a hassle that would be great if you could check on your side.

Yesterday I built a second rpi just to rule out the onboard ethernet hardware. Now that all cables and hardware but the USB network adapter has been changed I think we can almost confirm that is the issue.
No prob.
So I was looking at your network config again and suddenly I realize something is not quite right, and possibly wrong: you should define eth0 and eth1 as "inet manual", and br0 alone as "inet dhcp".
I think you may get too many routes or something like that when you bridge an interface that has an IP already.

Can you try this on your side?
(Since you set manual, you may need to "denyinterfaces eth0 eth1" in dhcpcd.conf, if it is still installed)
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Ernst
Posts: 1334
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: USB network adapter bridge question

Tue Feb 21, 2017 3:11 pm

epoch1970 wrote:
kramlegan wrote:If it wouldn't be too much of a hassle that would be great if you could check on your side.

Yesterday I built a second rpi just to rule out the onboard ethernet hardware. Now that all cables and hardware but the USB network adapter has been changed I think we can almost confirm that is the issue.
No prob.
So I was looking at your network config again and suddenly I realize something is not quite right, and possibly wrong: you should define eth0 and eth1 as "inet manual", and br0 alone as "inet dhcp".
I think you may get too many routes or something like that when you bridge an interface that has an IP already.

Can you try this on your side?
(Since you set manual, you may need to "denyinterfaces eth0 eth1" in dhcpcd.conf, if it is still installed)
I do not have the same type of USB3 ethernet interface but tried to the identical configuration (with dhcp on eth0 and eth1) using an AX88772 USB2 ethernet adapter and was unable to reproduce the problem. IMHO there is no problem with the configuration and it could well be a problem in the driver causing on either the transmit or receive path.
The road to insanity is paved with static ip addresses

kramlegan
Posts: 6
Joined: Mon Feb 20, 2017 4:42 am

Re: USB network adapter bridge question

Tue Feb 21, 2017 3:24 pm

Thank you for testing.

I have updated the config from DHCP to manual. Still have the same issue.

I downloaded the ASIXS_AX88179 linux driver from the website and then could not get the network adapter to come up with that driver installed.

I have rolled back and am going to now locate a new USB to Ethernet adapter. Will keep you posted...might be a few days.

Thanks again.

epoch1970
Posts: 5131
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: USB network adapter bridge question

Tue Feb 21, 2017 5:06 pm

I tested myself, the ASIX AX88179 adapter works fine.

"joinville" is a Pi 3
"montmartre" is an old Aspire One, (not so) fast ethernet
"biot" is a server VM on a gigabit path

The gory details on joinville:

Code: Select all

admin@joinville ~ $ uname -a
Linux joinville 4.4.38-v7+ #938 SMP Thu Dec 15 15:22:21 GMT 2016 armv7l GNU/Linux

admin@joinville ~ $ lsb_release -a
No LSB modules are available.
Distributor ID:	Raspbian
Description:	Raspbian GNU/Linux 8.0 (jessie)
Release:	8.0
Codename:	jessie

admin@joinville ~ $ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

# eth0 denied in dhcpcd.conf
auto eth0
iface eth0 inet static

# eth1 denied in dhcpcd.conf
allow-hotplug eth1
iface eth1 inet static

auto br0
iface br0 inet dhcp
bridge-ports eth0 eth1
bridge-stp on

# wlan0 denied in dhcpcd.conf
#allow-hotplug wlan0
#iface wlan0 inet dhcp
#wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

#allow-hotplug wlan1
#iface wlan1 inet manual
#    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

admin@joinville ~ $ lsusb
Bus 001 Device 004: ID 0b95:1790 ASIX Electronics Corp. AX88179 Gigabit Ethernet
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

admin@joinville ~ $ ifconfig 
br0       Link encap:Ethernet  HWaddr 00:0e:c6:c4:1d:1c  
          inet addr:172.17.255.147  Bcast:172.17.255.255  Mask:255.255.0.0
          inet6 addr: fe80::20e:c6ff:fec4:1d1c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:85839 errors:0 dropped:0 overruns:0 frame:0
          TX packets:164434 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:5317264 (5.0 MiB)  TX bytes:246892569 (235.4 MiB)

eth0      Link encap:Ethernet  HWaddr b8:27:eb:01:16:2f  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:45371 errors:0 dropped:12 overruns:0 frame:0
          TX packets:82978 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3168893 (3.0 MiB)  TX bytes:124548512 (118.7 MiB)

eth1      Link encap:Ethernet  HWaddr 00:0e:c6:c4:1d:1c  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:40836 errors:0 dropped:0 overruns:0 frame:0
          TX packets:84162 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2207535 (2.1 MiB)  TX bytes:124550492 (118.7 MiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:1223 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1223 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:362820 (354.3 KiB)  TX bytes:362820 (354.3 KiB)

wlan0     Link encap:Ethernet  HWaddr b8:27:eb:54:43:7a  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

admin@joinville ~ $ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         172.17.0.1      0.0.0.0         UG    0      0        0 br0
0.0.0.0         172.17.0.1      0.0.0.0         UG    205    0        0 br0
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br0
172.17.0.0      0.0.0.0         255.255.0.0     U     205    0        0 br0

admin@joinville ~ $ brctl show
bridge name	bridge id		STP enabled	interfaces
br0		8000.000ec6c41d1c	yes		eth0
							eth1
With joinville connected to a giga switch on eth0 (built-in) and with eth1 (ASIX adapter) directly connected to montmartre:

Code: Select all

admin@joinville ~ $ iperf -c montmartre
------------------------------------------------------------
Client connecting to montmartre, TCP port 5001
TCP window size: 43.8 KByte (default)
------------------------------------------------------------
[  3] local 172.17.255.147 port 54064 connected with 172.17.255.12 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec   112 MBytes  94.2 Mbits/sec
admin@joinville ~ $ iperf -c biot
------------------------------------------------------------
Client connecting to biot, TCP port 5001
TCP window size: 43.8 KByte (default)
------------------------------------------------------------
[  3] local 172.17.255.147 port 45146 connected with 172.17.0.2 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec   112 MBytes  94.2 Mbits/sec
Switch cables between eth0 and eth1 on joinville, wait for the bridge to re-learn the MACs:

Code: Select all

admin@joinville ~ $ iperf -c biot
------------------------------------------------------------
Client connecting to biot, TCP port 5001
TCP window size: 43.8 KByte (default)
------------------------------------------------------------
[  3] local 172.17.255.147 port 45166 connected with 172.17.0.2 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec   113 MBytes  94.3 Mbits/sec
admin@joinville ~ $ iperf -c montmartre
------------------------------------------------------------
Client connecting to montmartre, TCP port 5001
TCP window size: 43.8 KByte (default)
------------------------------------------------------------
[  3] local 172.17.255.147 port 54090 connected with 172.17.255.12 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec   112 MBytes  94.2 Mbits/sec
Same same, and fast ethernet speeds all the way.

BTW, make sure wlan0 doesn't get in the way, and that name resolution points to the bridge address (and not wlan0's). I was seeing all sort of strange things, before I realized I was hitting the wrong IP address in some cases.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

kramlegan
Posts: 6
Joined: Mon Feb 20, 2017 4:42 am

Re: USB network adapter bridge question

Wed Feb 22, 2017 5:13 am

There must be an issue with the ASIX AX88179 and the Rpi Model B Rev 1. I tired a different adapter AX88772B and I get full speed now both down and up now!

Thanks for the help! Issue resolved!

Return to “Troubleshooting”