Slow network speed between TD-W8970 and upstream router

Hello,

I feel like banging wall with my head here, any help would be appreciated. I am new to openWRT, the setup is quite simple:

TP Link TD-W8970 (192.168.1.1) through WAN port connected to ISP router (192.168.1.100). The W8970 distributes wireless along the premise and the ISP router (some Huawei
HS8546V with Fiber) has pretty much everything disabled.

The whole idea of the setup is that TD-W8970 will be doing openvpn tunneling with a Netgear Nighthawk in another location.

When connecting through cable to Huawei I get 250-300mbps. The same for W8970 gives roughly 50mbps (same on cable and wiereless).

Ports on both ends are detected as 1gbps. Went through firewall config and qos on both routers but cannot seem to find anything that might lead to this.

I am not sure whether this can be due to OpenWRT switching limitations on this device or where else to look for problems. Please assist :slight_smile:

network:

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd20:be60:59a9::/48'

config interface 'lan'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option ifname 'eth0.1'
        option macaddr 'e8:94:f6:c6:97:48'
        option gateway '192.168.100.1'
        list dns '192.168.100.1'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '0 2 5 6t'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '4 6t'


config atm-bridge 'atm'
        option vpi '1'
        option vci '32'
        option encaps 'llc'
        option payload 'bridged'
        option nameprefix 'dsl'

config interface 'wan'
        option proto 'dhcp'
        option macaddr 'e8:94:f6:c6:97:49'
        option ifname 'eth0.2'

config vdsl 'dsl'
        option annex 'a'
        option firmware '/lib/firmware/vdsl.bin'
        option tone 'av'

Firewall:

config defaults
        option syn_flood '1'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'REJECT'

config zone
        option name 'lan'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'
        option network 'lan'

config zone
        option name 'wan'
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option masq '1'
        option mtu_fix '1'
        option network 'wan'

config forwarding
        option src 'lan'
        option dest 'wan'

config rule
        option name 'Allow-DHCP-Renew'
        option src 'wan'
        option proto 'udp'
        option dest_port '68'
        option target 'ACCEPT'
        option family 'ipv4'

config rule
        option name 'Allow-Ping'
        option src 'wan'
        option proto 'icmp'
        option icmp_type 'echo-request'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-IGMP'
        option src 'wan'
        option proto 'igmp'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-DHCPv6'
        option src 'wan'
        option proto 'udp'
        option src_ip 'fe80::/10'
        option src_port '547'
        option dest_ip 'fe80::/10'
        option dest_port '546'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-MLD'
        option src 'wan'
        option proto 'icmp'
        option src_ip 'fe80::/10'
        list icmp_type '130/0'
        list icmp_type '131/0'
        list icmp_type '132/0'
        list icmp_type '143/0'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Input'
        option src 'wan'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        list icmp_type 'router-solicitation'
        list icmp_type 'neighbour-solicitation'
        list icmp_type 'router-advertisement'
        list icmp_type 'neighbour-advertisement'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Forward'
        option src 'wan'
        option dest '*'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config include
        option path '/etc/firewall.user'

config rule
        option src 'wan'
        option dest 'lan'
        option proto 'esp'
        option target 'ACCEPT'
        option enabled '0'

config rule
        option src 'wan'
        option dest 'lan'
        option dest_port '500'
        option proto 'udp'
        option target 'ACCEPT'
        option enabled '0'

Not sure if anything else might be needed, let me know please.

Is your OpenWrt router configured with the same 191.168.1.0/24 network on both sides? That is not going to work, LAN should be on a different segment than WAN.

Hi Eduperez,

no, the WAN interface gets 192.168.100.2 through DHCP , I have it on static lease from the Huawei side. Everything seems to be working routing-wise, correct routes exist within the routing table so this part checks out. It just seems bizarre to me that its roughly 10-15% of the upstream bandwidth:( The only part that is fishy to me and I don't grasp is:

Switch

The XWAY VRX286 SoC features an internal configurable Infineon Gigabit Ethernet switch that connects all the physical Ethernet ports together.

As of yet (trunk: 38701) no support for this switch exists on OpenWrt.

However a GPL source code exists for the switch under the name “ifx_ethsw” for the kernel module and “switch_utility” for the user-space configuration tool. The code can be found from links below: 

It's from https://openwrt.org/toh/tp-link/td-w8970_v1#switch . There's also https://dev.archive.openwrt.org/ticket/15511 , but I believe I would stumble on similar issues reported by other users, cannot find anything tho.

Edit:

OK found this now: Tp-link w8970 internal 1gbit switch works in 100mbit mode , possibly its same for me, but I cannot even get 100.

I have enabled 5ghz on Huawei and will use that for higher-need services. The 50mbps will still get the job done for the tunnel;-)

For a router with sqm, this is the performance you can expect from this device, it is limited by the CPU. To rule out the link speed as a possible cause, issue the command swconfig dev switch0 show.

According to this diagram, you can expect an OpenVPN throughput of roughly 10 Mbit/s.