centerclick / feedback

Issues, Bug Reports, and Feature Requests
7 stars 0 forks source link

Add the ability to broadcast NTP time at configurable intervals #34

Closed mikestrauser closed 2 years ago

mikestrauser commented 2 years ago

When no Network Services are available it can be difficult to get the IP Address of the NTP server to network devices. It would be nice if the NTP server could be configured for Broadcast mode and have a setting for number of milliseconds between broadcasts.

dave4445 commented 2 years ago

Note that broadcast server mode has the same timing as other ntp features, that being a power of 2 which defaults to every 64 seconds.

dave4445 commented 2 years ago

prototyped, needs testing

NTP250> conf ntp bcast

Current NTP Broadcast/Multicast:
  send 224.0.1.1
  send 255.255.255.255
  send ff02::101

Broadcast/Multicast Commands:
  exit          Exit Access Control Menu
  send IP       add broadcast/multicast server entry
  no send IP    delete broadcast/multicast server entry

  Examples:
  send 255.255.255.255      # RFC919: limited broadcast
  send 192.0.2.255          # RFC919: all hosts on the local IP net
  send 224.0.1.1            # RFC5905 Section 8
  send ff02::101            # RFC5905 Section 8

NTP250[bcast]> 
srob1 commented 2 years ago

What if the time server receives it's ip address dynamically via DHCP rather than being statically addressed? will there be some way to configure the all hosts on the local IP net without having to change the configuration to match the dhcp served net should it change on the fly ?

dave4445 commented 2 years ago

Sam, yes you are correct, if you are doing a broadcast to the connected subnet's broadcast IP, then yes this will be dependent on the prefix assigned by DHCP. However this is the least desirable option, using the 224.0.1.1 multicast address is prefered method as it will only go to hosts that actually want it, baring that 255.255.255.255 limited broadcast will also work.

srob1 commented 2 years ago

So is it possible that you could allow a generic "broadcast to the local subnet" send configuration command that would not be hard coded to the actual IPv4 subnet but would adapt when the subnet changes via DHCP ? Like "send local" or "local broadcast" something like that? You could still allow "send a.b.c.d" for the case where the unit is statically configured.

I get that configuring the unit for DHCP is not a great idea but since it's an allowed setting I thought it would be good to think about that for broadcasts.

dave4445 commented 2 years ago

using a symbolic name would require translation at both config time and after each dhcp renew/discover as it may change on the fly. possible but much more work, it's simply much simpler to use the well-known multicast addresses or simply the limited broadcast address both of which never change.

dave4445 commented 2 years ago

1.29