Device name in network has a number in parenthesis and it is incrementing My iPad's name used to be Behdad's iPad for many years, but a few days back, it was automatically changed to Behdad's iPad (4) and when I manually deleted the number, it was soon changed to Behdad's iPad (8). Now that I'm writing this, it is currently Behdad's iPad (543), which has been changed from Behdad's iPad (284) from yesterday!


A few points to consider:
It all started when I installed YazFi package on my ASUS RT-AC87U router with Asuswrt-Merlin 384.13_2 firmware on it and my current network configuration is as follows:

I have two networks, one is 192.168.1.0/24 and another is 192.168.2.0/24.
All my devices occasionally connect to any of those networks, including my iPhone and my MacBook Pro.
This naming thing happens on both my iPad and MacBook Pro (but not to this extent, as it is currently sitting on `Behdad's MacBook Pro (7)&quot;, but not to my iPhone.

Do you have any idea on why this happens and how can I make it stop? I'm worried it messes something with iCloud, as these names appear on my iCloud device list.
This does not mess up iCloud devices, the device is getting the name from the router and reporting it. As soon as you rename the device or fix the network to assign a different name, iCloud will reflect the current names quickly.

It definitely is made worse by YazFi, because since I uninstalled it from my router, all my devices have kept their names. I'm going to ask its developer also. This can happen on any network, however with bonjour sleep proxy and dns/dhcp not cleaning old records at the same rate as iOS devices reconnect after sleep.
YazFi's developer had asked people to reply to a thread in SmallNetBuilders forum regarding any issues. Several others created accounts there, but looks new users need to gain a few points to be able to post on the forums (similar to how new users can’t comment here without reputation or make edits without approval).
Getting enough momentum posting on SNB forums to link to this question might help others see it.
Editors note: this answer came from edits to the question so I moved it to the answer. I encourage others to put up a better answer or edit this as needed.