# Data Dissemination Performance in P2P-Based Vehicular Communications for Smart City Environments

Authors: Mario E. Rivero-Angeles; Izlian Y. Orea-Flores; Andrés Lucas-Bravo; Iclia Villordo-Jiménez; Miguel F. Mata-Rivera; Luis A. Macedo Santiago; Mónica L. Morales-Varela
Journal: Wireless Communications and Mobile Computing
 (2022)

---

## Abstract

Peer-to-Peer (P2P) networks, as well as vehicular networks, have been extensively studied in the literature. However, the statistical characteristics of connection times among vehicles on the performance of a P2P network to allow Vehicle-to-Vehicle (V2V) communications have been largely overlooked. Specifically, the periods that vehicles remain connected to neighboring vehicles to directly communicate among them in different road characteristics (urban or highway) and road traffic conditions (low, medium, or high) are of main importance for the adequate performance of a P2P system. Indeed, these connection times establish the average number of peers and hence the bandwidth available in the communication system. These times have not been studied nor characterized before for the purpose of calculating the download probability and average download times, which are calculated in this work using a teletraffic analysis. We also present simulation results considering the CSMA/CA random access scheme established in the IEEE 802.11p communication protocol for V2V communications to investigate the effect of the random access protocol on the system performance.


---

## Body

## 1. Introduction

Smart city is a general term used to represent an information system installed in certain intelligent environments to disseminate information regarding the operation of the city and the quality of life of the residents [1], such as information about the water supply, traffic conditions, dangerous leaks, cultural and sports events, health-related information, updates about pollution, and climate-related data among many others. Furthermore, the use of vehicles to enhance the data dissemination process in smart cities can provide an invaluable tool to reach a big portion of the residents and visitors of the city. Indeed, this falls in the growing trend of the Internet of Vehicles (IoV) [2, 3], where cars share their sensors, communication capabilities, and processing resources to benefit others.Regarding data dissemination, Peer-to-Peer (P2P) networks have been used for efficient massive file sharing services due to its scalability and distributed nature. However, most studies have focused on resource allocation schemes with static nodes for both real and nonreal time data [4–9]. In VANETs, unlike conventional ad hoc networks, nodes (placed in each vehicle) have high mobility, and the connection among nodes changes very rapidly except when traffic conditions are very high. These connection times are the opportunities that nodes have in order to share their data using short range communication links. Although long-range communication links can be used, they may generate high interference levels hindering the operation of nearby systems, especially in future vehicle communication systems where autonomous vehicles will certainly increase data traffic. Building on this, an accurate characterization of connection times among neighbor vehicles is of great importance to have a realistic estimation of the capacity of the network, and in the case of our work, the probability to download a file and average downloading delays which greatly depend on the number of peers in the network. Note that the number of neighbor nodes is directly related to the communication range and traffic conditions in the roads. These parameters are widely overlooked in previous works in the area, for instance [10–20], but are crucial in the analysis presented in this paper.Additionally, in previous P2P models, the connection times of nodes have been modeled using random exponentially distributed times which are mainly based on the behavior of users. Indeed, in a P2P network, the time the user decides to remain in the system sharing its resources is a crucial issue for the performance of the network. Furthermore, in a vehicular P2P system sharing, data related to the city operation changes the paradigm where the user has control over the sharing of the files.Instead, in this smart city perspective, the user receives data whenever the network operator initiates this process to inform the residents about certain important events. As such, the user driving the vehicle has no impact neither on the time to start the download nor the time to leave the system. As long as the vehicle is in use, it remains active in the sharing process. Hence, the connection times no longer depend on the user deciding to leave the system but rather on the inherent dynamics of the vehicles and the times that they remain close to each other (inside each other’s coverage radio), depending on the environment and traffic conditions.Building on this, we analyze and mathematically model a P2P network for Vehicle-to-Vehicle (V2V) communications in order to obtain performance metrics, such as the download probability, in different vehicle traffic conditions, namely, high, medium, and low in both urban and highway environments. As such, this work provides valuable information for a future use of P2P networks enabling high data exchange in the future IoT and 5G mobile communication systems. We develop a Continuous Time Markov Chain (CTMC) that captures the main dynamics of the vehicle’s movement that provides the average number of peers in the system which in turn reflects the data traffic in the network. To this end, we perform extensive simulations in different scenarios to obtain the statistical properties of the connection times between vehicles which are later used to develop the mathematical analysis.The main contribution of this paper is the connection time characterization in different environments and traffic conditions which we consider to be of major importance to have an accurate evaluation of the P2P network and which has been largely overlooked. Also, the derived mathematical model, as opposed to the simulation results typically reported in previous works, entails a design tool for P2P-based vehicular applications in current and future smart city developments.The rest of the paper is organized as follows: First, we review some relevant works previously published in the literature and related to our work. Then, in Section3, we provide extensive details regarding the system model and main assumptions of the system including the vehicular environment. In Section 4, we analyze the connection times for each scenario and obtain the main statistical parameters needed to develop our mathematical analysis, which is presented in Section 5. Finally, we end the paper presenting the most relevant results and conclusions.


## 2. Related Work

Peer-to-Peer networks have been studied before in the context of vehicular environments. For instance, in [21], the authors focus on the performance of vehicle clouds, which is a mobile cloud computing service using the resources onboard vehicles to provide access to the cloud. However, they do not study the problem of efficiently sharing a file; they rather take advantage of the resources provided by the cars through their proposed PrEPARE sharing protocol for routing purposes for unicast communications. Instead, we focus on the evaluation of a broadcast system at the MAC layer.Conversely, the work developed in [22] focuses on both unicast and multicast data dissemination. That work is similar to our research in the sense that they also consider that a vehicle (for their first proposed scheme) or multiple vehicles (in the case of their second proposed scheme) receive a file of interest to be shared among neighboring vehicles in mobile clusters using a P2P network. Also, similar to our work, this information is related to emergency or safety events in a certain region, but unlike our paper, they focus on emergency services only (e.g., police or firefighters) while we consider a more broad population like residents and visitors in a smart city environment. That paper also considers specific parameters of the physical layer, such as fading, coding, and modulation schemes, while we focus on the MAC layer operation. Specifically, they calculate the packet delay for a different number (fixed) of cooperative vehicles, while for us, the number of vehicles varies according to the movement and trajectories of each car.In [23], the work is focused on V2V communications for safety communication purposes, mainly to avoid crashes between cars. Hence, they are interested in maintaining a manageable number of communicating vehicles to allow fast communication of safety messages. Indeed, for safety messages, only the few vehicles at risk are interested in receiving this information. This is also the case for [24] but instead of collision avoidance between cars, they focus on congestion avoidance in roads. They achieve this by proposing a pull-based geocast protocol to efficiently disseminate data to interested users, which requires GPS information. That protocol is based on caching information to be later shared among vehicles, and their results are mainly focused on the efficiency of their proposed caching scheme. Similar research is presented in [25], where the authors propose a distributed infrastructureless vehicular congestion and traffic optimization system in urban environments. That work is aimed at providing efficient information to reduce travel times. Hence, they do not investigate neither the performance of the data dissemination process nor the P2P operation. Conversely, we are interested in communicating vehicles to the highest amount of neighboring vehicles possible to better disseminate the city’s information, whereas maintaining a low packet delay is not our focus.Works in [11–15] present clustering schemes in VANETs using a P2P architecture, where data is shared according to common benefits and vehicles communicate with the detected neighbors. Much of the work in these papers is focused on managing the cluster members and cluster heads and how to route messages among clusters using the instantaneous number of nodes or cellular systems or infrastructure road access points. In [16, 17], the authors propose a protocol for efficient file sharing in VANETs based on a TDMA (Time Division Multiple Access) scheme, but the number of vehicles per clusters is given according to the number of neighbors during the vehicular simulations. Also, in [18–20], the authors propose efficient file sharing keeping tables and updating the neighbor information. However, none of these works consider the average times that nodes are connected to each other. Hence, the statistical properties of the dynamics of the vehicles per cluster are overlooked, and so, the average time that nodes can share their files is not calculated nor used in their proposals, which we believe is of paramount importance to accurately model the system performance.Content delivery in vehicular networks and general operation of VANETs has been studied before [3, 25–29] but most of those works do not consider a P2P network to share data in an efficient manner. In [30], the authors propose a P2P cooperative caching scheme where users share different files in order to reduce the packet traffic load on central, fixed servers. Unlike that work, we focus on data relevant for the smart city operation (to be consumed by the user or the vehicle or both) where users have no direct control on the data dissemination. Conversely, they focus on user-related content. As such, some files are intensively shared (the most popular data is stored in many vehicles) while other data is less requested (less popular data is not stored and hence is harder to access). In smart city applications, data is shared not based on the user’s interest but rather is massively shared to enhance the operation of certain processes or events. Also, the authors in [30] develop a Markov chain to analyze the cache process of different data files found in the vehicles’ buffers. As such, performance evaluation is focused on their proposed cache scheme (query latency), rather than the data dissemination in the VANET (data download probability, number of seeds, etc.). Similarly, in [31], multimedia data dissemination is considered from the user-interest perspective considering both the cache process and fairness. Specifically, the authors propose a P2P-based vehicular network to maximize user satisfaction and achieve a certain amount of fairness. In our case, neither user satisfaction nor fairness metrics are relevant to the effectiveness of the dissemination process for nonuser centered applications.In [32], the authors consider a P2P vehicular system using a micromobility scenario in order to investigate the performance of the system under realistic conditions, such as the impact of the propagation and fading in the wireless channel on packet loss ratio. Although that work considers a more detailed vehicular movement, it does not consider the statistics of the connection times to evaluate the performance of the system.The work presented in [3] studies video streaming services in VANETs for smart cities oriented applications. Although that work does not consider a P2P network, the authors provide relevant information regarding technologies and applications to enable video streaming in vehicular environments. Our focus is the dissemination of general data files, but we believe that our mathematical framework can be extended to consider video streaming in future works. Also the use of machine learning techniques can be implemented in future works, such as the one proposed in [29] in order to optimize the data dissemination in terms of selecting the appropriate nodes to be served depending on the speed, direction, and amount of chunks previously downloaded.Other works have focused on the performance of the IEEE 802.11p protocol [33–35]. However, those works do not investigate the efficiency of the data dissemination in a P2P network with mobile nodes.None of the previous works obtain metrics for the connection times among vehicles, and no mathematical analysis of the P2P network is derived to find the average number of leechers and seeds in a given cluster, which in turn reflects the number of successful downloads of the data file. As we show later on, the connection times of vehicles is a major parameter to calculate the performance of the vehicular P2P system, and this parameter has been greatly overlooked in the literature.


## 3. Simulation Model

In this section, the basic assumptions and system’s variables of a wireless BitTorrent-like P2P network are described. In this work, we consider a vehicular network where vehicles move in either a highway or city scenario. Each vehicle has a coverage radio, which represents the distance where its transmitted packets can be adequately received and decoded. Whenever the vehicles find themselves inside each other’s coverage radio, we assume that they can initiate the file exchange based on a P2P system. Hence, vehicles enter and leave each other’s communication range based on their random movement and possible individual routes.


### 3.1. Vehicular Environment

In this work, we use a macromobility vehicular model that considers road layout, number of lanes, and speed limits [32] which models the general behavior in a vehicular environment and allows us to focus on developing a mathematical framework for the P2P system as opposed to micromobility models that are much more time-consuming and require heavy processing tasks to account for driver behavior and obstacles in the roads. Accordingly, in this work, we aim at providing initial and general results in the P2P vehicular research area and micromobility models, like the ones presented in [36], which can be used in future research works to consider more specific variables and scenarios.To this end, we consider two environments: urban (based on the Manhattan model) and highway (straight segment). Additionally, we study the system performance in three traffic conditions, namely, high, medium, and low, according to the following characteristics [37], although these values are different in urban and highway environments:
(i)
High traffic is characterized by vehicles traveling at less than 40 km/hr which in our simulation, this is achieved for a vehicle interarrival rates to a street/road of 2 minutes or less(ii)
Medium traffic is characterized by vehicles traveling in the range of 40 to 70 km/hr which is attained at vehicle interarrival rates to a street/road of more than 2 minutes but less than 5 minutes(iii)
Low traffic is characterized by vehicles traveling at more than 70 km/hr, and this is achieve for vehicle interarrival rates to a street of more than 10 minutesIn the highway environment, there are no traffic lights, no crossroads, nor any other obstacle that requires vehicles to reduce their speed or stop their motion, except for the interaction with other vehicles as shown in Figure1. Besides, we consider two lanes for each direction of the highway. For the urban environment, based on the Manhattan model, depicted in Figure 2, we considered that the vehicles can move along the streets but can turn right, left, or continue straight ahead at each intersection with probabilities tl=0.25, tr=0.25, and ts=0.5, respectively.Figure 1
Vehicular circulation in the highway environment.Figure 2
Vehicular circulation in the city environment.On the other hand, high traffic conditions are considered when vehicles have a nominal speed of less than 40 km/hr, medium traffic conditions occur when vehicles transit at a speed in the range of 40 to 80 km/hr, and low traffic conditions occur when vehicles have a speed of more than 80 km/hr.For the vehicle mobility model, we make use of the exponential model described in [38]:
(1)ve=vle−k/kc,whereve is the speed of a vehicle, vl is the maximum speed of a vehicle in case the road is empty, k is the current vehicle density in the road (vehicles per kilometer per lane), and kc corresponds to the maximum vehicle density the road can support. This is a simple macroscopic model that relates the speed of each vehicle to the vehicle density in the area. Specifically, as the density increases (decreases), the vehicles reduce (increment) their speed. Also, the vehicle flow is given by:
(2)q=vlke−k/kc.It can be seen that, as the number of vehicles decreases in the area of interest,k, i.e., k⟶0, then the speed of vehicles corresponds to the maximum speed when the road is empty, vl, and the vehicle flow is simply the number of vehicles times the speed of each car. Conversely, when traffic density is high and approaching the maximum vehicle density, k⟶kc, then, the speed of the vehicles is drastically reduced to approximately one-third of the maximum speed. Note that this simple model does not account for small variations in the traffic such as one vehicle suddenly reducing or increasing its velocity. However, it gives a general idea of the movement of vehicles in different traffic conditions. Additionally, the proposed methodology for the connection time characterization and P2P communication model among vehicles can be obtained for any vehicle movement simulator or even for real traces and is not exclusive for this vehicle movement.Based on the above mobility model, we now assign a specific speed for each incoming vehicle as follows: First, we calculate the value ofve using (1). Then, an exponentially distributed random speed is assigned to each incoming vehicle with rate ve. Hence, we can follow each vehicle in the interest area, either the highway or city environments, by calculating its position at every instant in the simulation.


### 3.2. Vehicular P2P Network

Based on the position of each vehicle, we consider a single file distribution in the system with sizeF bytes. The file is divided into chunks of the file of 256 KB [9]. We focus on a system with at least one seed, i.e., a vehicle that has the complete file and can distribute it to the rest of the vehicles’ leechers (that do not have the file or have only a part of it) that it encounters and can connect with. (Note that seeds that are found inside the coverage range do not connect among them since they already have the complete file and have no need to download the file from each other.) To this end, a circular coverage area is assigned, with these vehicles acting as seeds in the center of the circle. All vehicles found inside this coverage area can eventually be connected to the seed and to the rest of the vehicles inside it, depending on their particular movement pattern generated by the model explained earlier. All the vehicles inside this area can connect to each other in order to share their chunks (parts of the file); i.e., we are considering a fully cooperative system. The case where some nodes do not cooperate has been studied before [7, 8]. Vehicles arrive according to a Poisson process and leave the coverage area according to their position given by their speed and direction. Download rate is considered to be 11 Mbps while upload rate is only one-fourth of the download rate as considered in [9]; then, upload rate is 2.75 Mbps.Then, we calculate the successful download probability, given by:(3)Psd=NumberofnodesthatdownloadthecompletefileNumberofnodesthatstartadownload,and the average download time given by:(4)Psd=TotaltimeofcompletedownloadsNumberofnodesthatdownloadthecompletefile.In Figure3, we present the general operation of the simulation developed for this work. Specifically, we use a home-made discrete event simulation in C++ where we follow each vehicle in the system by calculating its position according to its speed and direction.Figure 3
General operation of the simulator.For this simulation, we introduce the following parameters: length of the area of interest, coverage area, maximum number of vehicles to simulate, maximum number of allowed vehicles in the area of interest, maximum speed of vehicles, and arrival rate of vehicles to the area of interest. The simulation keeps a record of the number of vehicles that have entered the area of interest. For each arrival, we generate the next arrival according to a Poisson process, and we calculate the speed of the arriving vehicle according to the number of cars already in the system. At each simulation interval, we calculate the position of each vehicle, and we decide if it is inside or outside the area of interest. Also, we make sure that a seed is inside the interest area; if there are no seeds, we assign this role to the incoming vehicle. In practice, a cellular system or public Wi-Fi network can serve some selected vehicles to act as seeds by downloading the complete file. In this simulation, the time interval is 0.1 seconds which is selected in order to update the position of all vehicles in the system. Based on the maximum speed of vehicles and traffic conditions, we consider that their position is not greatly modified in intervals of 0.1 seconds. Hence, no important events are dismissed between updates. Finally, in this simulation, after updating the positions of the nodes, we can verify if the vehicles in the last update are still inside the interest area or if they have left it, and we update the vehicle density accordingly.Once we know the position of each vehicle at each instant of the simulation, we determine the possible connection among vehicles inside the communication range of the seed of interest. To this end, we detail the P2P connection procedure in Figure4.Figure 4
Simulator connection procedure.The P2P connection is performed whenever a vehicle updates its position or when a car enters or leaves the region of interest. Then, whenever the distance between two vehicles is lower than the communication range (defined at the beginning of the simulation), a connection is stablished (in case that these vehicles were not connected before) or maintained (if these vehicles were already connected in the previous interval). Each vehicle can have at most 4 active connections as stablished in [9], i.e., connections where chunks are being transmitted and received, but also can have multiple nonactive connections, where vehicles are inside each other’s communication range but no chunks are being shared due to the fact that one of them already has 4 connections or they have no chunks that they can share. If the connection time between these vehicles is higher than the chunk download time, the chunk is shared. In case the downloading node does not have this particular chunk and as long as they are connected, all possible chunks are downloaded. At the end of the P2P connection, we verify if the nodes have completed the download of the complete file. If so, the node becomes a seed.It is important to note that we consider the case where chunk transmission is performed with and without the IEEE 802.11p protocol. The idea is to account for the impact of the use of such protocol compared to a system without it. Besides, the mathematical model does not account for this effect; that is, it does not consider a particular medium access protocol. Thence, while investigating the performance degradation incurred by using this protocol, we believe it would be straightforward to consider it in the analytical results (by including the collision probability or probability to enter the backoff procedure). We give further detail on this issue in the numerical results section.


### 3.3. IEEE 802.11p

The IEEE 802.11p standard, based on the CSMA/CA (Carrier Sense Multiple Access/Collision Avoidance) random access protocol, also known as the Wireless Access Vehicular Environment (WAVE) [39], was developed specifically for vehicular environments. The WAVE protocol assumes a highly dynamic environment at the physical layer and short message interchange among vehicles (V2V) and between vehicles and static Road Side Units (RSU) that enables vehicle to infrastructure (V2I) information exchange. We focused on the IEEE 802.11p standard since it is likely that cars (and autonomous vehicles in the near future) will have some similar or modified version of this protocol. Although the main interest of this is to send emergency packets, we believe that it can also be used to exchange any type of short packet and not necessarily for emergency cases only.The CSMA/CA protocol in the Distributed Coordination Function (DCF) mode allows nodes to transmit a new packet by waiting for a Distributed Inter Frame Space (DIFS) whenever the shared medium is empty (no other transmission is underway); otherwise, the node enters into the backoff procedure. Likewise, after waiting for a Short Inter Frame Space (SIFS) period, if the medium remains empty, the node transmits its packet; otherwise, it goes to the backoff procedure. (This accounts for the collision avoidance strategy.) In the backoff procedure, nodes wait for a uniformly random time in the range0,CW, where the contention window (CW) is calculated as follows:
(5)CW=min2j×CWmin,CWmax,whereCWmin is the minimum value of the contention window, CWmax is the maximum value of the CW (when this value is reached, the range of the CW remains constant but the backoff value remains a random value), and j is the number of transmission attempts for a specific packet. Hence, the Binary Exponential Backoff is used [40]. Building on this, after a failed transmission attempt (when the node finds the channel occupied or a collision has occurred), the node randomly selects an initial counter value, based on (5), and decreases by one after each minislot whenever the channel is sensed as idle. If the channel is used, the nodes in the backoff procedure stop the countdown until the channel becomes idle again. When the backoff counter reaches zero, nodes attempt the packet transmission by sensing the channel: if it is idle, they wait for a DIFS period; otherwise, they go to the backoff procedure again, increasing the number of attempts. If the channel remains idle after the DIFS period, then the node transmits its packet; otherwise, it goes to the backoff procedure and so on and so forth until the packet is successfully transmitted. If a node has multiple packets to transmit, it has to wait for a DIFS in order to attempt the transmission of a next frame after entering the backoff procedure with the value of CW=CWmin. The receiving node transmits an ACK in case that the packet is received successfully (without collisions). It does so by waiting for a Short Inter Frame Space (SIFS) instead of a DIFS, where SIFS<DIFS, effectively assigning a higher priority to the acknowledged transmission over a regular packet.All this overhead is what accounts for the performance degradation of the P2P connection in contrast with the case when no transmission protocol is considered.Regarding the IEE802.11p protocol [33], multiple Inter Frame Spaces are used to assign priorities to different types of packets. (As in the case of the SIFS and DIFS, different values to these time intervals can be used to probabilistically assign a higher priority to shorter periods.) Specifically, the IEEE 802.11 considers four priority levels, each of which has a different interframe time. In our work, we consider that all packets have the same priority. Hence, the operation of the MAC protocol is basically as we described it above.


## 3.1. Vehicular Environment

In this work, we use a macromobility vehicular model that considers road layout, number of lanes, and speed limits [32] which models the general behavior in a vehicular environment and allows us to focus on developing a mathematical framework for the P2P system as opposed to micromobility models that are much more time-consuming and require heavy processing tasks to account for driver behavior and obstacles in the roads. Accordingly, in this work, we aim at providing initial and general results in the P2P vehicular research area and micromobility models, like the ones presented in [36], which can be used in future research works to consider more specific variables and scenarios.To this end, we consider two environments: urban (based on the Manhattan model) and highway (straight segment). Additionally, we study the system performance in three traffic conditions, namely, high, medium, and low, according to the following characteristics [37], although these values are different in urban and highway environments:
(i)
High traffic is characterized by vehicles traveling at less than 40 km/hr which in our simulation, this is achieved for a vehicle interarrival rates to a street/road of 2 minutes or less(ii)
Medium traffic is characterized by vehicles traveling in the range of 40 to 70 km/hr which is attained at vehicle interarrival rates to a street/road of more than 2 minutes but less than 5 minutes(iii)
Low traffic is characterized by vehicles traveling at more than 70 km/hr, and this is achieve for vehicle interarrival rates to a street of more than 10 minutesIn the highway environment, there are no traffic lights, no crossroads, nor any other obstacle that requires vehicles to reduce their speed or stop their motion, except for the interaction with other vehicles as shown in Figure1. Besides, we consider two lanes for each direction of the highway. For the urban environment, based on the Manhattan model, depicted in Figure 2, we considered that the vehicles can move along the streets but can turn right, left, or continue straight ahead at each intersection with probabilities tl=0.25, tr=0.25, and ts=0.5, respectively.Figure 1
Vehicular circulation in the highway environment.Figure 2
Vehicular circulation in the city environment.On the other hand, high traffic conditions are considered when vehicles have a nominal speed of less than 40 km/hr, medium traffic conditions occur when vehicles transit at a speed in the range of 40 to 80 km/hr, and low traffic conditions occur when vehicles have a speed of more than 80 km/hr.For the vehicle mobility model, we make use of the exponential model described in [38]:
(1)ve=vle−k/kc,whereve is the speed of a vehicle, vl is the maximum speed of a vehicle in case the road is empty, k is the current vehicle density in the road (vehicles per kilometer per lane), and kc corresponds to the maximum vehicle density the road can support. This is a simple macroscopic model that relates the speed of each vehicle to the vehicle density in the area. Specifically, as the density increases (decreases), the vehicles reduce (increment) their speed. Also, the vehicle flow is given by:
(2)q=vlke−k/kc.It can be seen that, as the number of vehicles decreases in the area of interest,k, i.e., k⟶0, then the speed of vehicles corresponds to the maximum speed when the road is empty, vl, and the vehicle flow is simply the number of vehicles times the speed of each car. Conversely, when traffic density is high and approaching the maximum vehicle density, k⟶kc, then, the speed of the vehicles is drastically reduced to approximately one-third of the maximum speed. Note that this simple model does not account for small variations in the traffic such as one vehicle suddenly reducing or increasing its velocity. However, it gives a general idea of the movement of vehicles in different traffic conditions. Additionally, the proposed methodology for the connection time characterization and P2P communication model among vehicles can be obtained for any vehicle movement simulator or even for real traces and is not exclusive for this vehicle movement.Based on the above mobility model, we now assign a specific speed for each incoming vehicle as follows: First, we calculate the value ofve using (1). Then, an exponentially distributed random speed is assigned to each incoming vehicle with rate ve. Hence, we can follow each vehicle in the interest area, either the highway or city environments, by calculating its position at every instant in the simulation.


## 3.2. Vehicular P2P Network

Based on the position of each vehicle, we consider a single file distribution in the system with sizeF bytes. The file is divided into chunks of the file of 256 KB [9]. We focus on a system with at least one seed, i.e., a vehicle that has the complete file and can distribute it to the rest of the vehicles’ leechers (that do not have the file or have only a part of it) that it encounters and can connect with. (Note that seeds that are found inside the coverage range do not connect among them since they already have the complete file and have no need to download the file from each other.) To this end, a circular coverage area is assigned, with these vehicles acting as seeds in the center of the circle. All vehicles found inside this coverage area can eventually be connected to the seed and to the rest of the vehicles inside it, depending on their particular movement pattern generated by the model explained earlier. All the vehicles inside this area can connect to each other in order to share their chunks (parts of the file); i.e., we are considering a fully cooperative system. The case where some nodes do not cooperate has been studied before [7, 8]. Vehicles arrive according to a Poisson process and leave the coverage area according to their position given by their speed and direction. Download rate is considered to be 11 Mbps while upload rate is only one-fourth of the download rate as considered in [9]; then, upload rate is 2.75 Mbps.Then, we calculate the successful download probability, given by:(3)Psd=NumberofnodesthatdownloadthecompletefileNumberofnodesthatstartadownload,and the average download time given by:(4)Psd=TotaltimeofcompletedownloadsNumberofnodesthatdownloadthecompletefile.In Figure3, we present the general operation of the simulation developed for this work. Specifically, we use a home-made discrete event simulation in C++ where we follow each vehicle in the system by calculating its position according to its speed and direction.Figure 3
General operation of the simulator.For this simulation, we introduce the following parameters: length of the area of interest, coverage area, maximum number of vehicles to simulate, maximum number of allowed vehicles in the area of interest, maximum speed of vehicles, and arrival rate of vehicles to the area of interest. The simulation keeps a record of the number of vehicles that have entered the area of interest. For each arrival, we generate the next arrival according to a Poisson process, and we calculate the speed of the arriving vehicle according to the number of cars already in the system. At each simulation interval, we calculate the position of each vehicle, and we decide if it is inside or outside the area of interest. Also, we make sure that a seed is inside the interest area; if there are no seeds, we assign this role to the incoming vehicle. In practice, a cellular system or public Wi-Fi network can serve some selected vehicles to act as seeds by downloading the complete file. In this simulation, the time interval is 0.1 seconds which is selected in order to update the position of all vehicles in the system. Based on the maximum speed of vehicles and traffic conditions, we consider that their position is not greatly modified in intervals of 0.1 seconds. Hence, no important events are dismissed between updates. Finally, in this simulation, after updating the positions of the nodes, we can verify if the vehicles in the last update are still inside the interest area or if they have left it, and we update the vehicle density accordingly.Once we know the position of each vehicle at each instant of the simulation, we determine the possible connection among vehicles inside the communication range of the seed of interest. To this end, we detail the P2P connection procedure in Figure4.Figure 4
Simulator connection procedure.The P2P connection is performed whenever a vehicle updates its position or when a car enters or leaves the region of interest. Then, whenever the distance between two vehicles is lower than the communication range (defined at the beginning of the simulation), a connection is stablished (in case that these vehicles were not connected before) or maintained (if these vehicles were already connected in the previous interval). Each vehicle can have at most 4 active connections as stablished in [9], i.e., connections where chunks are being transmitted and received, but also can have multiple nonactive connections, where vehicles are inside each other’s communication range but no chunks are being shared due to the fact that one of them already has 4 connections or they have no chunks that they can share. If the connection time between these vehicles is higher than the chunk download time, the chunk is shared. In case the downloading node does not have this particular chunk and as long as they are connected, all possible chunks are downloaded. At the end of the P2P connection, we verify if the nodes have completed the download of the complete file. If so, the node becomes a seed.It is important to note that we consider the case where chunk transmission is performed with and without the IEEE 802.11p protocol. The idea is to account for the impact of the use of such protocol compared to a system without it. Besides, the mathematical model does not account for this effect; that is, it does not consider a particular medium access protocol. Thence, while investigating the performance degradation incurred by using this protocol, we believe it would be straightforward to consider it in the analytical results (by including the collision probability or probability to enter the backoff procedure). We give further detail on this issue in the numerical results section.


## 3.3. IEEE 802.11p

The IEEE 802.11p standard, based on the CSMA/CA (Carrier Sense Multiple Access/Collision Avoidance) random access protocol, also known as the Wireless Access Vehicular Environment (WAVE) [39], was developed specifically for vehicular environments. The WAVE protocol assumes a highly dynamic environment at the physical layer and short message interchange among vehicles (V2V) and between vehicles and static Road Side Units (RSU) that enables vehicle to infrastructure (V2I) information exchange. We focused on the IEEE 802.11p standard since it is likely that cars (and autonomous vehicles in the near future) will have some similar or modified version of this protocol. Although the main interest of this is to send emergency packets, we believe that it can also be used to exchange any type of short packet and not necessarily for emergency cases only.The CSMA/CA protocol in the Distributed Coordination Function (DCF) mode allows nodes to transmit a new packet by waiting for a Distributed Inter Frame Space (DIFS) whenever the shared medium is empty (no other transmission is underway); otherwise, the node enters into the backoff procedure. Likewise, after waiting for a Short Inter Frame Space (SIFS) period, if the medium remains empty, the node transmits its packet; otherwise, it goes to the backoff procedure. (This accounts for the collision avoidance strategy.) In the backoff procedure, nodes wait for a uniformly random time in the range0,CW, where the contention window (CW) is calculated as follows:
(5)CW=min2j×CWmin,CWmax,whereCWmin is the minimum value of the contention window, CWmax is the maximum value of the CW (when this value is reached, the range of the CW remains constant but the backoff value remains a random value), and j is the number of transmission attempts for a specific packet. Hence, the Binary Exponential Backoff is used [40]. Building on this, after a failed transmission attempt (when the node finds the channel occupied or a collision has occurred), the node randomly selects an initial counter value, based on (5), and decreases by one after each minislot whenever the channel is sensed as idle. If the channel is used, the nodes in the backoff procedure stop the countdown until the channel becomes idle again. When the backoff counter reaches zero, nodes attempt the packet transmission by sensing the channel: if it is idle, they wait for a DIFS period; otherwise, they go to the backoff procedure again, increasing the number of attempts. If the channel remains idle after the DIFS period, then the node transmits its packet; otherwise, it goes to the backoff procedure and so on and so forth until the packet is successfully transmitted. If a node has multiple packets to transmit, it has to wait for a DIFS in order to attempt the transmission of a next frame after entering the backoff procedure with the value of CW=CWmin. The receiving node transmits an ACK in case that the packet is received successfully (without collisions). It does so by waiting for a Short Inter Frame Space (SIFS) instead of a DIFS, where SIFS<DIFS, effectively assigning a higher priority to the acknowledged transmission over a regular packet.All this overhead is what accounts for the performance degradation of the P2P connection in contrast with the case when no transmission protocol is considered.Regarding the IEE802.11p protocol [33], multiple Inter Frame Spaces are used to assign priorities to different types of packets. (As in the case of the SIFS and DIFS, different values to these time intervals can be used to probabilistically assign a higher priority to shorter periods.) Specifically, the IEEE 802.11 considers four priority levels, each of which has a different interframe time. In our work, we consider that all packets have the same priority. Hence, the operation of the MAC protocol is basically as we described it above.


## 4. Mobility Statistics

In this section, we study in detail the duration of the connection times among vehicles in different environments and conditions. To this end, the simulation parameters considered are shown in Table1.Table 1
Simulation parameters.
ParameterValueLength of the road20 kmDistance between vehicles1 mLength of the vehicles3 mMinimum speed of vehicles4 m/secCommunication range10 m, 20 m, 30 m, and 40 mFile size50 MBHighwayNumber of lanes2 per directionNumber of directions2Width of lanes5 mMaximum speed of vehiclesLow traffic110 km/hrMedium traffic80 km/hrHeavy traffic75 km/hrCityNumber of lanes2 per directionNumber of directions2Width of lanes5 mNumber of blocks in the mesh20Maximum speed of vehiclesLow traffic54 km/hrMedium traffic45 km/hrHeavy traffic36 km/hrThe communication range among vehicles using Dedicated Short Range Communications (DSRC) of 10 to 20 meters is commonly used in many parts of the world for V2V and V2I applications [41], such as Europe and Japan; although in the USA, a much larger range is considered (up to a 1000 meters). In this regard, the selection of a 10 to 40 meter coverage radio is twofold: First, for smart city applications, many information shared among vehicles would be local, such as objects in the road, empty parking spaces, and acting as data mules for nearby nodes (fixed or mobile). Hence, this information would mainly concern nodes in the same segment of the street or highway and not to vehicles in other streets. Second, for technical reasons, we assume that nodes in a P2P vehicular scenario communicate using a random access protocol. As such, if the number of nodes increases, also the collision probability increases, and throughput drastically decreases. Then, maintaining a relatively low number of nodes benefits the performance of the communication system making a better use of resources.Based on the simulations explained in the previous section, we focus on finding the connection times among vehicles for both highway and city environments and different connection ranges. Building on this, we find the connection time histograms. In Figures5–7, we show the results for the city environment for high, medium, and low traffic conditions, while in Figures 8–10, we show the results for the highway environment. In each histogram, we show some statistics parameters, such as the mean (EX), standard deviation (σX), variance (σX2), and coefficient of variation (CoV) which are found as follows:
(6)EX=∑i=1nxin,(7)σX2=∑i=1nxi−EX2n,(8)σX=σX2,(9)CoV=σXEX,Figure 5
Histograms for the connection times of vehicles in a city environment with high traffic load.Figure 6
Histograms for the connection times of vehicles in a city environment with medium traffic load.Figure 7
Histograms for the connection times of vehicles in a city environment with low traffic load.Figure 8
Histograms for the connection times of vehicles in a highway environment with high traffic load.Figure 9
Histograms for the connection times of vehicles in a highway environment with medium traffic load.Figure 10
Histograms for the connection times of vehicles in a highway environment with low traffic load.wheren is the number of connection times measured in the simulations. It is important to note that for almost all the connection times (except for the case of coverage radio of 30 m in a city environment for medium traffic conditions), the CoV is higher than one. This information is relevant because it implies that the same distribution function can be used to model most connection times, with different parameters for each scenario.Also note that as the communication range increases, the mean connection time is increased accordingly, which is an expected result since vehicles remain connected longer times. This effect can also be seen for different traffic density since the mean connection time increases as vehicle traffic worsens (increases).Finally, note that in all histograms there is a clear concentration of the connection times in the lower part of the graphs; i.e., there is a high probability to find small connection times and a low probability to find high connection times. This observation leads to the possibility of using phase-type distribution functions to model connection times in highly variable environments, such as the ones found in vehicular networks. We now provide further details regarding this issue.


### 4.1. Phase-Type Distributions for Vehicle Connection Times

From these results, the CoV is of major importance since we formulate the following hypotheses:(1)
If theCoV<1, the connection times can be modeled using an Erlang distribution(2)
If theCoV>1, the connection times can be modeled using a hyperexponential distribution(3)
If theCoV=1, the connection times can be modeled using an exponential distributionGiven that most connection times have aCoV>1, we focus on finding the parameters of the hyperexponential distribution. This distribution is obtained using two exponential distributions, where the first one, with rate θ1, is selected in probability p and the other one, with rate θ2, with the complementary probability, 1−p as shown in Figure 11.Figure 11
General diagram of a hyperexponential distribution.Then, the probability density function is described by:(10)fXx=pθ1e−θ1x+1−pθ2e−θ2x.Then, the mean is given by:(11)EX=∫0∞xfXxdx(12)=p1θ1+1−p1θ2,and the variance can be calculated, after some algebraic manipulation, as follows:
(13)σX2=∫0∞x−EX2fXxdx=pθ122−p+1−pθ21+pθ2−2pθ1.Solving (12) for p, we get:
(14)p=EX−1/θ2θ1θ2θ2−θ1.Clearly from this, we have the following restrictions:θ2>θ1 and 0≤p≤1, then:
(15)EX−1/θ2θ1θ2θ2−θ1<1,(16)θ1+EXθ2−1θ1<θ2,(17)θ1<1EX.Using these expressions, we are able to find all the parameters of the hyperexponential distribution, namely,p, θ1, and θ2, for each traffic condition and environment. The fitting distributions are shown in Figure 12.Figure 12
Fitting of the hyperexponential distribution on different vehicular environments.For the cases where the CoV is close to 1, we use an exponential distribution by finding the value ofθ=1/EX based on the mean found in the corresponding histograms. In Figure 13, we show the fitting distribution.Figure 13
Fitting of the exponential distribution on different vehicular environments.Since none of the histograms show a CoV significantly lower than 1, we do not use the Erlang distribution to approximate the connection times.Now, we perform the Pearson Goodness-of-Fitness test [42], also known as the Chi-Square test, to evaluate the approximation of the hypothetical distribution (hyperexponential or exponential) compared to the connection times obtained from the simulations. The test is based on calculating the square error between the hypothetical distribution and the experimental results as follows:
(18)χ2=∑i=1khi−ei2ei,where k is the number of bins in the histograms, hi is the hypothetical frequency values in bin i according to the possible distribution that fits the data, and ei is the experimental frequency values in bin i. The Chi-Square has k−1−d degrees of freedom (DF), and d is the number of parameters of the hypothetical distribution. (In the case of the exponential distribution d=1, since only parameter θ is required, while for the hyperexponential distribution d=3 since parameters p, θ1, and θ2 are required.) Then, based on the Chi-Square distribution, we can calculate the significance value, α to accept the hypothesis (if α is sufficiently small) or to reject it (if α is large).Building on this, the Chi-Square results obtained for the exponential fit for the cases where the CoV is close to 1 are presented in Table2, accepting the hypothetical distribution.Table 2
Chi-Square values for the exponential distribution fit.
Hypothetical valueExperimental valueDFα8.807714.0770.0512.782914.07130.0523.954429.14140.01As such, the exponential distribution is accepted as an adequate hypothetical distribution. For the case whereCoV>1, we use the hyperexponential distribution as hypothetical distribution, obtaining the results shown in Table 3. (We only present some of these results for illustrative purposes.)Table 3
Chi-Square values for the hyperexponential distribution fit.
Hypothetical valueExperimental valueDFα9.343916.9290.0518.939926.30160.059.216815.5180.05In view of these results, the Chi-Square Goodness-of-Fit test accepts the hyperexponential distribution to model the connection times for these environments. Note that this proposed procedure to find the distribution of connection times is the same for more sophisticated and accurate mobility models. Hence, the validity of our work is not affected by the vehicular traces or simulations.


## 4.1. Phase-Type Distributions for Vehicle Connection Times

From these results, the CoV is of major importance since we formulate the following hypotheses:(1)
If theCoV<1, the connection times can be modeled using an Erlang distribution(2)
If theCoV>1, the connection times can be modeled using a hyperexponential distribution(3)
If theCoV=1, the connection times can be modeled using an exponential distributionGiven that most connection times have aCoV>1, we focus on finding the parameters of the hyperexponential distribution. This distribution is obtained using two exponential distributions, where the first one, with rate θ1, is selected in probability p and the other one, with rate θ2, with the complementary probability, 1−p as shown in Figure 11.Figure 11
General diagram of a hyperexponential distribution.Then, the probability density function is described by:(10)fXx=pθ1e−θ1x+1−pθ2e−θ2x.Then, the mean is given by:(11)EX=∫0∞xfXxdx(12)=p1θ1+1−p1θ2,and the variance can be calculated, after some algebraic manipulation, as follows:
(13)σX2=∫0∞x−EX2fXxdx=pθ122−p+1−pθ21+pθ2−2pθ1.Solving (12) for p, we get:
(14)p=EX−1/θ2θ1θ2θ2−θ1.Clearly from this, we have the following restrictions:θ2>θ1 and 0≤p≤1, then:
(15)EX−1/θ2θ1θ2θ2−θ1<1,(16)θ1+EXθ2−1θ1<θ2,(17)θ1<1EX.Using these expressions, we are able to find all the parameters of the hyperexponential distribution, namely,p, θ1, and θ2, for each traffic condition and environment. The fitting distributions are shown in Figure 12.Figure 12
Fitting of the hyperexponential distribution on different vehicular environments.For the cases where the CoV is close to 1, we use an exponential distribution by finding the value ofθ=1/EX based on the mean found in the corresponding histograms. In Figure 13, we show the fitting distribution.Figure 13
Fitting of the exponential distribution on different vehicular environments.Since none of the histograms show a CoV significantly lower than 1, we do not use the Erlang distribution to approximate the connection times.Now, we perform the Pearson Goodness-of-Fitness test [42], also known as the Chi-Square test, to evaluate the approximation of the hypothetical distribution (hyperexponential or exponential) compared to the connection times obtained from the simulations. The test is based on calculating the square error between the hypothetical distribution and the experimental results as follows:
(18)χ2=∑i=1khi−ei2ei,where k is the number of bins in the histograms, hi is the hypothetical frequency values in bin i according to the possible distribution that fits the data, and ei is the experimental frequency values in bin i. The Chi-Square has k−1−d degrees of freedom (DF), and d is the number of parameters of the hypothetical distribution. (In the case of the exponential distribution d=1, since only parameter θ is required, while for the hyperexponential distribution d=3 since parameters p, θ1, and θ2 are required.) Then, based on the Chi-Square distribution, we can calculate the significance value, α to accept the hypothesis (if α is sufficiently small) or to reject it (if α is large).Building on this, the Chi-Square results obtained for the exponential fit for the cases where the CoV is close to 1 are presented in Table2, accepting the hypothetical distribution.Table 2
Chi-Square values for the exponential distribution fit.
Hypothetical valueExperimental valueDFα8.807714.0770.0512.782914.07130.0523.954429.14140.01As such, the exponential distribution is accepted as an adequate hypothetical distribution. For the case whereCoV>1, we use the hyperexponential distribution as hypothetical distribution, obtaining the results shown in Table 3. (We only present some of these results for illustrative purposes.)Table 3
Chi-Square values for the hyperexponential distribution fit.
Hypothetical valueExperimental valueDFα9.343916.9290.0518.939926.30160.059.216815.5180.05In view of these results, the Chi-Square Goodness-of-Fit test accepts the hyperexponential distribution to model the connection times for these environments. Note that this proposed procedure to find the distribution of connection times is the same for more sophisticated and accurate mobility models. Hence, the validity of our work is not affected by the vehicular traces or simulations.


## 5. Mathematical Model

Once the distributions for the connection times among vehicles are obtained (we also refer to them as nodes throughout the paper), we now develop the mathematical model to calculate the number of leechers and seeds in the system, which in turn allows us to calculate the successful downloading probability.We first describe the basic model developed by [8, 9, 43], which focuses on a fixed node P2P system. Here, nodes arrive to the system according to a Poisson process with rate λ. Leechers and seeds remain connected for a random exponentially distributed time with mean 1/θ and 1/γ, respectively. Peers (both seeds and leechers) upload their chunks with rate μ files per second and download chunks at rate c files per second. These processes, the downloading and uploading of chunks, are also considered to be Poisson processes. The accuracy of this simple model has been extensively studied and validated in the literature; therefore, we base our model on such previous work. Building on this, a Continuous Time Markov Chain (CTMC) describing this P2P system, depicted in Figure 14, can be used to calculate the average number of leechers, x, and seeds, y. The rate at which leechers become seeds, i.e., nodes complete the download of the file, can be calculated as follows:
(19)τ=mincx,μηx+y,where η is an efficiency parameter that accounts for cases when leechers that connect may not share chunks they both have. The rationale of this equation is that if the number of peers in the system is such that the system’s bandwidth, μηx+y, surpasses the maximum download rate of the system, cx, then the rate at which the leechers become seeds is dictated by this maximum download rate. This condition is also referred as abundance. Otherwise, the available bandwidth is lower than the maximum download rate. This condition is also known as penury.Figure 14
Basic P2P model for fixed nodes.In this model, the time nodes that are connected are mainly related to the behavior of the users, that is, human behavior in the sense that nodes remain connected as long as the human users are willing to share their file or are encouraged to remain in the system either to download their file or to improve theirsharing score. Indeed, BitTorrent systems offer different incentives to sharing peers and penalize freeloaders.


### 5.1. Mobile P2P System

In our model, we focus on a scenario where nodes are vehicles downloading relevant information for the city or improving vehicle mobility by sharing data with updated traffic conditions, for example. In this way, the connection time among nodes is not dictated by human behavior but rather by the inherent movement and trajectories of the vehicles. Indeed, we consider a scenario where human behavior has no impact since, in many cases, people are focused on driving and do not have the possibility to stop or resume the file downloading process. Rather, the application (either in a mobile device or embedded in the vehicle’s navigation system) is in charge of updating traffic conditions. Additionally, the file can also be related to city general information in a smart city environment that updates data regarding pollution conditions, cultural events, and emergency services, among others.In the previous section, we found that the connection times among vehicles follow a hyperexponential distribution in the majority of cases or an exponential distribution in some cases. Hence, we use these distributions to dictate the connection times among nodes, rather than the classicθ and γ parameters in previous works. We now describe this in detail.For the scenarios where the connection times are exponentially distributed, we use the classic P2P model previously discussed, with the difference that the values ofθ and γ are obtained from the vehicle simulations instead of arbitrary values or values related to human behavior.For the scenarios where the connection times follow a hyperexponential distribution, we extend the basic model to the one depicted in Figure15 for x1,y1,x2,y2>0.Figure 15
Mobile P2P model for hyperexponential connection times.Note that for border states, i.e., eitherx1=0 or x2=0 or y1=0 or y2=0 or a combination of these cases, some transitions are not valid. Specifically, when z=0, there are no transitions to states with z−1 where for z=x1,x2,y1,y2. As discussed before, the hyperexponentially distributed times state that users have a random exponentially distributed time with rate θ1 with probability p and a random exponentially distributed time with rate θ2 with probability 1−p. Since connection times are no longer based on human decision, we assume that these times are the same either if the vehicle is a leecher or a seed. Hence, we assume that θ1=γ1 and θ2=γ2. It is important to note that, since the connection times are exponentially distributed (either with parameter θ1 or θ2) and they are a memoryless process, the time that a node remains connected as a seed does not depend on the time that the node remained as a leecher. This effect has been corroborated by simulation results.Based on this, the system now considers two populations of nodes, namely, leechers (seeds) in stage 1 with connection times1/θ1 (1/γ1) and leechers (seeds) in stage 2 with connection times 1/θ2 (1/γ2). As such, the transition rates can be expressed as follows:
(20)τ1=mincx1,μηx+yx1x,(21)τ2=mincx2,μηx+yx2x,wherex=x1+x2 and y=y1+y2. Note that both populations of peers upload chunks to the rest of the peers, as described by μηx+y. However, this bandwidth is divided according to the proportion of nodes in each population. Hence, this total bandwidth is scaled by the terms x1/x and x2/x, respectively. We numerically solve the aforementioned CTMCs in order to find the average number of leechers and seeds.


## 5.1. Mobile P2P System

In our model, we focus on a scenario where nodes are vehicles downloading relevant information for the city or improving vehicle mobility by sharing data with updated traffic conditions, for example. In this way, the connection time among nodes is not dictated by human behavior but rather by the inherent movement and trajectories of the vehicles. Indeed, we consider a scenario where human behavior has no impact since, in many cases, people are focused on driving and do not have the possibility to stop or resume the file downloading process. Rather, the application (either in a mobile device or embedded in the vehicle’s navigation system) is in charge of updating traffic conditions. Additionally, the file can also be related to city general information in a smart city environment that updates data regarding pollution conditions, cultural events, and emergency services, among others.In the previous section, we found that the connection times among vehicles follow a hyperexponential distribution in the majority of cases or an exponential distribution in some cases. Hence, we use these distributions to dictate the connection times among nodes, rather than the classicθ and γ parameters in previous works. We now describe this in detail.For the scenarios where the connection times are exponentially distributed, we use the classic P2P model previously discussed, with the difference that the values ofθ and γ are obtained from the vehicle simulations instead of arbitrary values or values related to human behavior.For the scenarios where the connection times follow a hyperexponential distribution, we extend the basic model to the one depicted in Figure15 for x1,y1,x2,y2>0.Figure 15
Mobile P2P model for hyperexponential connection times.Note that for border states, i.e., eitherx1=0 or x2=0 or y1=0 or y2=0 or a combination of these cases, some transitions are not valid. Specifically, when z=0, there are no transitions to states with z−1 where for z=x1,x2,y1,y2. As discussed before, the hyperexponentially distributed times state that users have a random exponentially distributed time with rate θ1 with probability p and a random exponentially distributed time with rate θ2 with probability 1−p. Since connection times are no longer based on human decision, we assume that these times are the same either if the vehicle is a leecher or a seed. Hence, we assume that θ1=γ1 and θ2=γ2. It is important to note that, since the connection times are exponentially distributed (either with parameter θ1 or θ2) and they are a memoryless process, the time that a node remains connected as a seed does not depend on the time that the node remained as a leecher. This effect has been corroborated by simulation results.Based on this, the system now considers two populations of nodes, namely, leechers (seeds) in stage 1 with connection times1/θ1 (1/γ1) and leechers (seeds) in stage 2 with connection times 1/θ2 (1/γ2). As such, the transition rates can be expressed as follows:
(20)τ1=mincx1,μηx+yx1x,(21)τ2=mincx2,μηx+yx2x,wherex=x1+x2 and y=y1+y2. Note that both populations of peers upload chunks to the rest of the peers, as described by μηx+y. However, this bandwidth is divided according to the proportion of nodes in each population. Hence, this total bandwidth is scaled by the terms x1/x and x2/x, respectively. We numerically solve the aforementioned CTMCs in order to find the average number of leechers and seeds.


## 6. Numerical Results

We now discuss some of the relevant results of this study. First, we focus on the P2P system results using the simulator developed in this work. To this end, we begin by discussing the system performance without the use of the CSMA/CA protocol. Then, we study the system with the use of the MAC layer of the IEEE 802.11p standard to study the impact on this specific protocol on the performance of the P2P system. We finish this section analyzing the accuracy of the mathematical model derived above to clearly show the benefits and limitations of the analytical framework.


### 6.1. Performance of the Pure P2P Network in VANETs

The relevance of these results lies on understanding the operation of the P2P network in a highly dynamic environment, such as the vehicular case, in terms of the connections that can be established without the packet overhead and control packets added by the random access protocol.


#### 6.1.1. Highway Environment

In the highway environment, where no left or right turns are allowed and vehicles drive in a straight line in just two possible directions, the number of seeds in the system mainly depends on the number of vehicles in the area of interest, as seen in Figure16. Clearly, as the number of vehicles increases, the number of nodes with the complete file also increases. As an interesting observation, we can see that for coverage areas higher than 20 meters, the number of seeds in the system is practically the same. In other words, a coverage area of 10 meters is not efficient enough while coverage areas higher than 20 meters do not improve the file sharing service. This can also be seen in Figure 17 which shows the number of connections stablished by the seeds in this environment.Figure 16
Number of seeds in highway conditions, 4 lanes, 20 km for different traffic conditions.
(a)
Low traffic(b)
Medium traffic(c)
High trafficFigure 17
Number of seed’s connections in highway conditions, 4 lanes, 20 km for different traffic conditions.
(a)
Low traffic(b)
Medium traffic(c)
High trafficWe can also see that neither the file size nor the traffic conditions have an important impact on the number of connections nor the number of seeds in the system. However, these parameters have an important impact on the successful download probability as depicted in Figure18. In this figure, we can clearly see that as the traffic conditions increase, the number of nodes that successfully download the file increases too, since nodes move at lower speeds and spend much more time connected to other nodes. Note that the number of seeds presented before is related to the nodes that download the file and remain in the system afterwards, while in this figure, we can clearly see that many nodes can download the file but may not spend much time afterwards; such is the case for low traffic conditions, where vehicles leave the system much faster, effectively decreasing the successful download probability.Figure 18
Number of successful download in highway conditions, 4 lanes, 20 km for different traffic conditions.
(a)
Low traffic(b)
Medium traffic(c)
High trafficBesides, the file size has an important impact on the successful file downloading process. These results are of major relevance since the network administrator can carefully select this parameter according to the traffic conditions and type of data to share. For instance, for smart city environments, data dissemination can be done by using small packets, such as text-based information, to disseminate important information, for example, traffic accidents or emergency events, thus increasing the probability that nodes download this information. However, for other types of data, like cultural events or sporting events, higher file sizes can be used in video format but mainly when traffic is high and cars are moving slowly. This can be clearly seen in Figure19, where we show the average download times and successful download probabilities. As mentioned before, for high traffic conditions, the successful download probability is almost constant for coverage radios higher than 20 meters and for any file size. In these conditions, the network administrator can choose to send mostly video files which require high bandwidth. Conversely, in medium to low traffic conditions, only very small files, those that can be downloaded in 100 seconds or less, can be efficiently shared, while heavier files would require up to 3000 seconds (50 minutes), which in high traffic conditions in a highway trajectory can be acceptable. Also, in this figure, we can see that the coverage areas lower than 10 meters greatly increase the average download times for small file sizes. (For higher file sizes, the download probability greatly decreases.)Figure 19
Performance of the P2P network in highway conditions, 4 lanes, 20 km for different traffic conditions.
(a)
Average download time(b)
Probability of successful download


#### 6.1.2. City Environment

Similar results can be seen in the city environments shown in Figures20 and 21, with the important difference that a coverage radio of 10 meters has very similar results (in terms of number of seeds and seed’s connections) to the case of 20 meters and higher. Also note that the number of seeds is much lower in this city environment compared to the highway case, since now vehicles can turn left or right at each intersection leaving the system with a higher probability than in the highway case. However, the number of seed’s connections is much higher. This is due to the lower driving speed in cities, which entails longer connection times.Figure 20
Number of seeds in city conditions, 152 lanes, 10 km for different traffic conditions.
(a)
Low traffic(b)
Medium traffic(c)
High trafficFigure 21
Number of seed’s connections in city conditions, 152 lanes, 10 km for different traffic conditions.
(a)
Low traffic(b)
Medium traffic(c)
High trafficIn terms of the probability to download the complete file, we can now see a big impact of the file size with a steep decline for moderate and large file sizes. This leads us to believe that in a city environment, where vehicles can take many different roads, nodes spend much less time connected among them, decreasing the probability to download the file as well as the average download time, as seen in Figures22 and 23. In contrast with the highway case, the average downloading time for any file, regardless of size, is over 100 seconds, and the probability to download is lower than 25%.Figure 22
Probability of successful download in city conditions, 152 lanes, 10 km for different traffic conditions.
(a)
Low traffic(b)
Medium traffic(c)
High trafficFigure 23
Performance of the P2P network in city conditions, 152 lanes, 10 km for different traffic conditions.
(a)
Average download time(b)
Probability of successful downloadBuilding on this, we can see that a highway environment allows for a much more efficient file sharing process than in the more chaotic city case. Hence, in this scenario, only small files (basically text-based information) can be efficiently shared, even in high traffic conditions.


### 6.2. Performance of the P2P Network in VANETs with CSMA/CA

We now present the results of the simulations with the MAC layer of the IEEE 802.11p standard.In Figures24 and 25, we present the main performance metrics of the P2P networks (average download delay, probability of successful download, and number of seed connections) in the most favorable conditions for the file exchange, i.e., high traffic conditions where vehicles spend more time connected, for highway and city environments, respectively. First, for the highway environment, we can see that the average download delay is much higher when the CSMA/CA protocol is enabled. It is of particular interest to see that for small file sizes, the average delay in the case of the CSMA/CA system remains somewhat the same while in the pure P2P system (without the effect of the random access protocol), this delay decreases when the file is small. We can see then that the CSMA/CA protocol introduces a high amount of overhead and control packets that greatly impact the performance of the network. Furthermore, when the CSMA/CA protocol is introduced, the probability of successfully downloading the file is very small (in the order of 0.4%), for almost all configurations of the system, except when the coverage radio is higher than 20 meters, and the file is lower than 100 MBytes. Again, due to the operation of the CSMA/CA protocol, where nodes have to wait for very long times before attempting a transmission, it is very difficult to download the file, and almost no node can do so. Finally, the number of seed’s connections is impacted, even if this parameter is mainly related to the time that nodes are inside each other’s coverage radio. When the CSMA/CA protocol is introduced, it takes much longer time for vehicles to communicate among each other, effectively reducing the connection time, i.e., the times when they recognize each other as communicating nodes.Figure 24
Comparison between the P2P network with and without CSMA/CA for highway conditions and heavy traffic.
(a)
Average download time(b)
Probability of successful download(c)
Seed’s connectionsFigure 25
Comparison between the P2P network with and without CSMA/CA for city conditions and heavy traffic.
(a)
Average download time(b)
Probability of successful download(c)
Seed’s connectionsA similar behavior is found in the city environment, namely, a decrease in the system performance, but not as marked as in the highway environment.The rationale is as follows: as opposed to the case of the highway environment where vehicles remain connected longer times creating an environment where nodes have to enter the backoff process much more often than in the city environment (where nodes remain connected much shorter times), the CSMA/CA protocol allows a faster connection and more regular transmissions in a more dynamic case (the city case) than in a more stable case (the highway case). Hence, the impact of the CSMA/CA protocol is milder in the city environment.These results are relevant in the sense that we can clearly evaluate the impact of the random access protocol in the vehicular environment. Based on this results, we can propose different protocols which impose less overhead or less control traffic in order to avoid such steep decrease in the performance of the system. Perhaps a protocol based on the ALOHA family and eliminating the acknowledgement packets could provide better results. In data dissemination for smart cities for instance, it is not of paramount importance for all the nodes to confirm the reception of the packets, while for emergency services, to avoid collisions for example, it is not feasible to eliminate these messages. However, the objective of this work is to consider the IEEE 802.11p standard most likely to be used in future VANETs, and the proposal of a more efficient MAC layer lies outside the scope of this work; thus, we leave it for future research.


### 6.3. P2P Analytical Results

We now analyze the results of the mathematical model where the connection times between vehicles follow either an exponential or a hyperexponential distribution.For the majority of cases, the connection times have aCoV>1. Therefore, we approximate these times by a hyperexponential distribution, and its parameters are calculated according to Section 4. Then, the model presented in Section 5, based on the CTMC depicted in Figure 15, is numerically solved to find the average number of leechers and seeds in clusters of vehicles, i.e., for nodes inside each other’s coverage radios. Building on this, Figures 26–28 present the average number of vehicles, seeds, and leechers for 1, 10, and 100 arrival rates to the clusters, respectively. The number of vehicles connected in a given cluster is obtained through the system simulations developed for this work. In each cluster, we consider a single initial seed, while the rest of the vehicles at the beginning are leechers with no chunks downloaded. At the bottom of each of these figures, we see the evolution in time of the number of vehicles in a given cluster (selected at random). At the top, we show the evolution in time of the number of seeds, and in the middle, we have the evolution in time of the number of leechers. For the number of leechers and seeds, we have placed a red line that corresponds to the mean number of either leechers or seeds obtained through the solution of the Markov chain. We can see that for low values of the arrival rates (λ=1 and λ=10), the number of seeds remains low even if there are many vehicles in the cluster. However, for λ=100, we can see that after an initial period, the number of seeds increases around 23, which allows the system to have enough bandwidth to efficiently share the file.Figure 26
Number of seeds, leeches, and vehicles for the hyperexponential model withλ=1.Figure 27
Number of seeds, leeches, and vehicles for the hyperexponential model withλ=10.Figure 28
Number of seeds, leeches, and vehicles for the hyperexponential model withλ=100.It is important to notice that the mathematical model has a good match with the simulation results, effectively predicting the average number of peers in the system.Similar results are obtained in the exponential case, using the CTMC depicted in Figure14. Since finding exponential distributed connection times in this vehicle environment and to avoid redundancy, we only present the cases for λ=1 and λ=100 in Figures 29 and 30, respectively. Again, the mathematical model, represented by the red line in the leechers’ and seeds’ graphs, shows a good match between the analytical and simulation results.Figure 29
Number of seeds, leeches, and vehicles for the exponential model withλ=1.Figure 30
Number of seeds, leeches, and vehicles for the exponential model withλ=100.


## 6.1. Performance of the Pure P2P Network in VANETs

The relevance of these results lies on understanding the operation of the P2P network in a highly dynamic environment, such as the vehicular case, in terms of the connections that can be established without the packet overhead and control packets added by the random access protocol.


### 6.1.1. Highway Environment

In the highway environment, where no left or right turns are allowed and vehicles drive in a straight line in just two possible directions, the number of seeds in the system mainly depends on the number of vehicles in the area of interest, as seen in Figure16. Clearly, as the number of vehicles increases, the number of nodes with the complete file also increases. As an interesting observation, we can see that for coverage areas higher than 20 meters, the number of seeds in the system is practically the same. In other words, a coverage area of 10 meters is not efficient enough while coverage areas higher than 20 meters do not improve the file sharing service. This can also be seen in Figure 17 which shows the number of connections stablished by the seeds in this environment.Figure 16
Number of seeds in highway conditions, 4 lanes, 20 km for different traffic conditions.
(a)
Low traffic(b)
Medium traffic(c)
High trafficFigure 17
Number of seed’s connections in highway conditions, 4 lanes, 20 km for different traffic conditions.
(a)
Low traffic(b)
Medium traffic(c)
High trafficWe can also see that neither the file size nor the traffic conditions have an important impact on the number of connections nor the number of seeds in the system. However, these parameters have an important impact on the successful download probability as depicted in Figure18. In this figure, we can clearly see that as the traffic conditions increase, the number of nodes that successfully download the file increases too, since nodes move at lower speeds and spend much more time connected to other nodes. Note that the number of seeds presented before is related to the nodes that download the file and remain in the system afterwards, while in this figure, we can clearly see that many nodes can download the file but may not spend much time afterwards; such is the case for low traffic conditions, where vehicles leave the system much faster, effectively decreasing the successful download probability.Figure 18
Number of successful download in highway conditions, 4 lanes, 20 km for different traffic conditions.
(a)
Low traffic(b)
Medium traffic(c)
High trafficBesides, the file size has an important impact on the successful file downloading process. These results are of major relevance since the network administrator can carefully select this parameter according to the traffic conditions and type of data to share. For instance, for smart city environments, data dissemination can be done by using small packets, such as text-based information, to disseminate important information, for example, traffic accidents or emergency events, thus increasing the probability that nodes download this information. However, for other types of data, like cultural events or sporting events, higher file sizes can be used in video format but mainly when traffic is high and cars are moving slowly. This can be clearly seen in Figure19, where we show the average download times and successful download probabilities. As mentioned before, for high traffic conditions, the successful download probability is almost constant for coverage radios higher than 20 meters and for any file size. In these conditions, the network administrator can choose to send mostly video files which require high bandwidth. Conversely, in medium to low traffic conditions, only very small files, those that can be downloaded in 100 seconds or less, can be efficiently shared, while heavier files would require up to 3000 seconds (50 minutes), which in high traffic conditions in a highway trajectory can be acceptable. Also, in this figure, we can see that the coverage areas lower than 10 meters greatly increase the average download times for small file sizes. (For higher file sizes, the download probability greatly decreases.)Figure 19
Performance of the P2P network in highway conditions, 4 lanes, 20 km for different traffic conditions.
(a)
Average download time(b)
Probability of successful download


### 6.1.2. City Environment

Similar results can be seen in the city environments shown in Figures20 and 21, with the important difference that a coverage radio of 10 meters has very similar results (in terms of number of seeds and seed’s connections) to the case of 20 meters and higher. Also note that the number of seeds is much lower in this city environment compared to the highway case, since now vehicles can turn left or right at each intersection leaving the system with a higher probability than in the highway case. However, the number of seed’s connections is much higher. This is due to the lower driving speed in cities, which entails longer connection times.Figure 20
Number of seeds in city conditions, 152 lanes, 10 km for different traffic conditions.
(a)
Low traffic(b)
Medium traffic(c)
High trafficFigure 21
Number of seed’s connections in city conditions, 152 lanes, 10 km for different traffic conditions.
(a)
Low traffic(b)
Medium traffic(c)
High trafficIn terms of the probability to download the complete file, we can now see a big impact of the file size with a steep decline for moderate and large file sizes. This leads us to believe that in a city environment, where vehicles can take many different roads, nodes spend much less time connected among them, decreasing the probability to download the file as well as the average download time, as seen in Figures22 and 23. In contrast with the highway case, the average downloading time for any file, regardless of size, is over 100 seconds, and the probability to download is lower than 25%.Figure 22
Probability of successful download in city conditions, 152 lanes, 10 km for different traffic conditions.
(a)
Low traffic(b)
Medium traffic(c)
High trafficFigure 23
Performance of the P2P network in city conditions, 152 lanes, 10 km for different traffic conditions.
(a)
Average download time(b)
Probability of successful downloadBuilding on this, we can see that a highway environment allows for a much more efficient file sharing process than in the more chaotic city case. Hence, in this scenario, only small files (basically text-based information) can be efficiently shared, even in high traffic conditions.


## 6.1.1. Highway Environment

In the highway environment, where no left or right turns are allowed and vehicles drive in a straight line in just two possible directions, the number of seeds in the system mainly depends on the number of vehicles in the area of interest, as seen in Figure16. Clearly, as the number of vehicles increases, the number of nodes with the complete file also increases. As an interesting observation, we can see that for coverage areas higher than 20 meters, the number of seeds in the system is practically the same. In other words, a coverage area of 10 meters is not efficient enough while coverage areas higher than 20 meters do not improve the file sharing service. This can also be seen in Figure 17 which shows the number of connections stablished by the seeds in this environment.Figure 16
Number of seeds in highway conditions, 4 lanes, 20 km for different traffic conditions.
(a)
Low traffic(b)
Medium traffic(c)
High trafficFigure 17
Number of seed’s connections in highway conditions, 4 lanes, 20 km for different traffic conditions.
(a)
Low traffic(b)
Medium traffic(c)
High trafficWe can also see that neither the file size nor the traffic conditions have an important impact on the number of connections nor the number of seeds in the system. However, these parameters have an important impact on the successful download probability as depicted in Figure18. In this figure, we can clearly see that as the traffic conditions increase, the number of nodes that successfully download the file increases too, since nodes move at lower speeds and spend much more time connected to other nodes. Note that the number of seeds presented before is related to the nodes that download the file and remain in the system afterwards, while in this figure, we can clearly see that many nodes can download the file but may not spend much time afterwards; such is the case for low traffic conditions, where vehicles leave the system much faster, effectively decreasing the successful download probability.Figure 18
Number of successful download in highway conditions, 4 lanes, 20 km for different traffic conditions.
(a)
Low traffic(b)
Medium traffic(c)
High trafficBesides, the file size has an important impact on the successful file downloading process. These results are of major relevance since the network administrator can carefully select this parameter according to the traffic conditions and type of data to share. For instance, for smart city environments, data dissemination can be done by using small packets, such as text-based information, to disseminate important information, for example, traffic accidents or emergency events, thus increasing the probability that nodes download this information. However, for other types of data, like cultural events or sporting events, higher file sizes can be used in video format but mainly when traffic is high and cars are moving slowly. This can be clearly seen in Figure19, where we show the average download times and successful download probabilities. As mentioned before, for high traffic conditions, the successful download probability is almost constant for coverage radios higher than 20 meters and for any file size. In these conditions, the network administrator can choose to send mostly video files which require high bandwidth. Conversely, in medium to low traffic conditions, only very small files, those that can be downloaded in 100 seconds or less, can be efficiently shared, while heavier files would require up to 3000 seconds (50 minutes), which in high traffic conditions in a highway trajectory can be acceptable. Also, in this figure, we can see that the coverage areas lower than 10 meters greatly increase the average download times for small file sizes. (For higher file sizes, the download probability greatly decreases.)Figure 19
Performance of the P2P network in highway conditions, 4 lanes, 20 km for different traffic conditions.
(a)
Average download time(b)
Probability of successful download


## 6.1.2. City Environment

Similar results can be seen in the city environments shown in Figures20 and 21, with the important difference that a coverage radio of 10 meters has very similar results (in terms of number of seeds and seed’s connections) to the case of 20 meters and higher. Also note that the number of seeds is much lower in this city environment compared to the highway case, since now vehicles can turn left or right at each intersection leaving the system with a higher probability than in the highway case. However, the number of seed’s connections is much higher. This is due to the lower driving speed in cities, which entails longer connection times.Figure 20
Number of seeds in city conditions, 152 lanes, 10 km for different traffic conditions.
(a)
Low traffic(b)
Medium traffic(c)
High trafficFigure 21
Number of seed’s connections in city conditions, 152 lanes, 10 km for different traffic conditions.
(a)
Low traffic(b)
Medium traffic(c)
High trafficIn terms of the probability to download the complete file, we can now see a big impact of the file size with a steep decline for moderate and large file sizes. This leads us to believe that in a city environment, where vehicles can take many different roads, nodes spend much less time connected among them, decreasing the probability to download the file as well as the average download time, as seen in Figures22 and 23. In contrast with the highway case, the average downloading time for any file, regardless of size, is over 100 seconds, and the probability to download is lower than 25%.Figure 22
Probability of successful download in city conditions, 152 lanes, 10 km for different traffic conditions.
(a)
Low traffic(b)
Medium traffic(c)
High trafficFigure 23
Performance of the P2P network in city conditions, 152 lanes, 10 km for different traffic conditions.
(a)
Average download time(b)
Probability of successful downloadBuilding on this, we can see that a highway environment allows for a much more efficient file sharing process than in the more chaotic city case. Hence, in this scenario, only small files (basically text-based information) can be efficiently shared, even in high traffic conditions.


## 6.2. Performance of the P2P Network in VANETs with CSMA/CA

We now present the results of the simulations with the MAC layer of the IEEE 802.11p standard.In Figures24 and 25, we present the main performance metrics of the P2P networks (average download delay, probability of successful download, and number of seed connections) in the most favorable conditions for the file exchange, i.e., high traffic conditions where vehicles spend more time connected, for highway and city environments, respectively. First, for the highway environment, we can see that the average download delay is much higher when the CSMA/CA protocol is enabled. It is of particular interest to see that for small file sizes, the average delay in the case of the CSMA/CA system remains somewhat the same while in the pure P2P system (without the effect of the random access protocol), this delay decreases when the file is small. We can see then that the CSMA/CA protocol introduces a high amount of overhead and control packets that greatly impact the performance of the network. Furthermore, when the CSMA/CA protocol is introduced, the probability of successfully downloading the file is very small (in the order of 0.4%), for almost all configurations of the system, except when the coverage radio is higher than 20 meters, and the file is lower than 100 MBytes. Again, due to the operation of the CSMA/CA protocol, where nodes have to wait for very long times before attempting a transmission, it is very difficult to download the file, and almost no node can do so. Finally, the number of seed’s connections is impacted, even if this parameter is mainly related to the time that nodes are inside each other’s coverage radio. When the CSMA/CA protocol is introduced, it takes much longer time for vehicles to communicate among each other, effectively reducing the connection time, i.e., the times when they recognize each other as communicating nodes.Figure 24
Comparison between the P2P network with and without CSMA/CA for highway conditions and heavy traffic.
(a)
Average download time(b)
Probability of successful download(c)
Seed’s connectionsFigure 25
Comparison between the P2P network with and without CSMA/CA for city conditions and heavy traffic.
(a)
Average download time(b)
Probability of successful download(c)
Seed’s connectionsA similar behavior is found in the city environment, namely, a decrease in the system performance, but not as marked as in the highway environment.The rationale is as follows: as opposed to the case of the highway environment where vehicles remain connected longer times creating an environment where nodes have to enter the backoff process much more often than in the city environment (where nodes remain connected much shorter times), the CSMA/CA protocol allows a faster connection and more regular transmissions in a more dynamic case (the city case) than in a more stable case (the highway case). Hence, the impact of the CSMA/CA protocol is milder in the city environment.These results are relevant in the sense that we can clearly evaluate the impact of the random access protocol in the vehicular environment. Based on this results, we can propose different protocols which impose less overhead or less control traffic in order to avoid such steep decrease in the performance of the system. Perhaps a protocol based on the ALOHA family and eliminating the acknowledgement packets could provide better results. In data dissemination for smart cities for instance, it is not of paramount importance for all the nodes to confirm the reception of the packets, while for emergency services, to avoid collisions for example, it is not feasible to eliminate these messages. However, the objective of this work is to consider the IEEE 802.11p standard most likely to be used in future VANETs, and the proposal of a more efficient MAC layer lies outside the scope of this work; thus, we leave it for future research.


## 6.3. P2P Analytical Results

We now analyze the results of the mathematical model where the connection times between vehicles follow either an exponential or a hyperexponential distribution.For the majority of cases, the connection times have aCoV>1. Therefore, we approximate these times by a hyperexponential distribution, and its parameters are calculated according to Section 4. Then, the model presented in Section 5, based on the CTMC depicted in Figure 15, is numerically solved to find the average number of leechers and seeds in clusters of vehicles, i.e., for nodes inside each other’s coverage radios. Building on this, Figures 26–28 present the average number of vehicles, seeds, and leechers for 1, 10, and 100 arrival rates to the clusters, respectively. The number of vehicles connected in a given cluster is obtained through the system simulations developed for this work. In each cluster, we consider a single initial seed, while the rest of the vehicles at the beginning are leechers with no chunks downloaded. At the bottom of each of these figures, we see the evolution in time of the number of vehicles in a given cluster (selected at random). At the top, we show the evolution in time of the number of seeds, and in the middle, we have the evolution in time of the number of leechers. For the number of leechers and seeds, we have placed a red line that corresponds to the mean number of either leechers or seeds obtained through the solution of the Markov chain. We can see that for low values of the arrival rates (λ=1 and λ=10), the number of seeds remains low even if there are many vehicles in the cluster. However, for λ=100, we can see that after an initial period, the number of seeds increases around 23, which allows the system to have enough bandwidth to efficiently share the file.Figure 26
Number of seeds, leeches, and vehicles for the hyperexponential model withλ=1.Figure 27
Number of seeds, leeches, and vehicles for the hyperexponential model withλ=10.Figure 28
Number of seeds, leeches, and vehicles for the hyperexponential model withλ=100.It is important to notice that the mathematical model has a good match with the simulation results, effectively predicting the average number of peers in the system.Similar results are obtained in the exponential case, using the CTMC depicted in Figure14. Since finding exponential distributed connection times in this vehicle environment and to avoid redundancy, we only present the cases for λ=1 and λ=100 in Figures 29 and 30, respectively. Again, the mathematical model, represented by the red line in the leechers’ and seeds’ graphs, shows a good match between the analytical and simulation results.Figure 29
Number of seeds, leeches, and vehicles for the exponential model withλ=1.Figure 30
Number of seeds, leeches, and vehicles for the exponential model withλ=100.


## 7. Conclusions

In this work, we study, analyze, and mathematically model a VANET using a P2P architecture to disseminate information in smart city applications. In the considered system, we propose that the network administrator sends the complete file to a few vehicles that will act as seeds and connect to other vehicles to share chunks of the file. We investigate the efficiency of the proposed system in terms of the probability to successfully download the file and the average delay as well as the number of seeds, leechers, and number of connections in the system.The results presented in this work can be used as guidelines for the adequate operation of the system in the sense that the network administrator can clearly see in which environments and conditions certain files can be efficiently shared and select the appropriate file format accordingly. For instance, video- or text-based files can be selected in different conditions. Specifically, video files can be sent in high traffic conditions, and text files can be sent in medium to low traffic conditions. Also, the coverage radio can be selected, knowing that coverage areas higher than 20 meters do not entail faster download times except for very small files. Also, we can see that a highway environment allows a more efficient sharing process, since vehicles spend much more time connected among them compared to more dynamic case of city environments.The mathematical results derived using the CTMC proposed in this paper closely match the simulation results, effectively predicting the operation of the P2P vehicle system. Hence, this model can be used to finely select the parameters of the system to provide an efficient file sharing service in VANETs for smart city applications, i.e., to deliver content related to the operation of the city, such as traffic updates, emergency events, cultural and sports events, and among others. Note that this is content that the city disseminates to the residents of the city and not content selected by the users.As a continuation of this work, we plan to use a more detailed vehicle simulator such as SUMO, where even real vehicle traces can be extracted, to have more control on the actual movement of vehicles, like stops and traffic lights which can greatly affect the vehicle dynamics. Also, different P2P architectures can be used where not only clusters of vehicles can share their data, but a more extensive population of peers is involved. Finally, we are interested on investigating the use of public transportation systems that can act as seeds, taking advantage of highly transited routes and their own predictive movement.



---

*Source: 7202412-2022-05-24.xml*