Ring leader election algorithm