Switches can communicate and decide who is the leader and calculate their distance from the root