Cooperative Downloading in Mobile Ad Hoc Networks: A Cost-Energy Perspective

Cooperative downloading in mobile ad hoc networks is an effective way to improve the efficiency of downloading files. This work addresses the problem while distributing content to a group of mobile terminals (MTs) that cooperate during the download process by forming mobile ad hoc networks. However, the efficiency, cost, and energy consumption of cooperative downloading are sensitive by content distribution, which is a challenge to get the optimal in mobile ad hoc networks. This paper proposes a cost distribution (OCD) algorithm and a content distribution algorithm based on auction (OCDA) for mobile ad hoc networks based on relative location of nodes and local optimization theory. In order to make cooperative users take part when the downloading is beginning, several rounds of content distribution approach are designed based on users' relative location in the cooperative ad hoc network. To satisfy users' personal demands, the paper also designs a local optimization mechanism based on cost and energy. The simulation results show that the cost and content distribution method can achieve better performance, higher downloading efficiency, and lower energy consumption than the self-organized market algorithm (SOMA) and the average distribution algorithm (ADA).


Introduction
Mobile ad hoc networks (MANETs) are nodes self-organizing and self-managing in a distributed way. The networks consist of mobile nodes that communicate with each other. MANETs have some special characteristics, such as no center and dynamic topology [1].
In the recent years, most research efforts have been put into MANETs, such as routing protocol and cooperative network security. Among these research fields, the nodes and cooperative networks have gained more attention as they overcome the limitations of single node capacity in MANETs. Cooperative downloading in MANETs is used as a way to improve the efficiency of information delivery among a group of mobile nodes. At present, almost mobile phones are equipped with the wireless communication modules (such as Wireless-Fidelity and Bluetooth) which allow the users to communicate with others located within one-hop communication range. Then, the messages will be disseminated and shared among a group of mobile phones users [2].
Generally, mobile phone users watch the video or download the files from 4G (4th-generation wireless communications systems). This is comfortable for users with the development of 4G technology, however, to watch or download a video (i.e., 1 GB movie) that is luxury for most users. Cooperative method in this environment will be effective to reduce the cost. The users may form an alliance to download one movie and share with other users in this alliance. This can be used in the place such as railway station, subway, stadium, park, school, and other public places. These places provide opportunities for users to collaborate with each other through the spontaneous ad hoc interaction of diverse users [3] (e.g., watching a sports game in a stadium, waiting at a train station, watching a film in a park, and studying in a school).
Cooperative downloading is an interesting paradigm that it is easy for implementation in modern multiple-interface (MTs) in the wireless communication [4]. Cooperative downloading as an effective way to reduce the costs and decrease the downloading time and the energy consumption has attracted an extensive research attention recently. The 2 International Journal of Distributed Sensor Networks cooperative mobile-to-mobile file dissemination that is based on the uplink/downlink traffic imbalance in 3G wireless networks has been shown to decrease the file downloading time [5]. A cooperative file downloading scheme is proposed to share the burden of file downloading activities that several neighboring nodes act as proxies [6]. In [7], the collaborative urban computing (CUC) paradigm is present which supports serendipitous cooperation between a set of users physically located in an urban environment and all sharing a common goal.
The collaborative stream among mobile users has been shown which can decrease the communications cost [8]. A cost model is built to encourage collaboration among users and a proper accounting scheme is introduced to support interactions [9]. The wireless cooperation approach, followed in the present paper, differs from the latter mainly for the instantaneous payoff (i.e., energy consumption gain) each user experiences in the collaborative cluster [4]. In [10], the cooperative framework is proposed which encompasses awareness of the potential gain of cooperation and adapts the choice of the content sharing strategy to different cooperative scenarios. One of the major goals of cooperative methods among the mobile phones is to decrease the energy consumption. The cooperative energy-efficient content distribution among a number of MTs has been shown which can decrease the energy consumption [11]. Recently, there are activity researches on energy consumption to reduce the energy consumption of mobile phone in the cooperative downloading systems. Many studies show that the high energy consumption of mobile phones will be one of the key limiting factors in future wireless communication systems [12][13][14][15]. The authors in [16,17] minimize the total energy consumption of the MTs where they cooperatively multicast the content to each other by forming MANETs. Most of these works have designed energy-efficient content distribution protocols based only on few selected network parameters and not considering the costs and benefits of nodes.
In this work, first, we divide the cooperative nodes into two groups (request group and downloading group) and use the negotiation way to form the groups. Then, a fair cost distribution approach is presented to the request group which considered the cost performance and the requirement. And we also present a local optimized approach that is based on the relative location and considered the cost-energy for cooperative content distribution to the downloading group. This paper is organized as follows. Related work is discussed in Section 2. Section 3 presents the system model that includes assumption and defines topological structure and the formation of cooperative group. Section 4 describes the algorithm of OCD and OCDA. Simulation results and analysis of OCD and OCDA are present in Section 5. Finally, conclusions are drawn in Section 6.

Related Work
The previous work is discussed briefly as follows. Recently, to improve content downloading modalities, intense research activities are conducted through the multiple wireless network interfaces of the MTs. The users take the MTs with the different wireless network interfaces to associate with the same device owned by nearby users [18]. The cellular and short-range integration has been shown to improve the performance in the ad hoc network [19]. To minimize the streaming cost, the multimedia data among mobile devices are shared to use a CHUM (cooperating ad hoc networking to support messaging) method, in which one of the peers shares the multimedia content with other peers [20]. Then, a cooperative file downloading scheme is proposed to share the burden of file downloading through several neighboring nodes [6]. Similarly, another scheme [21] is proposed to download the parts of the content randomly from the base station (BS) and share them to their neighbors through long range (LR) link interface and short range (SR) link interface.
In [10], the cooperative communication architecture has shown the energy consumption and transfer delay benefits. The energy consumption of wireless interface cards is measured from the host terminal in [22]. The total energy consumption is predicted to make these attached wireless cards more energy-efficient using an energy saving algorithm to choose the optimal interface. However, the optimal energy minimization in this scheme is not considered. In the recent years, energy-aware protocols for content distribution are gaining increasing attention such as in [12][13][14][15][16]23]. The work in the [16] is an NP-hard problem to minimize the total energy consumption of the MTs. Because the transmit energy value is higher than the received energy value, the authors only consider the transmit energy value of the MTs. The authors in [24] subdivide the video stream into subsets and distribute the subsets equally to each MT according to the number of requesting MTs. The wireless local area network (WLAN) is used to send the subsets to each MT and Bluetooth is used to receive the remaining subsets. The collaboration method can reduce the energy consumption significantly. In [25], a content distribution algorithm is proposed to distribute the content fairly in P2P environment. It sends the equal parts of the content to each MT through LR by using the LTE and then MTs share the content through SR by using Bluetooth. The authors in [26] divide the video into substreams according to the interest by using a coding scheme. The substreams are downloaded by MTs through LR and then sent to the other cooperating MTs through SR. The simulation result of the code scheme to use the general packet radio service on LR and Bluetooth on SR shows that the energy consumption can reduce to 50% in two cooperating nodes.
Literature [6] focuses on the large file downloading that let a client node request and the nearby nodes help to download the different pieces of the same file acting as proxies. The pieces of the file are downloaded by using the cellular and send the pieces of the file to the request node to use the Wi-Fi interfaces. However, the energy and costs of the nodes acting as proxies are not considered in this scheme. The authors in [27] take all MTs as a cooperating group and the formed group downloads parts of the content through LR and then forwards it to all other MTs through SR. In this paper, the implications and gains of the MTs in the group International Journal of Distributed Sensor Networks 3 are also not discussed. The most present papers focus on the energy consumption and lack considering the cost reduction of the mobile users. In [9], a cost model is built to encourage collaboration among users and a proper accounting scheme is introduced to support interactions. Unlike the solution in [6,27], the scheme in [9] allows the cooperating nodes to accumulate credits from the provider. Another scheme in [7] is present to support the downloading in an urban environment. The self-organized market algorithm (SOMA) is proposed to encourage the nodes to participate in the cooperating downloading. However, the optimal energy and cost minimization in these works are not considered. To the best of our knowledge, literature [7] is the only recent work that closely related to our work, so we will compare our scheme with the SOMA. In our work, we consider the cost and energy consumption and use the local optimal solution to distribute the content in mobile ad hoc network. The contributions of this paper can be summarized as follows: (i) Formulating the cost and content distribution problem and presenting the optimal solution in iterative way.
(ii) Establishing the topology model that is based on the relative location.
(iii) Proposing a centralized cost distribution algorithm for the request nodes and a content distribution algorithm based on auction for the downloading nodes which approximates the optimal solution with improved performance.
(iv) Comparing the proposed scheme of the recent work and showing that the energy consumption and cooperative downloading time are reduced.

System Model
The traditional cooperative downloading networks are closed to other nodes and nodes leaving the networks will carry off parts of content that waste the network resource. The novel cooperative downloading scheme is proposed to use the nodes' relative location to distribute the content. The advantage of this method can reduce the content lost when the mobile nodes leave the network and also can make the other nodes participate when the downloading is beginning. In our work, all nodes have Wi-Fi communication modules and can become hotspots that can get information from their neighbors. The nodes also can access the 4G server to get information. LTE-advanced 4G and Wi-Fi technology are combined in this scheme to cooperate downloading for mobile users. This can effectively reduce the cost and benefit for the cooperative nodes. The novel cooperative downloading scheme is depicted in Figure 1. This system included three phases as follows: (i) Form Group. The users through server form two groups (request group and downloading group).
(ii) Content Auction. The server auctions the content to cooperative downloading nodes. (iii) Cooperative Downloading. The downloading group downloads the content and then delivers it to request group.

Assumptions and Definitions.
The assumptions in this system are as follows: (i) The location of each node is known by server through the Global Positioning System (GPS) service at any given time.
(ii) Each node is equipped with Wi-Fi module that has the capability of short-range wireless communication.
The definitions in this paper are as follows: (i) Request Node (RN). The node is actively or passively request the downloading task. Considered set of request nodes is called request group (RG).
(ii) Downloading Node (DN). The node is cooperative downloading from the server. Considered set of cooperative downloading nodes is called downloading group (DG).
(iii) Cooperative Downloading Network (CON). Cooperative downloading network is composed of the request group and downloading group. The size of the CON is the scope of all request nodes covered.
(iv) Stable Downloading Time (SDT). All request nodes and downloading nodes in this time will not leave the cooperative downloading network.

Topological Structure and Content Predistribution.
The mobility of nodes is considered by this scheme because it will change the topology of cooperative networks. The nodes leaving or joining the networks frequently will waste the resource and reduce the efficiency of downloading. The topology of the network is shown in Figure 2. Consider a set, = { : 1, 2, . . . , }, of the RG that is interested in downloading the file and similarly = { : 1, 2, . . . , } of the DG that agrees to participate in downloading together. The coverage radius of node is denoted . The space distance between the node and the other nodes is ( , ∪ ). The relative velocity between the node and the other nodes is denoted V , ∪ . The stable time is denoted as follows: In this scheme, if stable time is too short, the numbers of content distribution rounds will increase and then influence the efficiency of cooperative downloading. The relative stable time is introduced to avoid this kind of situation. The relative stable time is denoted as sd . The stable time can also be denoted as follows: The content distribution is designed based on SDT and distributed by several rounds. In the first round, the stable time is assumed as (1) sd and the data transfer rate of DN ( ∈ ) is assumed as (1) . So the maximum content size of can be calculated as follows: The first round of maximum content size (1) 1 can be calculated as follows: The number of rounds of the content distribution is assumed as ; the total size of the file is assumed as that can also be calculated as follows:

Cooperative Request Group (RG).
When request node needs to download information (i.e., files, video) that will send the cooperative downloading request to the server, after the server received the request, it will search the other potential cooperative request nodes according to its geographic location. The cooperative downloading request message is designed as ⟨ ,max , , , , , pr ⟩: (i) ,max denotes maximum cost of the user ( ∈ ) that is willing to pay for the server.
(ii) denotes the content downloading rate of the user ; its value is between [0, 1]. 0 denotes the case when downloading task is not beginning and 1 denotes the case when the downloading task has completed.
(iii) denotes actual time that the user takes to complete the downloading task. It is known by user and the server.
(iv) , denotes maximum delay to complete downloading that the users can endure. If is bigger than , , that means that the server cannot earn the full cost and needs to pay fine to users.
(v) pr denotes penalty rate that the server needs to pay fine to user . If , is bigger than , that means that the server needs to base this penalty rate to pay fine to user .
After receiving the request, the server will ask the other user nodes if they want to participate in this RG according to request and other information (i.e., hobby, geographical location). The ask message will include the price of the downloading task. The price is decided by the file size, popularity, network environment, and others. The price model of server is as follows: is the based cost of the file, is the number of file downloading requests, is the maximum number of file downloading requests, is the time of file from appearing to now, is the price control factor, and 2 / is the popularity of the file. The users can decide if they are willing to participate in this RG according to this price and their interest. Figure 3 shows the process of RG formed. User 1 as the request initiator sends request to server and then server proposes user 2, user 3, and user 4 to participate in this RG. User 3 and user 4 are not interested and reject to participate in this downloading task. At last, user 1 and user 2 will form the RG. The server will calculate the users' cost of the RG and then reply to the users of the RG. The server will deduct the cost if the users accept the cost. If the users all reject, the request user will be the only node of RG and need to pay all cost of the file.

Cooperative Downloading Group (DG).
After request group formed, the next step is to form downloading group. The server will search the DNs according to the location of the RG. The server will ask the searched nodes if they want to participate in this DG to download the task through Wi-Fi or 4G. The ask message of server is designed as ⟨ ,max , , , , , pr ⟩: (i) ,max denotes maximum cost of the server that is willing to pay for the DNs.
(ii) denotes the content size that the server distributed to user of the DG.
(iii) denotes actual time that user of the DG takes to download . It is known by user and the server.
(iv) , denotes maximum delay that the server can accept to download . If is bigger than , , that means that user of the DG cannot earn the full cost and needs to pay fine to the server.
(v) pr denotes penalty rate that the rate of user needs to pay fine to the server. If is bigger than , , that means that the user needs to base this penalty rate to pay fine to the server.
After the user received the ask message, the user will decide if he/she wants to participate in this DG according to this information. The benefits are used to motivate users to participate.

Algorithm Description
The mobile users in actual world are various and the demand is different, so, in this paper, we choose cost performance as a standard to distribute the cost fairly. All RNs have to send the demand information to server before RG is formed. The cost is distributed by the server according to the demand information.

Algorithm of Cost Distribution.
The distribution vector of cost is assumed as ( ) = ( 1 , 2 , . . . , ). In order to improve the different experience of users to download, cost performance is used as the utility function. It is defined as follows: So the optimal cost distribution problem is to solve the following formula: The Lagrange function is constructed to solve the problem as follows: The Karush-Kuhn-Tucker conditions are as follows: So the cost distribution of the user is as follows: However, if you want to solve you must know the Lagrange multiplier vectors and . The dual problem is used to earn the Lagrange multiplier vector in this paper. The dual problem of the original problem is as follows: The dual problem function is differentiable. The gradient iteration method is used to earn the Lagrange multiplier vector and the method is as follows: Δ ( , ) is the step length of iteration and decides the convergence of the algorithm. The algorithm of the cost distribution is as shown in Algorithm 1.
It takes the request message ⟨ ,max , , , , , pr ⟩ as the initialization and input parameters. Then, the server calculates ( ) according to these parameters. The next step is to adjust parameters until the error meets the requirement. The RNs send their ,max to the server The server gets the ,max = ( 1,max , 2,max , . . . , ,max ) The server calculate the formula (11) to get ( ) Then the server get the ( ) end if (8) if (∑ =1 ( ) − ( −1) ≤ ) then (9) break (10) end if (11) end for (12)

Algorithm of Content Distribution Based on Auction.
When the server earned the cost, it will distribute the content to DG. In this phase, the server will auction the content to the DNs. The content distribution is decided by the price, the energy, and the downloading ability in this algorithm. ( 1 , 2 , . . . , ). The content is distributed by the server; the lower the bids of the cooperative downloading nodes are, the better it is for the server. The energy consumption is also considered, so the lower the energy consumption, the better the DNs.

Content Distribution
The all distributed cost of server is ; the distributed costs of the round are ( ) = ( ) / . The utility function of the DG (1, 2, . . . , ) is . The content size of the DG distributed in the round is ( ) . The distributed content size of the DN is according to the bid of the DN . The content distribution vector of the DG in the round is . . , ( ) ). The DN sends the bid ( ) to server and then the server distributes the content ( ) ( ) to the DN in the round. The energy consumption in the round is ( ) ( ( ) ). The optimal content distribution problem is to solve the following formula: In formula (17), ( ) sd is the stable time and ( ) is the actual time that user takes to download ( ) in the round. In formula (14), the utility function of the DN in the round is ( ) ( ) ( ) ( ( ) ). However, the unit of benefits and energy consumption is different and it will lead the result irrationality so that the dimensionless processing is needed. The dimensionless processes are as follows: In formula (18), ( ) ( ( ) ) is the actual value and ( ) ( ( ) ) is the dimensionless value. In formula (19), ( ) ( ( ) ) is the actual value and ( ) ( ( ) ) is the dimensionless value.

Energy Consumption Model.
The energy consumption of DN that received the content from server to use Wi-Fi is denoted as ( ) , . The size of the Wi-Fi packet and the head of packet are denoted as and ℎ , so the size of content that the DN received is ( ) /( − ℎ ). The DN received the a packet will return an ACK confirm packet to server, the energy consumption of ACK packets is not considered because they are too small compared with the data packets. So The energy consumption of DN that received the content from server to use 4G is denoted as ( ) , . The size of the 4G packet and the head of packet are denoted as and ℎ , so the amount of data that the DN received is ( ) /( −ℎ ).
, is the 4G downloading data rate, and , is the unit energy consumption of DN downloading the content through the 4G.
The energy consumption of DN transmits the content to RG to use Wi-Fi that is denoted as ( ) , . So ( ) , = ( ) , / ( ) , ( − ℎ ), ( ) , is the Wi-Fi data transmission rate, and , is the unit energy consumption of the DN that transmits the content through Wi-Fi. The energy consumption model of DN is defined as follows: The ratio of DN that used the Wi-Fi to download is defined as ( ) , the ratio of DN that used the 4G to download is defined as ( ) , and ( ) + ( ) = 1.

Content Distribution Model. ( ) ( ) denotes the
downloading time of the distributed content ( ) . In this model, the DG downloads the content and then sends it to RG immediately, so the downloading time of the distributed content ( ) can be calculated as ( ) The Lagrange function is constructed to solve the problem that is as follows: The Karush-Kuhn-Tucker condition is as follows: So the content distribution of the DN is as follows: However, if you want to solve you must know the Lagrange multiplier vectors and . The dual problem is used to earn the Lagrange multiplier vector in this paper. The dual problem of the original problem is as follows: ) .
The dual problem functions are differentiable so the gradient iteration method is used to earn the Lagrange multiplier vector and the method is as follows: After iteration, ( ) Δ ( , ) ≥ 0 is the step length of iteration and decides the convergence of the algorithm. The algorithm of the content distribution is as follows.
The first step of Algorithm 2 is to initialize the parameters.
Third, the DNs adjust ( ) ( +1) according to the received ( ) ( ) and send ( ) ( +1) to the server. Steps 5 to 10 are continuing to cycle until the error to meet the requirement.

Simulation Results and Analysis
There is only a source of content distribution in this simulation model. In order to be close to the reality that users have different downloading demand, this model set up a variety of nodes that have different sensitivity to the expenses and downloading time. In our simulation, the MAC protocol of Wi-Fi is 54 Mbps 802.11 g and LTE-advanced 4G is 100 Mbps. The average downloading speed of Wi-Fi is assumed as 1.8 MB/s and 4G is 6.0 MB/s. The energy consumed on the reception is following the experimental measurements in the work [28]. The results have shown that the energy consumption during reception on the SR is 0.925 joules/sec and LR is 1.8 joules/sec. So the energy consumed per unit size is calculated according to the model work [28]. The simulation parameters are presented in Table 1.
To assess the performance of the proposed scheme, a 100 m × 100 m area is selected and the nodes of DG use the rand direction model to move. After the system starts, the nodes from the initial positions randomly select a direction at the speed of V to move. When the nodes reach the boundary, they will suspend time and then randomly select next direction to move to in the area. The motion will be repeated until the end of downloading. The speeds of the DNs V are between 0 m/s and 5 m/s. The fifty times motion state is selected to calculate the average sum energy consumption and average downloading time. In order to verify the performance and convergence of the algorithm OCD and OCDA two group experiments are carried out. The first group experiment is mainly to verify the convergence and performance of the algorithm OCD. The second group experiment is to verify the convergence and performance of the algorithm OCDA and mainly to compare with the SOMA algorithm [7] and the average distribution algorithm.

The Convergence and
Performance of the OCD. The four nodes of RG are used to assess the performance of the OCD. Figure 4(a) shows the cost distribution with iteration in this algorithm. ,max of the RNs are assumed as RN1,max = 80, RN2,max = 100, RN3,max = 160, and RN4,max = 200. , of the RNs are assumed as ,1 = 3600 s, ,2 = 2400 s, ,3 = 1800 s, and ,4 = 1200 s. When ,max is higher, the cost distribution is higher. It shows the fair distribution of cost. However, the cost distribution is not linear because , is considered in this algorithm. The lower ,max and the longer , , the lower the cost distribution. The distribution cost of the RNs is stabilized at about 58, 86, 124, and 165. The cost distribution algorithm in the iteration is stabilized after about 12 times. Figure 4(b) shows the cost distribution with iteration that includes selfish nodes in this algorithm. In this simulation, the RN4 is the selfish node and set 4,max = 40, , = 1200 s, and the other set is the same. The distribution cost of the RNs is stabilized at about 74, 102, 142, and 73. However, the cost distribution in the figure of RN4 is more than 40. In this condition, the server will ask the RN4 if he/she is willing to accept the cost. So the selfish node will not earn lower cost than 40. The cost distribution algorithm in this condition in the iteration is stabilized after about 15 times. Figure 5(a) shows the cost distribution compared with the SOMA algorithm and the ADA algorithm. The ADA distributes ( ) averagely so the costs of the RNs are  the same. The SOMA distributes the cost based on the battery charge level and signal strength level. The OCD considers the demand of the nodes to distribute the cost. Reducing the time , , the cost distribution of the RNs to use the OCD algorithm is increasing. However, the cost distribution of the RNs to use the ADA algorithm is the same and that to use the SOMA algorithm is random. Figure 5(b) shows the cost distribution includes selfish nodes of RN4 in this algorithm. The cost distributions of the RNs to use the ADA and SOMA algorithm are the same as in Figure 5(a). The RN4 cost distribution is the selfish node, however, the cost is not lower than ,max = 40. In this condition, the distributed cost of the other three nodes is a little higher as shown in Figure 5(a). The cost of the other nodes is also lower than their ,max and is in the tolerated scope.  are more than the DN1 and DN2, that is, because of their higher downloading data rate, lower bids, and lower energy consumption. Figure 7(a) shows the energy consumption compared with the SOMA algorithm and ADA algorithm. The ADA distributes the content averagely so the energy consumption of DN1, DN2 is the same and of the DN3, DN4, and DN5 is the same. The SOMA distributes the content which does not consider the energy consumption, so the energy consumption of the five DNs is different. The OCDA considers the energy consumption of DNs to distribute the content, so the energy consumption of the five DNs is relative equilibrium.  The profits of ADA are also the same and SOMA is different. The sum profits of OCDA are lower than ADA and SOMA which means the server needs to pay less to the DG. The profits of OCDA are relative equilibrium compared with the SOMA and ADA. Figure 8(a) shows comparison of the average sum energy consumption in case of the downloading ratio using Wi-Fi. With the ratio of downloading increasing, the sum energy consumption is also increasing. The average sum energy consumption of OCDA is 3.44% lower than ADA and is 2.70% lower than SOMA. It is means that our algorithm has less average energy consumption than the other two algorithms. Figure 8(b) shows comparison of the average downloading times in case of the downloading ratio using Wi-Fi. The average downloading time of OCDA is 2.10% less than ADA and is 15.51% less than SOMA. It is obvious that our algorithm has less average downloading time than the other two algorithms. Figure 9(a) shows comparison of the average sum energy consumption in the case of the different average speeds. The average sum energy consumption goes up along with the nodes speed increase. However, the average energy consumption of ADA and OCDA begins to decline at the speed V which is 4 m/s. With the speed increasing, the repeated downloading contents are decreasing because the nodes in the network time are also decreasing, so the sum energy consumption is reduced. Figure 9(b) shows comparison of the average downloading times in case of the different average speed.

The Convergence and
The average downloading time goes up along with the nodes speed increasing. However, the average downloading time at the speed 2 m/s is less than that at 1 m/s. This is because , is set as 5 s and as the speed increasing, the repeated downloading contents are decreasing because the nodes in the network time are also decreasing, so the downloading time is reduced. As in Figure 9(b), the average downloading time of OCDA is less than ADA and SOMA at most of the time. It is obvious that our algorithm has less average downloading time than the other two algorithms at the speed V increased from 2 m/s to 5 m/s. Figure 10 shows comparison of the average downloading time in case of the different number of cooperative downloading nodes. The average downloading time is slowed down with the number of increased DNs. With the increase of downloading nodes, the curve is smooth and the drop is reduced, that is, because the content transfer accounts for the main part of the downloading. In Figure 10, the OCDA and SOMA algorithm have less average downloading time than the ADA algorithms and our algorithm also has a slight advantage compared with the SOMA.

Conclusions
This work presented a study of cooperative downloading in mobile ad hoc networks. In this paper, a cost distribution algorithm and a content distribution algorithm are proposed for MANETs by optimizing the cost and energy consumption. In order to incentivize more users to participate in the cooperative downloading system, we use virtual money  mechanism to form the cooperative downloading group. The OCD algorithm is proposed which considers the cost performance to decide the cost fairly to the nodes of RG. The OCDA algorithm is proposed which considers the benefits and energy consumption to distribute the downloading content to the nodes of DG. The simulation experiment shows that the cost distribution is fair and content distribution has higher downloading efficiency and lower energy consumption.