udp_bind() cannot receive broadcast.

Hello,

I am implementing firmware to communicate using UDP between two nRF7002.

The sender does not know the IP address, so it tries to know the IP address of the receiver using broadcast. But udp_bind() ignores the broadcast for some reason.

It is correct because udp_bind() can receive using unicast.

Is it a specification that broadcasts cannot be received? Or is it not implemented yet?

Best Regards,
Yoshihiro Goto

  • Hi, 

    Let me check with the team and then back to you next week. 

    Regards,
    Amanda H.

  • Hi, 

    The team said that binding to a broadcast address has not been implemented. There are a few alternatives though:

    1. bind() to ANY address instead (0.0.0.0), that should make the socket receive all packets for the port which get through the IP layer,
    2. stick to multicast addressing instead, that's utilized by multiple network services in the system already (IGMP, mDNS etc.)
    3. or just use a protocol which was designed for the job. I suggest the customer to get familiar with mDNS and DNS Service Discovery and Zephyr's implementation of those, which were designed exactly for that purpose (obtaining IP address of a host based on a service name)

    Regards,
    Amanda H.

Related