A Dynamic Programming Model for Internal Attack Detection in Wireless Sensor Networks. (1st June 2017)