Algorithm 1 Caching algorithm at base station |
Initialize:=0, =0, =0
-
1:
Receive packet i
-
2:
for Every packet i from wired network do
-
3:
if Destination address == vehicle’s ID then
-
4:
if
=0 then
-
5:
Cache the package.
-
6:
=
-
7:
else if
<
then
-
8:
=
-
9:
Cache the package.
-
10:
else
-
11:
Drop the package.
-
12:
end if
-
13:
if
=0 then
-
14:
=
-
15:
else if
<
then
-
16:
=
-
17:
Cache the package.
-
18:
else
-
19:
Drop the package.
-
20:
end if
-
21:
end if
-
22:
if Source address == vehicle’s ID then
-
23:
if
=0 then
-
24:
else if
<
then
-
25:
=
-
26:
end if
-
27:
if
<
then
-
28:
Release the caching package from to -1
-
29:
=
-
30:
end if
-
31:
end if
-
32:
end for
|