Zero-configuration networking
We want to prevent annoying hardcoded IP addresses in the configuration, i.e. zeroconf.
I think the best general pattern is would be the following:
- A Satellite (Sat) tries to wildcard bind to a some port (retrying with another port if that port is already taken) and opens a REP socket
- The Sat announces itself (with a user-defined Sat-Name and the open port) via some discovery protocol
- RC reacts to Sat announcement, and connects via REQ and sends a Connection Message, containing the name of the module of the Sat
- Sat opens a new connection to RC for interrupt signals
Note: Late RC in case of custom UDP: sends request to Sat which announce again
Open questions:
- Discovery protocol:
- mDNS/DNS-SD:
- via Avahi/Bonjour/WinDNS
- pro: native on all systems, no mDNS interference
- con: API a bit annoying, needs wrapper
- via some library we still need to find
- pro: easier to use
- con: possible mDNS interference
- via Avahi/Bonjour/WinDNS
- custom UDP:
- see e.g. ZeroMQ Guide
- pro: can be adjusted to our needs
- con: needs to be written from scratch, differences for different OSes
- see e.g. ZeroMQ Guide
- mDNS/DNS-SD:
- Sat to RC back connection connection:
- Normal connection: Sat needs IP -> what if we have different networks? Can ZeroMQ give us the IP?
(I don't think so)Yes it does! - RC binds wildcard port: REP/REQ not possible? PUB/SUB would be possible but can drop packages -> not suitable
- Normal connection: Sat needs IP -> what if we have different networks? Can ZeroMQ give us the IP?
- Sat on different network:
- For later, but imagine we are on two different networks (e.g. Testbeam & DESY network) -> do we want to support this? If yes, we could create a "RC bridge" Sat module
Edited by Stephan Lachnit