# Fog Computing: Enabling the Management and Orchestration of Smart City Applications in 5G Networks
## 3 A Fog-Based Management and Orchestration Framework for 5G Smart Cities
### Distributed Data Monitoring and Analysis for 5G Smart Cities  
The future 5G network architecture will support the integration of a massive number of infrastructure components and application services in smart cities. Regarding 5G-enabled applications, one of the remaining challenges is how to provide efficient resource allocation operations, because of the stringent requirements introduced by these type of applications: extremely low latencies, ultra-reliable communications and massive M2M communications. For smart city applications, services can be placed in a highly congested area, which would result in a higher latency in the communication between the fog nodes and the IoT device. This is unfeasible for delay-sensitive applications, since these require very low latencies, meaning these applications must be allocated on fog nodes close to the IoT sensor enabling the control of time-sensitive network functionalities close to the device. Furthermore, to provide a secure and reliable communication, it is necessary to perform data processing and analysis operations in a distributed way in order to detect anomalous behaviors and abnormal events in a timely manner so that appropriate actions can be performed in real time. In traditional centralized cloud solutions, all data are sent to the cloud layer, and then, monitoring and analysis operations are executed, which is not suitable for IoT scenarios. As mentioned before, in the proposed architecture, a monitoring and analysis component is present in the architecture of the FN. The proposed monitoring and data analysis approach is shown in Figure 9. This way, data will be processed near the end devices at the edge providing low-latency and scalable anomaly detection solutions, which will provide appropriate responses to protect infrastructure components, as well as application-level communication. First, IoT sensors will be distributed at various public infrastructures to monitor their condition variations over time. Then, these sensors will forward the raw data into the fog layer, where each FN will process the data samples associated with a local group of sensors and perform data analysis operations in a timely manner.  
The outcomes of this first-level analysis will be processed by an event handler and a notification engine. If anomalous events are already detected on the data, notifications and alerts are generated and sent to the cloud layer, the CN and also to the IoT devices. Meanwhile, the unusual data samples that generate the alarms are also reported to the cloud layer in order to perform global behavior analysis based on machine learning techniques that require a higher computational power. Therefore, the CN will provide a broader view of the behavior of the network. Moreover, in-depth pattern recognition  
Figure 9: Overview of the distributed data analysis approach for 5G smart cities.  
and event detection operations can be performed at the CN in order to support the FD module to apply more appropriate reactive and proactive responses.