Skip to content

Problem with UDP broadcast packet reception on Linux #11

@mkolender

Description

@mkolender

Hello,

I'm running an Art-Net Output node using your library on Linux on a Raspberry Pi. I'm using DMX-Workshop and QLC+ on a separate Windows PC.

When using older version (0.0.20) of your library the node:

  • is discoverable using DMX-Workshop
  • receives broadcast ArtDmx packets

I am aware that controllers shouldn't be sending broadcast ArtDmx according to the specification, but it is useful in my case.

In the current version (0.0.38) the node:

  • cannot be discovered by DMX-Workshop
  • doesn't receive broadcast ArtDmx packets from QLC+

When running the same version (0.0.38) on a Windows PC the node:

  • is discoverable using DMX-Workshop
  • receives broadcast ArtDmx packets

After a little investigation I've noticed that the older version of your library used a single socket bound to 0.0.0.0. Current version creates a separate socket for each network interface bound to the local IP address.

I made a few experiments using sockets in Python on Linux. From what I know on Linux a socket bound to for example 10.0.0.5 can only receive packets with the destination IP 10.0.0.5. All of the broadcast packets are ignored in this case.

On Linux there are 2 ways of receiving broadcast packets:

  • binding a socket to 0.0.0.0 which doesn't filter destination IP at all.
  • binding a socket to the interface’s broadcast address (e.g. 10.255.255.255 for 10.0.0.5/8). In this case only packets with destination IP 10.255.255.255 are received.

I think that creating 2 sockets for each network interface (excluding loopback) on Linux could be a solution to this problem:

  • one for receiving unicast and transmitting
  • second socket only for receiving broadcast packets

I can also check how it works on macOS, but it should be similar to Linux, because both of them are Unix-like.

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions