AWSN
AWSN
1
Aim: How to install Linux OS on computer and how to setup Ubuntu on WSL2 on Windows
OS.
Let’s look the below Linux installation guide which has various methods we can use to
download Linux(Ubuntu) and install it.
This is one of the easiest methods of installing Ubuntu or any distribution on your computer.
Follow the steps to install Ubuntu from USB.
Download the .iso or the OS files on your computer from this link.
Download free software like Universal USB installer to make a bootable USB stick.
Fig 2. Universal-USB-Installer
1
Fig 3. Setup
After everything has been installed and configured, a small window will appear
Congratulations! You now have Ubuntu on a USB stick, bootable and ready to go.
Those who like the way a CD runs should try using this method.
(image source)
o Step 1) Download the .iso or the OS files onto your computer from this link
http://www.ubuntu.com/download/desktop.
o Step 2) Burn the files to a CD.
o Step 3) Boot your computer from the optical drive and follow the instructions as they
come.
Windows Subsystem for Linux (WSL) allows you to install a complete Ubuntu terminal
environment in minutes on your Windows machine, allowing you to develop cross-platform
applications without leaving windows.
1. Open the Microsoft Store (search for "store" from the start menu)
2
Fig 4. Download Ubuntu on Microsoft store
3
Practical 2
Aim: Familiarization with Linux operating system.
Introduction:
Linux is a community of open-source Unix like operating systems that are based on the Linux
Kernel. It was initially released by Linus Torvalds on September 17, 1991. It is a free and open-
source operating system and the source code can be modified and distributed to anyone
commercially or non-commercially under the GNU General Public License.
Initially, Linux was created for personal computers and gradually it was used in other machines
like servers, mainframe computers, supercomputers, etc. Nowadays, Linux is also used in
embedded systems like routers, automation controls, televisions, digital video recorders, video
game consoles, smartwatches, etc. The biggest success of Linux is Android(operating system)
it is based on the Linux kernel that is running on smartphones and tablets. Due to android Linux
has the largest installed base of all general-purpose operating systems. Linux is generally
packaged in a Linux
Linux Distribution:
MX Linux
Manjaro
Linux Mint
elementary
Ubuntu
Debian
Solus
Fedora
openSUSE
Deepindistribution.
4
6. cp - Similar usage as mv but for copying files in Linux
7. rm - Delete files or directories
8. touch - Create blank/empty files
9. ln - Create symbolic links (shortcuts) to other files
10. cat - Display file contents on the terminal
11. clear - Clear the terminal display
12. echo - Print any text that follows the command
Advantages of Linux
1. The main advantage of Linux, is it is an open-source operating system. This means the
source code is easily available for everyone and you are allowed to contribute, modify
and distribute the code to anyone without any permissions.
2. In terms of security, Linux is more secure than any other operating system. It does not
mean that Linux is 100 percent secure it has some malware for it but is less vulnerable
than any other operating system. So, it does not require any anti-virus software.
3. The software updates in Linux are easy and frequent.
4. Various Linux distributions are available so that you can use them according to your
requirements or according to your taste.
5. Linux is freely available to use on the internet.
6. It has large community support.
7. It provides high stability. It rarely slows down or freezes and there is no need to reboot
it after a short time.
8. It maintains the privacy of the user.
9. The performance of the Linux system is much higher than other operating systems. It
allows a large number of people to work at the same time and it handles them
efficiently.
10. It is network friendly.
11. The flexibility of Linux is high. There is no need to install a complete Linux suit; you
are allowed to install only required components.
12. Linux is compatible with a large number of file formats.
13. It is fast and easy to install from the web. It can also install on any hardware even on
your old computer system.
14. It performs all tasks properly even if it has limited space on the hard disk.
Disadvantages of Linux
5
Practical 3
Aim: Introduction of Wireless sensor network applications and its simulation.
Sensor nodes are used in WSN with the onboard processor that manages and monitors the
environment in a particular area. They are connected to the Base Station which acts as a
processing unit in the WSN system.
Base Station in a WSN System is connected through the Internet to share data.
WSN can be used for processing, analysis, storage, and mining of the data.
• Military Applications
• Health Applications
• Environmental Applications
• Home Applications
• Commercial Applications
6
• Area monitoring
• Health care monitoring
• Environmental/Earth sensings
• Air pollution monitoring
• Forest fire detection
• Landslide detection
• Water quality monitoring
• Industrial monitoring
7
makes use of more than one simulation paradigm to evaluate the model. It merges
the merits of two simulation approaches.
VARIOUS SIMULATOR:
NS-2
NS-2 is a discrete event simulator targeted at networking research. NS-2 began as a variant
of the REAL network simulator in 1989 and has evolved substantially over the past few
years. NS-2 has a modular approach and hence is effectively extensible.
Environment: It provides substantial support for simulation of TCP, routing, and multicast
protocols over wired and wireless (local and satellite) networks. Support for wireless
networks was added later to simulate wireless LAN protocols, mobile ad-hoc networks and
wireless sensor networks. The simulator focuses on following the ISO/OSI model.
TOSSIM
TOSSIM is a discrete event simulator for TinyOS wireless sensor networks, which were
developed at UC Berkeley. TOSSIM captures the behavior and interactions of networks not
on the packet level but at network bit granularity. TOSSIM is designed specifically for
TinyOS applications to be run on MICA Motes. TOSSIM simulates entire TinyOS
applications. It works by replacing components with simulation implementations.
TOSSIM can replace a packet-level communication component for packet-level simulation,
or replace a low-level radio chip component for a more precise simulation of the code
execution.
GloMoSim
Global Mobile Information System Simulator (GloMoSim) is a scalable simulation
environment for large wireless and wired communication networks. The node aggregation
technique is introduced into GloMoSim to give significant benefits to the simulation
performance. In GloMoSim, each node represents a geographical area of the simulation.
Hence the network nodes which a particular entity represents are determined by the physical
position of the nodes.
UWSim
UWSim is a simulator used for Underwater Sensor Networks (UWSN). Most of the
currently available simulators focus greatly on ground-based sensor and ad hoc networks
they do not consider the factors that affect the underwater communication [21]. UWSim, on
the other hand, has its focus on handling scenarios specific to UWSN environments, for
example low bandwidth, low frequency, high transmission power, and limited memory. It
is based on a network component-based approach, rather than a layer/protocol-based
approach.
8
Environment: Tailor-designed for simulations of under-water sensor networks.
Avrora
Avrora, a research project of the UCLA Compilers Group, is an open-source cycle- accurate
simulator for embedded sensing programs. Unlike other simulators, that are able to simulate
only specific platforms, Avrora has language and operating system independence. It
provides a framework for program analysis, allowing static checking of embedded software
and an infrastructure for future program analysis research.
Avrora simulates a network of motes, runs the actual microcontroller programs (rather than
models of the software), and runs accurate simulations of the devices and the radio
communication.
9
Practical 4
Aim: Network Simulator installation of wireless sensor network.
Network simulation (NS) is one of the types of simulation, which is used to simulate the
networks such as in MANETs, VANETs, etc. It provides simulation for routing and multicast
protocols for both wired and wireless networks. NS is licensed for use under version 2 of the
GNU (General Public License) and is popularly known as NS2. It is an object-oriented, discrete
event-driven simulator written in C++ and Otcl/Tcl.
NS-2 can be used to implement network protocols such as TCP and UDP, traffic source
behavior such as FTP, Telnet, Web, CBR, and VBR, router queues management mechanism
such as Drop Tail, RED, and CBQ, routing algorithms, and many more. In ns2, C++ is used
for detailed protocol implementation and Otcl is used for the setup. The compiled C++ objects
are made available to the Otcl interpreter and in this way, the ready-made C++ objects can be
controlled from the OTcl level.
1. Requirements
2. Assumptions
10
c. There are two ways to install after this step:
ii) Download and then Install (This option is desired when needed to install on
large no. of machines.)
11
f. Selecting connection to internet: Direct connection preferred
12
Select one of the mirror site, generally preference is made to site that’s near to download
location.
Since CYGWIN has lot of packages , its desirable to install all packages. In order to achieve
this ,Click view button , until it shows “full” .
In order to make all packages installed, click the each of “skip” entry. After this step the
installation window looks like this.
c. Now open the cygwin window by clicking the cygwin shortcut on the desktop.
13
d. In order to extract the NS installation file, go to the location where the installation file is
stored , by following commands:
cd c:
cd cygwin/
e. Extraction of files:
gzip –d ns-allinone-2.27.tar.gz
tar –xvf ns-allinone-2.27.tar
by the above commands there will be directory created in the name of ns-allinone-2.27
Commands to be executed:
cd ns-allinone-2.27
./install
IMP NOTE: if in the process, you get a prompt saying “package diff missing do u want to
proceed, press Y for proceeding or N for exiting.
If all the above steps are followed there should not be any error in installing NS2. if in any
case if u get an error message saying that package missing, it means that those packages are
skipped at the time of installation so u have to install those packages by doing setup again.
g. Validating NS2:
Move to the folder containing NS-2(i.e. ns-2.27) and then type the following command
./validate
This will test the installation of NS2 with the predefined examples.
14
Then u will find the following screen shot.
once the above command “startx” is entered. The following window is opened
do all the operations in the above window. Like compiling your tcl scripts etc
15
Installation Guidelines for NS2 on Ubuntu
To view our network simulation traces made using ns-2, we will need Nam: Network
Animator.
Nam is a Tcl/TK based animation tool for viewing network simulation traces and real world
packet traces. It supports topology layout, packet level animation, and various data inspection
tools.
16
Practical 5
Aim: Implementation of routing protocol in NS2 for DSR protocol.
NS2 Simulator
NS-2 is extensively used by the networking research community. It provides substantial support
for simulation of TCP, routing, multicast protocols over wired and wireless (local and satellite)
networks, etc.
DSR Protocol
The Dynamic Source Routing Protocol is a source-routed on-demand routing protocol. A node
maintains route caches containing the source routes that it is aware of. The node updates entries
in the route cache as and when it learns about new routes.DSR does not rely on functions like
periodic routing advertisement, link status sensing or neighbor detection packets and because
of the entirely on demand behavior, the number of overhead packets caused by DSR scales
down to zero.
Implementation of routing protocol in NS2 for DSR protocol:- #Simulation parameters
setup
17
NAM trace file set namfile [open
outm.nam w]
$ns namtrace-all $namfile
$ns namtrace-all-wireless $namfile $val(x) $val(y) set
chan [new $val(chan)];#Create wireless channel
# Nodes Definition
#Create nodes set
n0 [$ns node] $n0
set X_ 573
$n0 set Y_ 357
$n0 set Z_ 0.0
$ns initial_node_pos $n0 20
set n1 [$ns node] $n1
set X_ 227
$n1 set Y_ 294
$n1 set Z_ 0.0 $ns
initial_node_pos $n1 20 set
n2 [$ns node] $n2 set X_
103
$n2 set Y_ 109
$n2 set Z_ 0.0 $ns
initial_node_pos $n2 20 set
n3 [$ns node] $n3 set X_
882
18
$n3 set Y_ 112
$n3 set Z_ 0.0 $ns
initial_node_pos $n3 20 set
n4 [$ns node] $n4 set X_
739
$n4 set Y_ 46
$n4 set Z_ 0.0 $ns
initial_node_pos $n4 20 set
n5 [$ns node]
$n5 set X_ 830
19
$n11 set Z_ 0.0 $ns
initial_node_pos $n11 20 set
n12 [$ns node] $n12 set X_
354
$n12 set Y_ 419
$n12 set Z_ 0.0 $ns
initial_node_pos $n12 20 set
n13 [$ns node] $n13 set X_
1020
$n13 set Y_ 199
$n13 set Z_ 0.0 $ns
initial_node_pos $n13 20 set
n14 [$ns node] $n14 set X_
513
$n14 set Y_ -54
20
n20 [$ns node] $n20 set X_
768
$n20 set Y_ -156
$n20 set Z_ 0.0 $ns
initial_node_pos $n20 20 set
n21 [$ns node] $n21 set X_
962
$n21 set Y_ 198
$n21 set Z_ 0.0 $ns
initial_node_pos $n21 20 set
n22 [$ns node] $n22 set X_
747
$n22 set Y_ 293
$n22 set Z_ 0.0 $ns
initial_node_pos $n22 20 set
n23 [$ns node] $n23 set X_
589
$n23 set Y_ -56
$n23 set Z_ 0.0
# Generate movement
$ns at 0.3 " $n8 setdest 750 55 50 "
$ns at 0.5 " $n15 setdest 739 46 80 "
$ns at 0.4 " $n16 setdest 742 280 50 "
$ns at 0.2 " $n17 setdest 720 170 80 "
$ns at 0.2 " $n23 setdest 450 144 50 "
22
Practical 6
Aim: Study other wireless sensor network simulators (Mannasim. Contiki).
Configuring Access Points(Mannasim):-To create an access point (AP) the first thing it to
set node-config structure. This is a ns-2 structure used to define a bunch of mobile node
parameters. In Mannasim context the only difference from the tradicional settings is the
inclusion of -sensorNode ON command. With this command whenever an instance of a mobile
node is instantiated a wireless sensor node is automatically created. The box bellow shows a
sample configuration (note the use of val() vector).
Next thing to be done is to set sensor node functionalitys like for example, a transporte protocol,
a data generator, a processing module and an application running within the sensor node. All
these functionalities have have configuration parameteres of there own that will be explained
shortly.
Configuring teh sensor node requires the adjustment of nodes position, motion characteristics
(in the box example, 0 means that the sensor node is static) and the transport protocol.
IMPORTANT: when attaching the transport protocol to an AP node the port value used must
be the same of all network elements (common nodes, cluster heads, etc).
$node_($counter) random-motion 0
$node_($counter) set X_ 5.0
$node_($counter) set Y_ 5.0
$node_($counter) set Z_ 0.0
$node_($counter) attach $udp_($counter) $val(port)
On demand Networks
23
On demand networks require that the AP or other outsider send requests messages to the WSN.
These messages specifies the situation when the network should provide data to the requester.
To create a request message to be send by the AP the following parameters should be set:
when requested data should be sent back to AP (for example, send data when
temperature exceeds 25 celcius degrees).
request type - two values are possible: REAL (0) when sensor node drops all data all
data from its buffer, gather new one, process and deliver it to the disseminating module.
BUFFER (1) when sensor node process data from its buffer and give the results to the
disseminating module.
The sample code provided bellow defines the request time, schedules when data structure that
encapulates request data is created and when request message will be sent.
The Common Node (CN) configuration presents the greater number of parameter to be set.
Since a CN has an application, a processing module and a data generation module used to
simulate sensing tasks.
Sensor node creation is equal to Access Point node creation. Just put in the tradicional
nodeconfig structure the -sensorNode ON command.
Next step is to create common node functionality modules including a transport protocol, an
sensor application, a processing and a data generator. The data generator module is the
difference between a Cluster Head and a Common Node configuration. In the example box
presented bellow an UDP transport protocol, an AggregateProcessing processing module, a
TemperatureDataGenerator data generator module and a
CommonNodeApplication application module were used.
Common node application parameters include dissemination interval and type (PERIODIC -
0, CONTINUOUS - 1, ON_DEMAND - 2 and EVENT_DRIVEN - 3), sent messages
destination address. The attachements list is bigger including sensor node, transport protocol,
processing and data generator module (see example box following).
24
$app_($counter) set dissemination_type 0;
$app_($counter) set dissemination_interval 30.0;
$app_($counter) node $node_($counter);
$app_($counter) attach-agent $udp_($counter)
$app_($counter) attach_data_generator $gen_($counter)
$app_($counter) attach-processing $processing_($counter)
Overview of Contiki Cooja Simulator: Cooja is one of the sensor network simulators and it
is the short form of Contiki OS Java simulator. The Contiki OS is a convenient OS used for
the limited source of devices such as the sensor nodes and it is created in the event-driven
kernel.
The following is about the most important compensations in the Contiki Cooja.The Contiki
provides assistance for the pre-emptive and pre-process multi-threading and for interaction
process by message transmission over the optimal GUI subsystem
Let us discuss significant modules and the functions of that module based on the Cooja
simulator
Arm
It is used for the execution of atomic functions by the instructions of DMB, STREX,
and LDREX.
Arm-gcc in Contiki and arm related Contiki ports are created by the toolchain Major
Classes in Contiki Cooja Simulator
Hereby, we have listed down the notable classes which are useful for the development of the
research project. There are many significant classes based on the Contiki Cooja simulator but
we have listed down a class with their uses for your reference
File Target
It is utilized for the process of hash table which related to file writing
Hereby, we have highlighted some programming language for the implementation process in
the research based on the Contiki Cooja r and we support your ideas with our guidance
25
Programming Languages in Contiki Cooja
Java
C
The essential and supportive operating systems for the Contiki Cooja simulator are listed down.
If research scholars need some more requirements you can contact us for your research support
and our research experts will provide the complete guidance
Contiki-2.7
Ubuntu-14.04
Hereby, we have enlisted the version details for Cooja simulator. Similarly, research scholars
may select different versions for their research implementation process with our research expert
guidance
It is a new method of wireless sensor network simulation which permits the holistic
simulation in several levels
For instance, we are executing the simulator such as Cooja and Contiki sensor node.
Here Cooja permits the operating system level, machine code instruction level, and
network-level
The subject modules used in the Contiki Cooja are highlighted below. The research scholars
may use the module which suits their research projects with our support
Internet of Things
26
Practical 7
Aim: Implementation of routing protocol in NS2 for AODV protocol for TORA protocol.
#Define options
setval(chanl) Channel/WirelessChannel ; #channel type
27
-ifqLen $val(ifqlen)\
-antType $val(ant)\
-propType $val(prop)\
-phyType $val(netif) \
-channelType $val(chanl)\
-topo Instance$topo \
-agentTrace ON\
-routerTrace ON\
-macTrace OFF \
-movementTrace ON
28
$ns attach-agent $node_(11) $sink
$ns connect $tcp $sink set ftp [new
Application/FTP] $ftp attach-
agent $tcp
$ns at 10.0 "$ftp start"
$ns run
29