An epidemic model for security and performance of wireless sensor networks. (17th May 2019)