DCAR : DTN Congestion Avoidance Routing Algorithm Based on Tokens in an Urban Environment

When a delay/disruption tolerant network (DTN) is applied in an urban scenario, the network ismainly composed ofmobile devices carried by pedestrians, cars, and other vehicles, and the node’s movement trajectory is closely related to its social relationships and regular life; thus, most existing DTN routing algorithms cannot show efficient network performance in urban scenarios. In this paper, we propose a routing algorithm, called DCRA, which divides the urban map into grids; fixed sink stations are established in specific grids such that the communication range of each fixed sink station can cover a specific number of grids; these grids are defined as a cluster and allocated a number of tokens in each cluster; the tokens in the cluster are controlled by the fixed sink station. A node will transmit messages to a relay node that has a larger remaining buffer size and encounters fixed sink stations or the destination node more frequently after it obtains a message transmit token. Simulation experiments are carried out to verify the performance of the DCAR under an urban scenario, and results show that the DCAR algorithm is superior to existing routing algorithms in terms of delivery ratio, average delay, and network overhead.


Introduction
The concept of DTN [1] originated in the interplanetary network and refers to the source node and the destination node is not necessary to maintain a complete communication link, according to the node's mobility to achieve a communication opportunity to complete the message transmission.As the research continues, DTN has played a crucial role in diverse application fields [2]; the main application includes the following: wildlife tracking network [3], vehicle network [4], marine sensor network [5], and urban environment network [6].
DTN is characterized as highly partitioned, sparsely connected, and intermittently connected ad hoc networks [7].In these challenging scenarios, end-to-end communication paths between node pairs are rarely available; thus, the process of a node transmitting a message must experience a higher delay [8].In order to overcome these network characteristics, DTN adopts the method of "store-carry-forward" to transmit messages [9].That is to say, messages are temporarily stored and carried by a node until an appropriate relay node arises [10].For this reason, the movement trajectory of nodes is one of the crucial factors that affects the message delivery ratio, delay, and network overhead in the process of transmitting of messages.
However, with the continuous development of low-cost mobile devices, mobile devices in people's lives have been widely used, which has resulted in many urban applications of DTN [11].However, existing routing algorithms such as epidemic routing [12], prophet routing [13], and spray and wait routing [14] can show efficient network performance in some specific scenarios.But they are not suitable for deployment in urban scenarios.Because the streets and other public places are fixed, the node density is relatively large, the movement trajectory of nodes depends on the habits of human life, and the network topology is constantly changing, real-time global network knowledge is difficult to obtain.Therefore, according to the characteristics of the urban scenario, proposing a DTN routing algorithm that is suitable for the urban scenario has been one of the key problems in the field of DTN.In this paper, we propose a DTN routing algorithm based on tokens.The algorithm divides the urban map into grids, and fixed sink stations are established in specific grids.The 2 Journal of Sensors number of grids covered by the communication range of each fixed sink station is defined as a cluster, each cluster is allocated a number of tokens, and a node can transmit messages after it obtains a message transmit token.As the number of nodes that transmit messages at the same time is reduced, simultaneously, the buffer size and the frequency of encountering fixed sink stations or the destination node are fully considered during the routing process, thus avoiding the occurrence of congestion in the network.
The rest of this paper is organized as follows.Section 2 presents related works.In Section 3, the network model and design principles are described.The DCAR algorithm is presented in Section 4. Section 5 describes the simulation experiments and results.Finally, conclusions are summarized in Section 6.

Related Works
At present, a great deal of research has been presented on the DTN routing protocol, which divides into a singlecopy and multiple-copy routing protocol based on the number of message copies in the network.In the single-copy routing protocol, the typical routing protocols are direct transmission routing [15] and first contact routing [16].In the multiple-copy routing protocol, epidemic routing [12], prophet routing [13], and spray and wait routing [14] are more typical multiple-copy routing algorithms.However, the above algorithms are not suitable for deployment in urban scenarios.With the profound research of researchers, several VDTN routing protocols were proposed in [17][18][19][20].These algorithms can show better performance when used in an urban scenario.However, in these algorithms, the composition of the mobile node mainly involves the node carried by the vehicle; pedestrians are rarely considered.
Meanwhile, Ayaki et al. refer to the characteristics of DTN applied in the urban scenario; these are proposed to set some static nodes in the urban areas to collect real-time information so that nodes can determine their own position according to these static nodes and select the appropriate node as the next hop [21].On this basis, Li et al. demonstrate that the node's movement area and encountering opportunity are closely related to the geographic position at some particular time points; and it is appropriate to deploy some fixed stations for data sinks in urban areas, which can improve network performance.Thus, they proposed a DTN routing algorithm called the GeoGrid algorithm for urban scenarios [22].Compared with traditional routing algorithms, it is more suitable for deployment in urban scenarios.However, under conditions of large node density, the algorithm makes it easy for the network to be congested.
In this paper, we propose a DTN congestion avoidance routing algorithm.The algorithm uses fixed sink stations as a data collection and publishing center; simultaneously, they also have the function of controlling allocation and collection of tokens.The algorithm divides the urban map into grids; some fixed sink stations are established in specific grids such that the communication range of each fixed sink station can cover a specific number of grids.In these grids region, a number of tokens are allocated.These tokens are controlled by the fixed sink station, and any two stations will not cover the same grid.Successful message delivery behavior in the network occurs between nodes and fixed stations or the destination node of the message.Each node maintains a grid table and regularly updates with this grid table while transmitting.This allows nodes to record their transmit activity in each region.When a node has messages that are required to transmit, it must obtain a message transmit token.As a node can transmit messages after it obtains the token, realize the concurrent transmitting of the message in the network, to avoid the occurrence of congestion in the routing process.

Network Model and Design Principles
In this section, we first introduce the network model and then present the establishment principles of fixed sink stations and the calculation principles of the grid region.

Network Model.
We model the network as a quadruple Net = {, , , }.Among them,  is a set of fixed sink stations in the network, and  is a set of grids in the network. is a set of nodes in the network;  is a set of connections between two nodes or a fixed sink station and a node.At instantaneous time , the set of grids is covered by the communication range of the th fixed sink station; that is, () = { Each node maintains a list Vir = (, , , , , Ψ), where  is the identifier of the node,  is the remaining buffer of the node,  is the number of times that the node successfully transmits messages to their destination node or fixed sink stations, and  represents the number of times that the node transmits any message to other nodes in every time interval. is the number of times that the node cannot obtain a message transmit token when it is required.Ψ is the twodimensional grid matrix.List Vir is constantly updated over time.

Fixed Sink Station Based DTN.
In order to adapt to the harsh environment of DTN, by referring to literature [22], we propose a new idea of fixed sink station establishment.In this paper, the location and the number of fixed sink stations can be changed, and a fixed sink station has the following three functions: (1) the first function acts as a data collection center or an Internet access point; (2) the second function is used to publish the collected information; (3) the third function is to control the allocation and collection of the token within the coverage of the fixed sink station.As shown in Figure 1, the mobile node  is under the coverage of fixed sink station , allowing node  to deliver messages to fixed sink station .If the fixed sink station  is located in area   , this delivery behavior implies node  once it arrived at area   .

Sink station
User In this paper, we assumed that each mobile node is equipped with a GPS module that can be utilized for positionlocating and clock synchronization.At the same time, the position coordinates of the fixed sink stations and the size of the urban map are global information for the nodes in the network.We establish a fixed sink station that follows four principles: (1) A fixed sink station is usually established in the large user node density area so that the fixed sink station can efficiently receive messages for mobile nodes.
(2) Any two fixed sink stations cannot directly transmit data to each other because two sink stations can communicate through the Internet rather than wirelessly.
(3) We define the number of grids covered by the communication range of each fixed sink station as a cluster, and any two fixed sink stations cannot cover the same grid.
(4) The fixed sink station can communicate with the mobile node that is covered by itself in any time; that is, when the fixed sink station receives a message from the mobile node, it can deliver the message to its destination node when the destination node is covered by itself.The mobile node can communicate with the fixed sink station when the distance between the node and the fixed sink station is less than its communication radius.

Calculation of Grid Region.
In this paper, we divided the urban map into × square grid regions.These grids can be represented as a two-dimensional matrix Ψ, which is shown as ) . (1) From Figure 1, we can see that the fixed sink station must be located in one of the square grid regions.For example, if the fixed sink station  located in () received a message, the delivering mobile node must have arrived in the grid near () or at the same grid.Then, the mobile node will record this grid by itself, and when it encounters another mobile node, they will know how this node arrived in the grid.In other words, the delivery capability of nodes is associated with the passing grid.The location information contains the geography longitude, latitude, and altitude.In real applications, the mobile node gets its own current grid through a series of calculations.To improve positioning precision, the location is determined using coordinate transformations.The calculating steps of current grid region are shown as follows.
Step 1.The method of literature [23] is used to obtain the geocentric coordinates of mobile nodes.In this study, the mobile node first obtains the geodetic coordinates of the nodes and transforms them into geocentric coordinates from the geodetic coordinates.In this process, the geocentric coordinate is established using the center of the Earth as the coordinate-origin, and the X-Y plane coincides with the equatorial plane of the Earth, and the positive direction of the -axis points to the North Pole.Let  represent the mobile node location.  is the projection position of  on the X-Y plane.Point  gets its own geodetic (, , ℎ) from GPS, and then point  geocentric ( 0 ,  0 ,  0 ) can be shown: where  0 represents the geocentric latitude of point . represents the longitude, and  is the equivalent radius of the Earth.The relationship between the geodetic latitude  and geocentric latitude  0 is shown as follows: where  represents the length axis of the Earth and  represents the short axis of the Earth.Using 1983 IUGG recommendation  = 6378136 m and  = 6376751 m.Thus, putting (3) into (2), we can obtain ( 0 ,  0 ,  0 ) as shown: Step 2. The upper-left corner of the urban map is represented as 1, and a Cartesian coordinate is established by the 1.
The positive -axis points to the south and the positive axis points to the east; the direction of -axis is the opposite of the direction of gravity.Furthermore, the geodetic coordinate (, , ℎ) of 1 is global knowledge to all nodes, and its geocentric coordinate (, , ) can be derived by Step 1. From the literature [22], ( 2) is used to get the unit vector of the X-, Y-, and Z-axis; we can get the X-, Y-, and Z-axis unit vector matrix: Then, the location ( 0 ,  0 ,  0 ) of mobile node  in the new Cartesian coordinate system can be described as Step 3. When a mobile node's delivery or transmitting behavior occurs in a grid, the node should update the current grid variable   , which belongs to the matrix Ψ.After its own geodetic (, , ℎ) is got from the GPS module, the calculation of the grid region is shown as where  represents the width of the square grid.The value of  depends on the node's coverage radius.Using the above three steps, the mobile node can accurately calculate the grid region where they stay at the current time.

DCAR Routing Algorithm
According to whether nodes are covered by fixed sink stations, the nodes in the network can be divided into two categories; thereby, there are two situations in the process of routing.Situation one is when nodes are dense and covered by fixed sink stations.In this situation, nodes can transmit messages after obtaining message transmit token; situation two is when nodes are sparse and nodes are not covered by fixed sink stations.In this situation, nodes can transmit messages that are not limited by tokens.Let us introduce each of these two situations in more detail.

4.1.
The DCRA Routing Algorithm Used in Situation One.The DCRA routing algorithm in situation one mainly includes the following four pieces of content: allocation of the node's identifier; allocation of token; selection of relay node; and selection of message.

Allocation of Node's Identifier. The identifier of any node
in the network is a triple , where  = (, V, ),  is the ID of a fixed sink station that covered node , V is the ID of a grid region where it is staying, and  is the node ID in grid V.When a new node is added to arbitrary grid (), the DTN node ID allocation method is used to allocate a node ID for the new node.In this paper, the DTN node ID allocation method is defined as follows: for an arbitrary grid (), the node ID set is  = {(1), (2), . . ., (), . . ., ()}; if a new node joins the grid (), the node ID assigned to the new node is () = max() + 1, where  ∈ , and the identifier of all nodes will regularly update in a period .
The update principle is that the node ID is the largest in the current period, and it will be the smallest in the next period.

Allocation of Token.
We define the range covered by each fixed sink station as a cluster.Each cluster contains a fixed sink station, and each cluster consists of multiple grids.
There are three kinds of tokens in a cluster: that is, message transmit token, probe token, and reserve token.The fixed sink station controls all the tokens within the grid, which is covered by itself, and regularly updates the number of tokens in a period .We will introduce the main functions of these three tokens in the following sections.The function of the message transmit token is to control node transmit messages; that is, a node must obtain a message transmit token before selecting the next hop node and other operations.When a node completes transmit messages, the fixed sink station will require the message transmit token to be collected.The number of messages transmit tokens that can be allocated in a cluster is ⌈/⌉, where  is the number of nodes in the cluster and  is the adjustment factor.
The function of the probe token is to detect which nodes have messages that are required to be transmitted and request a message transmit token from the fixed sink station for the node.In a cluster, the number of probe tokens is one, and the fixed sink station monitors the probe token in real-time.The probe token in each cluster continuously probes whether the nodes in the grids have messages to be transmitted based on a cycle ascending order of the grid ID and the ID of nodes in the cluster (i.e., the node with the smallest grid ID and node ID will be detected after detecting the node with the largest grid ID and node ID).When a node has messages to be transmitted, if the cluster has idle message transmit tokens, the probe token requests a message transmit token from the fixed sink station to allocate to the current node for transmitting messages.Otherwise, the number of times that the node has not been given a message transmit token (i.e., ) is increased by one, and the probe token will continue detecting which node has messages that require transmitting.When the number of times that a node cannot obtain the message transmit token reaches the threshold value Δ, a reserve token is requested from the fixed sink station for the node, allowing it to select the next hop node and other operations.
Similarly, we can describe the function of the reserve token.The reserve token is allocated by the fixed sink station to a node to transmit messages when the number of times a node fails to obtain a message transmit token reaches a threshold value at the same time that no idle message transmit tokens exist within the cluster.The node can select the next hop node and other operations after obtaining a reserve token, and the number of reserve tokens is not limited.

Selection of Relay Node.
At time slot , node  in the grid   has messages that are to be transmitted, and it has obtained a message transmit token.If a fixed sink station or one of the destination nodes of messages is in its neighbor node set , the messages are transmitted preferentially to the fixed sink station or the destination node.Otherwise, the utility value of any node in the neighbor set is calculated.∀ ∈ , Λ =  ×  () where () is the number of times the node  transmits messages to theirs destination nodes or fixed sink stations.  represents the number of times that node  transmits messages to other nodes in every time interval.   represents  node's transmit behavior in the grid   .When Λ > Λ, the node  will be one of the next hop nodes of node .

Selection of Message.
Any message  in node  has a weight   ; when   <   , the message  will be transmitted to node .  is calculated as follows: where  is the destination node of the message .   () represents the number of times that node  delivers messages to node  or fixed sink stations in time ;   tosize is the total buffer size of node .  lesize is the remaining buffer size of node .

The DCRA Routing Algorithm Used in Situation Two.
Because nodes are not covered by fixed sink stations, the major task of this situation is to transmit messages to a node that frequently encounters fixed sink stations or the destination node.So, node  will be selected as the relay node when Γ  < Γ  .Γ  is calculated as follows: where () is the number of times node  transmits messages to their destination nodes or fixed sink stations.() is the number of times that node  transmits messages to fixed sink stations and 1 + 1 = 1.

Simulation and Results
In order to better verify the efficiency of the DCAR algorithm, we will compare the algorithm with the epidemic routing algorithm [12], the prophet routing algorithm [13], and the GeoGrid routing algorithm [22] in terms of the message delivery ratio, average delay, and network overhead.

Simulation Environment.
We use the opportunistic network environment (ONE) [24,25] simulator to simulate the proposed algorithm.In order to simulate the urban environment, we set up public places such as schools, cinemas, parks, and other public places in the simulation.The specific parameters are shown in Table 1.There are four kinds of nodes in the simulation, including fixed sink stations, pedestrians, cars, and trams, as shown in Table 2.

Delivery Ratio.
The delivery ratio is the ratio of successful deliveries to generated messages within a given time period [26].A routing algorithm with a good performance must have a high delivery ratio.
Figure 2(a) illustrates the changes in the message delivery ratio when the buffer size is varied from 5 to 30 M; with the increase in node buffer size from 5 M to 30 M, the delivery ratios of the epidemic algorithm and prophet algorithm gradually increase.The delivery ratios of the DCAR and GeoGrid algorithms are relatively stable during the period 5-30 M, and the delivery ratio of the DCAR is significantly greater than the three compared algorithms.Figure 2(b) depicts the changes in the message delivery ratio when the simulation time is varied from 30 to 150 h.It can be seen from Figure 2(b) that the delivery ratios of the epidemic and prophet algorithms are closely matched, and the delivery ratio of the GeoGrid algorithm is higher than both of them.However, in these four algorithms, the delivery ratio of the DCAR algorithm is significantly higher than the other three compared algorithms.Overall, the delivery ratio of the DCAR algorithm is higher than the epidemic algorithm, prophet algorithm, and GeoGrid algorithm; in the DCAR algorithm, nodes transmit messages are controlled by tokens and always transmit messages to a node that has a high possibility of encountering the destination node or fixed sink stations, therefor increasing the delivery ratio of the message.

Average
Delay.Average delay is the average time between a message being generated and successfully received by a fixed sink station or destination node.
Figure 3(a) illustrates the changes in the delay when the buffer size is varied from 5 to 30 M; as can be seen from Figure 3(a), on increasing the node buffer size, the message delays of all four algorithms increase.But the delay of the DCAR algorithm is considerably lower compared to the other three compared algorithms.Figure 3(b) displays the changes in the message delay when the simulation time is varied from 30 to 150 h; it can be seen from Figure 3(b) that the delays of all four algorithms are relatively stable during the period 30-150 h.The delays of the epidemic algorithm and prophet algorithm are closely matched, and the delay of the DCAR algorithm is obviously lower than the other three compared algorithms.Overall, the DCAR algorithm shows better performance in terms of delay; in the process of transmitting a message, the DCAR algorithm selects reasonable messages to transmit to a relay node, and thus the message can be transmitted to the destination node or a fixed sink station in a timely manner, therefore reducing the time that it stays in the network.

Overhead.
The overhead ratio reflects the network load to some extent.Network overhead is the ratio of the number of messages that are not successfully delivered to the destination node or fixed sink stations and the number of messages that are successfully delivered to the destination node or fixed sink stations.A better routing algorithm should have a lower overhead ratio.
Figure 4(a) illustrates the changes in the network overhead when the buffer size is varied from 5 to 30 M; as can be seen from Figure 4(a), when the buffer size increases from 5 to 30 M, the overheads of the four algorithms are all decreasing.But the network overhead of the GeoGrid algorithm and DCAR algorithm decreases to a relatively lesser extent.When the buffer size increases from 5 M to 30 M, the network overhead of the DCAR algorithm is less than that of the other three compared algorithms.Figure 4(b) depicts the changes in the overhead when the simulation time is varied from 30 to 150 h.During the simulation period 30-150 h, there are relatively fewer changes in the network overhead of all four algorithms; the overhead of the epidemic algorithm is the largest, whereas that of the DCAR algorithm is the least.
In total, the network overhead of the DCAR algorithm is less than that of the other three compared algorithms.This is mainly because the node's buffer is taken into account during the message transmitting process, and the DCAR algorithm transmits messages to a node which encounters fixed sink stations or the destination node more frequently after it obtains a message transmit token.Therefore, network overhead is decreased by reducing unnecessary copies of messages.

Conclusion
Because the existing DTN routing algorithms cannot be applied well in urban scenarios, we propose a DCAR algorithm.The algorithm establishes fixed sink stations as a data collection and publishing center; simultaneously, fixed sink stations also control the allocation and collection of tokens in the network.A node can transmit messages after it obtains a transmit token, thus realizing the concurrent transmission of messages.The algorithm can not only choose a node that has a larger remaining buffer size as the relay node for transmitting messages but also reduce the number of nodes of transmit messages at the same time, effectively avoiding congestion.Simulation results show that the DCAR algorithm shows better network performance in terms of the message delivery ratio, delay, and network overhead.

Figure 1 :
Figure 1: Distribution of fixed sink stations.

Figure 2 :
Figure 2: Delivery ratio with varying buffer size and simulation time.

Figure 3 :
Figure 3: Delay with varying buffer size and simulation time.

Figure 4 :
Figure 4: Overhead with varying buffer size and simulation time.

Table 2 :
Assignment of nodes.