## 6 Computing in Vehicular Networks
### Edge and Fog  
Edge computing and fog computing are critical concepts in vehicular networks and have been the subject of extensive research in recent years. These concepts improve the performance, security, and scalability of connected vehicles by processing data closer to the source, thereby reducing latency, and improving decision-making capabilities. Edge computing is a distributed computing paradigm that brings computation and data storage closer to the network's edge, where devices such as vehicles are located. The objective of edge computing is to diminish the latency of processing and decision making, which is crucial for real-time applications such as traffic management, accident detection, and road safety [111]. Processing data at the edge reduces the need to transmit large amounts of data to a central location, thereby reducing network congestion and improving overall network performance [112]. This concept has been widely studied in the literature, with various edge-based solutions having been proposed for vehicular networks, such as edge-assisted vehicular ad hoc networks for VANETs and edge-assisted ITSs [113]. Fog computing extends edge computing by bringing computation and data storage even closer to the edge to the \"fog\" of devices that are located between the edge and the cloud [114]. This allows for even lower latency processing of data and can also improve security and privacy by keeping sensitive data closer to the source [115]. In vehicular networks, fog computing can be used to support advanced applications such as cooperative intelligent transportation systems (C-ITSs), and V2X communications. C-ITSs enable vehicles to communicate with each other, as well as with the infrastructure, to improve safety and traffic flow, while V2X communications allow vehicles to communicate with other devices such as smartphones and traffic lights [116]. Fog computing additionally facilitates the integration of machine learning and artificial intelligence algorithms, which can consequently improve the decision-making capabilities of connected vehicles [117]. For example, trajectory prediction, traffic prediction, and accident prevention are some of the applications that can be improved with the integration of machine learning algorithms. Additionally, fog computing can also help to improve the scalability of vehicular networks by processing and making decisions locally, thereby reducing the need for central processing [117]. Recently, fog-based solutions have gained traction as a promising approach for optimizing communication and data processing in vehicular networks. Fog-assisted V2X communication and fog-assisted C-ITSs are examples of such solutions [118]. The literature presents various architectures and protocols for fog-based vehicular networks, including fog-assisted VANETs [119] and fog-assisted ITSs [120]. These fog-based solutions offer a promising path toward improving communication and data processing in vehicular networks. In addition, edge and fog computing can also help to improve the security and privacy of vehicular networks by processing data locally and encrypting data in transit. This can prevent malicious attacks on the network and protect sensitive information such as vehicle location and speed [121]. Furthermore, edge and fog computing can also help to improve the energy efficiency of vehicular networks by reducing the amount of data transmitted over the network, thereby reducing the need for large and power-hungry central servers and enabling the use of low-power devices [122]. In conclusion, the concepts of edge computing and fog computing have garnered significant attention in the realm of vehicular networks and have been extensively researched in recent years.