Ysurac / openmptcprouter

OpenMPTCProuter is an open source solution to aggregate multiple internet connections using Multipath TCP (MPTCP) on OpenWrt
https://www.openmptcprouter.com/
GNU General Public License v3.0
1.8k stars 258 forks source link

Adding latency to WAN interface #2432

Closed SatExo closed 1 year ago

SatExo commented 2 years ago

Hi Yannick,

I would need to add latency to some network interfaces for them to be in line with others (satellite - 4G)
Tried setting interface - advanced - latency to 500 but that did not seem to affect anything. Is there a specific syntax required or is this not working.

I also looked at loading opkg-netem but that didn't seem possible (yet)

This is on 0.58.5

Thanks Michaël

Ysurac commented 2 years ago

The latency setting use netem, so netem is installed by default. What do you have in uci show network and what the result of tc qdisc show vis SSH on the router ?

SatExo commented 2 years ago

I had put 500 on WAN7

root@Hyper-Gate:~# uci show network network.loopback=interface network.loopback.ifname='lo' network.loopback.proto='static' network.loopback.ipaddr='127.0.0.1' network.loopback.netmask='255.0.0.0' network.loopback.multipath='off' network.loopback.macaddr='00:00:00:00:00:00' network.loopback.metric='6' network.globals=globals network.globals.multipath='enable' network.globals.mptcp_path_manager='fullmesh' network.globals.mptcp_checksum='0' network.globals.mptcp_debug='0' network.globals.mptcp_syn_retries='2' network.globals.mptcp_fullmesh_num_subflows='1' network.globals.mptcp_fullmesh_create_on_err='1' network.globals.mptcp_ndiffports_num_subflows='1' network.globals.ula_prefix='fd24:0399:ff9b::/48' network.globals.mptcp_scheduler='default' network.globals.congestion='bbr' network.lan=interface network.lan.ifname='eth0' network.lan.proto='static' network.lan.ip6assign='60' network.lan.delegate='0' network.lan.multipath='off' network.lan.ip4table='lan' network.lan.macaddr='3c:ec:ef:02:fd:88' network.lan.metric='7' network.lan.defaultroute='0' network.lan.peerdns='0' network.lan.ipv6='1' network.lan.ipaddr='192.168.100.1' network.lan.netmask='255.255.255.0' network.lan.label='Hyper-G' network.lan.addlatency='0' network.wan1=interface network.wan1.proto='static' network.wan1.ip4table='wan' network.wan1.defaultroute='0' network.wan1.metric='8' network.wan1.peerdns='0' network.wan1.ipv6='0' network.wan1.type='macvlan' network.wan1.masterintf='eth2' network.wan1.label='W1' network.wan1.gateway='10.10.0.1' network.wan1.ifname='wan1' network.wan1.addlatency='0' network.wan1.macaddr='3c:ec:ef:02:fd:01' network.wan1.ipaddr='10.10.0.2' network.wan1.netmask='255.255.255.0' network.wan1.multipath='master' network.wan2=interface network.wan2.proto='static' network.wan2.ip4table='wan' network.wan2.defaultroute='0' network.wan2.metric='9' network.wan2.peerdns='0' network.wan2.ipv6='0' network.wan2.type='macvlan' network.wan2.masterintf='eth2' network.wan2.label='W2' network.wan2.ipaddr='10.10.1.2' network.wan2.netmask='255.255.255.0' network.wan2.gateway='10.10.1.1' network.wan2.ifname='wan2' network.wan2.addlatency='0' network.wan2.macaddr='3c:ec:ef:02:fd:02' network.wan2.multipath='off' network.wan3=interface network.wan3.proto='static' network.wan3.type='macvlan' network.wan3.masterintf='eth2' network.wan3.ip4table='wan' network.wan3.defaultroute='0' network.wan3.ifname='wan3' network.wan3.metric='10' network.wan3.peerdns='0' network.wan3.ipv6='0' network.wan3.addlatency='0' network.wan3.label='W3' network.wan3.ipaddr='10.10.2.2' network.wan3.gateway='10.10.2.1' network.wan3.netmask='255.255.255.0' network.wan3.macaddr='3c:ec:ef:02:fd:03' network.wan3.multipath='on' network.wan4=interface network.wan4.proto='static' network.wan4.ip4table='wan' network.wan4.defaultroute='0' network.wan4.metric='11' network.wan4.peerdns='0' network.wan4.ipv6='0' network.wan4.type='macvlan' network.wan4.masterintf='eth2' network.wan4.label='W4' network.wan4.ipaddr='10.10.3.2' network.wan4.netmask='255.255.255.0' network.wan4.gateway='10.10.3.1' network.wan4.ifname='wan4' network.wan4.addlatency='0' network.wan4.macaddr='3c:ec:ef:02:fd:04' network.wan4.multipath='off' network.wan5=interface network.wan5.proto='static' network.wan5.ip4table='wan' network.wan5.defaultroute='0' network.wan5.metric='12' network.wan5.peerdns='0' network.wan5.type='macvlan' network.wan5.masterintf='eth2' network.wan5.label='W5' network.wan5.ipaddr='10.10.4.2' network.wan5.netmask='255.255.255.0' network.wan5.gateway='10.10.4.1' network.wan5.ifname='wan5' network.wan5.ipv6='0' network.wan5.addlatency='0' network.wan5.macaddr='3c:ec:ef:02:fd:05' network.wan5.multipath='on' network.wan6=interface network.wan6.proto='static' network.wan6.ip4table='wan' network.wan6.defaultroute='0' network.wan6.metric='13' network.wan6.peerdns='0' network.wan6.ipv6='0' network.wan6.type='macvlan' network.wan6.masterintf='eth2' network.wan6.label='W6' network.wan6.ipaddr='10.10.5.2' network.wan6.netmask='255.255.255.0' network.wan6.gateway='10.10.5.1' network.wan6.ifname='wan6' network.wan6.addlatency='0' network.wan6.macaddr='3c:ec:ef:02:fd:06' network.wan6.multipath='off' network.wan7=interface network.wan7.ip4table='wan' network.wan7.defaultroute='0' network.wan7.metric='18' network.wan7.peerdns='0' network.wan7.ipv6='0' network.wan7.macaddr='6a:f0:0e:85:bc:0f' network.wan7.ifname='eth3' network.wan7.proto='dhcp' network.wan7.label='BKPWANDHCP' network.wan7.multipath='backup' network.wan7.addlatency='500' network.lan_rule=rule network.lan_rule.lookup='lan' network.lan_rule.priority='100' network.omrvpn=interface network.omrvpn.ip4table='vpn' network.omrvpn.multipath='off' network.omrvpn.leasetime='12h' network.omrvpn.type='tunnel' network.omrvpn.txqueuelen='100' network.omrvpn.metric='1200' network.omrvpn.ipv6='0' network.omrvpn.proto='none' network.omrvpn.ifname='tun0' network.omr6in4=interface network.omr6in4.proto='6in4' network.omr6in4.ip4table='vpn' network.omr6in4.multipath='off' network.omr6in4.metric='1201' network.omr6in4.ip6addr='fe80::a00:2/126' network.omr6in4.gateway='fe80::a00:1/126' network.omr6in4.force_link='1' network.omr6in4.ipaddr='10.255.255.2' network.omr6in4.peeraddr='10.255.255.1' network.wan1_dev=device network.wan1_dev.name='wan1' network.wan1_dev.type='macvlan' network.wan1_dev.ifname='eth2' network.wan1_dev.macaddr='3c:ec:ef:02:fd:01' network.wan3_dev=device network.wan3_dev.name='wan3' network.wan3_dev.type='macvlan' network.wan3_dev.ifname='eth2' network.wan3_dev.macaddr='3c:ec:ef:02:fd:03' network.wan2_dev=device network.wan2_dev.name='wan2' network.wan2_dev.type='macvlan' network.wan2_dev.ifname='eth2' network.wan2_dev.macaddr='3c:ec:ef:02:fd:02' network.wan4_dev=device network.wan4_dev.name='wan4' network.wan4_dev.type='macvlan' network.wan4_dev.ifname='eth2' network.wan4_dev.macaddr='3c:ec:ef:02:fd:04' network.wan5_dev=device network.wan5_dev.name='wan5' network.wan5_dev.type='macvlan' network.wan5_dev.ifname='eth2' network.wan5_dev.macaddr='3c:ec:ef:02:fd:05' network.wan6_dev=device network.wan6_dev.name='wan6' network.wan6_dev.type='macvlan' network.wan6_dev.ifname='eth2' network.wan6_dev.macaddr='3c:ec:ef:02:fd:06' network.BALANCER=interface network.BALANCER.proto='static' network.BALANCER.ifname='BALANCER' network.BALANCER.masterintf='eth2' network.BALANCER.label='Balancer' network.BALANCER.multipath='off' network.BALANCER.addlatency='0' network.BALANCER.ipaddr='10.10.10.20' network.BALANCER.netmask='255.255.255.0' network.BALANCER.gateway='10.10.10.10' network.BALANCER.defaultroute='0' network.BALANCER.metric='15' network.BALANCER.peerdns='0' network.BALANCER.type='macvlan' network.BALANCER.macaddr='fa:54:43:9c:5b:b7' network.BALANCER_dev=device network.BALANCER_dev.name='BALANCER' network.BALANCER_dev.type='macvlan' network.BALANCER_dev.ifname='eth2' network.BALANCER_dev.macaddr='fa:54:43:9c:5b:b7' network.LAN2=interface network.LAN2.proto='static' network.LAN2.ifname='eth1' network.LAN2.label='LAN2' network.LAN2.multipath='off' network.LAN2.addlatency='0' network.LAN2.netmask='255.255.255.0' network.LAN2.ipaddr='192.168.101.10' network.LAN2.macaddr='3c:ec:ef:02:fd:89' network.LAN2.metric='20' network.LAN2.defaultroute='0' network.LAN2.peerdns='0'

root@Hyper-Gate:~# tc qdisc show qdisc noqueue 0: dev lo root refcnt 2 qdisc mq 0: dev eth0 root qdisc fq_codel 0: dev eth0 parent :4 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64 qdisc fq_codel 0: dev eth0 parent :3 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64 qdisc fq_codel 0: dev eth0 parent :2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64 qdisc fq_codel 0: dev eth0 parent :1 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64 qdisc mq 0: dev eth1 root qdisc fq_codel 0: dev eth1 parent :4 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64 qdisc fq_codel 0: dev eth1 parent :3 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64 qdisc fq_codel 0: dev eth1 parent :2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64 qdisc fq_codel 0: dev eth1 parent :1 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64 qdisc mq 0: dev eth2 root qdisc fq_codel 0: dev eth2 parent :4 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64 qdisc fq_codel 0: dev eth2 parent :3 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64 qdisc fq_codel 0: dev eth2 parent :2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64 qdisc fq_codel 0: dev eth2 parent :1 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64 qdisc mq 0: dev eth3 root qdisc fq_codel 0: dev eth3 parent :4 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64 qdisc fq_codel 0: dev eth3 parent :3 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64 qdisc fq_codel 0: dev eth3 parent :2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64 qdisc fq_codel 0: dev eth3 parent :1 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64 qdisc noqueue 0: dev BALANCER root refcnt 2 qdisc noqueue 0: dev wan1 root refcnt 2 qdisc noqueue 0: dev wan2 root refcnt 2 qdisc noqueue 0: dev wan3 root refcnt 2 qdisc noqueue 0: dev wan4 root refcnt 2 qdisc noqueue 0: dev wan5 root refcnt 2 qdisc noqueue 0: dev wan6 root refcnt 2 qdisc fq_codel 0: dev tun0 root refcnt 2 limit 10240p flows 1024 quantum 1500 ta rget 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64

Ysurac commented 2 years ago

This was not working due to a typo, this will be fixed for next release.

SatExo commented 2 years ago

Thanks Yannick, Is there a way I can correct it manually? or can I enter the netem instructions somewhere manually (so they are processed at reboot) Best regards Michaël

Ysurac commented 2 years ago

This is the change I made: https://github.com/Ysurac/openmptcprouter-feeds/commit/debdc682e15227e4c7ce8ff40c6e35df7feb3d9c You then need to launch /etc/init.d/openmptcprouter restart

SatExo commented 2 years ago

Thanks, I'll give it a shot.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days