|
Algorithm 3 Teegraph adaptation for VANET environments. |
Require: Communication range, traffic density, vehicle speed, geo-routing algorithm
Ensure: Performance metrics
-
1:
Initialize system parameters and TEE enclave
-
2:
Discover neighbors via the specified geo-routing algorithm
-
3:
Adjust gossip interval and neighbor count based on local density and speed
-
4:
procedure
TransmitThread
-
5:
while true do
-
6:
send(DAG.getUnseenEvents(), selectNeighbor())
-
7:
if DAG.allConfirmed() then
-
8:
pauseGossip()
-
9:
end if
-
10:
end while
-
11:
end procedure
-
12:
procedure
ReceiveConsensusThread
-
13:
while true do
-
14:
msgs ← receive()
-
15:
if validate(msgs) then
-
16:
newEvent ← createEvent(selfParent, otherParent(msgs))
-
17:
signedEvent ← TEE.sign(newEvent)
-
18:
DAG.append(signedEvent)
-
19:
else
-
20:
discard(msgs)
-
21:
end if
-
22:
DAG.finalizeConsensus()
-
23:
end while
-
24:
end procedure
-
25:
Launch TransmitThread() and ReceiveConsensusThread() in parallel
-
26:
return performanceMetrics
|