TLDR probably just a TCP problem the whole time. Disregard this post lol
I had a similar problem with my CRS317 (CRS317-1G-16S+RM) - bought back in april 2021.
Connected my EnGenius EWS377AP which provides 2.5G LAN on it. Got full 1Gbps throughput from my internet connection (gigabit service → gigabit modem → CRS317 → AP → laptop) and perfect 10Gbps throughput on local devices (desktop → CRS317 → local machine) but terrible 30-40 Mbps throughput on local LAN + Wifi (local machine → CRS317 → AP → laptop). It drove me absolutely batty.
Fixed the problem with the help of this thread.
- Booted the CRS317 into SwOS, since I saw mention of 2.5G and 5G being fixed in the release notes for some other CRSxxx device. Dunno about the latest ROS, maybe it has the same fixes.
- Turned on Rx AND Tx flow control for all the affected SFP+ ports
- In addition, my AP had STP disabled by default (configuration on the AP device). I’m not network-savvy enough to actually know what STP/RSTP truly do under the hood - but I have to assume having STP enabled on an AP is important for this use case (to span a subtree?). Then, the CRS317 detects the AP providing (doing?) STP, and sets the link to the AP as “point-to-point” instead of “edge” or “endpoint” (forgot the term). I didn’t A-B test that one, but I am guessing it’s important.
Edit, after some more experimentation:
When running iperf from wired machine → CRS317 → AP → wifi machine, I see pause frames accumulating in their respective counters for both Rx on the one CRS317 port/interface (don’t know the proper term), and Tx on the other. The throughput stays up around the proper real-world amount, matching the throughput from ISP → CRS317 → AP → wifi machine.
So flow control is almost certainly working on SwOS 2.13.
However, going from wifi machine → AP → CRS317 → wired machine is still slow, with wild swings in bandwidth, and some outright connection drops. There are no pause frames, as expected; we’re sending data from a smaller pipe (2.5G from AP → CRS317) to bigger pipe (10G from CRS317 → wired machine). So unless there’s something obviously wrong with my config that I don’t know about (which is admittedly pretty likely), I may have issues with my AP after all. I’m going to swap it out for another one and see what happens.
Edit Edit
I was using iperf3 to test bandwidth, which defaults to TCP. Saw a bunch of retries, so I switched to UDP and the problem was fixed. (see https://software.es.net/iperf/faq.html under the section: “TCP throughput drops to (almost) zero during a test, what’s going on?”) Probably some kind of fragmentation issue with my NICs/configs on client devices, and TCP freezes up/retries a bunch.
To saturate my ~866 Mbps wireless link, I needed two udp streams on two Zen2 cores, and specified the client MTU manually:
iperf3 -s -p 5201 & iperf3 -s -p 5202 && fg
iperf3 -c -T s1 -p 5201 -M 1500 -u & iperf3 -c -T s2 -p 5202 -M 1500 -u && fg