Resilience of wireless sensor networks