# Simulating Fog and Edge Computing Scenarios: An Overview and Research Challenges
## 2 Fog and Edge Computing: Modelling and Simulation Challenges
### Resource Management  
The majority of 4 IR, Industry 4.0 and IOT scenarios assume the generation, capture and analysis of data in volumes, variety and velocities orders of magnitude greater than before. This data may include useful information if such information can be identified [28]. For example, a basic connected vehicle system can generate tens of megabytes of data per second [5]. To provision infrastructure efficiently and effectively requires several key decisions, not least how the data will be collected, where and how data will be processed (edge, fog or cloud), and how often the data should be sent to the cloud for long-term storage or further analysis. There are two competing pressures informing these decisions - use of infrastructure and end user quality of service. Complex Event Processing (CEP) systems are increasingly cited for processing and analysing high volumes of data and detecting events of interest when they occur [28; 29]. However, the CEP task can be time-consuming, and commonly fog or edge devices present computational and storage capacity limitations, when compared to cloud capacity and capability. As such, caching is used widely to bring storage functionality to network edges with lower latency, less excessive bandwidth consumption, and reduced streaming times [19; 30; 31]. This is particularly the case for content distribution use cases such as IP video, forecast to account for a significant portion of all IP traffic in the coming years [32]. [PERSON] et al. [19] summarise the main challenges in content caching in edge networks as caching placement, content popularity, caching policies and algorithms, and mobility awareness. Understanding data load generation and its propagation through a given system is a worthwhile approach for deciding on (optimal) resource placements. Data load prediction has been presented as a solution for proactive system remediation [33]. In this case, historical (big) data stored at cloud and live data collected in the fog and edge devices are used to feed models and predict important metrics, such as resource usage and content popularity distribution [34]. Machine learning techniques have also been widely used to solve this problem. For instance, [PERSON] et al. [35] use machine learning to predict the spatio-temporal user behaviour for proactive caching decisions with a goal of satisfying user demand by delivering low latency and higher QoE. [PERSON] et al. [36] identify energy efficiency as one of the significant challenges for mobile cloud resource management. For example, while offloading data processing to the cloud can reduce device battery consumption, it increases network bandwidth usage and power consumption, a significant contributor to rising energy consumption [37; 38]. Unsurprisingly, energy efficiency is a major focus of cloud, fog and edge computing research including the optimisation of resource allocations under energy, performance, and QoS constraints [39; 40; 41]. Fog computing can introduce management flexibility by providing more options for data processing within the distributed network hierarchy. From the cloud perspective, deciding whether to cache or process the data offload is one way to alleviate network congestion and reduce data transfer costs; from an edge device perspective, offloading some computing tasks could enhance the service performance and be more energy efficient [42; 43], since some edge devices are very energy constrained (and, at the same time, hungry energy consumers). As such, the performance profile of the edge device should be taken in to consideration, especially for real-time sensitive applications, such as vehicle-to-vehicle communications, vehicle-to-roadside communications and real-time financial trading applications that may require latencies below tens of milliseconds [5]. Intensive benchmark performance experiments are typically required to decide the best fog-to-edge configuration considering a range of factors including computational and storage capacity, battery life, mobility, communication interface etc.