Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Jamming Avoidance Assume that you have an IoT network composed of several IoT devices to track several environmental factors such as temperature, humidity, rain, etc.
Jamming Avoidance
Assume that you have an IoT network composed of several IoT devices to track several environmental factors such as temperature, humidity, rain, etc. The IoT devices are distributed over a specific rectangularshaped geographical area and communicate with each other wirelessly using either Bluetooth technology or WiFi technology. Some IoT devices have only WiFi, some have Bluetooth, and others have dual support; WiFi and Bluetooth. A WiFi IoT device can connect to WiFi IoT devices, and a Bluetooth IoT device can connect to Bluetooth devices, and the dual support can connect to both types of networks. Each IoT device has a fixed xy location and does not move. The range distance that a device can reach is very much dependent on the antenna type installed on the device. An antenna of gain db can reach meters, a db antenna can reach meters, and a db can reach meters. Every IoT device can be a source, a destination, or a relay point for communication. This allows building a mesh network where one IoT device can communicate with an outrange IoT device if there is a communication path in between. The communication path might include passing through several connected IoT devices acting as relay points in this case.
One or more IoT devices might be compromised by an attack. Once an IoT device is compromised, it launches a continuous jamming attack. A jamming attack prevents all IoT devices within range from ability to sendreceive messages, or to use that jammed range for communication.
Write the implementation of the function JammingAvoidance that takes as inputs:
The number of IoT devices as an integer
Array of the x and y locations of each IoT device
An array of the types of IoT devices type values can be interpreted as the following: for WiFi, for Bluetooth, and for dual support
An array of the antenna db values of IoT devices. Notice for dual support IoT device, if the antenna type is db assume you have two antennas, db for WiFi and db for Bluetooth.
The number of jammed IoT devices
Array of jammed IoT devices
Source IoT device
Destination IoT device
Assume the following about the IoT network:
Each IoT device has a fixed xy location and does not move.
Also, assume that the distance between two IoT devices is measured using the Euclidean distance formula as below:
d
x
x
y
y
Output
Your function should print the following:
In the first line, print the shortest distance possible between the source and the destination assuming no jammers. Distance is measured in the number of connections the traffic has to cross from source to destination.
In the second line, the shortest distance possible between the source and the destination least number of connections to cross considering the presence of the jammers Jammer and jammed IoT devices cannot receive or send data. Your program should count and print the number of edges on the shortest unjammed path.
If there is no path from source to destination, your program should print "Not Possible".
Example :
Assume we have the following network of IoT devices along with their information
For Jammers, assume we have one node comprised as a jammer which is node
Since the above network is all of type WiFi IoT devices and all of the same type of antenna which means meters coverage,
This will result in a network of the following distances among nodes:
Since the distance above is ignored antenna type then the actual connected nodes are as the following
This will result in the following network
For source and destination
output
Not Possible
Explanation, the line between and interferes intersects with the jamming area produced by
For source and destination
output
Not Possible
Explanation, device is not reachable due to the jamming produced by so Device cannot send or receive usingcprogramming
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started