## 4 Functional Model of the Framework  
The functional model of the framework is presented in Figure 2. For each layer of the framework, there is a corresponding level in the functional model, highlighted in yellow in Figure 2. Our solution is based on dividing the traffic congestion problem into four levels, which include: (a) traffic lights at intersections, (b) main streets of the city, (c) city traffic-flow plan, and (d) assistant applications and services).  
To illustrate how these levels collaborate to solve traffic management issues, the following scenario is considered. If there is a traffic jam in a specific street, then the first level (smart traffic light) will give extra time to this street to ease the congestion. The second level will notice the condition of the street as congested and will send alerts to vehicles to stay away from this street currently and reroute their journey, which will further contribute to the speedy resolution of the problem. In this case, the third level is responsible for storing the data, and it will be noticeable during data analytics if this scenario occurs repeatedly. This will raise the alarm to solve this chronic problem by, for example, diverting the traffic at a specific time, or building a tunnel or bridge, and so on. Finally the fourth level, through various applications, such as the parking service, will help to alleviate the problem by restricting traffic to the congested area by providing stoppage places, and so on.  
This framework is comprehensive because it is based on the principle of integrating many solutions together to create an effective solution. For example, if there is congestion on one side of a traffic signal, the smart-signal in the first level will increase the time of the green signal on the congested side to allow more vehicles to cross. However, at the same time, if the congestion is large and the waiting queue is long, the second level will notice that there is congestion at the street level and not only at the intersection. It will send alerts to drivers to avoid coming to this street and suggest them to take alternate routes to their destination. This will contribute significantly to resolving the congestion. The third level will store all the information according to the place and time, and after collecting huge volumes of these data, it is possible to discover the behavior of traffic on streets that are often crowded. Hence, this information will support decision-makers in taking action at the city level in re-planning the movement and flow of traffic by building  
Figure 2: Functional model of the proposed framework with a description of each level.  
bridges or tunnels. Finally, at the fourth level, assistant applications contribute towards reducing the causes of congestion by facilitating tasks, such as looking for parking spaces in the city center (which otherwise cause very slow traffic movement) or using private vehicles for schools and work instead of mass transit (which otherwise cause crowding at peak times). In addition, as proposed in the framework, the diversity of data sources at each level, for the purpose of reliability, is also achieved in the functional model. In first level, we rely on cameras, WSNs, and RFIDs to know the number of vehicles in the street. In the second level, we rely on drones, tweet analysis, and a smartphone application that enables commuters to know the traffic status of the streets.