2

I have nearly 300 devices interconnected in the local ipv4 network and would like to discover each other somehow. At the moment, I'm using mdns announce to achieve this (using avahi lib). This solution works up to 50 devices, but it goes more than 100 I started to face some flooding of avahi announce messages in the network (of course it's obvious).

Is there any other alternative to mdns discovery to achieve the same result? all my device has arch Linux and I'm ok to install any open-source software.

Vencat
  • 129
  • 3

1 Answers1

0

I believe that paper referenced by Robert Harvey focuses on locating resources within an established p2p network, while your question is concerned with initial discovery of possible neighbors. Is that right?

For scalability, I would make the frequency of announce messages be inversely proportional to the known number of nodes in the p2p net, so that in the steady state the number of mdns messages per unit of time is bounded.

To achieve that, each device needs to know (or have a good estimate of) the number of other distinct devices reachable via direct or indirect connections. If you have disjunct meshes, the number of announcements per unit of time will be higher, but such disjunct meshes would quickly join each other.

Hans-Martin Mosner
  • 14,638
  • 1
  • 27
  • 35
  • while your question is concerned with the initial discovery of possible neighbours - yes but I also need to update, if some nodes disappear from the network and a new node is added to the network. – Vencat Oct 13 '22 at 13:55
  • Each node should send announcements based on its own knowledge about the size of the mesh it's connected to. So a newly added node will send an announcement immediately, and will get connection requests from others (it may refuse connections after some limit). If nodes disappear, their peers will notice the connection loss and need to decide whether a partition happened. Caveat: I have no actual experience with the behavior of such a p2p net, but the strategy to reduce the announcements based on network size should work to limit the noise. – Hans-Martin Mosner Oct 13 '22 at 15:33