Skip to main content
. 2019 Oct 6;19(19):4321. doi: 10.3390/s19194321
Algorithm 1 Sybil Node Detection
Initialization: K = ⌀, i = 0, α = 1, β = 1, γ = 1, δ = 1.
procedure
2:     K ← Kti
4:     while i<ηdo η is the number of nodes.
6:        if Kti Kti+1 then
8:         Kti = Kti
10:         i = i + 1
12:        else
14:          Kti = Kti+1
16:        end if
18:     end while
20:     return Kt
22:     broadcast Kt to all nodes in the network. ▹ After this broadcast, Node 0 will continue the following policy
24:     (K, Rmax) ←(,)
26:     while Rα K do
28:        if Rα(SNβ) ≠ RSSI(Rα(SNβ)) then
30:         Exclude Rα(SNβ)
32:        else
34:          RRγ← Rα(SNβ)
36:        end if
38:        if Rα(GNβ) ≠ RSSI(Rα(GNβ)) then
40:         Exclude Rα(GNβ)
42:         α = α + 1
44:        else
46:          RRγ← Rα(GNβ)
48:          γ = γ + 1
50:        end if
52:     end while
54:     γ = 1
56:     bool = true
58:     while bool do
60:        if SizeOf(RRγ(GN)) ≥ SizeOf(RRγ+1(GN) then
62:          Rmax = RRγ(GN)
64:          γ = γ + 1
66:        else
68:          Rmax = RRγ+1(GN)
70:        bool = false
72:        end if
74:     end while
76:     return Rmax
78:     broadcast Rmax to all nodes in S.
80: end procedure