3.1. The Strategy of Cooperative Downloading
To illustrate the method clearly, we assume that only one client requests cooperative downloading and that APs can communicate with each other via the Internet. According to the request of the client, APs choose a group of vehicles to provide cooperative downloading services. Each vehicle was equipped with a Wi-Fi interface and a DSRC protocol stack. Depending on running direction, the vehicles were divided into two groups: one moving with the same direction as the client (represented by ) and the other moving in the opposite direction (represented by ). When the client left an AP coverage area without finishing its downloading, the next AP chose vehicles in {} that can catch up with the client and download the remaining packets to it. The principles of choosing cooperative vehicles included no overlapping collision area and a pursuit of maximum throughput.
As shown in
Figure 2, the vehicles entered and left the AP communication area at different times as well as encountered the client in the dark area (DA) at different times and areas. Therefore, AP could choose a group vehicles to relay data to the client in the DA, as shown at t1–t4 in
Figure 2. Due to the limited communication area of the vehicles (about 300 m using DSRC), the amount of data the cooperative vehicles carried was decided by the encountering time with the client. According to previous research [
17], traffic conforms to Poisson distribution. When
λ = 5, up to 20% vehicles can act as the helpers. Transmission collision will take place if more than 20% vehicles provide cooperative downloading services. Therefore, which vehicles are selected to provide cooperative downloading services is closely related to system throughput. According to the characteristic of VANET, we propose a cooperative downloading strategy based on dynamic slots. In this strategy, the DA is divided into several slots according to the encountering time between the vehicles and the client.
While entering an AP coverage area, the vehicle n registers its ID, the speed vn, and the present time tn. Every AP maintains a list including all vehicles in its coverage area, which is represented by List = {(id0, v0, t0), …, (idn, vn, tn)}. The list changes along with vehicles entering or leaving the communication area of the AP. AP1 and AP2 exchange their Lists every 30 s and the relevant items will be removed when an AP finds that the vehicle with a newer t is in the list of other APs.
When AP1 receives a downloading request from a client, it searches for the content from the Internet before it downloads the data to the client. The size of the downloading data is determined by its running time in the communication area, which can be calculated according to the information in the List. If the downloading is unfinished, AP1 informs AP2 of cooperative downloading.
When
AP2 receives the task, it picks out a group of vehicles that will meet the client in different time slots of the DA and put them in the collection
M = {(
id0,
v0,
t0,
B0,
E0,
T0), …, (
idn,
vn,
tn,
Bn,
En,
Tn)} in items of meeting time. (
idn,
vn,
tn,
Bn,
En,
Tn) represent the vehicle ID, its average speed, its register time, the begin time of encountering, the end time of encountering, and the selecting time, respectively. The
slotn = (
En −
Bn) is the entire duration of communication when the client meets the helper
Cn. The
Bn and
En can be calculated by Equations (1) and (2).
As shown in Equations (1) and (2), Tn has nothing to do with Bn and En. If the DA is regarded as a linear space on a time axis, then the slotn becomes a communication slot in which a cooperative vehicle communicates with the client. The strategy guarantees no overlap of the slots for improving channel utilization.
Assuming that the bandwidth between vehicles is W, the cooperative vehicle n should carry the data of W × (En − Bn) in theory. However, due to the characteristics of bad channel quality and high packet loss in the environment of VANET, cooperative vehicles have to carry fewer data than the theoretical value to compensate packet loss.
The traditional DFC can be utilized to solve packet loss, but VANET cooperative communication consists of serval links and communication time is short between the source and the destination. Therefore, it is difficult to converge the communicating process though feedback from receiver to source. This problem will result in a longer transmission delay. To solve the problem, we propose distributed DFC to relay data among the client and the helpers. Since the relative vehicle speeds running at the same direction is slower and the communicating time is longer, in this method, we only make use of SDCD (same direction cooperative downloading) and employ DFC with a hierarchical feedback mechanism to decrease transmission delay.
3.2. The Algorithm of Distributed Digital Foundation Code
To illustrate the scheme clearer, we turn the two processes in
Figure 1 into a three-node communication model. As shown in
Figure 3, the original cooperative vehicle
S encounters the client
D at its slot in DA and sends encoding packets to
D. The vehicle
C running at the same direction with
D receives these packets and sends data to the client
D when
S leaves out the communication area of the client. The source (
S) and the cooperative vehicle (
C) stop transmitting packets when they leave out the communication area of the destination (
D).
Assuming that the channels between nodes are erasure channels, the erasure probabilities are , , and , respectively. S and C encode the receiving packets into LT-encoded packets. S utilizes the degree distributed function to encode the raw data before it broadcasts to C and D. When C receives the encoded packets, instead of decoding, it utilizes another degree distributed function to encode the packets secondly before sending to D. D employs BP (Belief Propagation) algorithm to decode those encoded packets from S and C. If C leaves the area of D, another cooperative vehicle C’ continues to relay the encoded packets. The process does not stop until D receives enough packets to restore the raw data. Unlike traditional digital fountain code, D does not need to feedback to the original cooperative vehicle because it might have already left the communication area of S without receiving enough packets to restore the data. In this method, therefore, D only sends feedback to the last senders when finishing transmission. In order to obtain better decoding performance, the key challenge is how to design the degree distributed functions and so that D can easily decode the encoded packets using the degree distributed function . An algorithm of distributed digital fountain code is given as follows.
Assuming that the source node
S will transmit
n packets, it encodes the raw data using DFC with the distributed function
before broadcasting the encoded packets to
C and
D. The probability of which the packets are received correctly through the link
S-
D is (1 −
), while the probability of which the packets arrive at
C through the link
S-
C is (1 −
).
C does not decode the packets, but encodes them secondly using the distributed function
before it sends the packets to
D, and the probability of delivering is (1 −
). Therefore, via
C, the probability of which packets are received correctly by
D is
. In this model, there are two ways that the packets are transmitted from
S to
D. Assuming that the probability of which
D receives encoded packets from
C is
P1, while the probability of receiving from
S is
P2, then
Assuming that the degree distribution function of
S,
C, and
D are
,
,
. Obviously,
and all probability of the degree distributed functions are supposed to satisfy
. If the degree distributed function of the packets received by
D approximately equals the degree distribution function of DFC
then
To analyze easily, we employ a matrix formula to represent (5)
In Equation (6),
,
,
, then
Because the equation set is nonlinear, it is difficult to obtain an algebraic solution. If we can get a suitable δ, ω can be determined by linear equation set uniquely. The coefficient of a distributed function of LT coding attenuates with the increase of the degree of distributed function. Therefore, δ can be represented by a matrix.
According to the fundamental theorem of linear algebra, the necessary and sufficient condition for which
ω has real solutions is that the rank of
δ equals the rank of (
δ θ). According to the characteristic of the lower triangular matrix, the rank of δ is
. Therefore, the rank of (
δ θ) is also
, namely,
We deduce the relations further to simplify the formula. Defining
. If
, then
Combing Equation (5) with (7), we can deduce Equation (10):
According to Equations (6) and (8), we can deduce Equation (11).
. According to Equations (7) and (12), we can deduce Equation (13).
Due to
, Equation (14) is deduced from (13).
Therefore, can be obtained by recursion in sequence, while it is easy to solute using the result of and .
In order to compare the delay using DDFC with traditional DFC to download the file in theory, we used the two methods to download the same file. The file was divided into
n packets and the length of every packet is
l. The overhead of the decoding of the client was
ε and source node and the relay node uses degree distributed function
to encode the packets, respectively (there is one relay node in this example). The relay node encodes packets directly before sending to the client. Because the relay node does not need to decode data, we can get the transmission time using DDFC as Equation (15):
The is defined as a repeated index. The source node and relay node might send the same packet to the client, so the value of is ; is the ACK time which was returned to the relay node by the client when the data were decoded correctly.
Accordingly, using traditional DFC, the relay node has to decode the data received from the source node before re-encoding the data and sending to the client. Furthermore, it needs cascading feedback to the source. These processes increase transmission delay. The delay is as follows:
Obviously, as shown at Equation (16), although using traditional DFC can reduce the influence of retransmission due to packet loss, frequent encoding and decoding increase processing delay. Therefore, traditional DFC does not adapt to VANET, since the nodes move fast and topology change frequently. Compared with that, DDFC using distributed encoding method reduces the procedure of the encoding and decoding of relay nodes so that the transmission efficiency of cooperative downloading of VANET is greatly improved.