In sensor networks, average consensus and gossiping algorithms, featuring only near neighbor communications, present advantages
over flooding and epidemic algorithms in a number of distributed signal processing applications. This chapter looks into the
implementation of average consensus algorithms within the constraints of current sensor network technology. Our event-based
protocols work in the real event-based environment provided by a common Mica2 platform and use its wireless CSMA packet-switched
network interface. Within this architecture our chapter derives different protocols according to an event-based software architecture
that are suitable for an environment like TinyOS, the most used operating system for low-power mote platforms. Theoretical
and simulation results are presented, and the main advantage over traditional routing protocols is given by the fully distributed
and scalable nature this approach follows.