|
Algorithm 3 Algorithm for Gateway-independent and Gateway-assisted Trust Evaluation |
|
Input: The trustiness of the node k
|
| The node u is who sends a query against suspicious node w
|
| The forwarding ratio of the node k
|
| The malicious node threshold of suspicious node w
|
| The set of child nodes v
|
| The logical inspection node l
|
|
Output: Whether the suspicious node is malicious or normal |
| //Collaborative inspection |
| gateway sends collaborative inspection response to node u
|
| node u relay response to child nodes v except suspicious node w
|
|
for node c ∈ v
do
|
| node c collects transmission/reception information |
| node c reports to node u
|
|
end for
|
| node u calculates about suspicious node w |
|
if <
then
|
| suspicious node w becomes malicious node |
|
else
|
| suspicious node w becomes normal node |
|
end if
|
| //Logical inspection |
| gateway selects node l with the highest trustiness T among 1-hop nodes of suspicious node w
|
| gateway sends logical inspection response to node l
|
|
|
|
fori = 1 to 5 do
|
| node l selects random interval time
|
| node l calculates in seconds about suspicious node w
|
| if
<
then
|
| ++ |
| end if
|
|
end for
|
|
if > 2 then
|
| suspicious node w becomes malicious node |
|
else
|
| suspicious node w becomes normal node |
|
end if
|
| //Physical inspection |
| gateway sends physical inspection response to drone node |
|
|
| drone node goes to suspicious node w area |
| drone node collects transmission/reception information about suspicious node w
|
|
fori = 1 to 10 do
|
| gateway calculates in t seconds about suspicious node w
|
| if
<
then
|
| ++ |
| end if
|
|
end for
|
|
if > 4 then
|
| suspicious node w becomes malicious node |
|
else
|
| suspicious node w becomes normal node |
|
end if
|