BPI-R3 Debian hostapd ping with DUP!

Hello again. I have Debian on a BPI-R3 configured as a router. Lan and wlan are in bridge. I am using isc-dhcp. During ping, I found duplicate packets (5-25%) only on wireless devices. Lan operation is ok. I checked the DHCP settings and it should be fine. Where could the problem be?

Have you disabled systemd dhcp i have as default? But i guess it is not a dhcp issue more likely because larger latency on wifi and maybe reflections (physical layer of wifi)

It’s very strange. I have never experienced duplicate packets being caused by a bad wifi signal.

64 bytes from 192.168.100.1: icmp_seq=200 ttl=64 time=881 ms (DUP!)
64 bytes from 192.168.100.1: icmp_seq=202 ttl=64 time=1368 ms
64 bytes from 192.168.100.1: icmp_seq=206 ttl=64 time=15.0 ms
64 bytes from 192.168.100.1: icmp_seq=207 ttl=64 time=67.8 ms
64 bytes from 192.168.100.1: icmp_seq=208 ttl=64 time=9.21 ms
64 bytes from 192.168.100.1: icmp_seq=209 ttl=64 time=9.00 ms
64 bytes from 192.168.100.1: icmp_seq=210 ttl=64 time=122 ms
64 bytes from 192.168.100.1: icmp_seq=210 ttl=64 time=122 ms (DUP!)
64 bytes from 192.168.100.1: icmp_seq=210 ttl=64 time=123 ms (DUP!)
64 bytes from 192.168.100.1: icmp_seq=210 ttl=64 time=126 ms (DUP!)
64 bytes from 192.168.100.1: icmp_seq=211 ttl=64 time=249 ms
^C
--- 192.168.100.1 ping statistics ---
211 packets transmitted, 191 received, +155 duplicates, 9.47867% packet loss, time 210617ms
rtt min/avg/max/mdev = 1.864/214.393/1368.014/259.823 ms, pipe 2

Is there a way to increase signal strength in hostapd.conf?

What do you mean? systemctl stop systemd-networkd systemctl disable systemd-networkd?

Imho not,but maybe you can set it via iw…but on my tests signal strength is enough by default…but there are limits in firmware/eeprom and regulatory domain

My image has defined dhcp-server via systemd-networkd on lanbr0 and wifi interfaces…just disable the options in the right network config file

If you bridge wifi to lanbr0 then ip config on wifi is useless.

Thanks a lot. I already figured this out too. I removed the 25-lanbr.network file from the folder. Could duplicate packets be a firmware or driver problem? I noticed that they were dealing with something similar with TPlink here: TL WPA4220 DUP packets when using WiFi - Home Network Community

Possible is also a driver issue…not sure if firmware can cause this too…but i have no idea to nail this down.

Have you dropped the wlanX configs too? And of course restarting systemd-networkd

My /etc/hostapd/hostapd_wlan0.conf is:

#ctrl_interface=/var/run/hostapd
#ctrl_interface_group=0 # These 2 are just parameters so that the hostap daemo>

interface=wlan0
driver=nl80211
bridge=lanbr0
ssid=-RAJ-

hw_mode=g
channel=1
#macaddr_acl=0
auth_algs=1
#ignore_broadcast_ssid=0
wpa=2
wmm_enabled=1
wpa_passphrase=mypassword
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

Although I think that wlan0 and wlan1 should not have the same MAC address.

You could try to give them different mac adresses and look if it solves the dup packets

Same mac on 2 different wlan interfaces indeed will be trouble. Also needs to be different from bridge mac, even when enslaved to that bridge.

Still not sure on dsa-ports with same mac, but I suspect trouble there too.

There are duplicate packets even when vlan1 is turned off. I found that the worse the wifi signal, the more DUP! The strange thing is that not every ping is a DUP!

Could you try removin the wifi interfaces from bridge like my original image does?

Is rhe ip number used unique on the network?

Also incomplete packets may cause dups.

What is the outpur of

ip a
ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1504 qdisc mq state UP group default qlen 1000
    link/ether b2:1a:4d:60:f7:02 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 2e:68:ed:ec:34:cd brd ff:ff:ff:ff:ff:ff
4: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0
5: wan@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 08:22:33:44:55:77 brd ff:ff:ff:ff:ff:ff permaddr b2:1a:4d:60:f7:02
    inet 192.168.88.252/24 metric 1024 brd 192.168.88.255 scope global dynamic wan
       valid_lft 202942sec preferred_lft 202942sec
    inet6 fe80::a22:33ff:fe44:5577/64 scope link 
       valid_lft forever preferred_lft forever
6: lan0@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master lanbr0 state UP group default qlen 1000
    link/ether b2:1a:4d:60:f7:02 brd ff:ff:ff:ff:ff:ff
7: lan1@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master lanbr0 state UP group default qlen 1000
    link/ether b2:1a:4d:60:f7:02 brd ff:ff:ff:ff:ff:ff
8: lan2@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master lanbr0 state LOWERLAYERDOWN group default qlen 1000
    link/ether b2:1a:4d:60:f7:02 brd ff:ff:ff:ff:ff:ff
9: lan3@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master lanbr0 state LOWERLAYERDOWN group default qlen 1000
    link/ether b2:1a:4d:60:f7:02 brd ff:ff:ff:ff:ff:ff
10: lan4@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether b2:1a:4d:60:f7:02 brd ff:ff:ff:ff:ff:ff
11: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master lanbr0 state UP group default qlen 1000
    link/ether 00:0c:43:26:60:00 brd ff:ff:ff:ff:ff:ff
12: wlan1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master lanbr0 state UP group default qlen 1000
    link/ether 82:0c:43:26:60:00 brd ff:ff:ff:ff:ff:ff
13: lanbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 1a:03:b0:1e:b6:0e brd ff:ff:ff:ff:ff:ff
    inet 192.168.100.1/24 brd 192.168.100.255 scope global lanbr0
       valid_lft forever preferred_lft forever
    inet6 fe80::1803:b0ff:fe1e:b60e/64 scope link 
       valid_lft forever preferred_lft forever
14: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default 
    link/ether 02:42:27:db:18:53 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
    inet6 fe80::42:27ff:fedb:1853/64 scope link 
       valid_lft forever preferred_lft forever
16: vethdb2ac62@if15: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP group default 
    link/ether 22:81:e0:c0:6f:73 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet6 fe80::2081:e0ff:fec0:6f73/64 scope link 
       valid_lft forever preferred_lft forever
18: veth6ef6891@if17: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP group default 
    link/ether 4e:32:f7:ad:77:ad brd ff:ff:ff:ff:ff:ff link-netnsid 1
    inet6 fe80::4c32:f7ff:fead:77ad/64 scope link 
       valid_lft forever preferred_lft forever
20: vethc9048a7@if19: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP group default 
    link/ether 7a:35:21:5c:87:f9 brd ff:ff:ff:ff:ff:ff link-netnsid 2
    inet6 fe80::7835:21ff:fe5c:87f9/64 scope link 
       valid_lft forever preferred_lft forever

In my setting I found that wlan1 (5Ghz) is pinging without DUP!

Why are there hostapd.conf, hostapd_wlan0.conf, hostapd_wlan1.conf files in the /etc/hostapd folder? Couldn’t the presence of hostapd.conf and hostapd_wlan0.conf create a DUP problem!?

Hostapd.conf should not be used…it is the default file from hostapd package…i renamed it to hostapd_wlanX.conf and changed in the /etc/default/hostapd hopefully :slight_smile:

You should have only 2 processes with hostapd_wlan*.conf

systemctl | grep hostapd

Imho ps is better

ps auxf | grep hostapd

Should print 2 hostapd processes with config file and the grep

ps auxf | grep hostapd
root      336810  0.0  0.0   3076  1408 pts/0    S+   15:54   0:00          \_ grep hostapd
root      127288  0.0  0.2  11152  4744 ?        Ss   Jul28   0:01 /usr/sbin/hostapd -B -P /run/hostapd2.pid /etc/hostapd/hostapd_wlan1.conf
root      127877  0.0  0.2  11144  4868 ?        Ss   Jul28   1:18 /usr/sbin/hostapd -B -P /run/hostapd.pid /etc/hostapd/hostapd_wlan0.conf

so no hostapd process with hostapd.conf…

Try changing one or more of bytes nr’s 4 to 6 in the mac addresses. Not sure if this is the cause, but I never tried only changing the first byte…

So

wlan0: xx:xx:xx:26:60:00
wlan1: xx:xx:xx:26:70:00

Just better not to change the first byte, because some bits have special functions.