naggie / sd01

Minimal service discovery with strict implementation. You should probably use mDNS.
MIT License
6 stars 2 forks source link

RFC: Hashed announce port? #10

Closed naggie closed 6 years ago

naggie commented 6 years ago

The initial implementation had an announce port, calculated from a CRC32 of the service name resulting in a port within a known range.

Advantages:

  1. Traffic is split over ports -- micro-controllers are less likely to get swamped by sd01 traffic if there are many devices on the network

Disadvantages:

  1. Complexity. This can be managed by a good test suite.
  2. It makes firewall rules a bit more annoying
jimjibone commented 6 years ago

Not sure I can think of any reason why not to go for the hashed announce port.

Only issue could be if we wanted to create a "listen" tool which displays all discovered services on a network (similar to tools for Bonjour/Zeroconf). However, this could just require that the user specifies the service name when "listening".

We just need to make sure that the process of going from service name to port number is clearly defined.

jimjibone commented 6 years ago

whoops...

naggie commented 6 years ago

Agreed -- lots of tests for that.

I'll put it on ice for a while. If we see issues with too much traffic for a uC to handle we can re-open it; perhaps we should blast an ESP with 1000 devices and see what happens....