An Introduction to Distributed Algorithms