0

Here's my LAN layout:

[Laptop (Windows 10)]  [Raspberry Pi (Ubuntu)]
                   \    /
               (Layer 2 Switch) 
                      |
     (Wireless router w/ gigabit LAN) 
                      |
     (Wireless router w/ 100 Mbps LAN)
                      |
                   Internet

I'm using the Raspberry Pi as a NAS, so I want gigabit speeds between the Pi and the Windows laptop.

The setup was LAN-to-WAN between the two routers, and I had gigabit speeds between Windows and Pi.

I've just changed it so the gigabit router is in LAN-to-LAN mode (ethernet plugged into LAN port, DHCP disabled). But now, Pi and Windows only talk at 338 Mbps! What's up with that?

My understanding is that the switch will direct the traffic directly from one to the other, without involving the routers. (Also, pathping/tracert don't show any other IP addresses between the two.) However:

  1. When I run the iperf3, all three lights on the switch blink frantically - including the one to the router.
  2. The speed is gigabit when I allow the gigabit router to be its own boss (DHCP enabled, connected WAN-to-LAN).
  3. The speed is ~338 Mbps both when I set the gigabit router as the secondary router (DHCP off, LAN-to-LAN), and when I remove the gigabit router, connecting the switch directly to the 100 Mbps router. Same speed in both cases, so the slow router is clearly involved.

(Details: I'm measuring with iperf3. The Windows machine is using iperf3 in WSL, with an ethernet-to-USB 3.0 adapter. The switch is a D-Link DGS-105, the gigabit router is a TP-Link Archer C2, the 100 Mbps router is a Fritz!Box 7430. I've only measured with Windows as client and Pi as server; I can't get it to work the other way round, even with firewalls disabled.)

5
  • 1
    Is the speed still the same when you completely disconnect the laptop+switch+pi from the routers and test in isolation? Commented Jul 26, 2021 at 17:02
  • 1
    Also, do the hosts' ARP tables (arp -a or ip neigh) show the correct MAC addresses for the opposite host? Commented Jul 26, 2021 at 17:20
  • You say you switched the mode; are you still using the WAN port for anything? // The speed exceeding 100 Mbit/s a lot strongly hints at the FritzBox not being involved.
    – Daniel B
    Commented Jul 26, 2021 at 17:41
  • If I disconnect the DHCP-enabled router, the devices are unable to do anything on the network. Is that wrong?
    – sssheridan
    Commented Jul 27, 2021 at 6:37
  • Which model of Pi?
    – Tom Yan
    Commented Jul 27, 2021 at 6:53

1 Answer 1

0

Problem resolved! I needed to do a DHCP release/renew. (Answering my own question so I can mark it as resolved.)

To any future readers: on Windows, that's ipconfig /release then ipconfig /renew, and on Linux, sudo dhclient -r eth0 then sudo dhclient eth0. (eth0 is the interface; check with ip a to identify the right name for your interface).

If anyone's got a few minutes to answer some remaining questions I have, I'd appreciate it! Trying to learn something from this.

Here's a timeline:

  1. iperf3 runs at 338 Mbps and requires the FritzBox 100 Mbps router.
  2. 12 hours pass. Unfortunately I didn't check iperf again before doing the following.
  3. On Windows, I checked arp -a and the Pi was simply absent from the list.
  4. I poked around a bit, including ssh'ing into the Pi from Windows (using hostname). When I checked arp -a again, the Pi had magically appeared! (I hadn't done a DHCP release/renew at this stage.)
  5. iperf3 now yielded gigabit speed, but when I disconnected the switch from the router, the Pi and Windows couldn't ping each other. Also, the switch's port to the router blinked frantically while running iperf.
  6. I did a DHCP release/renew on both Windows and Pi. Now, I get the same gigabit speed, but it works even when I disconnect the switch from the router. When connected during iperf, the port to the router still blinks, but less frantically than before.

What I understand from this is the following:

  • When I was getting 338 Mbps, the switch needed the DHCP-enabled router for something, but probably not for carrying the traffic (because 338 Mbps > 100 Mbps). Was it perhaps querying the router to determine the destination of each and every packet?
  • by SSH'ing from Windows into Pi, I somehow improved the situation but didn't give the switch full independence from the router(s). Perhaps this caused the gigabit router to learn how to answer the switch's queries, without involving the slower router?
  • With a full DHCP release/renew, the switch became able to direct the traffic without a router. Was this because Windows and/or Pi learned each other's address, or did the DHCP release/renew also update the switch's routing tables (or whatever a switch's equivalent is)?
  • Now that the switch can carry the traffic without the router, why does it still loop the router in (as indicated by the blinking light) if available?

Thanks for your time in answering any of these questions! And thanks to @user1686 for setting me on the right track.

3
  • 1
    The layer-2 equivalent of a routing table on switches is the "MAC address table" (mapping layer-2 MAC addresses to layer-1 interfaces). Switches usually update the MAC-port associations every time they see a packet from that MAC address arriving through a particular port -- this happens whenever the switch sees the Pi broadcasting its DHCP lease request (but also when it sees literally any other packet from the Pi as well). It's difficult to know what was wrong without being able to examine the switch's MAC table (which is possible on "managed" switches). Commented Jul 27, 2021 at 10:40
  • 1
    Because switches forward based on MAC address (which is already in each frame), they don't make any queries to any router -- Ethernet forwarding is based purely on learnt MAC-port associations. Either the switch knows the destination MAC in its table and forwards the frame through the corresponding port, or it doesn't know the destination MAC and forwards the frame through all ports at once (except the incoming port). If any queries were made, those could only be ARP (i.e. IP->MAC) queries from one of the hosts, but certainly not MAC->port queries from a switch. Commented Jul 27, 2021 at 10:42
  • 1
    The ARP table is really just an ARP cache, so it's completely normal for devices to be absent from arp -a unless you communicated with them very recently from this particular device. The point was to check whether it contains a correct mapping specifically during normal operation (i.e. when it was "slow") -- my suspicion is that the router might be answering ARP queries on behalf of other devices, and the hosts would end up learning the router's MAC instead of the (expected) each other's MAC addresses. Commented Jul 27, 2021 at 10:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .