The research of traffic density extraction method under vehicular ad hoc network environment

Zhizhou Wu (College of Transportation Engineering, Tongji University, Shanghai, China)
Yiming Zhang (College of Transportation Engineering, Tongji University, Shanghai, China)
Guishan Tan (SAIC Motor Corporation Limited, Shanghai, China)
Jia Hu (College of Transportation Engineering, Tongji University, Shanghai, China)

Journal of Intelligent and Connected Vehicles

ISSN: 2399-9802

Article publication date: 30 July 2019

Issue publication date: 19 September 2019



Traffic density is one of the most important parameters to consider in the traffic operation field. Owing to limited data sources, traditional methods cannot extract traffic density directly. In the vehicular ad hoc network (VANET) environment, the vehicle-to-vehicle (V2V) and vehicle-to-infrastructure (V2I) interaction technologies create better conditions for collecting the whole time-space and refined traffic data, which provides a new approach to solving this problem.


On that basis, a real-time traffic density extraction method has been proposed, including lane density, segment density and network density. Meanwhile, using SUMO and OMNet++ as traffic simulator and network simulator, respectively, the Veins framework as middleware and the two-way coupling VANET simulation platform was constructed.


Based on the simulation platform, a simulated intersection in Shanghai was developed to investigate the adaptability of the model.


Most research studies use separate simulation methods, importing trace data obtained by using from the simulation software to the communication simulation software. In this paper, the tight coupling simulation method is applied. Using real-time data and history data, the research focuses on the establishment and validation of the traffic density extraction model.



Wu, Z., Zhang, Y., Tan, G. and Hu, J. (2019), "The research of traffic density extraction method under vehicular ad hoc network environment", Journal of Intelligent and Connected Vehicles, Vol. 2 No. 1, pp. 25-32.



Emerald Publishing Limited

Copyright © 2019, Zhizhou Wu, Yiming Zhang, Guishan Tan and Jia Hu.


Published in Journal of Intelligent and Connected Vehicles. Published by Emerald Publishing Limited. This article is published under the Creative Commons Attribution (CC BY 4.0) licence. Anyone may reproduce, distribute, translate and create derivative works of this article (for both commercial and non-commercial purposes), subject to full attribution to the original publication and authors. The full terms of this licence may be seen at

1. Introduction

There is an increasing need for traffic density estimation to improve the management-level transportation system. The dynamics of a traffic system can be typically expressed using three parameters – density, mean speed and traffic volume, until now, these data have been acquired by means of devices such as loop detectors, radars, magnetometers and television cameras.

While information from such devices is readily available, it not sufficient to give us a lucid picture, as the coverage of these devices is limited in terms of the area that can be monitored; hence, the full scope and real-time traffic information cannot be obtained directly (Leduc, 2008; Marti et al., 2014). Therefore, as an ideal way of collecting traffic information, the traffic parameter estimation method based on the vehicular ad hoc network (VANET) technology has become a hot area of research.

Artimy (2007) proposed a local density estimation scheme, based on the relationship of average speed and density. The author derived an equation to calculate local density, which took into account the mobility pattern and the stopping time of the vehicles, but the simulation was not conducted in VANET environment. Panichpapiboon and Pattara-Atikom (2009) proposed a traffic density estimation method under the VANET environment, which was based on the number of vehicles that were close to the probe vehicle. In that method, the overall density was estimated according to the local density, and then the traffic density of the whole road could also be estimated. This research was extended to the clustering method afterward (Panichpapiboon and Pattara-Atikom, 2011), estimating the overall density based on the cluster member information, which was collected via the cluster head. However, that model is only applicable when the space headway of vehicles obeys the exponential distribution. Fogue et al. proposed real-time traffic density estimation method under the VANET environment by means of vehicle-to-vehicle (V2V) (Sanguesa et al., 2012), vehicle-to-infrastructure (V2I) (Sanguesa et al., 2012; Barrachina et al., 2015) and V2X (Barrachina et al., 2013) technology, which verifies that the regression models can estimate the traffic density of any given city precisely. On this foundation, Sanguesa et al. (2016) proposed an improved traffic density estimation method; the effect of the whole length of road network was considered. As the method mainly focused on the average traffic density of the whole road network, the traffic density of a certain segment was not considered. Arbabi and Weigle (2009) and Kerner (2009) proposed traffic parameters’ extraction method in the VANET environment. The traffic parameters, including the time mean speed, space mean speed, traffic volume and average travel time, can be extracted. The research has been further improved (Arbabi and Weigle, 2011), and a dynamic traffic monitoring system was designed under the VANET environment. The results show that the average speed and travel time can be estimated accurately even in a low penetration rate; however, the only situation in free flow has been considered, whereas the other traffic state, such as traffic jam, was not considered.

In general, although there are some improvements in the acquisition of traffic density, the deficiencies are also apparent, which mainly reflected in the following aspects:

  • Data sources: Some researchers only use the real data from traditional traffic environment, or the static data obtained from separated simulation, both of them cannot reflect the VANET information interaction environment.

  • Simulation method: Most research studies use separate simulation methods, importing trace data obtained from the simulation software to the communication simulation software.

  • Model applicability: Most relevant research studies consider only the traffic parameter acquisition in a free-flow environment, whereas the abnormal state, such as traffic jam, has not been considered.

Therefore, considering the deficiencies of the existing research studies, the tight coupling simulation method would be applied in this paper. Using real-time data and historical data, the research focuses on the establishment and validation of the traffic density extraction model.

The remainder of this paper is organized as follows. Section 2 describes the necessary assumptions and definitions of this research; Section 3 illustrates the traffic density extraction model; Section 4 expounds the construction of simulation platform; Section 5 discusses the simulation results; and finally, Section 6 provided the conclusions.

2. Question description and parameter definition

Traffic information of any vehicles can be extracted directly from the data package that the on-board unit (OBU) sends to the road-side unit (RSU). That provides good conditions for the estimation of traffic density of the lane level, section level or even the network level. To simplify the question, the study of this paper is carried out on the basis of the following assumptions:

The Doppler effect caused by the high-speed OBU (vehicle) is not considered.

  • Every OBU (vehicle) has the same RX sensitivity and the effective transmission range.

  • Every OBU (vehicle) can get lane-level location information.

  • The penetration rate of OBU (vehicle) is 100 per cent.

  • The impact of different communication performances (package size, sending power, transmission frequency) on the extraction accuracy under the VANET environment is not considered.

  • Assuming the RSU is installed in the middle of the segments, covering all the road network.

  • The effect of Beacons-level package and MAC-level package is not considered, assuming the communication process is ideal.

Definition 1: Package – In the VANET environment, the package format of V2V and V2X communications is defined as follows.

In the packages, VID represents the unique identification of a vehicle, RID represents the unique road segment of which the vehicle is running in, Lane-ID represents the number of lanes in which the vehicles are located, and PosX and PosY represent x- and y-coordinated of the vehicles, respectively. Speed and Acc represent the real-time speed and acceleration of vehicles, respectively, and Vtype represents the type of vehicles.

Definition 2: Segment – From the RID information mentioned above, the detailed information of that segment can be acquired. Any segment can be expressed as the five-dimension group listed below:

(1) r={s(x,y),e(x,y),Vmax,n,D}n
where s(x,y) and e(x,y) represent the beginning and ending coordinates of the segment, respectively; Vmax represents the maximum speed of the segment; n represents the number of lanes; and D represents the direction of the segment D{se,es}.

Definition 3: Vehicle type – From the Vtype information mentioned above, specific information of the vehicles can be acquired. In this research, three different vehicle types are defined: large-sized vehicle, middle-sized vehicle, small-sized vehicle, expressed as L, M, S, respectively. The characteristics and driving behavior of different vehicles are quite different. The unit conversion is needed when extracting traffic parameters. The vehicle conversion coefficient ω and average vehicle length (m) are defined are follows:

(2) ω={3.0,Vtype=L2.0,Vtype=M1.0,Vtype=SLenght={12,Vtype=L8,Vtype=M5,Vtype=S

3. Extraction method of traffic density

Traffic density represents the intensive degree of a single lane, which can be explained as the number of vehicles per unit length of the roadway (Kerner, 2009). This parameter is one of the most important parameters to consider in the traffic operation fields. Under the VANET environment, in high-penetration conditions (100 per cent OBU penetration rate), the communication of V2V and V2I is stable and reliable, so there are more possibilities of the extraction of traffic density. With the help of the abundance of the data sets under the VANET environment, a real-time traffic density extraction method has been proposed as follows.

In segment l, the instant vehicle number Nli(t) of lane i at moment t is equal to the vehicle ID number that RSU received between moment t and moment t1, that is:

(3) Nli(t)=(uni(VID)×ω

In the packet Data (Vehicle), the following conditions must be met:

(4) N l i ( t ) = ( u n i ( V I D ) × ω

In the two continuous moments, probably the RSU would receive multiple data packages sent by one vehicle, which is ascribed to signal frequency and road environment. To avoid the deviation caused by duplication statistics, assuming that the function uni only represents the statistics of vehicle number that only possess a single VID.

Similarly, the number of vehicles Nji(t) in the intersection at moment t can be calculated as given in the following equation:

(5) Nj(t)=(uni(VID)×ω

The number of vehicles of all the lanes in that segment at moment t can be calculated as given in the following equation:

(6) Nl(t)=i=1i=nNli(t)=i=1i=n(uni(VID)×ω)

The instantaneous vehicle quantity of the whole road network at moment t is equal to the summary of instantaneous vehicle quantity of the segments and intersections, that is:

(7) N(t)=l=1l=mNl(t)+j=1j=pNj(t)

In the equation, m and p represent the quantity of segments and intersections in the road network, respectively.

Therefore, the instantaneous density of lane i, segment l and moment t can be calculated according to the following equation:

(8) kli(t)=Nli(t)dl=(uni(VID)×ω)dl

The instantaneous density of segment l can be expressed as follows:

(9) kl(t)=Nl(t)dl=i=1i=n(uni(VID)×ω)dl

The instantaneous density of the whole road network can be expressed as follows:

(10) k(t)=N(t)lLdl=l=1l=mi=1i=n(uni(VID)×ω)+j=1j=p(uni(VID)×ω)lLdl      

In the equations above, dl represents the length of segment l, and L represents the aggregation of all the segments in the road network.

4. Construction of simulation platform

4.1 Lane-change maneuver recognition

Based on the mature communication simulation and traffic simulation software, the mutually coupled simulation platform was constructed by means of the Veins frame; it can simulate the impact that communication has on road traffic. Meanwhile, the impact that road traffic has on communication is also available to this platform.

In the aspect of network simulation, OMNet++ was chosen as a network simulation software. It is a modular, component-based C++ simulation library and framework, primarily for building network simulators. Both C++ and NED are available for modeling. Different modules in OMNet++ are linked by ports, and the communication links are stored in NED files. Besides, OMNet++ has extensive GUI support, and owing to its modular architecture, the simulation kernel (and models) can be embedded easily into many applications (Varga and Hornig, 2008).

In the aspect of traffic simulation, simulation of urban mobility (SUMO) has been chosen as the traffic simulator. It is an open source, microscopic and multi-modal traffic simulation software. It allows simulating how a given traffic demand which consists of single vehicles moves through a given road network. Each vehicle is modeled explicitly, having its own route and moving individually through the network (Krajzewicz et al., 2012).

The Veins framework was selected to be the middleware that links network simulation and traffic simulation, in order to construct the mutually coupled VANET simulation platform (Segata et al., 2014). The communication module of the two simulators was extended by Veins, and then, the communication module interface of the traffic simulator can receive the instruction sent by OMNet++. Meanwhile, the execution of the next simulation step will be triggered, and the status of the vehicles node will also be sent to OMNet++. The overall structure of the simulation is as shown in Figure 1. It is mainly composed of middleware, traffic simulator and communication simulator. Furthermore, the map data and external application are also included. Limited to research contents, the specific external applications are not considered, and only the corresponding interfaces have been reserved. In that platform, the network simulation software OMNet++ contains a physical layer, a MAC layer and an application layer, and it can also simulate the radio broadcasting effect. SUMO plays a role in traffic simulation, including real road network, vehicles’ mobility characteristics, operation rules in the intersection, etc. The Veins contains many submodules in the VANET environment, including obstacle submodule, scene submodule, node submodule, RSU submodule. When carrying out a simulation experiment, via TCP and Python script in Veins, OMNet++ and SUMO would be mutually and tightly coupled, and the execution command and vehicle trajectory information can also be exchanged.

This simulation platform was developed in the Windows environment; the software version information and hardware platform used in the paper are listed in Table I. In the platform, Python was used to develop the submodules of OMNet++, and JOSM was used to edit the road network information, which needs to be processed in the JAVA environment, and Notepad++ was used to edit the xml documents and configuration files.

4.2 Design of simulation procedure

The processing of the VANET platform is controlled by Veins. When simulation starts, the initialization stage would be entered first; SUMO and OMNet++ will be activated by a registered executable file; and the map data and OBU and RSU would be loaded successively. The communication and traffic environment would be created by configuration files. After the initialization stage, the simulation control stage would start, which is the key stage in the simulation process. Network simulation and traffic simulation would be carried out simultaneously. Network simulation would receive, synchronize and process traffic information, and it will determine whether to change the communication parameters. Traffic simulation would send traffic information, receive communication information and process the information to determine whether to change the traffic status. The detailed simulation procedure is as shown in Figure 2.

In the simulation process, the transitive relationship between information flow and traffic flow is as shown in Figure 3.

4.3 Simulation scenario design

In this paper, urban roads of Shanghai were chosen as simulation scenarios, which include complex road network and multiple signal-controlled intersections. Besides, considering the intensive buildings and trees by the roads, the communication conditions were much stricter than the urban expressway and highway. If the model can perform well in the former environment, then it will also perform well in the latter one.

The simulated road network is in Pudong District, Shanghai, containing many complex environments, which include arterial roads (Zhangyang road), sub-arterial roads (Minsheng road), driveways and intersections. The actual road network is as shown in Figure 4. Using JOSM (Java OpenStreetMap) to consummate the map, the simulated road network transformed by SUMO is as shown in Figure 5. To simulate the impact that architectures and trees in an urban network have to package commissions, using the Polyconvert command in SUMO, based on the real conditions, the elements including buildings and trees have been added in a road network, which is expressed as colored polygons in Figure 5.

To avoid the effect of the accidental error, different random seeds are used to conduct simulation for five times. This would generate multiple simulation data sets, which can be used for validation. The simulation cycle length is 1,000 s (including 200-s system warm-up time), and the simulation time step is 100 ms, using the average value of each experiment containing five simulation times to do an analysis. In the simulation experiment, a scalar output file and a vector output file can be obtained. The scalar output file contains some statistical parameters of communication simulation and traffic simulation. It can be used to validate the mutual effect between traffic flow and information flow, whereas the vector output file contains many kinds of information such as time, location, speed and acceleration, which can be used to simulate the commission of data packages. Meanwhile, the traffic parameter extraction model can be validated based on them.

5. Simulation results analysis

When the OBU (vehicles) penetration rate reaches 100 per cent, theoretically, the traffic parameters, including accurate traffic density and space occupancy of vehicles, have no difference to the real value; therefore, in this section, only the practicability of the traffic parameters extraction method has been validated.

The intersection of arterial road “Zhangyang road” and branch road “ZhiYuanshen road” and four segments nearby have been chosen to conduct the simulation analysis, shown as the orange line in Figure 5. In that region, the Zhangyang road is bi-directional and has four lanes, and its segment length is 1,015 m. The Yuanshen road is bi-directional and has two lanes; the segment length is 912 m and the signal cycle length is 90 s. In the LOS C environment (stable traffic flow), simulating the ordinary traffic state and accidental traffic incidents, 740 million and 92 million data information were obtained, respectively. Before importing into MATLAB to extract traffic parameters, the text information in packages is required to be digitalized first, and the process is shown as follows:

For the “id” column, 0 represents west–east straight direction, 1 represents west–north left-turning direction, 2 represents west–south right-turning direction, 3 represents east–west straight direction, 4 represents east–south right-turning direction, 5 represents east–south left-turning direction, 6 represents south–north straight direction and 7 represents north–south straight direction. For the “type” column, the value below represents space headway of vehicles, 6.5 represents small vehicles, 10 represents middle vehicles and 14.5 represents large vehicles (Figure 6).

During the ordinary traffic state, taking the west segment of Zhangyang road (west →) as an example, the real-time traffic density of the whole segment is as shown in Figure 7. To be detailed, the density of different lanes is as shown in Figure 8. Lane-1 represents the rightmost lane and Lane-4 represents the leftmost lane. From the figure, it can be concluded that Lanes 1, 2, 3 presents cyclical fluctuation, the peaks of the wave are corresponding with red light, which means it is about to switch to green. While the valleys of wave mean it is about to switch to red. The fluctuation cycle is about 100 s, which is close to the signal cycle length (about 90 s).

These illustrate that traffic lights would probably lead to the intermittent activating and braking periodically to the stable traffic flow. When referred to the real-time density of the leftmost left-turn lane, the density shows small-scale fluctuations, but there is no evident periodicity; on the one hand, it is owing to the small amount of left-turn traffic demand. Further, it means the left-turn traffic light can meet the left-turn traffic demand. Additionally, the results also indicate that the real-time traffic density of different lanes is distributed quite unevenly. The leftmost lane shows minimum average density; meanwhile, the second left-turn lane reveals the maximum average density, which puts forward different requirements for traffic control. It is difficult to obtain the real-time traffic density of different lanes and the real-time lane-level traffic management and control under VANET environment by traditional methods.

As for the accidental traffic incidents environment, during the simulation process, the speed of a particular vehicle is set to be 0 km to simulate the occurrence of a traffic accident. From Figure 8, it can be observed that the traffic density of segments still presents periodic fluctuation, but the traffic accidents lead to an increase in segment traffic density. During 420 s and 750 s, the fluctuation of segments’ traffic density becomes much violent, and the peak of wave is higher when compared with the peak in ordinary traffic conditions, lasting about 330 s, which is a little longer than the simulation setting time (300s). This is because, the blocking flow caused by traffic accidents needs some time to dissipate. Moreover, this simulation experiment also shows that the precise real-time traffic parameter (less than 3-5 min) is of great importance to monitor the traffic accidents. In the actual applications, traditional traffic parameter acquisition device needs at least 5 min to upload the data, which is not able to be used in the monitor of short time traffic accidents (Figure 9).

6. Conclusion

The main contribution of this paper is the formulation of a traffic density extraction method under the VANET environment. This method represents a novel approach to extracting the vehicle density of lane level, segment level and network level, which overcome the disadvantages of the traditional methods. Meanwhile, based on the SUMO traffic simulator, the OMNet++ communication simulator and the Veins framework, a two-way coupled VANET simulation platform was constructed. Using the platform to validate the model, it has been verified that this model is pretty applicable to the complex traffic conditions.

In the real VANET environment, the data obtained would contain outlier data and missing data. Although random noise was added in the simulation process, there still exists a gap between actual data and simulation data. On this foundation, the following study should focus on increasing the authenticity of the data and enriching the variety of the extraction of traffic parameters.


Structure of VANET simulation platform

Figure 1

Structure of VANET simulation platform

Simulation procedure

Figure 2

Simulation procedure

Interactional relationship of traffic flow and information flow

Figure 3

Interactional relationship of traffic flow and information flow

Actual road network

Figure 4

Actual road network

Road network constructed by SUMO

Figure 5

Road network constructed by SUMO

Text information digitalization results

Figure 6

Text information digitalization results

Real-time traffic density of the whole segment in ordinary traffic conditions

Figure 7

Real-time traffic density of the whole segment in ordinary traffic conditions

Real-time traffic density of lanes in ordinary traffic conditions

Figure 8

Real-time traffic density of lanes in ordinary traffic conditions

Real-time traffic density of segments in fortuitous accidents conditions

Figure 9

Real-time traffic density of segments in fortuitous accidents conditions

Hardware platform

Hardware platform
Processor Intel(R) Core(TM) i7-3632QM CPU M330 @ 2.20GHz
Memory 4.00GB
Display Intel(R) HD Graphics 4000/NVIDIA GeForce GT 730 M
Software version
Operating system Windows7 (64 bit)
Network simulation OMNet++ 5.0
Traffic simulation SUMO-0.27.1
Middleware Veins-4.4
Adaptive software Python 3.6, JOSM, JAVA1.8.0, Notepad++


Arbabi, H. and Weigle, M.C. (2011), “Monitoring free flow traffic using vehicular networks”, Consumer Communications & Networking Conference.

Arbabi, M.H. and Weigle, M.C. (2009), “Using vehicular networks to collect common traffic data”, International Workshop on Vehicular Ad Hoc Networks.

Artimy, M. (2007), “Local density estimation and dynamic transmission-range assignment in vehicular ad hoc networks”, IEEE Transactions on Intelligent Transportation Systems, Vol. 8 No. 3, pp. 400-412.

Barrachina, J. et al. (2013), “V2X-d: a vehicular density estimation system that combines V2V and V2I communications”, Wireless Days.

Barrachina, J., et al. (2015), “A V2I-based real-time traffic density estimation system in urban scenarios”, Wireless Personal Communications, Vol. 83 No. 1, pp. 259-280.

Kerner, B.S. (2009), Introduction to Modern Traffic Flow Theory and Control.

Krajzewicz, D., et al. (2012), “Recent development and applications of SUMO – simulation of urban MObility”, International Journal on Advances in Systems & Measurements, Vol. 3 No. 4, pp. 128-138.

Leduc, G. (2008), “Road traffic data: collection methods and applications”, JRC-IPTS Working Papers.

Marti, M., et al. (2014), “Traffic data collection improvements”, Data Collection.

Panichpapiboon, S. and Pattara-Atikom, W. (2011), “Exploiting wireless communication in vehicle density estimation”, IEEE Transactions on Vehicular Technology, Vol. 60 No. 6, pp. 2742-2751.

Panichpapiboon, S. and Pattara-Atikom, W. (2009), “Evaluation of a neighbor-based vehicle density estimation scheme”, International Conference on Its Telecommunications.

Sanguesa, J.A., et al. (2012), “Real-Time density estimation in urban environments by using vehicular communications”, Wireless Days.

Sanguesa, J.A., et al. (2016), “On the study of vehicle density in intelligent transportation systems”, Mobile Information Systems, Vol. 2016 No. 5, pp. 1-13. 2016,(2016-2-21).

Segata, M., et al. (2014), “Plexe: a platooning extension for veins”, 2014 IEEE Vehicular Networking Conference (VNC).

Varga, A. and Hornig, R. (2008), “An overview of the OMNeT++ simulation environment”, International Conference on Simulation Tools & Techniques for Communications.


The authors would like to acknowledge the support of Shanghai Science and Technology Commission (Project No. 16DZ1204002), National Natural Science Foundation of China (No. 61773288) and Fundamental Research Funds for the Central Universities (No. 1600219316). The authors would also like to express their sincere thanks for the valuable comments and criticisms.

Corresponding author

Yiming Zhang can be contacted at: