Reliable and efficient communications in wireless sensor networks