CAND_IDS (path P) { //Input: valid path P //Output: IDS_node/Null //Prerequisite: path P is validated by check_point ( ) //Initial Condition: Nodal nodes in the path P with valid check //Exit Criteria: 1. enum e1{eEnable, eDisable, eError} 2. -- non-nodal sensor node with non-nodal path node 3. if(!path(sensor-node)) then 4. if (sensor-node.logic == eEnable) then 5. if (sensor-node is acquiring P(sensor-node). info in path P) then 6. declare sensor-node.logic = eError 7. sensor-node.alertflag = true 8. send(sensor-node.location, sensor-node.info, −2) 9. stop data-transmission 10. restart CCRP ( ) 11. else 12. sensor-node.logic == eEnable 13. end if 14. end if 15. -non-nodal-node acts as a compromised node 16. if(path(sensor-node)) then 17. if (sensor-node.logic == eEnable) then 18. if (sensor-node is acquiring G(sensor-node)) then 19. declare sensor-node.logic = eError 20. sensor-node.alertflag = true 21. send(sensor-node.location, sensor-node.info, −2) 22. stop data-transmission 23. restart CCRP ( ) 24. else 25. sensor-node.logic == eEnable 26. end if 27. end if 28. - nodal - node act as a compromised node 29. if(path(nodal-node)) then 30. if (nodal-node.logic == eEnable) then 31. nodal-node (monitor-node) 32. declare nodal-node.logic = eError 33. nodal-node.alertflag = true 34. send(nodal-node.location, nodal-node.info, −1) 35. stop data-transmission 36. restart CCRP ( ) 37. else 38. nodal-node.logic == eEnable 39. end if 10. end if 41. - preemptive terminate of data transmission 42. send(nodel-node.path, −3) 43. clear path (P) 44. disable all flags 45. end 46. } |