# An Efficient and Secure Fog Based Routing Mechanism in IoT Network
## 1 Introduction  
The Internet of Things (IoT) network is made up of small devices commonly known as sensor nodes that are used in physical and environmental conditions to monitor a wide range of parameters including temperature, pressure, light, heat, motion, sound, vibration and many more. These sensor nodes are often deployed in risky and unattended territory where they accumulate myriad types of environmental data and transmit it to the base station or sink node via hop-by-hop or intermediate nodes for further processing [1; 2; 3; 4; 5; 6; 7]. The IoT networks have been the buzz of the contemporary period due to their amazing effects that have taken the globe by storm. In order to deal with diverse problems, the sensor nodes are now being widely employed, thereby jacking up the number of devices to manifold. Contrary to the past, where human resources were needed to monitor environmental factors in stable areas, the unsteady areas or regions used to remain unrevealed due to potential dangers and the incapacity of people to access the extremely volatile locations. Due to this, the sensor nodes are now used in these situations to lessen the difficulties faced by the general public. However, sensor nodes are installed in dangerous/hostile and even unattended premises where they are more prone to various kinds of attacks [8; 9; 10]. Moreover, owing to the absence of any predefined topology in the IoT network, every node requires the capacity of routing for data forwarding. As a result, the nodes are increasingly exposed to myriad routing assaults [11]. Although a lot of traditional cryptographic, detecting malicious nodes and routing algorithms [12; 13; 14; 15; 16; 17; 18; 19; 20] have been designed to make IoT networks secure and safe these algorithms demand heavy computations/calculations and processing which cause lots of energy utilization. In addition to this, the cryptography and authentication-based algorithms work only on the IoT network comprising all the trustworthy and cooperative nodes, therefore, they are not suitable to cope with internal node attacks launched by malicious and faulty sensor nodes [21; 22; 23; 24]. In order to detect and remove faulty/malicious nodes to prevent these rogue nodes from launching internal node attacks within the network, trust-based security mechanisms have been proven to be most efficient and effective [25]. Aside from the internal node attacks in IoT networks, efficient energy utilization is also a serious factor to consider since it has a significant influence on network performance. In addition to energy constraints, the storage and processing capacities of sensor nodes are also limited in fog cloud environment. In order to address the issues faced in the cloud environment and to alleviate the strain on cloud servers, the scientific community has developed a new idea called fog extending the functionality of cloud computing. The fog processing is a sort of distributed processing paradigm in which some data processing, calculation, and storage are carried out between the devices that generate the data on the cloud server [26]. These objects, often referred to as fog devices, are positioned close to the sensor nodes that produce data. Therefore, the data that needs an immediate reply is analyzed, computed and processed here at fog devices and finally, the result is sent back to the desired location. The data that is frequently needed is also retained at fog devices, and the remaining information is sent to the cloud server for further processing in addition to long-term storage. This capability significantly reduces the workload on the server, bandwidth use, data dropping ratio, and latency rate and serves as a crucial tool to minimize response rate [27; 28]. Since the fundamental objective of sensor nodes in fog-based IoT is to communicate the sensed data towards the intended destination, therefore, secure and efficient routing is a dire requirement to make the entire network secure, safe and reliable from internal as well as external attacks.