Distributed Consensus in Networks