Answered step by step
Verified Expert Solution
Link Copied!

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 rectangular-shaped 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 (x,y) 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 1-db can reach 5 meters, a 2-db antenna can reach 10 meters, and a 3-db can reach 25 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 out-range 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 send/receive 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: 1 for WiFi, 2 for Bluetooth, and 3 for dual support)
An array of the antenna db values of IoT devices. Notice for dual support IoT device, if the antenna type is 1-db, assume you have two antennas, 1db for WiFi and 1db 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 (x,y) location and does not move.
Also, assume that the distance between two IoT devices is measured using the Euclidean distance formula as below:
=
(
1
2
)
2
+
(
1
2
)
2
d=
(x
1
x
2
)
2
+(y
1
y
2
)
2
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 jammer(s). 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 1:
Assume we have the following network of 10 IoT devices along with their information
For Jammers, assume we have one node comprised as a jammer which is node 8
Since the above network is all of type WiFi IoT devices and all of the same type of antenna =1 which means 5 meters coverage,
This will result in a network of the following distances among nodes:
Since the distance above 5 is ignored (antenna type 1), then the actual connected nodes are as the following
This will result in the following network
For source=7 and destination=3
output
3
Not Possible
Explanation, the line between 7 and 0 interferes (intersects) with the jamming area produced by 8
For source=7 and destination=9
output
3
Not Possible
Explanation, device 9 is not reachable due to the jamming produced by 8, so Device 9 cannot send or receive usingc++programming

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Revenue at 5 0 0 units ? refer image

Answered: 1 week ago