Ring Based Algorithm In Distributed Systems