This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

WL1835 in AP mode does not appear to pass Rx'd multicast traffic

Other Parts Discussed in Thread: WL1835, WL1271

This is reproducable on the BeagleBone (white) with WL1835 cape which was used to verify WiLink8 functionality.  That is running the Angstrom distribution.

From the BeagleBone:

Linux am335x-evm 3.12.10-ti2013.12.01 #22 Thu May 8 14:33:47 IDT 2014 armv7l GNU/Linux

wlcore: wl18xx HW: 183x or 180x, PG 2.2 (ROM 0x11)
wlcore: loaded
wlcore: driver version: ti2013.12.01-5-g0d378db
wlcore: compilation time: Thu May  8 14:39:03 2014

wlcore: PHY firmware version: Rev 8.2.0.0.195
wlcore: firmware booted (Rev 8.8.0.0.13)

wlan0     Link encap:Ethernet  HWaddr 34:B1:F7:E3:04:8D
          inet addr:172.16.10.108  Bcast:0.0.0.0  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:27691 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16393 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:15271650 (14.5 MiB)  TX bytes:4613878 (4.3 MiB)

wlan1     Link encap:Ethernet  HWaddr 34:B1:F7:E3:04:8E
          inet addr:172.30.1.1  Bcast:172.30.255.255  Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6549 errors:0 dropped:7 overruns:0 frame:0
          TX packets:4388 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:478837 (467.6 KiB)  TX bytes:787831 (769.3 KiB)

Driver versions from our device:

wlcore: wl18xx HW: 183x or 180x, PG 2.2 (ROM 0x11)
wlcore: loaded
wlcore: driver version: ol_r8.a9.14

wlcore: PHY firmware version: Rev 8.2.0.0.224
wlcore: firmware booted (Rev 8.9.0.0.31)

mDNS traffic over AP mode (hostapd) works fine with a USB stick which we used on our product prior to integrating the WiLink device.  I have not attempted to wedge the drivers for that into the BeagleBone, as we are confident that given multicast traffic is being treated the same on the Beaglebone using the WiLink8 as it does in our own environment, it appears to be in the driver.

iptables has been cleared - there are no iptables rules in place which would interfere with any traffic.

To test on the BeagleBone, I installed the avahi-daemon using opkg and set up a simple configuration file for it (mimic'ing the config used on our device, which has been functioning for some time, excepting this WiLink8 AP issue).  In STA connections, it works fine, and when avahi-daemon first starts up (including when it is killed and re-run), the data is multicast on the AP interface (wlan1), implying Tx of multicast is functional.  No mDNS traffic is seen on the wlan1 interface while in AP mode from any of the clients.

This behaviour is not seen when the same hostapd and avahi components and configurations are used with a USB WiFi device.

If I can  provide any additional information, including tcpdump captures, let me know.  This is holding up a product release because the mDNS functionality is significant to device discovery.

Note that I have a tcpdump capture from a workstation of a multicast from the Beagle when the avahi initializes, so I know it is Tx'ing the multicast:

Ethernet II, Src: 34:b1:f7:e3:04:8e (34:b1:f7:e3:04:8e), Dst: IPv4mcast_00:00:fb (01:00:5e:00:00:fb)
    Destination: IPv4mcast_00:00:fb (01:00:5e:00:00:fb)
        Address: IPv4mcast_00:00:fb (01:00:5e:00:00:fb)

  • Hi,

    Multicast should be working without issues.
    Can you test is using the prebuilt images (software-dl.ti.com/.../index_FDS.html) and confirm if there is a problem?

    Regards,
    Gigi Joseph.
  • I set up a new SDCard for the beaglebone and copied the prebuilt images to it.  The fault persists.

    Put beagle into AP mode (in my case, I connected via USB-serial and deconfigured eth0 and configured wlan to AP with hostapd), then run:

    iperf -s -u -B 224.1.1.1 -i 5

    connect a client system to the AP (in our case, I used both a system running the WiLink8 as well as a separate test with a different wireless device), and run:

    iperf -c 224.1.1.1 -u -T 32 -i 5


     (server and client can be swapped between the two hosts on other test runs, the result seems to be the same)

    Drop AP configuration and bind the two hosts to an intermediate AP and run the commands again:

    root@am335x-evm:/var/log# iperf -s -u -B 224.1.1.1 -i 5
    ------------------------------------------------------------
    Server listening on UDP port 5001
    Binding to local address 224.1.1.1
    Joining multicast group  224.1.1.1
    Receiving 1470 byte datagrams
    UDP buffer size:  160 KByte (default)
    ------------------------------------------------------------
    [  3] local 224.1.1.1 port 5001 connected with 172.16.10.105 port 44403
    [ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
    [  3]  0.0- 5.0 sec   204 KBytes   334 Kbits/sec  11.867 ms  310/  452 (69%)
    [  3]  0.0- 9.9 sec   614 KBytes   507 Kbits/sec  15.072 ms  465/  893 (52%)
    [  3]  0.0- 9.9 sec  17 datagrams received out-of-order
    [  4] local 224.1.1.1 port 5001 connected with 172.16.10.105 port 44403

    The number of dropped packets isn't the immediate concern here - the fact that the AP interface doesn't pass any of the multicast traffic is the chief concern, as mDNS relies on this in order to function.

  • Hi,

    How about the case when the WL18xx AP is connected to two stations, and STA1 is running the multicast server and STA2 running multicast client?

    Can you enable the driver logs (echo 0xFFFF> /sys/module/wlcore/parameters/debug_level), and really confirm that the driver/fw is not forwarding the multicast packets to the network stack.

    I think this is some network stack configuration issue....

    Regards,
    Gigi Joseph.
  • No resolution of multicast between clients when the WiLink8 is the AP.  Associate the two client systems to a consumer router, and mDNS works.

    I separately provided tcpdump files correlating to this activity to our TI App Engineer, Michael Questo.

    beagle.messages.0.logbeagle.messages.log

  • HI,

    I will check the logs and let you know next week.
    In the meantime, can you just check if the multicast packet is not getting routed to another interface?

    You can add: "route add –net 224.0.0.0 netmask 255.255.255.0 wlan0" and see if it helps.

    Regards,
    Gigi Joseph.
  • I had set a manual route previously with no luck with multicast:

    ip route add 224.0.0.0/24 dev wlan1

    but your route command seems to work right now (using wlan1 interface for AP mode, not wlan0).

    [18:46:51][envoy:~$] route -n
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    0.0.0.0         192.168.11.1    0.0.0.0         UG    40     0        0 wlan0
    169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
    172.30.0.0      0.0.0.0         255.255.0.0     U     0      0        0 wlan1
    192.168.11.0    0.0.0.0         255.255.255.0   U     0      0        0 wlan0
    224.0.0.0       0.0.0.0         255.255.255.0   U     0      0        0 wlan1

    This manual route is not necessary for any of the other interfaces or the USB WiFi device which still calls into question why it is necessary.  In prior testing I also took down eth0 and wlan0 configurations and still had the multicast issues on wlan1.

    Although Monday is a holiday here, I will be checking mail throughout the weekend.


    Thank you for your assistance.

  • Well, I was too eager to test, and had overlooked the initial mDNS Tx - turns out, the manual route is not making a difference. My client workstation was associated with the AP beforehand and when I restarted the system, it jumped right on and saw the initial mDNS Tx as avahi wrapped up initialization.
  • Hi,

    To set the correct routing rules, please use:
    "ip route add 224.0.0.0/4 dev wlan0"

    I just tried this on my setup, and it works fine. Please try it at your end too and confirm.

    My Full Steps:

    ======================================================
    wl18xx AP Commands
    ======================================================
    > hostapd -B /etc/hostapd.conf -P /var/run/hostapd.pid
    > ifconfig wlan0 10.4.30.34 netmask 255.255.255.0 up
    > udhcpd /etc/udhcpd.conf
    > ip route add 224.0.0.0/4 dev wlan0
    > iperf -s -u -B 224.0.67.67 -i 1

    ======================================================
    wl18xx STA Commands
    ======================================================
    iw wlan0 scan | grep SSID
    iw wlan0 connect SoftAP_Role
    udhcpc -iwlan0
    iperf -c 224.0.67.67 -u --ttl 5 -t 5


    ======================================================
    My hostapd.conf was as below:
    ======================================================
    interface=wlan0
    driver=nl80211
    channel=11
    hw_mode=g
    preamble=1
    dtim_period=2
    beacon_int=100
    logger_syslog=-1
    logger_syslog_level=2
    logger_stdout=-1
    logger_stdout_level=2
    dump_file=/tmp/hostapd.dump
    ctrl_interface=/var/run/hostapd
    ctrl_interface_group=0
    supported_rates=60 90 120 180 240 360 480 540
    basic_rates=60 90 120 180 240
    ssid=SoftAP_Role
    max_num_sta=5
    macaddr_acl=0
    auth_algs=3
    ieee80211d=0
    uapsd_advertisement_enabled=1
    wep_rekey_period=0
    own_ip_addr=127.0.0.1
    wpa_group_rekey=0
    wpa_strict_rekey=0
    wpa_gmk_rekey=0
    wpa_ptk_rekey=0
    #ap_table_max_size=255
    #ap_table_expiration_time=60
    eap_server=1
    disassoc_low_ack=1
    ap_max_inactivity=4294967295

    ======================================================
    My udhcpd.conf was as below:
    ======================================================
    # Sample udhcpd configuration file (/etc/udhcpd.conf)
    # The start and end of the IP lease block
    start 10.4.30.40 #default: 192.168.0.20
    end 10.4.30.48 #default: 192.168.0.254
    # The interface that udhcpd will use
    interface wlan0 #default: eth0
    #Examles
    opt dns 8.8.8.8 8.8.4.4 # public google dns servers
    option subnet 255.255.255.0
    opt router 10.4.30.34
    option lease 864000 # 10 days of


    Regards,
    Gigi Joseph.
  • For test, I duplicated your configuration on my Beagle, including that we're using wlan0 (not wlan1) for the AP mode.

    With the usual wireless initialization script disabled, I rebooted the Beagle (so a clean slate for wiress config)

    This config does appear to function unto itself.

    As we need the multicast running on our device with the interface and network address, etc as we have them, we cannot simply adopt your init sequence and configuration files.  I migrated your configurations into the setup I had on the Beagle which mimics ours, and found that even with your specific configuration values, multicast remained non-functional.  The one standout difference was the sequence in which you configure the wlan interface address - we do it BEFORE launching hostapd (which has always worked with our other wireless adapters), but you're doing it after running hostapd.  The order has NO effect on hostapd running and providing non-multicast services, just (apparently) functioning of multicast Rx.

    Further, if initialized in the order you present, setting the multicast route turns out to be unnecessary.

    To reproduce, simply move your hostapd line down below your ifconfig command.

    At this point, we've reworked our initialization around to accommodate this behaviour.  I greatly appreciate your assistance.

    As this has not been an issue with our other wireless drivers, some understanding of what is going on would be appreciated - it would seem as if the driver is initializing differently if the hostapd is already running with the interface is brought up versus if the interface is up before hostapd is launched.  Why should it treat mullticast differently?

  • Hello Sean,

    I use wilink8 chip on a custom board and ran exactly in these kind of scenario.

    I figured out the rootcause :
    When you configure (set it up) a STAtion interface, the driver install a multicast filter. This is normal behavior, when one application subscribe to multicast address the filter is updated.
    When Access Point interface is configured, there is no filter installation and the "filter update" path is disabled in the driver.

    The problem is when you switch an interface from Station type to AP type. The filter is installed but there is no means to update it.

    I patched the driver in order to ensure to remove any filter when AP interface is configured and it seems to work just fine.
    I submitted this patch via TI ticketing service, I don't know if it will be integrated in the next driver release.

    From fc76b2317dd07ad76eacd6d8edbc5295b12616e7 Mon Sep 17 00:00:00 2001
    From: Jimmy Perchet <jimmy.perchet@parrot.com>
    Date: Wed, 11 Mar 2015 15:16:50 +0100
    Subject: [PATCH] wireless:wl18xx: Disable filtering in AP role.

    Change-Id: Ief7edb251ee3fe562fa5829ed9cb6e5bdffb38be
    ---
    drivers/net/wireless/ti/wlcore/init.c | 5 +++++
    1 file changed, 5 insertions(+)

    diff --git a/drivers/net/wireless/ti/wlcore/init.c b/drivers/net/wireless/ti/wlcore/init.c
    index 2307671..a74aaac 100644
    --- a/drivers/net/wireless/ti/wlcore/init.c
    +++ b/drivers/net/wireless/ti/wlcore/init.c
    @@ -549,6 +549,11 @@ static int wl12xx_init_ap_role(struct wl1271 *wl, struct wl12xx_vif *wlvif)
    {
    int ret;

    + /* Disable filtering */
    + ret = wl1271_acx_group_address_tbl(wl, wlvif, false, NULL, 0);
    + if (ret < 0)
    + return ret;
    +
    ret = wl1271_acx_ap_max_tx_retry(wl, wlvif);
    if (ret < 0)
    return ret;
    --
    2.1.4



    BR
    Jimmy
  • Thank you for this information.  It certainly appears as if you've run into the same core issue.

    When I have an opportunity, I'll apply your patch into a build here and see whether it has an impact on our config.

    I don't know if it actually directly applies to the situation we're having, in that this interface is never configured as a station: the WiLink8 has two radios, one we use for client (STA) connections, and the other as an AP - the wlan1 interface is generated solely for AP, and that's the interface we're experiencing this misbehaviour on.

    iw dev wlan0 interface add wlan1 type managed

    Yes, the interface is created based on an interface which may have been in station mode.

    The exchange here with TI was using wlan0 in the test scripts, but our deployed environment uses wlan1, which is itself never configured as a station interface.

  • After testing with the original change of initialization order, we ran into cases where if the AP had previously been used, then shut down, multicast might or might not work on a subsequent start of AP mode.

    I applied your patch, and on those systems where we were still having a lingering multicast problem, it seems resolved.

    Thank you.

    TI: PLEASE further test and integrate this fix.
  • Seems to work here too. Thank you! :)

  • For completeness a patch is now documented at processors.wiki.ti.com/.../WiLink8_Enable_Multicast_for_MDNS_in_AP_Mode

    The difference to Jimmy's patch is that it is now controllable from command line with option to "ip" of "allmulticast on" or "allmulticast off"
    It has been submitted to mainline.