Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable host name lookup in network-related mn_* services #128

Open
nettings opened this issue Dec 5, 2023 · 0 comments
Open

Enable host name lookup in network-related mn_* services #128

nettings opened this issue Dec 5, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@nettings
Copy link
Owner

nettings commented Dec 5, 2023

Currently, we use multicast groups for convenience and ease of setup even when not strictly necessary.
With uncompressed video streaming, the network load penalty has become too high, so we need to make unicast just as straightforward.

It is already possible to use unicast IPv4 addresses in network services in config.json.
But: We don't want to assume fixed and known IP addresses. Instead, we want to give our medianet nodes functional host names and use those.

So we need a way to reliably look up names. Currently, several things can go and are going wrong when using hostnames naively:

  • On the sender, an implicit lookup can yield either an IPv6 or an IPv4 address. It is not clear that the receiver is listening on both.
  • On the receiver, the "source" host is not the sender, but rather the receiving host itself. The IP is required to determine which network interface to bind to. Here, things usually break because one's own hostname usually resolves to 127.0.0.1 or ::1.

So it's time to write a library function that can be re-used by all network-related services, and place it neatly in /medianet/overlay/usr/local/lib/systemd/scripts.

On a UDP sender, we need to do the following:

  • if the input is a multicast address, keep it
  • if the input is a unicast IPv4 address, keep it (but we don't really want have to use it!)
  • if the input is a hostname (local or fully qualified), perform an A record lookup and substitute its IPv4 address

On a UDP receiver:

  • if the input is a multicast address, keep it
  • if the input is one of our own IP addresses, make the service bind to that interface
  • if the input is textual, check if
    • it's one of our own hostnames, then bind to that interface
    • if it's an interface name (such as "medianet0"), bind to that
@nettings nettings added the enhancement New feature or request label Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant