Create a synchronous network of 400 devices
First, synchronize all of the devices to a common timebase using NTP, PTP or GPS, depending on your actual accuracy requirements (on the order of ms, µs, or ns, respectively).1 NTP should be sufficient for &quot;a window of 10 ms&quot;.
Your command packets should include both the action to be performed along with a timestamp (a short time into the future) that indicates when the action should happen. The device then performs the action at the specified time.2

1 &quot;Exact same&quot; is not an engineering specification. You need to specify a tolerance.
2 Many years ago, I was able to use this general strategy — GPS synchronization plus delayed action — to synchronize multiple simulcast transmitters across an entire metropolitan area to within ±1 µs.