A defense strategy against energy exhausting attacks in wireless sensor networks