LeaderElection algorithm for network mode