Echo algorithm for topology establishment for network represented as a cyclic  graph, implementation of message communication and leader election