Hi, I recently installed OpenWrt 18.06.4 on my TP-Link Archer C7 v5 and I am seeing severe packet loss and latency spikes on the WAN port.
Here's a ping sample:
64 bytes from 1.1.1.1: seq=60 ttl=58 time=15.981 ms
64 bytes from 1.1.1.1: seq=61 ttl=58 time=16.256 ms
64 bytes from 1.1.1.1: seq=104 ttl=58 time=1044.304 ms
64 bytes from 1.1.1.1: seq=105 ttl=58 time=44.731 ms
64 bytes from 1.1.1.1: seq=106 ttl=58 time=15.892 ms
64 bytes from 1.1.1.1: seq=107 ttl=58 time=15.923 ms
64 bytes from 1.1.1.1: seq=108 ttl=58 time=15.724 ms
The Archer C7 v5 WAN port is connected to my ISP router/modem via Ethernet and receives an IP address via DHCP.
Pinging 1.1.1.1 from my ISP router/modem's diagnostics page has 0% packet loss and a stable ~15ms latency.
The packet loss is not related to Archer C7's wireless radios because they're both disabled and I am SSH'd in and testing directly against the WAN port.
I have tried installing OpenWrt 18.06.2, 18.06.3, 18.06.4 and the latest snapshot and I am seeing the same problem in every version.
I don't think it's related to CPU load because top and iftop are all normal.
Any help or debugging guidance would be much appreciated.
I don't see any errors there.
I assume switch0 port 1 is your WAN port.
It says link: port:1 link:up speed:100baseT full-duplex auto.
Can you configure it manually to 100/half-duplex for testing purposes?
I'm struggling to configure it manually to half duplex - I am getting Failed to set attribute: Operation not supported errors. Is there anything I am doing wrong?
root@Archer-C7:~# swconfig dev switch0 port 1 help
switch0: ag71xx-mdio.0(Atheros AR8337), ports: 7 (cpu @ 0), vlans: 128
--switch
Attribute 1 (int): enable_vlan (Enable VLAN mode)
Attribute 2 (none): reset_mibs (Reset all MIB counters)
Attribute 3 (int): enable_mirror_rx (Enable mirroring of RX packets)
Attribute 4 (int): enable_mirror_tx (Enable mirroring of TX packets)
Attribute 5 (int): mirror_monitor_port (Mirror monitor port)
Attribute 6 (int): mirror_source_port (Mirror source port)
Attribute 7 (int): arl_age_time (ARL age time (secs))
Attribute 8 (string): arl_table (Get ARL table)
Attribute 9 (none): flush_arl_table (Flush ARL table)
Attribute 10 (int): igmp_snooping (Enable IGMP Snooping)
Attribute 11 (int): igmp_v3 (Enable IGMPv3 support)
Attribute 12 (none): apply (Activate changes in the hardware)
Attribute 13 (none): reset (Reset the switch)
--vlan
Attribute 1 (int): vid (VLAN ID (0-4094))
Attribute 2 (ports): ports (VLAN port mapping)
--port
Attribute 1 (none): reset_mib (Reset single port MIB counters)
Attribute 2 (string): mib (Get port's MIB counters)
Attribute 3 (int): enable_eee (Enable EEE PHY sleep mode)
Attribute 4 (none): flush_arl_table (Flush port's ARL table entries)
Attribute 5 (int): igmp_snooping (Enable port's IGMP Snooping)
Attribute 6 (int): vlan_prio (Port VLAN default priority (VLAN PCP) (0-7))
Attribute 7 (int): pvid (Primary VLAN ID)
Attribute 8 (unknown): link (Get port link information)
root@Archer-C7:~# swconfig dev switch0 port 1 get link
port:1 link:up speed:100baseT full-duplex auto
root@Archer-C7:~# swconfig dev switch0 port 1 set link "duplex half"
Failed to set attribute: Operation not supported
root@Archer-C7:~# swconfig dev switch0 port 1 set link "speed 100 duplex half"
Failed to set attribute: Operation not supported
I can confirm that there isn't a systemic problem with 18.06.4 on an Archer C7 v5 – I have that arrangement running here and I have no packet loss or latency problems running your test.
How is your ISP modem configured? NAT? Bridge? Is your ISP using CG-NAT or do you get a public IP address on the Archer WAN port? If the modem is giving the Archer a private address, is there a conflict with your 192.168.1.0/24?
In your position, I would reflash a fresh download of 18.06.4, reset to defaults and try the ping test without any configuration added, except any minimum to get a connection to your modem, if necessary. If you can put the ISP modem into bridge mode, that would be good.
@jamesc
Perhaps the half-duplex setting isn't supported on your switch.
Can you see the duplex settings in your modem?
Do you ping directly from the OpenWRT box?
For me, it sounds like an L2-Ethernet prob.
But may be, I am totally wrong.
Bingo! this was the cause. The ISP modem was using the 192.168.1.0/24 range which is OpenWrt's default. Changing to a new range with uci set network.lan.ipaddr='192.168.10.1' did the trick.
I feel stupid for not changing that before, especially because [0] mentions it's a common source of problems:
A common source of internet connectivity failure is your OpenWrt and upstream WAN routers having conflicting IP address ranges. To correct this, adjust the OpenWrt router subnet by changing the network settings in the file /etc/config/network