rithm is divided into two phases. In the spray phase,
the source node calculates the number of copies that
must be sprayed. This calculation is based on the
number of network nodes and on the desired de-
lay time for the message to reach the destination.
These copies are sprayed in an opportunistic manner
among the nodes that enter the transmission area of
the source node. If the message is not delivered to the
destination in the spray phase, the nodes initiate the
wait phase. In the wait phase, each node keeps the
message in its buffer until it comes across the destina-
tion node, and only then does it deliver the message.
Although dense networks are beneficial to the op-
eration of the Spray and Wait algorithm, in vehicular
networks, density becomes a trap and compromises
the performance of the algorithm. This negative ef-
fect occurs because the flow of vehicles becomes con-
centrated at intersections and traffic lights then spread
along different directions that vehicles may follow.
Such behavior causes some copies of the message to
be taken away from the destination. As a solution, the
Route Spray algorithm uses the routes of vehicles to
determine the best route through which to send a mes-
sage. The algorithm sprays messages only among the
nodes that will encounter the destination node, thus
preventing the messages from being sprayed among
nodes that can never deliver them.
3 ROUTESPRAY ALGORITHM
To perform routing, the RouteSpray protocol assumes
that vehicles are equipped with GPS and that in addic-
tion to knowing their route, they also know the route
of the message destination. Those are premises of all
position-based algorithms (Mauve et al., 2001). The
RouteSpray algorithm, however, differs from the oth-
ers for predicting the mobility of the destination node.
Furthermore, there is no need for a fixed network in-
frastructure; that is, it is possible to perform the rout-
ing among vehicles in a completely ad hoc manner.
The operation of the protocol is based on the use
of two types of messages: control messages and data
messages. Control messages are used to maintain the
state of a network, which is achieved by sending con-
text information to neighboring nodes. In order to
avoid conflicts of messages created at the same time,
each message generated in the network has a unique
identifier, which consists of the address of the source
node, the creation time of the message and a counter.
The process of information exchange and the rout-
ing decision making can be divided into three dis-
tinct stages. In the first stage, communication is ini-
tiated by a handshake, when nodes exchange infor-
mation about the packages that have already been de-
livered over the network, allowing for the control of
messages stored in the buffer, which is achieved by
deleting those that have already been delivered. In
the second and third stages, the nodes exchange in-
formation about the state of the buffer. The source
node sends its neighbor a list containing an identi-
fier and the destination of each message in its buffer.
With this information, the neighbor calculates, using
the pre-established routes, the time in seconds that it
will take to deliver each message. After the source
node receives a response from the neighboring node,
it is able to determine which is the best carrier for the
message. More details about the routing stages are
presented below.
Whereas node X entered the broadcast area of the
node Y, the three stages would be as follows:
In the first stage, X sends Y a handshake message
that carries the list of messages that had already been
delivered in the network. Upon receiving this infor-
mation, Y is able to go through its buffer deleting the
messages listed as delivered. At the end of this pro-
cess, with a consistent buffer, Y delivers the messages
addressed to X and sends X a list of the messages it
has in its buffer.
In the second stage, when X receives the list of
messages in the buffer of Y, X calculates the time
it needs to deliver each of these messages. Then, it
sends Y a list containing the identifier and the time
required to deliver each message. To calculate the de-
livery time of the message, X travels the destination
route of the message looking for a intersection point
with its route. At the end of this process, if X finds a
point of intersection, it returns the time in seconds it
takes to go from its current position to that point. If
such intersection point does not exist, the algorithm
returns a negative value, indicating that X is not able
to deliver the message.
Finally, in the third stage, when Y receives infor-
mation about the estimated time that X takes to deliver
each message, it is able to decide which is the best car-
rier for the message. To make this decision, Y needs
to estimate the time it takes to deliver the message it-
self and compare it to the estimated time returned by
X. If Y has more than one copy of the message, it will
use the binary spray technique to spray those copies
to X. If the estimated delivery time returned by X is
shorter than the estimated delivery time returned by Y,
Y forwards the messages to X, making it responsible
for delivering the message to its destination.
The entire routing process described above is pre-
sented in greater detail in pseudo-code:
input: message
CombiningtheSprayTechniquewithRoutestoImprovetheRoutingProcessinVANETS
585