Algorithm 3 Dynamic itinerary planner algorithm. |
-
1:
initialize variables:
-
2:
MA = 0
-
3:
itinerary
-
4:
MA = Number of populated clusters
-
5:
for all clusters do
-
6:
initialize security parameter
-
7:
end for
-
8:
key ← security variable
-
9:
if
-
10:
key == 0 then
-
11:
hashed key ← MD5(key value)
-
12:
MA ← hashed key
-
13:
Gateway (G) ← hashed key
-
14:
end if
-
15:
for all clusters (C) do
-
16:
function
-
17:
call ← Routing()
-
18:
Routing() ← MST algorithm
-
19:
itinerary ← every cluster
-
20:
assign every cluster itinerary to MAs
-
21:
MA ← itinerary
-
22:
end function
-
23:
end for
-
24:
for all clusters (C) do
-
25:
MA → visit a cluster
-
26:
if MA hashed key Gateway hashed key then
-
27:
authenticate MA
-
28:
collect data
-
29:
else
-
30:
invalid key
-
31:
end if
-
32:
end for
-
33:
for all clusters do
-
34:
steps 15 and 24
-
35:
end for
-
36:
while the topology has changed do
-
37:
steps 1 to 24
-
38:
end while
|