Description
My simple network of 6 OTA arduino nodes and a few open Arduino IDE windows causes a massive flood of mDNS traffic.
The jmdns java package has a rather large issue relating to broadcast mDNS packets. It seems that each service that responds to the addServiceListener() for the _arduino._tcp.local query causes an extra mDNS broadcast to be sent by jmdns. This has major scaling issues when there are many OTA clients listening on a single network. Each broadcast causes N responses and creates N more broadcasts. leading to a massive flow of broadcast packets and responses.
Secondly, the Arduino code restarts the jmdns query every 5 seconds. If the above process takes over 5 seconds (like when 6 or more OTA clients exist), it causes the wireless network to goto 100% utilization processing these requests.
Issues:
There are two issues here:
- I tracked one down looking a cc.arduino.packages.discoverers.network.BoardReachabilityFilter's timer is too short. 5 seconds per broadcast is a bit much. Maybe a better option would be to adjust the TTL counters in the jmdns code??
- bugs in jmdns cause many broadcast packets (one for each service responder). This seems like a big issue, and I logged a ticket on the jmdns git repo to see if someone can look at it. I'll try to spend some time myself. (I tested this issue with a simple java program that just sends one start
see sample java program : MainClass.zip
Just start wireshark and select this filter: "dns and udp.port eq 5353 and ip.addr eq 224.0.0.0/24" to isolate the JmDNS traffic.
Proposed Fixes:
the BoardReachabilityFilter.start should not have a fixed 5 second poll. Although this is nice when there is only one OTA client, it gets out of hand when there are a bunch. I suppose that if the jmdns service is fixed it would reduce this timer, but if you have a few copies if the IDE up on different computers the flooding would begin.
The jmdns service needs to be replaced, or fixed.