Adhoc File - Sakeb
Adhoc File - Sakeb
Teacher’s
Sl no. Practical Name Date
Signature
Introduction:
Simulation is a very important modern technology. It can be applied to different
science, engineering, or other application fields for different purposes. Computer
assisted simulation can model hypothetical and real-life objects or activities on a
computer so that it can be studied to see how the system function. Different variables
can be used to predict the behavior of the system. Computer simulation can be used to
assist the modeling and analysis in many natural systems. Typical application areas
include physics, chemistry, biology, and human-involved systems in economics,
finance or even social science. Other important applications are in the engineering such
as civil engineering, structural engineering, mechanical engineering, and computer
engineering. Application of simulation technology into networking area such as
network traffic simulation.
Main features:
First and foremost, NS2 is an object-oriented, discrete event driven network
simulator which was originally developed at University of California-Berkely. The
programming it uses is C++ and OTcl (Tcl script language with Object-oriented
extensions developed at MIT). The usage of these two programming language has its
reason. The biggest reason is due to the internal characteristics of these two
languages.
C++ is efficient to implement a design but it is not very easy to be visual and
graphically shown. It's not easy to modify and assembly different components and to
change different parameters without a very visual and easy-to- use descriptive
language. Moreover, f or efficiency reason, NS2 separates control path
implementations from the data path implementation. The event scheduler and the
basic network component objects in the data path are written and compiled using C++
to reduce packet and event processing time.
OTcl happens to have the feature that C++ lacks. So the combination of these
two languages proves to be very effective. C++ is used to implement the detailed
protocol and OTcl is used for users to control the simulation scenario and schedule
the events. A simplified user's view of NS2 is shown in Figure 2.
The OTcl script is used to initiate the event scheduler, set up the network
topology, and tell traffic source when to start and stop sending packets through event
scheduler. The scenes can be changed easily by programming in the OTcl script.
When a user wants to make a new network object, he can either write the new object
or assemble a compound object from the existing object library, and plumb the data
path through the object. This plumbing makes NS2 very powerful.
Download the all in one package for ns2 from internet. The package downloaded will
be named "ns-allinone-2.35.tar.gz". Copy it to the home folder. Then in a terminal use
the following two commands to extract the contents of the package:
1. Ns2 requires a few packages to be pre installed. It also requires the GCC- version
4.3 to work correctly. So install all of them by using the following command:
3. Once the installation is over, we have to make a change in the "ls.h" file. Use the
following steps to make the changes: Navigate to the folder "linkstate", use the
following command. Here it is assumed that the ns folder extracted is in the home
folder of your system.
cd ~/ns-allinone-2.35/ns-2.35/linkstate
4. Now open the file named "ls.h" and scroll to the 137th line. In that change the word
"error" to "this->error". The image below shows the line 137 (highlighted in the
image below) after making the changes to the ls.h file. To open the file use the
following command:
gedit ls.h
6. Now there is one more step that has to be done. We have to tell the ns which version
of GCC will be used. To do so, go to your ns folder and type the following command:
1. In the file, change Change CC= @CC@ to CC=gcc-4.4, as shown in the image
below:
Step 2: Save that file and close it
Step 3: Installation
1. Now we are ready to install ns2. To do so we first require root privileges and then
we can run the install script. Use the following two commands:
cd ns-allinone-2.35
/install
2. After successful installation following message will be shown on the screen. Ns-
allinone package has been installed successfully.
tcl8.5.10: /home/sitams/ns-allinone-2.35/{bin,include,lib}
tk8.5.10: /home/sitams/ns-allinone-
2.35/{bin,include,lib} otcl: /home/sitams/ns-allinone-
2.35/otcl-1.14
tclcl: /home/sitams/ns-allinone-
2.35/tclcl-1.20 ns: /home/sitams/ns-allinone-
2.35/ns-2.35/ns
nam: /home/sitams/ns-allinone-2.35/nam-
1.15/nam xgraph: /home/sitams/ns-allinone-
2.35/xgraph-12.2
----------------------------------------------------------------------------------
1. The final step is to tell the system, where the files for ns2 are installed or present.
To do that, we have to set the environment path using the ".bashrc" file. In that
file, we need to add a few lines at the bottom. The things to be added are given
below:
sudo gedit ~/.bashrc
2. Lines to be added:
# LD_LIBRARY_PATH
OTCL_LIB=/home/sitams/ns-allinone-2.35/otcl-1.14
NS2_LIB=/home/sitams/ns-allinone-
2.35/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
export
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X
11_ LIB:$USR_LOCAL_LIB
# TCL_LIBRARY
TCL_LIB=/home/sitams/ns-allinone-
2.35/tcl8.5.10/libraryUSR_LIB=/usr/lib
export
TCL_LIBRARY=$TCL_LIB:$USR_LIB #
PATH
XGRAPH=/home/sitams/ns-allinone-2.35/bin:/home/sitams/ns-
allinone- 2.35/tcl8.5.10/unix:/home/sitams/ns-allinone-
2.35/tk8.5.10/unix
#the above two lines beginning from xgraph and ending with unix should
come on the same line
NS=/home/sitams/ns-allinone-2.35/ns-2.35/
NAM=/home/sitams/ns-allinone-2.35/nam-
1.15/
PATH=$PATH:$XGRAPH:$NS:$NAM
3. Once the changes have been made, save the file and restart the system.
Step 5: Running ns2
1. Once the system has restarted, open a terminal and start ns2 by using the
following command:
ns
2. System returns
Result :
NS2 software has been successfully installed and it’s tested with simple
example on Ubuntu Operating System.
Practical – 3
Objective: Simulate a Mobile Ad hoc Network.
Ad Hoc Network
Ad-hoc networks are temporary network. They do not need any external infrastructure like
base stations and physical wires.
14 -channel $chan_1_
The four last option in node configuration can either be ON or OFF based on the condition of
the mobile nodes. The agent trace will give the trace of TCP, routerTrace provides tracing of
packets used in routing, macTrace is used to trace MAC protocol packets and
movementTrace is used to allow tracing the motion of nodes for nam.
$node_($i) random-motion 0;
Receiver
Raspberry Pi—Model B with power supply, case, and SD card—Ensure the GPIO pins
are accessible with the case you choose
Pi compatible Wi-Fi adapter
Arduino
Breadboard jumper wires
Male to female jumper Wires
Logic level converter
434 MHz RF receiver
Half breadboard
Tools
PC/Mac with Arduino programming IDE installed
USB cable for programming Arduino boards
USB Keyboard and Mouse. Either combined or with a hub so both can be used with a
single USB port.
The source package associated with this tutorial on your programming workstation
Assemble Transmitters
The transmitters themselves are relatively simple circuits. Only one pin is used to retrieve the
information from the temperature and humidity sensor and one pin is used to send that data to the
RF transmitter. The breadboard diagram is shown below.
The 9V power supply will attach to the barrel connector making the bottom rails 9V. The power
regulator in the Arduino will produce 5V that is safe to use for the radio and sensors, the top
power rail of the diagram.
The sensor comes with a 10k ohm resistor that connects the data pin to power as a pull up resistor
while another wire connects it to GPIO D3.
Transmitter diagram
The antenna is an important part of the board because the RF module does not have a built in
antenna. I used a 6-inch female to male jumper wire plugged into the breadboard and it worked
well enough to allow reception from all parts of my home and a little bit outside. As noted in the
diagram, 6.5-inch is optimal for this antenna if you need additional range.
The transmitter uses two libraries that are not bundled with the Arduino IDE. Download the
libraries as described below and uncompressed them into your sketch directory in a subdirectory
named Libraries.
Download the VirtualWire source package for this tutorial and unzip
the wirelesstransmitter sketch folder into your Arduino sketch folder
In the wirelesstransmitter folder create a folder named Libraries
Download the latest version of the VirtualWire code, 1.23 as of this writing, from
the project page
Extract the VirtualWire folder into the wirelesstransmitter/Libraries/ folder so you
have another subfolder named VirtualWire
Download the DHT sensor library from its project github page
Extract the DHT folder into the Libraries folder as well. You should now have the two
required library folders DHT and VirtualWire in
your wirelesstransmitter/Libraries folder.
Program the Arduino Board
This tutorial assumes you have some experience with Arduino and how to program them using
the Arduino IDE. If you do not, there are very good instructions at the official Arduino site.
Open the wirelesstransmitter sketch from the source archive in the Arduino IDE and
save a copy locally
Ensure the Arduino is NOT connect to power via the barrel connector
Connect the board to your programming workstaiton station with an appropriate USB
cable
Set the board type to your selected Arduino board under the Tools > Board menu
Set the serial port to the port detected when you connected the Arduino board under
the Tools > Port menu
Ensure that the MYID define is set to 1 and the TRANSPIN and DHTPIN are properly
set to the pins connected to the RF transmitter module and DHT sensor respectively. If
you built your board per the diagram above this should all be set already. See the code
example below.
Ensure that the UNIT is set properly for your preference Fahrenheit or Celsius.
#define MYID 1 //the ID number of this board. Change this for each board you flash.
#define TRANSPIN 3 //what pin to transmit on
#define DHTPIN 4 // what pin the DHT is connected to
#define UNIT 0 // 0 for Fahrenheit and 1 for Celsius
The MYID define is a numeric ID that the transmitter uses to uniquely identify itself. Because
you will have multiple transmitters in different locations it is important to have a unique ID for
each one. This number will be used again when you setup the receiver script.
Verify the code by pressing Control-R to ensure the libraries are included and compiled
properly.
Push the code to the board by clicking the Upload button on the tool bar.
Open the Serial Monitor windows by pressing Control-Shift-M
The Serial Monitor window resets the Arduino so you should see a line of code on the screen
that looks something like:
Even if there is doubling and the signal from both transmitters is lost, the random interval will
ensure that their next broadcasts will not overlap. The random seed for this interval is set from
an analogRead on an unused analog port which will return random values to ensure no two
transmitters are on the same pattern.
The transmitters are set to wait 2 to 5 minutes between broadcasts by default. If you wish to
speed this up for debugging purposes then modify the delay() value at the end of the sketch to be
more like 5000 (ms). It is highly recommended that you change this back and re-upload the code
to your transmitters when you are ready for full time use.
The receiver board will be responsible for receiving the broadcast message on its RF Receiver
component and sending that message over serial wires to the Raspberry Pi. The Arduino board is
used to receive the signal for a couple very important reasons. The VirtualWire code uses the
real time nature of the Arduino to manage modulating and demodulating the signal.
This means that the receiving unit needs to be operating at the same frequency. In addition, there
is little room for jitter on the receiving processor, to which the Raspberry Pi is prone, due to its
preemptive, non real-time operating system. Comparing the costs of an Arduino Pro Mini plus the
RF receiver module to that of a Zigbee module that could talk directly to the Raspberry Pi
revealed that using an external Arduino was still quite economical.
Receiver Diagram
This component is required in order to convert the 5V Arduino serial signal to a 3.3V Raspberry
Pi serial signal and not damage the Pi. See the image below for additional help.
Note that the RX and TX wires cross through the logic level converter so that the TX from the
Arduino goes into the RX of the Pi. The next steps involve setting up the Pi, you'll return to
program the Arduino later.
There are several guides to purchasing and installing an OS on your Raspberry Pi. Install the
latest Raspbian operating system. The following steps describe connecting the peripherals to the
Pi and configuring.
Insert the USB Wi-Fi adapter into the top USB port on the Pi
Connect the USB hub to the bottom USB port on the Pi
Connect the mouse and keyboard to the USB hub
Connect the HDMI Monitor
Insert the SD Card
Connect the power supply
Perform first time setup configuration leaving the default option to boot to a graphical
desktop
After the Pi reboots to a desktop follow these instructions on how to use the GUI tool
to configure your wifi network.
Open a terminal window by double-clicking on the LXTerminal icon.
Execute the command sudo raspi-config
Select the Enable Boot to Desktop/Scratch > Console Text console, requiring
login option
Select the Advanced Options > SSH to enable network command line access
Select Finish and allow the Pi to reboot to the text console
Make note of the IP address the Pi reports when it boots. This will be used to SSH to the
Pi in later steps. The steps below for configuring the Pi are easier done from an SSH
session to the Pi.
Configure Raspberry Pi
The Raspberry Pi uses its serial port by default as a serial console. The device is
named ttyAMA0. When it boots it dumps boot messages to this device and sets up a login
session on it. In order to use it for receiving data from the Arduino you will need to disable the
serial console and session.
Edit the inittab file that controls text login session with the command below. It's always
recommended to make a backup of the original file before editing just in case something
goes wrong.
Locate the lines at the bottom of the file that refer to the device ttyAMA0 and add a # to
the start of the line that includes this device name. It should look like the lines below
when you are done
Edit the /boot/cmdline.txt with the command below. Don't forget to make a backup copy
just in case.
Remove the arguments that reference ttyAMA0. They part you want to remove looks
something like this: console=ttyAMA0,115200 kgdboc=ttyAMA0,115200
Save the file and reboot the Pi
The python script that will complete the receiver will perform several functions.
In order to perform these functions you will need to install the prerequisite modules to install the
serial libraries and Xively communications.
Xively is a service that collects data from things. You can setup and register your thing or
Raspberry Pi with Xively and data can be pushed from your Pi to the cloud for tracking and
triggering.
In order to post data to Xively the wirelessnetwork.py script needs to have the Feed ID and API
Keys that you recorded above. Edit the script using pico or your favorite editing tool.
#Create mapping from transmitter ID number to names. This could be a DB some day
DEV={'1':'Bedroom', '2':'Basement'}
DEBUG = True
While you are editing the script make sure to edit the DEV variable. This variable is a name
mapping for the IDs that the sensor modules will be sending. In this example when the sensor
module with ID 1 sends a message, the script will post to a Xively channel with the friendly
name Bedroom instead of ID1. In the same way, the sensor module with ID 2 will be reported
into the channel Basement.
The Raspberry Pi is now ready to receive data using the wirelessnetwork.py script. The Arduino
needs to be programmed with the wirelessreceiver sketch.
Open the wirelessreceiver sketch from the source package and save a copy locally
Copy the VirtualWire library from the wirelesstransmitter/Library directory to
the Library directory under the new wirelessreceiver directory
Attach the receiver Arduino receiver to your programming workstation and ensure the
port and board type are set correctly.
Ensure that the RXPIN define is set to the pin number that is connected to the RF
receiver module. If it is built per the diagram the sketch should be fine without changes.
Verify and upload the the sketch to the Arduino
Open the Serial Monitor windows by pressing Control-Shift-M. If the transmitters are
not running you will not see out put.
Plug one of the transmitter modules into power using the 9V wall adapter and the barrel
connector on the breadboard. You should now see the messages that are being received
on the Arduino. Unplug the USB cable from the Arduino
Now that you have the Arduino receiving data from a sensor module you can test the script on the
Pi to ensure it is properly reading the data and posting it to Xively. Open an SSH or terminal
session to the Pi for the following steps.
Activate the second wireless transmitter by plugging it in with the second 9V adapter
Execute the wirelessnetwork.py script from the /home/pi/scripts directory with the
following commands
cd /home/pi/scripts/
./wirelessnetwork.py
The script will create feeds for humidity and temperature the first time it runs. The example
above shows the script receiving the messages, parsing them and posting them to Xively
successfully. Use Control-C to exit the script before proceeding to the next step.
Switch to the browser windows where you created your Xively account and device. The new
datastreams and some information about them should be available and look something like the
image below.
Because the Raspberry Pi is going to be run headless the script should be set to start automatically
when the unit is powered.
Add the following line to the /etc/rc.local file. Use your favorite editor, but make sure to
sudo the edit command as /etc/rc.local is a root owned file. The script itself can run as
the user pi rather than as root.
Reboot the Pi
Login to the Pi after it has rebooted and verify that the script is running with the
following command.
ps ax |grep wirelessnetwork
A Wireless Access Point (WAP) is a networking device that allows wireless-capable devices
to connect to a wired network. Adding a WAP to your existing wired network is useful to
accommodate those devices that are only capable of wireless connection. It is like creating
another network only for wireless devices but still be a part of your existing wired network
such as shown in the diagram below.
In the network diagram above, the left portion shows an existing wired network. It
consists of four wired computers connected to a switch, which is connected to a router.
In the right portion, a wireless network shows two wireless computers connected to a
WAP.
Note: In the image above, 192.168.1.245 is used as an example of the IP address. This is
the default IP address of Cisco Access Points.
Step 4. In the authentication window, enter the username and password of the WAP in
the Username and Password fields, respectively.
Note: You can set up to five users to each access point that you are going to add to the
network. These users are the ones authorized to access the web-based utility through
their authentication keys but only one of these users can have the Read/Write privilege
level. Also, you can create a different username and password to each user.
Note: The default username and password of the default user for Cisco Access Points is
cisco/cisco.
Note: If you are using the WAP121, WAP321, WAP371, WAP551, or the WAP561,
choose LAN > VLAN and IPv4 Address.
Note: If you want to use IPv6 Addressing instead, click here for instructions.
Note: In this example, DHCP is chosen. This is the default setting. If you performed this
step, skip to Step 12.
Step 8. (Optional) If you chose Static IP in the previous step, enter the static IP address
you want to assign to the WAP in the Static IP Address field. Make sure that the IP
address you assign is in the same range as your network.
Note: In this example, the IP address used is 192.168.1.112.
Step 9. (Optional) Enter the subnet mask in the Subnet Mask field.
Step 2. (Optional) If you are using a dual-band access point, click a radio button to choose
the Radio Interface that you want to configure.
Radio 1 (2.4 GHz) — For wireless clients that operate in the 2.4 GHz frequency.
Radio 2 (5 GHz) — For wireless clients that operate in the 5 GHz frequency.
Note: You can add or create multiple VAPs on your WAP depending on the exact model
of your device by clicking on the Add button. For the WAP361, seven additional VAPs
can be created.
Step 4. Under SSID Name, create a new name for your wireless network in the field
provided.
Note: In this example, WireNet is used.
Step 5. (Optional) Under SSID Broadcast, check or uncheck the box depending on your
preference. Checking the box would allow your wireless network to broadcast its SSID
or to be visible to all wireless devices within its range. Unchecking the box would hide it
from all wireless devices.
Note: In this example, WPA Personal is chosen. The Security details window would
then be visible.
Step 7. Choose the types of client stations that you want to support by checking the
check boxes in the WPA Versions area.
WPA-TKIP — This option would allow wireless clients that only support the original
WPA and TKIP security protocol to be able to connect to the network.
WPA2-AES — This WPA version provides the best security per IEEE 802.11i
standard. As per the latest Wi-Fi Alliance requirement, the WAP has to support this
mode all the time.
Note: If the network has a mix of clients, check both of the check boxes. This setting lets
both WPA and WPA2 client stations associate and authenticate, but it uses the more
robust WPA2 for clients who support it. This WPA configuration allows more
interoperability in place of some security.
Step 8. In the Key field, enter a password consisting of 8 to 63 characters. Each wireless
device that would try to connect to this wireless network will be asked for this
authentication key.
Step 9. (Optional) Check the Show Key as Clear Text box to show the password you
created.
Note: The Key Strength Meter area shows colored bars based on the strength of the key
that you have created. In this example, Str0ngPassw0rd! is used as the authentication
key.
Step 10. In the Broadcast Key Refresh Rate field, enter a value from 0 to 86400 seconds.
This is the interval at which the broadcast (group) key is refreshed for clients associated
with this VAP.
Note: In this example, 300 seconds is used. This is the default value.
Step 11. (Optional) Under MAC Filter, click on the drop-down list either to disable
MAC Filter or to specify whether the stations that can access this VAP are restricted to a
configured global list of MAC addresses. The options are:
Disabled — Does not use MAC filtering.
Local — Uses the MAC authentication list that you configure on the MAC
Filtering page.
RADIUS — Uses the MAC authentication list on an external RADIUS server.
Note: To learn how to configure MAC Filtering, click here.
Step 12. (Optional) Check or uncheck the check box under Channel Isolation to enable
or disable it depending on your preference. When enabled, the WAP blocks
communication between the wireless clients on the same VAP. The WAP still allows
data traffic between its wireless clients and the wired devices on the network, across a
Wireless Distribution System (WDS) link, and with other wireless clients associated
with a different VAP, but not among the wireless clients. When disabled, the wireless
clients can communicate with one another normally by sending traffic through the WAP.
Step 13. (Optional) Check or uncheck the check box under Band Steer to enable or
disable it depending on your preference. This feature is for dual-band WAPs only.
Enabling band steer effectively utilizes the 5 GHz band by steering dual-band supported
clients from the 2.4 GHz band to the 5 GHz band when both radios are up.
You should now have successfully added a wireless network to your existing wired
network using a wireless access point.
Practical – 6
Objective: Implementing a wireless sensor network.
Receiver
Raspberry Pi—Model B with power supply, case, and SD card—Ensure the GPIO pins
are accessible with the case you choose
Pi compatible Wi-Fi adapter
Arduino
Breadboard jumper wires
Male to female jumper Wires
Logic level converter
434 MHz RF receiver
Half breadboard
Tools
PC/Mac with Arduino programming IDE installed
USB cable for programming Arduino boards
USB Keyboard and Mouse. Either combined or with a hub so both can be used with a
single USB port.
The source package associated with this tutorial on your programming workstation
Assemble Transmitters
The transmitters themselves are relatively simple circuits. Only one pin is used to retrieve the
information from the temperature and humidity sensor and one pin is used to send that data to the
RF transmitter. The breadboard diagram is shown below.
The 9V power supply will attach to the barrel connector making the bottom rails 9V. The power
regulator in the Arduino will produce 5V that is safe to use for the radio and sensors, the top
power rail of the diagram.
The sensor comes with a 10k ohm resistor that connects the data pin to power as a pull up resistor
while another wire connects it to GPIO D3.
Transmitter diagram
The antenna is an important part of the board because the RF module does not have a built in
antenna. I used a 6-inch female to male jumper wire plugged into the breadboard and it worked
well enough to allow reception from all parts of my home and a little bit outside. As noted in the
diagram, 6.5-inch is optimal for this antenna if you need additional range.
The transmitter uses two libraries that are not bundled with the Arduino IDE. Download the
libraries as described below and uncompressed them into your sketch directory in a subdirectory
named Libraries.
Download the VirtualWire source package for this tutorial and unzip
the wirelesstransmitter sketch folder into your Arduino sketch folder
In the wirelesstransmitter folder create a folder named Libraries
Download the latest version of the VirtualWire code, 1.23 as of this writing, from
the project page
Extract the VirtualWire folder into the wirelesstransmitter/Libraries/ folder so you
have another subfolder named VirtualWire
Download the DHT sensor library from its project github page
Extract the DHT folder into the Libraries folder as well. You should now have the two
required library folders DHT and VirtualWire in
your wirelesstransmitter/Libraries folder.
Program the Arduino Board
This tutorial assumes you have some experience with Arduino and how to program them using
the Arduino IDE. If you do not, there are very good instructions at the official Arduino site.
Open the wirelesstransmitter sketch from the source archive in the Arduino IDE and
save a copy locally
Ensure the Arduino is NOT connect to power via the barrel connector
Connect the board to your programming workstaiton station with an appropriate USB
cable
Set the board type to your selected Arduino board under the Tools > Board menu
Set the serial port to the port detected when you connected the Arduino board under
the Tools > Port menu
Ensure that the MYID define is set to 1 and the TRANSPIN and DHTPIN are properly
set to the pins connected to the RF transmitter module and DHT sensor respectively. If
you built your board per the diagram above this should all be set already. See the code
example below.
Ensure that the UNIT is set properly for your preference Fahrenheit or Celsius.
#define MYID 1 //the ID number of this board. Change this for each board you flash.
#define TRANSPIN 3 //what pin to transmit on
#define DHTPIN 4 // what pin the DHT is connected to
#define UNIT 0 // 0 for Fahrenheit and 1 for Celsius
The MYID define is a numeric ID that the transmitter uses to uniquely identify itself. Because
you will have multiple transmitters in different locations it is important to have a unique ID for
each one. This number will be used again when you setup the receiver script.
Verify the code by pressing Control-R to ensure the libraries are included and compiled
properly.
Push the code to the board by clicking the Upload button on the tool bar.
Open the Serial Monitor windows by pressing Control-Shift-M
The Serial Monitor window resets the Arduino so you should see a line of code on the screen
that looks something like:
Even if there is doubling and the signal from both transmitters is lost, the random interval will
ensure that their next broadcasts will not overlap. The random seed for this interval is set from
an analogRead on an unused analog port which will return random values to ensure no two
transmitters are on the same pattern.
The transmitters are set to wait 2 to 5 minutes between broadcasts by default. If you wish to
speed this up for debugging purposes then modify the delay() value at the end of the sketch to be
more like 5000 (ms). It is highly recommended that you change this back and re-upload the code
to your transmitters when you are ready for full time use.
The receiver board will be responsible for receiving the broadcast message on its RF Receiver
component and sending that message over serial wires to the Raspberry Pi. The Arduino board is
used to receive the signal for a couple very important reasons. The VirtualWire code uses the
real time nature of the Arduino to manage modulating and demodulating the signal.
This means that the receiving unit needs to be operating at the same frequency. In addition, there
is little room for jitter on the receiving processor, to which the Raspberry Pi is prone, due to its
preemptive, non real-time operating system. Comparing the costs of an Arduino Pro Mini plus the
RF receiver module to that of a Zigbee module that could talk directly to the Raspberry Pi
revealed that using an external Arduino was still quite economical.
Receiver Diagram
This component is required in order to convert the 5V Arduino serial signal to a 3.3V Raspberry
Pi serial signal and not damage the Pi. See the image below for additional help.
Note that the RX and TX wires cross through the logic level converter so that the TX from the
Arduino goes into the RX of the Pi. The next steps involve setting up the Pi, you'll return to
program the Arduino later.
There are several guides to purchasing and installing an OS on your Raspberry Pi. Install the
latest Raspbian operating system. The following steps describe connecting the peripherals to the
Pi and configuring.
Insert the USB Wi-Fi adapter into the top USB port on the Pi
Connect the USB hub to the bottom USB port on the Pi
Connect the mouse and keyboard to the USB hub
Connect the HDMI Monitor
Insert the SD Card
Connect the power supply
Perform first time setup configuration leaving the default option to boot to a graphical
desktop
After the Pi reboots to a desktop follow these instructions on how to use the GUI tool
to configure your wifi network.
Open a terminal window by double-clicking on the LXTerminal icon.
Execute the command sudo raspi-config
Select the Enable Boot to Desktop/Scratch > Console Text console, requiring
login option
Select the Advanced Options > SSH to enable network command line access
Select Finish and allow the Pi to reboot to the text console
Make note of the IP address the Pi reports when it boots. This will be used to SSH to the
Pi in later steps. The steps below for configuring the Pi are easier done from an SSH
session to the Pi.
Configure Raspberry Pi
The Raspberry Pi uses its serial port by default as a serial console. The device is
named ttyAMA0. When it boots it dumps boot messages to this device and sets up a login
session on it. In order to use it for receiving data from the Arduino you will need to disable the
serial console and session.
Edit the inittab file that controls text login session with the command below. It's always
recommended to make a backup of the original file before editing just in case something
goes wrong.
Locate the lines at the bottom of the file that refer to the device ttyAMA0 and add a # to
the start of the line that includes this device name. It should look like the lines below
when you are done
Edit the /boot/cmdline.txt with the command below. Don't forget to make a backup copy
just in case.
Remove the arguments that reference ttyAMA0. They part you want to remove looks
something like this: console=ttyAMA0,115200 kgdboc=ttyAMA0,115200
Save the file and reboot the Pi
The python script that will complete the receiver will perform several functions.
In order to perform these functions you will need to install the prerequisite modules to install the
serial libraries and Xively communications.
Xively is a service that collects data from things. You can setup and register your thing or
Raspberry Pi with Xively and data can be pushed from your Pi to the cloud for tracking and
triggering.
In order to post data to Xively the wirelessnetwork.py script needs to have the Feed ID and API
Keys that you recorded above. Edit the script using pico or your favorite editing tool.
#Create mapping from transmitter ID number to names. This could be a DB some day
DEV={'1':'Bedroom', '2':'Basement'}
DEBUG = True
While you are editing the script make sure to edit the DEV variable. This variable is a name
mapping for the IDs that the sensor modules will be sending. In this example when the sensor
module with ID 1 sends a message, the script will post to a Xively channel with the friendly
name Bedroom instead of ID1. In the same way, the sensor module with ID 2 will be reported
into the channel Basement.
The Raspberry Pi is now ready to receive data using the wirelessnetwork.py script. The Arduino
needs to be programmed with the wirelessreceiver sketch.
Open the wirelessreceiver sketch from the source package and save a copy locally
Copy the VirtualWire library from the wirelesstransmitter/Library directory to
the Library directory under the new wirelessreceiver directory
Attach the receiver Arduino receiver to your programming workstation and ensure the
port and board type are set correctly.
Ensure that the RXPIN define is set to the pin number that is connected to the RF
receiver module. If it is built per the diagram the sketch should be fine without changes.
Verify and upload the the sketch to the Arduino
Open the Serial Monitor windows by pressing Control-Shift-M. If the transmitters are
not running you will not see out put.
Plug one of the transmitter modules into power using the 9V wall adapter and the barrel
connector on the breadboard. You should now see the messages that are being received
on the Arduino. Unplug the USB cable from the Arduino
Now that you have the Arduino receiving data from a sensor module you can test the script on the
Pi to ensure it is properly reading the data and posting it to Xively. Open an SSH or terminal
session to the Pi for the following steps.
Activate the second wireless transmitter by plugging it in with the second 9V adapter
Execute the wirelessnetwork.py script from the /home/pi/scripts directory with the
following commands
cd /home/pi/scripts/
./wirelessnetwork.py
The script will create feeds for humidity and temperature the first time it runs. The example
above shows the script receiving the messages, parsing them and posting them to Xively
successfully. Use Control-C to exit the script before proceeding to the next step.
Switch to the browser windows where you created your Xively account and device. The new
datastreams and some information about them should be available and look something like the
image below.
Because the Raspberry Pi is going to be run headless the script should be set to start automatically
when the unit is powered.
Add the following line to the /etc/rc.local file. Use your favorite editor, but make sure to
sudo the edit command as /etc/rc.local is a root owned file. The script itself can run as
the user pi rather than as root.
Reboot the Pi
Login to the Pi after it has rebooted and verify that the script is running with the
following command.
ps ax |grep wirelessnetwork
7.1 TCP/IP
TCP/IP has been used successfully in wired 802.3 and wireless 802.11 networks and has been
discussed as a possible transport layer for WSN [14]. Certain attributes, such as IP addressing
for individual nodes, unnecessary header overhead for data segments, no support for data
centric routing, a heavyweight protocol stack, and an end-to-end reliability scheme that
attributes segment losses network congestion, of TCP/IP; however, they make it unsuitable
for use in WSNs without modification. Even if TCP/IP is not entirely suitable for WSNs, it is
informative to compare TCP/IP to transport protocols designed specifically for WSNs. Such a
comparison helps to illustrate that WSNs operate in a different paradigm, and thus need
specially designed transport layers to meet their unique needs.
TCP/IP may not be suitable for standard sensor nodes in a WSN, but may still be used at the
sink to communicate with other remote endpoints. Sensor nodes with high robustness, such as
Crossbow [18], may use TCP/IP as a virtual sink or proxy between the WSN and the remote
host to reduce the number of retransmissions of a data segment by less powerful sensor
nodes.
RMST, first proposed in [8], is a reliable transport layer for WSNs. RMST is meant to
operate on top of the gradient mechanism used in directed diffusion [5]. RMST adds two
important features to directed diffusion [8],
1. fragmentation and reassembly of segments, and
2. reliable message delivery.
One of the most intriguing features of RMST is that it is an extension of directed diffusion
that can be applied to a sensor node and configured without having to recompile. Essentially
RMST is a plugin transport layer mechanism for an already widely accepted and studied
WSN network layer.
RMST can be configured to allow hop-by-hop recovery (using local broadcast NACK) or
end-to-end recovery (end-to-end NACK) at run time, and can be combined with a MAC-level
Automatic Repeat Query (ARQ). The configuration between hop-by-hop (cached) recovery
and end-to-end (noncached) recovery can be configured at the sensor nodes at runtime.
The main contribution of the paper by Stann et al. [8] was to compare the combination of
transport layer reliability and lower layer recovery mechanisms. Reliable delivery was
compared to using end-to-end recovery at the transport layer, hop-by-hop recovery at the
transport layer, and hop-by-hop recovery at the MAC layer using an Automatic Repeat
Request (ARQ).
RMST employs a Negative Acknowledgement (NACK) gap detection to detect and recover
lost messages similar to the scheme used by PSFQ. However, RMST makes no guarantee of
in-order message delivery, rendering loss detection is particularly difficult since it is difficult
for sensor nodes to determine whether gaps are caused by out-of-order delivery or lost
messages. To help assuage this problem RMST creates a “hole map” for detected gaps and
assigns a “watchdog” timer to generate an automatic NACK for any segment that has not
been received in the timer interval [8].
Multiple fragment numbers can be combined into a single NACK, as in PSFQ, to cut down
on the network traffic generated during message recovery, as shown in Fig. 4. Since RMST
uses the same gap acknowledgement scheme as PSFQ, it inherits the same shortcomings
when detecting loss of truncated messages. As seen with PSFQ's recovery scheme, at least
one data segment must be received downstream for RMST to detect message loss.
RMST does not specify any congestion control or detection mechanism. It is concerned
solely with reliable data transfer between the sensor nodes and the sink. Any congestion
control mechanisms are a byproduct of the use of directed diffusion which offers minimal
congestion control. For example, sensor nodes having gradients that show interest in the same
information, but have different reporting intervals, may “downconvert” to the lower of the
two reporting intervals [5].
7.4 ESRT (Event to Sink Reliable Transport)
ESRT introduces the idea of reliable event detection from the sensor nodes to the sink. ESRT
leverages the loss tolerant characteristic of WSNs, the goal being to pass a course description
of the event rather than providing fine details. Since ESRT will only reliably pass a course
description of the event, it is unacceptable for applications that require delivery of all
message segments. Unlike PSFQ and RMST, ESRT would be a good choice for tasks such as
sensor retasking or transporting binary objects in general.
ESRT uses a different paradigm to measure reliability in wireless sensor networks. The
assumption is not made that only messages in the point-to-multipoint direction, i.e. from the
sink to the sensor nodes, is the only type of message that needs to be reliably delivered.
Instead a measure of goodness is created using a defined event detection threshold and that
threshold is used to define reliability in the multipoint-to-point direction.
ESRT's loss detection and recovery mechanism does not prevent all losses, nor does it
guarantee delivery of all message segments from all source nodes. Instead ESRT tries to find
the correct frequency, f, to send messages.
Sankarasubramaniam et al. [9] introduce definitions for observed event reliability, ri, and
desired event reliability, R. Observed event reliability, ri, is defined as the number of data
segments received over some interval i at the sink, and desired event reliability, R, is defined
as the number of packets required for reliable event detection, i.e. R is the threshold for
reliable event detection. Data segments are given event IDs, and thus ri can be computed in
real time by incrementing a counter at the sink for all correlated segments.
Control reliable event detection and network congestion by relating ri and R to f. The problem
of reliable event detection then becomes adjusting f to maintain ri in an optimal interval
around R.
To further explore the idea of maximizing energy efficiency on WSNs by minimizing the
transmission of highly correlated data flows. Eliminating the need to send data from all
sensor nodes allows for some redundancy for the sensor nodes in WSNs and can prolong the
lifetime of the network.
Practical – 8
Objective: Develop sample wireless network in which,
There are various simulators that can be used to simulate network protocols such
as NS2, NS3, OMNeT++, NetSim. Here I am using NS2, an open-source event-driven
simulator. NS2 is written in C++ and Otcl, and the simulation has to be written in TCL
Script. NS2 is a really old simulator, began as a revision of NS-1 in 1995. Though I am using
version 2.35 which was released in 2011 on Ubuntu 20.04.1, and it works really fine, So no
worries there :)
NS2 executes the TCL script and generates a trace file and a network animator file. The
trace file is used for the analysis of the simulation like throughput, energy consumption.
The network animator file is executed by Nam (version 1.15) which produces the simulation
as an animation.
Nodes discover routes using defined messages by AODV, which are Route Requests -
RREQ, Route Reply - RREP, Route Error - RERR. Originating node
broadcasts RREQ messages to all its neighbors, nodes that have a route to the destination
node broadcasts RREP message along the reverse route to the originating node. In case, the
neighboring node to originating node does not have a route to the destination, it, in turn,
broadcasts RREQ messages keeping a reverse route to the originating node. If a node loses
connection to its next-hop node destination, it broadcasts RERR messages to all nodes which
received RREP messages.
Network Interface
Hop Count
Next Hop
List of Precursors
Lifetime
First of all set up some variables, which will be used later on for node configuration. val here
is an array with non-number indices. val(stop) is the end time of the
simulation. val(x), val(y) will be used to define topography. val(nn) denotes no. of nodes
used. val(rp) contains the type of routing protocol, which is AODV in this case.
set val(chan) Channel/WirelessChannel;
set val(stop) 3;
val(ifq) is the interface queue that gives priority to routing protocol packets and val(ifqlen) is
the max length of the queue. val(ant) defines antenna type as Omni-direction which means it
can receive and transmit in all directions. var(prop) is set as TwoRayGround which is the
attenuation model during radio propagation (1/r⁴). val(netif) contains value for network
interface. The Network Interface layer serves as a hardware interface that is used by the
mobile node to access the channel and it is set as Phy/WirelessPhy.
create-god $val(nn)
Line 1 generates the NS simulator object instance and assigns it to variable ns. Line 2 creates
an empty trace file ns_aodv.tr and assigns it to variable tf. trace-all command traces all the
events in a specific format. Line 6 creates the NAM visualization file ns_aodv.nam and
assigns it to nf. Line 7 tells the simulator to record traces in NAM format. Line 10 sets the
topography to flatgrid. god object stores the table of shortest no. of hops required from one
node to another.
$ns node-
config -
adhocRouting
$val(rp) \
-llType $val(ll) \
-macType $val(mac) \
-ifqType $val(ifq) \
-ifqLen $val(ifqlen) \
-antType $val(ant) \
-propType $val(prop) \
-phyType $val(netif) \
-channel $chan_1_ \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace OFF \
-movementTrace ON \
-energyModel $val(energymodel) \
-initialEnergy $val(initialenergy) \
-rxPower 0.4 \
-txPower 1.0 \
-idlePower 0.6 \
-sleepPower 0.1 \
-transitionPower 0.4 \
-transitionTime 0.1
The above configures the node with the variable that we defined in the beginning. Some other
parameters such as agentTrace trace UDP in our case, routerTrace traces packets involved in
routing, macTrace traces MAC protocol packets, movementTrace traces the motion of
nodes.
Here the first loop is assigning the initial location of nodes and the second loop is providing
the random movement of nodes within the topography.
We are creating an object of UDP and attaching it to our node no. 5, which will be the
originating node. Also, creating a Sink and attaching it to the destination node, node no. 2.
CBR (Constant Bit Rate) is our traffic source that will generate packets to send over UDP.
for {set i 0} {$i < $val(nn)} {incr i} {
The first ‘for loop’ initialize all nodes with initial positions for nam and the second ‘for loop’
resets all nodes at the end of the simulation.
proc finish {} {
global ns tf nf
$ns flush-trace
close $tf
close $nf
exit 0
$ns run
The keyword global is used because we are using variables that were declared outside the
scope of proc finish (procedure). flush-trace command saves all traces to respective files.
The simulation begins at $ns run.
Output:
Practical – 9
Objective: Implement mobile devices as wireless access point.
On Android, open Settings > Network & internet > Hotspot & tethering.
Next, select Portable hotspot.
Tap On then confirm the message regarding interruptions to existing connections.
Click Configure hotspot.
Set a Network name (SSID) --- this can be anything.
Choose the Security level --- WPA2 PSK is the strongest.
Set a new Password.
When you're done, tap Save.
With the hotspot enabled, you'll be able to use your phone like a home wireless network.
iPhone users can use their phone like a Wi-Fi router by using the hotspot feature.
Open Settings.
Tap Personal Hotspot.
Enable Allow Others to Join.
You'll see a message labeled Bluetooth is Off.
Select Turn on Bluetooth or Wi-Fi and USB Only, as per your preference.
Tap Wi-Fi Password to set a new passkey.
With all options set, your iPhone will be running as a wireless hotspot --- essentially, a
mobile router for your home!
If you have an old phone you plan to use as a wireless router, it might be a Windows 10
Mobile.
Windows 10 Mobile features an option to remotely enable the mobile hotspot feature over
Bluetooth. To do this, enable Turn on remotely. If your second device (perhaps a remote
control or headset) is connected to your device over Bluetooth, this will work.
With your smartphone set up as a Wi-Fi router, you'll be ready to start connecting devices.
For the best results, keep this to as few devices as possible. A couple of tablets or laptops is a
smart idea; a games console, less so.
To do so, simply connect them as you would to any other wireless router. The broadcast
name (SSID) you specified will be displayed. Simply enable Wi-Fi on your device, find the
SSID, and enter the password you specified.
Practical – 10
Objective: Study of Security in Ad hoc Wireless Networks.
Each security approach must be aware of security parameters as shown in Figure 1. All
mechanisms proposed for security aspects, must be aware of these parameters and don’t
disregard them, otherwise they may be useless in MANET. Security parameters in MANET
are as follows:
Processing Time: Each security approach needs time to detect misbehaviours and eliminate
malicious nodes. Due to MANET’s dynamic topology it’s strongly possible that routes
between two different nodes break because of mobility. Therefore, security approaches must
have as low as possible processing time in order to increase MANET flexibility and avoid
rerouting process.
Energy Consumption: In MANET nodes have limited energy supply. Therefore, optimizing
energy consumption is highly challengeable in MANET. High energy consumption reduces
nodes and network’s lifetime. Each security protocol must be aware of these three important
parameters. In some situations a trade-off between these parameters is provided in order to
perform a satisfaction level in all of them. Security protocols that disregard these parameters
aren’t efficient as they waste network resources.
10.2 MANET Security Challenges
One of the earliest researches in security in MANET was presented in 2002 [9]. Some
security challenges in MANET were inherited from ad hoc networks that were research
interests since International Journal of Computer Science & Engineering Survey (IJCSES)
Vol.6, No.1, February 2015 17 1999 [10, 11]. Generally there are two important aspects in
security: Security services and Attacks. Services refer to some protecting policies in order to
make a secure network, while attacks use network vulnerabilities to defeat a security service.
In the next two parts, a brief discussion on these security aspects is presented.
Availability: According to this service, each authorized node must have access to all data
and services in the network. Availability challenge arises due to MANET’s dynamic topology
and open boundary. Accessing time, which is the time needed for a node to access the
network services or data is important, because time is one of the security parameters. By
using lots of security and authentication levels, this service is disregarded as passing security
levels needs time. Authors in [12] provided a new way to solve this problem by using a new
trust based clustering approach. In the proposed approach which is called ABTMC
(Availability Based Trust Model of Clusters), by using availability based trust model, hostile
nodes are identified quickly and should be isolated from the network in a period of time,
therefore availability of MANET will be guaranteed.
Authentication: The goal of this service is to provide trustable communications between two
different nodes. When a node receives packets from a source, it must be sure about identity of
the source node. One way to provide this service is using certifications, whoever in absence
of central control unit, key distribution and key management are challengeable. In [13] the
authors presented a new way based on trust model and clustering to public the certificate
keys. In this case, the network is divided into some clusters and in this clusters public key
distribution will be safe by mechanisms provided in the paper. Their simulation results show
that, the presented approach is better than PGP. But it has some limitations like clustering.
MANET dynamic topology and unpredictable nodes position, made clustering challengeable.
Data confidentially: According to this service, each node or application must have access to
specified services that it has the permission to access. Most of services that are provided by
data confidentially use encryption methods but in MANET as there is no central
management, key distribution faced lots of challenges and in some cases impossible. Authors
in [14] proposed a new scheme for reliable data delivery to enhance the data confidentially.
The basic idea is to transform a secret message into multiple shares by secret sharing schemes
and then deliver the shares via multiple independent paths to the destination. Therefore, even
if a small number of nodes that are used to relay the message shares, been compromised, the
secret message as a whole is not compromised. Using multipath delivering causes the
variation of delay in packet delivery for different packets. It also leads to out-of-order packet
delivery.
Integrity: According to integrity security service, just authorized nodes can create, edit or
delete packets. As an example, Man-In-The-Middle attack is against this service. In this
attack, the attacker captures all packets and then removes or modifies them. Authors in [15]
presented a International Journal of Computer Science & Engineering Survey (IJCSES)
Vol.6, No.1, February 2015 18 mechanism to modify the DSR routing protocol and gain to
data integrity by securing the discovering phase of routing protocol.
Non-Repudiation: By using this service, neither source nor destination can repudiate their
behaviour or data. In other words, if a node receives a packet from node 2, and sends a reply,
node 2 cannot repudiate the packet that it has been sent. Authors in [16] presented a new
approach that is based on grouping and limiting hops in broadcast packets. All group
members have a private key to ensure that another node couldn’t create packets with its
properties. But creating groups in MANET is challengeable.
10.4 Attacks
Due to special features like hop-by-hop communications, wireless media, open border and
easy to setup, MANET became popular for malicious nodes. Some of the most important
attacks in MANET are as follows:
Black Hole Attack: In this attack, malicious node injects fault routing information to the
network and leads packets toward itself, then discards all of them [17-19]. In [20] we present
a survey on black hole detection and elimination approaches. Also we presented a
classification of defeating approach for this attack. Authors in [21] presented a new approach
based on confirming the best path using second path. In this approach, whenever a source
node receives RREP packets, it send a confirmation packet through the second best path to
the destination and ask the destination whether it has a route to the RREP generator or to the
Next_Hop_Node of RREP generator or not. If the destination has no route to this nodes, both
RREP generator and it’s Next_Hop_Node will mark as malicious nodes. Using this approach
source node can detect cooperative malicious nodes. Whoever in the case of more than two
cooperative malicious node, this approach can’t detect all malicious nodes.
Worm Hole Attack: In worm hole attack, malicious node records packets at one location of
the network and tunnels them to another location [22]. Fault routing information could
disrupt routes in network [23]. Authors in [24] presented a way to secure MANET against
this attack by using encryption and node location information. But as mentioned before, key
distribution is a challenge in MANET.
Byzantine attack: In this attack, malicious node injects fault routing information to the
network, in order to locate packets into a loop [25, 26]. One way to protect network against
this attack is using authentication. Authors in [27] presented a mechanism to defeat against
this attack using RSA authentication.
Snooping attack: The goal of this attack is accessing to other nodes packets without
permission [28]. As in MANET packets transmitted hop by hop, any malicious node can
capture others packets.
Routing attack: In this attack, malicious node tries to modify or delete node’s routing tables
[17, 18, 29]. Using this attack, malicious node destroys routing information table in ordinal
nodes. Therefore, packet overhead and processing time will increase.
Resource consumption attack: In this attack, malicious node uses some ways to waste
nodes or network resources [30, 31]. For instance, malicious node leads packets to a loop that
consists of International Journal of Computer Science & Engineering Survey (IJCSES) Vol.6,
No.1, February 2015 19 ordinal nodes. As a result, node’s energy consumed for transmitting
fault packets. In addition, congestion and packet lost probability will increase.
Session hijacking: Session hijacking is a critical error and gives an opportunity to the
malicious node to behave as a legitimate system [32, 33]. Using this attack, malicious node
reacts instead of true node in communications. Cryptography is one of the most efficient
ways to defeat this attack.
Denial of service: In this attack, malicious node prevents other authorized nodes to access
network data or services [34-38]. Using this attack, a specific node or service will be
inaccessible and network resources like bandwidth will be wasted. In addition, packet delay
and congestion increases.
Jamming attack: Jamming attack is a kind of DOS attack [39]. The objective of a jammer is
to interfere with legitimate wireless communications. A jammer can achieve this goal by
either preventing a real traffic source from sending out a packet, or by preventing the
reception of legitimate packets [40].
Impersonation Attack: Using this attack, attacker can pretend itself as another node and
injects fault information to the network [41-43]. As MANET has open border and hop-by-hop
communications, it’s hardly vulnerable against this attack. In some cases even using
authentication is useless.
Modification Attack: In this attack, malicious nodes sniff the network for a period of time.
Then, explore wireless frequency and use it to modify packets [44, 45]. Man-in-the-middle is
a kind of Modification attack.
Fabrication Attack: In fabrication attack, malicious node destroys routing table of nodes by
injecting fault information [46-48]. Malicious node creates fault routing paths. As a result,
nodes send their packets in fault routes. Therefore, network resources wasted, packet delivery
rate decreased and packet lost will growth.
Man-in-the-middle attack: In this attack, malicious node puts itself between source and
destination. Then, captures all packets and drops or modifies them [49-51]. Hop by hop
communications are made MANET vulnerable against this attack. Authentication and
cryptography are the most effective ways to defeat this attack.
Gray Hole Attack: This attack is similar to black hole. In black hole, malicious node drops
all packets, while in this attack, malicious node drops packets with different probabilities. As
it relays some packets, detecting this attack is more complicated than black hole and some
detection approaches like sniffing or watchdog will be useless in it.
Traffic Analyse Attack: The goal of this attack is sniffing network traffic to use them in
another attack or in a specific time. Malicious node captures all packets to use them later.