Intelligent Traffic Management System Based on the Internet of Vehicles (IoV)

)e present era is marked by rapid improvement and advances in technology. One of the most essential areas that demand improvement is the traffic signal, as it constitutes the core of the traffic system.)is demand becomes stringent with the development of Smart Cities. Unfortunately, road traffic is currently controlled by very old traffic signals (tri-color signals) regardless of the relentless effort devoted to developing and improving the traffic flow. )ese traditional traffic signals have many problems including inefficient time management in road intersections; they are not immune to some environmental conditions, like rain; and they have no means of giving priority to emergency vehicles. New technologies like Vehicular Ad-hoc Networks (VANET) and Internet of Vehicles (IoV) enable vehicles to communicate with those nearby andwith a dedicated infrastructure wirelessly. In this paper, we propose a new traffic management system based on the existing VANETand IoV that is suitable for future traffic systems and Smart Cities. In this paper, we present the architecture of our proposed Intelligent TrafficManagement System (ITMS) and Smart Traffic Signal (STS) controller. We present local traffic management of an intersection based on the demands of future Smart Cities for fairness, reducing commute time, providing reasonable traffic flow, reducing traffic congestion, and giving priority to emergency vehicles. Simulation results showed that the proposed system outperforms the traditional management system and could be a candidate for the traffic management system in future Smart Cities. Our proposed adaptive algorithm not only significantly reduces the average waiting time (delay) but also increases the number of serviced vehicles. Besides, we present the implemented hardware prototype for STS.


Introduction
In many countries, including several developed countries, regardless of the extensive efforts devoted to develop and improve traffic flow, traditional traffic signals still have the following well-known problems: (a) ey provide inefficient time management on road intersections. is forces vehicle commuters to wait unnecessarily, which in turn causes traffic jams, pollution, extra delays, etc.
(b) Intelligence cannot be obtained and they are not adaptive. Currently, at intersections, each road is assigned a constant fraction of time to be green regardless of the number of vehicles or flow density. is generates inefficient traffic flow by not distributing time according to traffic congestion. In some periods during the day, some roads may be more crowded than others, requiring more time to reduce congestion. However, the traditional traffic signal cannot provide this feature. (c) ere is a need for a signal that directly closes once there are no more vehicles on the road in an intersection and opens the next road to avoid unnecessary waiting until the constant timer expires as explained in point a and point b.
(d) ey are not immune to some environmental conditions, like rain, fog, and the like. us, they may not work correctly in these conditions or be visible. is causes accidents and fatalities. (e) ey have no method of giving priority to emergency vehicles (Ambulances, Firemen, Police, etc.). Such vehicles require intelligent traffic signals to open the road for them even before arriving at the intersection. (f ) ere are many other drawbacks of the traditional traffic management systems due to the inability of the traditional traffic signals to help provide dynamic and adaptive services.
Based on the previously mentioned drawbacks of the traditional traffic management system, it is clear that there is a great need to improve its functionality by providing some form of intelligence to enable dynamism and adaptivity. is, in turn, can help in reducing traffic jams and road congestion, thus minimizing the travel time and reducing pollution. e traditional traffic management system was designed several decades ago. e number of vehicles was very small at that time and the traditional system was sufficient to efficiently manage the traffic with the available technology at that time. It is clear that with the massive increase in the number of vehicles and the inability to increase the sizes and the number of roads in many cities, there is a need for smarter solutions that use recent and most sophisticated technologies to adopt a smart traffic management system. us, there is a great and urgent need to replace the traditional traffic signal system with a new system: An Intelligent Traffic Management System (ITMS).
is ITMS system will provide many services that cannot be provided by the traditional system and it will solve the previously mentioned problems.
Internet of Vehicles (IoV) [1][2][3][4] or connected vehicles is a recent research venue that allows the development of many promising applications in Smart Cities [5][6][7] based on the Intelligent Transportation Systems (ITS). IoV [8] will be deployed widely in Smart Cities. us, instead of deploying dedicated infrastructure and very complex and expensive legacy systems to control and manage traffic, why not use the essential building block of future Smart Cities without any extra complexity and provide a better performance, hence solving most of the problems in the old system. ere are many efforts in the literature seeking intelligent traffic control. Most of the existing approaches rely solely on counting the vehicles on each road segment at the intersection.
ese approaches are named sensor-based technologies that include inductive loops, magnetometer, microwave radar, laser radar, ultrasonic, acoustics, video cameras [9], and counting cables [10]. In-depth studies of these sensor-based approaches are given in [11,12]. Table 1 summarizes the features of each of these approaches. However, these techniques cannot be deployed largely because of the complexity and the very high manufacturing cost. In addition, they are not scalable or reliable. Damage of the counting cable and even the video cameras can limit the reliability of the whole system.
In this paper, we propose the use of the existing IoV and VANET infrastructure to provide an efficient and intelligent traffic management system. We provide the details of the proposed architecture that reuses the same building blocks of IoV and VANET without incurring any further complexity of extra components or hardware or any special deployment. We propose the Smart Traffic Signal architecture and its operation. Furthermore, we present an adaptive algorithm to provide efficient and near-to-theoptimal traffic management of local intersections supporting any number of phases that is fully parameterized. Moreover, we present a simulator that we have developed for simulating and studying the effectiveness of the proposed algorithm compared to the fixed-time algorithm under different traffic conditions and in different scenarios. One essential feature of the proposed architecture is that it supports any adaptive algorithm without having to change the architecture. Tables 2 and 3 show the most used abbreviations in this paper.
In the proposed system, there will be no need for color lights. Vehicles will be able to communicate with the Intelligent Signals wirelessly to achieve their services and provide the following features: the ideal traffic flow as the opening (green light) for any road will be based on a dynamic priority; the opening time will be based on the number of waiting vehicles. is can optimize the waiting time (reduce the delay), reduce traffic congestion, give priority to crowded roads, and eliminate useless openings, thus facilitating adequate traffic flow. is in turn can reduce the total travel time and hence reduce pollution and fuel consumption. e ITMS can also provide priority access to emergency, police, and firefighter vehicles to seamlessly navigate the roads and arrive at open intersections. e rest of this paper is organized as follows. Related works are presented in Section 2. Technologies that are essential for developing the proposed Intelligent Traffic Management System (IMTS) are highlighted in Section 3.
is includes VANET, IoV, and Positioning Systems. Furthermore, Section 4 provides the details of the proposed IMTS architecture, the Smart Traffic Signal (STS), and the operation of the IMTS. In Section 4.1, we provide the proposed adaptive algorithm for traffic management and signal control to reduce the average waiting time and increase the number of serviced vehicles. In Section 5, we present our developed simulator and the obtained results. Finally, Section 6, provides the general conclusion and the future research direction.

Related Works
e problem of road traffic management has been an active research topic for several decades. Several attempts to propose an intelligent traffic control system are found in the literature. For example, in [13], the design of the Intelligent Traffic Light Controller Using Embedded System is proposed. Again, they use the traditional means to count the number of vehicles. In [14], the development of an intelligent traffic light for reducing traffic accidents is proposed. In Installation and maintenance costs and efforts. Not working well in bad weather conditions. Very expensive. Vehicle-to-vehicle communication V2I Vehicle-to-infrastructure communication Number of vehicles queued on the road r within a distance D max from the intersection [15], an intelligent traffic light control method based on the extension theory for crossroads is presented. An Agent Approach for Intelligent Traffic-Light Control is presented in [11]. e most common method is to install a tricolor signal at each road intersection to manage the access to the critical section (the intersection). Several variants of priority and critical section access are deployed. One of the variants is the round ribbon, which allocates a constant time for the open road (turning on the green light), then a fixed time for the transition period by turning on the yellow light, and then closing the road by turning on the red light, and repeating the process for the next road, etc. is is the least effective approach for managing traffic; however, it is the most common system worldwide except in several developed countries.
An algorithm to manage the operation of a single traditional traffic light signal for an intersection having fourway roads is presented in [16], suggesting adjusting the traffic according to the traffic condition. Although the proposed algorithm is claimed to be adaptive, it considers fixed periods of the days similar to the study presented in [17]. Similarly, a calendar-based history information approach is proposed in [18].
Another study using multi-agent communication based on edge computing architecture and IoT for traffic light control is presented in [19]. e authors propose a multiagent reinforcement learning (MARL) system for global traffic signal management. Similar studies based on MARL are presented in [20,21]. Other agent-based approaches are given in [11,12]. Another study using reinforcement learning is given in [6] to maximize the number of vehicles crossing the intersections using Q-learning. Similarly, deep reinforcement learning is proposed in [22]. Ant colony optimization approach is proposed in [23] and the artificial bee colony optimization approach is proposed in [24]. Social IoV [25] proposed for managing traffic is presented in [26].
Several studies are based on the congestion level of the roads. For example, in [27], an adaptive algorithm is presented and evaluated. In this study, the aim is to use V2V so that each vehicle can estimate the congestion level of the traffic and can reroute to the least congested route. Another study based on V2V communication is proposed in [28]. A framework for traffic optimization based on vehicle rerouting to reduce traffic congestion is given in [29]. In another study in [30], a system based on V2I communications is proposed. In addition, this study considers securing incident detection and dissemination from different types of attacks. Different experiments for traffic signal control based on the Floating Car Data (FCD) are given in [31]. FCD was used also in [32] for management techniques of vehicle tracking data.
Modular Timed Synchronized Petri Net model is proposed in [33] for traffic signal management to reduce environmental impact. Pareto max flow algorithm is presented in [34] and Cellular Genetic Algorithm is proposed in [35].
ere are several research works on using cameras to count the number of vehicles for traffic management and optimization. A recent study using the Internet of smart-cameras is presented in [36]. e solution is based on WSN and VANET by deploying a very large number of cameras connected in a dedicated infrastructure. e video stream of the cameras is sent to centralized servers to process them and extract useful traffic information that can be used to control the traffic signals. Other studies based on WSN are provided in [37,38]. Several approaches based on IoT are proposed such as in [5,39]. e authors in [40] propose the use of expert systems and AI to process the images extracted from cameras for traffic management. Pheromone-based Multi-Agent System based on the use of cameras and sensors is proposed in [21].
An interesting study selecting the best charging station for electric vehicles according to the traffic condition to minimize commuting time is presented in [41]. A parallel algorithm to synchronize intersections in large and dense zones suggesting improving the average speed-based Bus Rapid Transit is proposed in [42]. A similar study based on a hybrid heuristic approach is presented in [43]. Finally, in [44], the authors suggest the use of the speed of vehicles at the intersection as an optimization parameter for traffic light control.
In this paper, unlike the previously mentioned studies, we provide a complete architecture of a smart traffic management system and a smart traffic signal controller based on IoV technology that can be deployed effectively. Although other studies already suggested the use of V2I communication as the basis of the traffic management system, in this paper, we provide a complete study and performance analysis for different traffic conditions. As stated before, this study does not require any extra hardware like counting cables, computer vision, and camera systems [21,36]. ere is no need for expensive and complex systems to extract useful features such as computer vision or deep learning approaches [5,39,40] or parallel processing [42].

Technologies to Implement ITMS
is Section presents the Vehicular Networks, which are the base communication technology for the system. en, an overview of the positioning system is provided.

Vehicular Networks.
e direct communication between vehicles using an Ad Hoc network is referred to as intervehicle communication (IVC) or Vehicular Ad-hoc NETworks (VANETs) [45][46][47][48]. VANET has two communication types. Vehicle-to-Vehicle (V2V) communication allows vehicles to exchange messages among them on the road. Vehicles can communicate with an infrastructure deployed alongside the roads using Vehicle-to-Infrastructure (V2I) communication. Each vehicle has its Onboard Unit (OBU) that is similar to the vehicle computer with extra features allowing the services and layers of VANET. e infrastructure is a network of Roadside Units (RSU) that is installed on the roadside. Figure 1 depicts the topical architecture of VANET. e next generation of VANET is referred to as the Internet of Vehicles (IoV) [8,[49][50][51] that extends the functionality of VANET and inherits several features of the Internet of ings (IoT). In Addition to V2V and V2I communication services, IoV includes several others. As shown in Figure 2, IoV involves V2P (Vehicle-to-Pedestrian, allowing the communication with vulnerable road users), V2S (Vehicle-to-Sensor, on the inside of the vehicle), V2H (Vehicle-to-Home, of the owner of the vehicle), V2B (Vehicle-to-Building, the surrounding buildings in the smart city), V2G (Vehicle-to-Grid, for electric charging), V2D (Vehicle-to-Device, for all the onboard devices), and V2R (Vehicle-to-Road signs). IoV and VANET are the main enablers of the future Intelligent Transportation Systems (ITS) [52] as shown in Figure 3. e wireless communication is subject to the IEEE 802.11p standard that defines enhancements to IEEE 802.11 standards required to support Intelligent Transportation Systems (ITS) applications. e IEEE 802.11p controls data exchange between high-speed vehicles and between vehicles and the roadside infrastructure (RSUs) in the licensed ITS band of 5.9 GHz (5.85-5.925 GHz) [53].
VANETs/IoVs allow the development and creation of many new services. Safety-related services include crash or collision avoidance, emergency warning system, lane-changing assistant, intersection coordination, traffic sign/signal violation warning, road-condition warning, and traffic violation detection [54]. Other services may include toll collection, commerce transactions via vehicles, traffic information systems, navigation, automatic driving, weather information, gas station or restaurant locations, and interactive communications such as Internet access, music download, exchanging messages between drivers or passengers, and multimedia entertainment. For more details, please refer to [55].

Positioning
System. IoV/VANET technology is still in the research phase, where there are some challenges to be undertaken before its actual deployment in the Smart Cities. e most critical one is the positioning system (aka localization system) for the vehicles. In other words, this system answers the question "how to provide each vehicle with its real-time location?" ere exist several positioning techniques that are suitable for different application categories [56][57][58][59][60][61]. Each application or service provided by IoV/ VANET has its own requirements of the positioning system. Some applications may tolerate some error levels in the positioning information. Other applications require a very accurate and reliable positioning system. An example of the first category is traffic management applications. Most of the safety applications, on the other hand, require the second category. Some examples are collision avoidance, automatic driving, and lane tracking. e accuracy of the positioning system must be within the centimeter. In addition, its availability must be guaranteed. If it fails for some time, catastrophic circumstances may occur such as collisions.
e most common and widely used Positioning System is the Global Navigation Satellite System (GNSS) [62][63][64], a satellite navigation system with global coverage. ere are several GNSS systems, namely, Global Navigation Satellite System (GLONASS) [65,66], Global Positioning System (GPS) [67][68][69], BeiDou Navigation Satellite System (BDS) [70], Galileo [71], Quasi-Zenith Satellite System (QZSS) [72,73], and others. GNSS positioning systems have several drawbacks. e most unacceptable disadvantage would be the inaccuracy of the resulting measurements. For example, GPS devices can produce an error of up to 10 meters. is accuracy may seem to be acceptable for several Although there are several ways to improve the accuracy of the GNSS systems, such as using a ground base station that acts as a correcting base station (examples Differential GPS and RTK), GNSS still suffers from weak signals and thus do not work efficiently in tunnels, underground, and in highly dense areas with buildings. One way to overcome the accuracy problem and to provide centimeter-location service is by combining two or three frequencies broadcasted by each GNSS constellation as used in [74]. Furthermore, PPP (Precise Point Positioning), refer to Figure 4, is another technology that aims to provide a very accurate positioning service based on GNSS by providing worldwide networks for error corrections in real-time. Corrections are transmitted to the vehicle using RSU (Roadside unit) in VANET/IoV or directly from the Internet. Lastly, RTK (Real-Time Kinematic), as shown in Figure 5, sends error corrections from reference receivers in the city. e range of the coverage of the receiver can reach up to 40 Km. On the other hand, nanotechnology is a field of science that is concerned with controlling matter on a scale between 1nm and 100 nm. It provides solutions for sensing, actuation, radio, embedding intelligence into the environment, power-efficient computing memory, energy sources, human-machine interaction, materials, mechanics, manufacturing, and environmental issues. A proposal for using Nanotechnology as a positioning system for VANET is given in [59,76]. ere are other positioning systems that are used in IoV and VANET such as the Received Signal Strength [58,60,[77][78][79], and UAV [80].

Proposed Intelligent Traffic Management System (ITMS)
e overall architecture of the proposed Intelligent Traffic Management System (ITMS) is shown in Figure 6. e architecture inherits all the features and the functional layers of IoV. However, the Onboard Unit (OBU) is upgraded by adding several modules that are essential for the operation of the ITMS. A new component is added which is the Smart Traffic Signal (STS). ese two components operate together in order to provide all the required services from the ITMS. In the next subsections, we provide details about each component.   (vehicles, infrastructure, RSU, pedestrians, sensors, road equipment, cloud servers, grid, devices, etc.). (b) GNSS and Location Service Unit allows the vehicle to know its current position, its speed, and its direction in degrees. (c) V2S and S2V Communication Unit is used for the Vehicle-to-Signal and Signal-to-Vehicle communication (an additional communication protocol that is essential for exchanging messages between the vehicle and the STS). (e) Driver UI is used for the communication with the driver of the vehicle. is unit must have an LCD to display the information to the driver as well as loudspeakers to give audible instructions to the driver. is unit should also implement a speech recognition engine to interact verbally with the driver. It displays and voice prompts the driver to  Base receiver measurement data provided to rover receiver to-Vehicle functionality enabling communication among nearby vehicles. (g) Wireless Transceiver Unit allows the communication between the vehicle and the STS. e vehicle will send its position, speed, direction, and other information to the smart signal. e traffic information is received from the smart signal wirelessly. is information contains which road direction has passsignal and how much time is remaining. e wireless system is configured to work in Ad-Hoc networking mode to be able to communicate with the smart signals (h) e System Controller controls the operations and other devices in the system. (i) Security and Antitampering Unit that implements the necessary level of security and privacy of the vehicles. is contains the digital certificate of the vehicle that has been issued by the traffic authority or the vehicle manufacturer. It must contain also a group of anonymous certificates issued for this vehicle to be used for communication among other vehicles to maintain the privacy of the driver and prevent tracking of the vehicle. is unit is responsible for securing the communication between the vehicle and other entities including the traffic signals. RSUs will periodically broadcast the certificates of the trusted smart traffic signals to ensure that the vehicle is always communicating with a legitimate traffic signal. For the security aspects of ad-hoc networks and securing such systems and more specifically IoV and interconnected vehicles, please refer to [1,51,76,[81][82][83][84][85][86][87][88].

Smart Traffic Signal (STS) Controller.
e Smart Traffic Signal (STS) is a system that has to be placed in the center of the road intersection or any corner as shown in Figure 7. It must contain the following components as shown in Figure 6.
(a) Intersection Priority Management that implements the priority of the intersection at which this smart signal is placed.

Operation of the STS.
e operation of the smart traffic signal is as follows: (i) e STS will not have the traditional three lights; instead, it will broadcast the signals wirelessly using the S2V communication unit.
(ii) No need to place a GNSS receiver in the STS; its position can be programmed once by the engineer responsible for installation. However, if the STS will be used as GNSS/RTK error correction ground base station, it must include the GNSS receiving unit so that it can calculate the error and send it to the nearby vehicles to accurately calculate their location, speed, and direction.
(iii) e wireless transceiver enables the STS to communicate wirelessly with the vehicles, collect the locations of nearby vehicles, and broadcast the traffic control information (the pass-signal to specify which road can pass and the others have to stop).
(iv) e controller controls and manages the operations of the STS. It takes the decision based on the adaptive algorithm that will be explained later.
(v) e STS in each intersection receives the information from the waiting vehicles on each road. e collected information is vehicle UID from its certificate or any of the anonymous certificates list in the case when the privacy of the vehicles is mandated, vehicle current position, vehicle speed, and vehicle moving direction. e STS periodically collects all the information and updates its internal database. (vi) e controller, based on the current road statistics obtained from the vehicle's information in the internal database, executes the desired algorithm (details are given in the next subsections) and decides which road has to be opened at any given time. It sends this information wirelessly using the broadcast mode so that all the vehicles waiting in the intersection know if they can move forward (pass) or stop. (vii) It should be noted that pedestrian handling is out of the scope of this paper. is could be explored in future research work. . is information, if used by an efficient ATMA, can lead to optimal traffic management. In this subsection, we present the proposed ATMA that governs the operations of the STS. We define the parameters and symbols used in the proposed algorithm in Table 3. e pseudocode of the main algorithm is defined as shown in Algorithm 1 listing. e algorithm to select the next open road in the intersection is given in the Algorithm 2 listing. Handling the emergency or priority vehicles is given in Algorithm 3. Please refer to Figures 8-10 for a flowchart illustration of each part of the algorithm.
As depicted in Algorithm 1 listing and in Figure 8, after initializing the variables, the system repeats forever the following. It calculates the number of vehicles in each road with the distance to the intersection <D max . In the case when there are no more vehicles within D max in the open road (the open road is empty), the road is closed after waiting for the transition period. en, select the next open road. At any time if an emergency or priority vehicle arrives on any closed road, then send a warning message to all vehicles on the open road (r g ) that the road will be closed now due to the existence of an emergency or priority vehicle on another road. en, wait for the transition time, T y , and after that close the open road, r g . en, open the road (r em ) having the emergency vehicle and keep it open until the emergency vehicle sends a message that it has crossed the intersection (overriding the T r max threshold). On the expiration of the green timer, the system will decide dynamically which road should be open. A dynamic algorithm called "Select Next Open Road" (as shown in Algorithm 2 listing and Figure 9) is devised to estimate the best road to open in order to optimize the traffic flow, minimize the average waiting time, and increase the number of serviced vehicles (crossing the intersection): (i) To prevent starvation (few vehicles waiting too long on a road while there are many vehicles on the other roads), find the road with the largest close time with the condition that it has vehicles, excluding those having no vehicles. If this road is closed more than T r max , then this road will be the next one to open. (ii) Otherwise, the road having the largest number of vehicles will be the next one to open. (iii) e green time (the open time) will be set dynamically as the ratio of the number of vehicles of the selected road and the total number of waiting vehicles on all the roads multiplied by the cycle time T turnover . (iv) Adjust the calculated green timer to be within the maximum and minimum allowed values for the open timer.

Operation of the Smart Traffic Management System.
Since IoV is used when any vehicle is going to travel on any road, before going to that road, it must know all the public keys of all the STSs. is can be downloaded to the internal memory of the On-Board unit using the RSU or directly from the server using long-distance communication (e.g., 4G, 5G, LoRa, etc.). e vehicles will trust only the STS's with these public keys. is is to avoid any attack from any fake or malicious STS. In this section, we are going to explain the overall operation procedure and algorithm that manage the functionality of the Intelligent Traffic Management System.
(i) Each STS periodically broadcasts its digital certificate, the heading angles, the Ending Lines (ELs) points P i1 and P i2 coordinates.
(ii) e vehicles that are on the intersection managed by this STS can know the Ending Line of the current road. ey will not cross it unless this road opens. If for any reason the vehicle crosses this line while the state of the current road is "Closed," the vehicle will record it in its internal memory as a red-light signal crossing violation. e information that will be saved is the STS ID, the current road, the current location, the Ending Line (EL) points P i1 and P i2 coordinates, and the current time.
Knowing this is very simple by using the heading angle, the current location, and the Ending Line. (iii) When the vehicle is approaching the intersection, it broadcasts its location and its heading angle. is information will be received by the STS.  Set t g � τ (1) Set t r (r g ) � τ (2) # To prevent starvation, find the road with the largest close time with the condition that it has vehicles, excluding those having no vehicles (3) Let r lw represents the road with the longest close time and initialize it to −1 (4) For x in all the roads R: (5) if [τ − t r (x)] > T r max and V(x) > 0 then Set r lw � x (6) If r lw > � x, then Set r g � r lw else Set r g � argmax [V(r)] # select the road having the largest number of cars (7) # now specify the green light time based on the number of cars (8) Let Set g t � (V(r g )/N v × T turnover ) (10) # Adjust the calculated green timer to be within the maximum and minimum allowed values for the open timer (11) If g t > T g max then Set g t � T g max (12) Else if g t < T g min then Set g t � T g min End of "Select Next Open Road" algorithm. Inputs: R, L(r), T g min , T g max , T r max , T y , T turnover , SL r , d ir , D max as defined in Table 3.

Initialize variables (1) For each r in R (i)
Set t r (r) � τ # set the closing time for the roads equals the current time (ii) Set V(r) � 0 # initialize the vehicle counts in all the roads (2) Set g t � (T g min + T g max )/2 # initialize the Open Timer to the average of the minimum and maximum open timers (3) Set r g � 1 # Set the current open road to be the first one (4) Repeat forever: (5) Calculate the number of vehicles in each road with the distance to the intersection <D max # To minimize the computation and iterating on a very large number of entries, we use the following approach: (6) # For the open road, when a vehicle is crossing the intersection stop line SL r g from any lane L(r g ),  (11) Wait for the transition time, T y (12) Close the open road, r g (13) Call "Select Next Open Road" algorithm. (14) If (Emergency vehicle on a Closed Road r em ): (15) Call Handle_Emergency_Vehicle (r em , r g ): (16) If τ > (t g + g t ): # When the green timer expired (17) Call "Select Next Open Road" algorithm. Journal of Advanced Transportation timer that is assigned to each road. is timer is reset each time this road is closed (changing its state from open to close). e STS checks all these timers before making the decision on which road will be opened. If it finds any of these timers exceeding the maximum allowed closing time, it selects the road having the max value of this timer and opens it.
(x) In the case where one road has an approaching emergency vehicle (police, ambulance, firemen, etc.), the normal procedure is suspended, and that road will open immediately until the emergency vehicle crosses the intersection. Subsequently, that road closes and the normal procedure takes effect once more. (xi) Before opening the road for the emergency vehicle, the STS sends a warning signal to all the vehicles and waits three seconds before closing the currently opened road and opens the road having the emergency vehicle. (xii) When installing the STS, it has to be programmed to ensure its absolute position (error-free) and the To handle the situation when there is an emergency vehicle on a closed road Inputs: r em : the closed road that has the emergency vehicle r g : the currently open road (1) Send a warning message to all vehicles on the open road (r g ) that the road will be closed now due to the existence of an emergency vehicle on another road (2) Wait for the transition time, T y (3) Close the open road, r g (4) Open the road (r em ) having the emergency vehicle (5) Keep that road (r em ) open until the emergency vehicle sends a message that it has crossed the intersection (overriding the T r max threshold) (6) Wait for the transition time, T y End of "Handle Emergency Vehicle" algorithm. heading angle (d1, d2, d3, d4, d5, etc. as in Figure 6) for each road that joins that intersection.

e Procedure of Installing the STS.
Each STS must be installed and set up in a specific way to operate correctly.
Here are the steps that must be followed for each STS in an intersection, please refer to Figure 6.
(1) All STS hardware must be placed in the middle of the intersection or in any corner of any road on the condition that the emitted signals can reach all the vehicles in all the roads for at least a length of 400 meters in any of the roads. (2) Its absolute position is not required; thus, there is no need to have GPS receiver in its hardware. (3) e engineers must use a centimeter-accurate positioning system, namely, RTK or DGPS to obtain the coordinates of the Ending Line (EL) of each road. Each road, i, has an Ending Line (EL i ) where the vehicles must not cross while this road is closed. Each Ending Line has two points (P i1 and P i2 ) intersecting with the road edges. e exact accurate coordinates of P i1 and P i2 must be measured and saved in the STS.
(4) For each road i, the heading angle di must be calculated and saved in the STS. (5) e STS must be connected to the infrastructure by any of the following communication means: cellular networks 3G, 4G, or 5G; fiber optics; microwave communications; or any long-distance reliable data communication. (6) A digital certificate, which is issued from the traffic authority CA, must be saved in the STS. It must contain the public key of that STS. It will be used to encrypt any message sent to that STS. In addition, the private key related to that public key must be saved in the memory of the STS. is private key will be used to digitally sign any message sent out from that STS.

Hardware Implementation of STS.
We have implemented the system in a hardware prototype to test and validate the operation of the STS controller for traffic management. is hardware is for a single STS for managing traffic locally.

ITMS Simulator.
We have developed an event-based simulator in Python simulating the proposed algorithm. e simulator is fully parameterized to simulate any intersection having a variable number of roads in the intersection. Vehicles' inter-arrival time in each road is obtained by exponential random distribution function expovariate (1/rate), with the rate (real number) being the desired mean rate. For example, if rate � 0.5, this means that the mean of the interarrival time between two vehicles on this road is 0.5, that is, approximately two vehicles every one second. Each road can have a specific inter-arrival rate. Queuing theory is used to implement the vehicle's state starting from its arrival into the D max waiting for the ITMS to open its road according to the proposed algorithm until it reaches the top of the queue and crosses the intersection line, EL g . e time required by a vehicle to cross this line, t s , is parameterized. In addition, the following parameters are implemented and can be set to any value to study their effect: R, T g min , T g max , T r max , T y and L(r).
In addition, the simulator simulates the Fixed-Time algorithm that exists in all the legacy tri-color traffic signals for different configuration parameters (R, T green , T yellow , and L(r)). For each run, the simulator calculates the total vehicles arriving on all the roads; the number of vehicles crossing the intersection while their road is open; and the total and average waiting time. All these values are calculated for the Proposed Algorithm (PA) and the Fixed-Time (FT) Algorithm. e source code of the developed simulator is available upon request for any researcher.
To evaluate the effectiveness of the proposed Algorithm (PA) compared to the Fixed-Time (FT) Algorithm, we have fixed the random seed to a constant so that all the simulator runs have the same random pattern to eliminate the effect of the random pattern on the results. e next subsections provide the obtained results for different scenarios. To study the effect of one or more parameters on the performance of the two algorithms, we set the following defaults: −R � 4, T green � 60 sec, T yellow � 2 sec, T red � 600, L(r) � 1), T g min � 5 sec, T g max � 60 sec, T r max � 200 sec, and T y � 2 sec. e simulation time is fixed to 1 hour � 36,000 ds (decisecond). Descriptions of the abbreviations that are used in the next figures are given in Table 4.

Effect of Arrival Rates.
To study the effect of the traffic density on the performance of the Proposed Algorithm (PA), we have prepared two scenarios. In both scenarios, the interarrival rate r of one road is varied from 1 to 20 sec. In the first scenario, the other three roads have different arrival rates (10,15, and 20 sec). In the second scenario, the other three roads have a constant low rate (r � 30 sec). Please note that the traffic density decreases with the increase in the value of r. As shown in Figure 11, for high traffic density, the proposed algorithm outperforms the FT one in terms of the number of serviced vehicles. It can be seen that the number of serviced vehicles using the FTalgorithm is constant for the rates from 1 to 9. It can also be seen that the PA gives almost the same results as the Optimal Algorithm.
In terms of the Average Waiting Time (AWT), the performance of the FT is very poor for high traffic density that can reach (370, 550 s) for the two scenarios, as shown in Figure 12. However, using the PA, the AWT is reduced significantly (47, 18 s) for the two scenarios. With the decrease of the traffic density (r > 8.5), the PA still outperforms the FT by a factor of at least 4 folds.

Performance on Different Traffic Densities.
e effectiveness of our PA can be further demonstrated when the traffic density is not the same on each road. To illustrate this, we have varied the traffic density on one road starting from a very high arrival rate (smaller values of r), namely, r � 1 to 20 sec. e other three roads are charged with low traffic density, namely, r � 30 (equivalent to one vehicle every 30 sec). e results are shown in Figures 13(a) and 14(a).
is represents an actual situation for a specific type of traffic congestion, where only one road is very charged and the other intersecting roads are not. We have repeated the same scenario but by varying the traffic density on two roads and fixing the traffic density at a low rate on the other two roads. e results are shown in Figures 13(b) and 14(b).
Next, another simulation run is performed by varying the traffic density on three roads and fixing the traffic density at a low rate on the fourth road. e results are shown in Figures 13(c) and 14(c). Finally, we have varied the traffic rate equally on all the roads from very high density (r � 1) to Set t g = τ Set t r (r g ) = τ Let r lw = -1 Each subfigure in Figure 13 shows the obtained number of serviced vehicles using the Optimal Algorithm (OA), the Fixed-Time (FT), and the Proposed Algorithm (PA) for each scenario. As you can see, PA outperforms the FT in the first three cases with a significant improvement, which is almost equal to that of the OA. For example, in the case when only one road has varied traffic density and the others have fixed low density, the number of serviced vehicles when r � 1 were:

Optimal algorithm
Maximum number of vehicles that can be serviced (crossing the intersection). is is a function of the service time and the traffic density. It can be calculated using: minM(N, T/s)N, where N is the total arrived vehicles, T is the total simulated period, and s is the vehicle service time.  PA � 1754, FT � 786, and OA � 1774. is gives a percentage of 223% of serviced vehicles compared to FT.
As the traffic density decreases, PA continues providing the performance of the OA; however, the FT continues to provide almost the same low number of serviced vehicles (around 780). When the rate is very low (r > 9), the total arriving vehicles is very low and thus all the algorithms give almost the same performance with a slight improvement of the PA over the FT. e upper bound that can be reached using FT is improved with the increase of the number of roads having varied traffic density as follows: 786, 1100, 1418, 1733 compared to 1754, 1738, 1730, 1733 for the PA. e proposed algorithm contributes to significantly reducing the Average Waiting Time (AWT) in the four cases as shown in Figure 14. For Example, in the first scenario, when r � 3 the AWT is PA � 18 sec, FT � 655 sec. is means that the FT is providing AWT 36 times longer than the PA in this case. As expected, the AWT decreases with the decrease of the traffic density until a certain limit using the FT and the PA as shown in the four subfigures. e reason for this great improvement is as follows. In the FT system, the road will be open for a fixed duration even if no vehicles are waiting on the currently open road. us, for low traffic density, in the FT system, the intersection will remain idle (not servicing any vehicle) while other roads may have several waiting vehicles. is yields fewer serviced vehicles and more waiting time (delay). However, our proposed system will avoid this issue by minimizing the idle time of the intersection and dynamically switching to another road if there are no waiting vehicles in the open road.
is maximizes the number of serviced vehicles and minimizes the average waiting time. When the traffic density increases on all the roads, the improvement decreases. e only case when the two systems give the same results is when all the four roads are crowded. In all the other cases, our system demonstrates an improvement.

Effect of Changing the Maximum Open Period and Green
Time. We run different simulation scenarios to change the maximum open period, T g max , for the proposed algorithm and the Green period for the FT algorithm. However, the Green period of the FT algorithm does affect the number of serviced vehicles. As shown in Figure 15, the number of serviced vehicles is 800 for the FT algorithm compared to 1083 for both the OA and PA algorithms. Similarly, Figure 16 depicts that the average waiting time is significantly decreased when using PA. T g max has almost no effect on the AWT using PA. However, the AWT using FT increases with the increase of the Green period. As it is expected, for the number of serviced vehicles, this parameter does not affect and regardless of its value, the number of serviced vehicles using PA equals that of the OA. is is because the proposed algorithm calculates adaptively the optimal value to open the is also contributes to maximizing the number of serviced vehicles and in addition reduces the average waiting time significantly compared to the FT algorithm.

Effect of Changing the Minimum Open
Period. T g min (Minimum Open Period) does not affect the performance of the FT algorithm. However, it has a significant effect on the PA. As shown in Figure 17, increasing this value beyond a certain threshold (depending on the traffic density) tends to degrade the performance of PA by reducing the number of serviced vehicles. is is also true for the AWT as shown in Figure 18. e AWT at 10 sec equals 70 sec using PA and 550 using FT. e AWT increased from 70 sec to 450 sec when the T g min increased from 10 sec to 100 sec. e reason for this considerable impact on both the number of serviced vehicles and the AWT is: by increasing the T g min , the intersection may stay idle without servicing any vehicle and thus increase the queue of waiting vehicles. is suggests that the recommended value of T g min must be as small as possible; however, it must be greater than the service time of the longest vehicle.
Simulation results showed that T r max (the maximum close period) has a slight impact on the number of serviced vehicles using PA, as shown in Figure 19. Increasing T r max decreases the AWT as shown in Figure 20. is parameter does not affect the FT algorithm. Smaller values of T r max eliminate the optimization based on the traffic density on the roads and give priority to the starved roads by opening the roads having the maximum close time (equivalent to the red time). is in turn reduces the number of serviced vehicles and thus increases the AWT. For PA to give results that equal to the Optimal Algorithm, the value of T r max should be greater than 70 sec.

Effect of the Number of Roads (Phases) in the Intersection.
To study the effect of the number of incoming roads (phases) at the intersection on the number of serviced vehicles and the average waiting vehicles, we have run different scenarios. Two of them will be presented here.
First, we have set the same inter-arrival rate (same traffic density) on all the roads but by decreasing the traffic density with the increase of the number of roads R using this equation, 30 × (R − 2). We have varied R from 3 to 9.
e results are shown in Figures 21 and 22. Ideally, for high traffic density, the number of serviced vehicles should be constant and equal to the OA for both the PA and FT. However, when the traffic density decreases by increasing r as shown in Figure 22, the number of serviced vehicles decreases and the PA outperforms the FT algorithm. Regarding the AWT, it decreases with the increase of R and the PA is always lower than the FT as in Figure 21.
In the second scenario, we kept the traffic rate constant (r � 30 sec) for all the roads except for one of the roads where we simulated high traffic density (r � 2.5 sec). e results are shown in Figures 23 and 24. e number of serviced vehicles using PA equals that of the Optimal Algorithm. However, the FT can service almost half of those serviced by the Optimal Algorithm. Similarly, for small R, the PA yields very low AWT compared to the FT. e performance of the FT improves gradually with the increase in R.

Conclusions and Future Directions
In this paper, we have provided an analytical study of all the services that can be provided by the proposed Intelligent Traffic Management System (ITMS). e proposed ITMS employs the existing IoV and VANET infrastructure to provide an efficient and intelligent traffic management system without incurring any further complexity of extra components or hardware or any special deployment. In addition, we provided the Smart Traffic Signal architecture and its operation that are suitable for the requirements of Smart Cities. Furthermore, we presented an adaptive algorithm to provide efficient and near-to-theoptimal traffic management for local intersections supporting any number of phases and fully parameterized. Moreover, we presented a simulator that we have developed that simulates the proposed algorithm to study its effectiveness compared to the fixed-time algorithm under different traffic conditions and in different scenarios. We have studied the effectiveness of our proposed system in different traffic scenarios including varied traffic conditions on each segment of the intersection, the minimum and maximum open time (virtual green time), the maximum close time (red time) which is used to prevent starvation, the number of roads, and the service time. Obtained results showed that our ITMS effectively outperforms the traditional traffic management systems with a considerable improvement in terms of the average waiting time and the number of serviced vehicles.
Future work directions may include extending the proposed algorithm for global traffic management, including the optimization of all the intersections in Smart Cities. Furthermore, handling the pedestrian in the intersection using Vehicle-to-Pedestrian (V2P) communication and the wearables is one of the possible important future works. is may include the development of an extra communication model, namely, Pedestrian-to-Infrastructure (P2I). Another work direction is to use Deep Learning and AI in the optimization process for the traffic management process using the current location, destination, and speed of each vehicle to provide better and efficient traffic management.
Data Availability e source code of the software and the developed simulator used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.

20
Journal of Advanced Transportation