0% found this document useful (0 votes)
13 views105 pages

MC File Final

This document is a practical file for a Master of Technology program in Mobile Communication and Network Technology, detailing various experiments using the NS-2 simulator. It includes objectives, theoretical backgrounds, installation instructions, and code snippets for implementing different network simulations, such as point-to-point networks and Ethernet LANs. The experiments aim to analyze network performance metrics like packet drops, congestion windows, and protocol comparisons.

Uploaded by

Mayank Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views105 pages

MC File Final

This document is a practical file for a Master of Technology program in Mobile Communication and Network Technology, detailing various experiments using the NS-2 simulator. It includes objectives, theoretical backgrounds, installation instructions, and code snippets for implementing different network simulations, such as point-to-point networks and Ethernet LANs. The experiments aim to analyze network performance metrics like packet drops, congestion windows, and protocol comparisons.

Uploaded by

Mayank Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 105

Practical File

Mobile Computing
(ITMDE01)

Master of Technology
In

Mobile Communication and Network


Technology

By
KSHITIJ SHARMA
2024PMN4205

Under the Guidance of


Mr. Karan Gupta
Practical Instructor
Department of Information Technology
Practical File
Mobile Computing
(ITMDE01)

Master of Technology
In

Mobile Communication and Network


Technology

By
BHUPESH SINGH
2024PMN4216

Under the Guidance of


Mr. Karan Gupta
Practical Instructor
Department of Information Technology
Practical File
Mobile Computing
(ITMDE01)

Master of Technology
In

Mobile Communication and Network


Technology

By
MAYANK SINGH
2024PMN4215

Under the Guidance of


Mr. Karan Gupta
Practical Instructor
Department of Information Technology
INDEX
S NO TITLE DATE SIGN
Download NS-2 simulator and install in Unix
1. System Jan 3, 2025

Implement a point – to – point network


consisting of FOUR (04) nodes using the NS2
simulator with duplex links between them.
Initiate a communication between these nodes.
Set the queue size, vary the bandwidth and find Jan 10,
2.
the number of packets dropped. Finally plot a 2025
graph showing the performance of this network
in terms of the number of packets dropped with
varying bandwidth.

Implement an Ethernet LAN using ’N’ nodes and


set multiple traffic nodes and plot congestion Jan 17,
3. windows for different source/destination pairs in 2025
NS2/NS3.

Implement an Ethernet LAN comprising of ’N’


nodes and set multiple traffic nodes and plot the
performance for varying congestion window for Jan 24,
4
different source/destination on pair in NS2/NS3. 2025

Implement and study the performance of GSM Jan 31,


5 on NS2/NS3 using MAC layer 2025

1
S NO TITLE DATE SIGN

Implement an Infrastructure-less wireless


network comprising of ’N’ nodes in an area of
400m x 300m and set multiple traffic nodes.
6 After simulation plot the performance in terms Feb 7, 2025
of the End-to-End delay, Throughput, packet
delivery ratio for varying for No. of nodes with
different source/destination pair in NS2/NS3.

Implement an Infrastructure-less wireless


network comprising ’N’ nodes in an area of 1000
x 1000 square meters. At the routing layer use
AODV and DSR protocols. Perform the
simulations with a varying number of nodes. Mar 21,
7
Plot and compare the performance of AODV and 2025
DSR in terms of the End-to-End delay,
Throughput, and packet delivery ratio using the
NS2/NS3 simulator.

Implement an Infrastructure-less wireless


network comprising of ’N’ MOBILE nodes.
Perform the simulations with varying speed of
the nodes.
Plot and compare the performance of different Mar 21,
8
MAC layer protocols using NS2/NS3 simulator 2025
in terms of:
(1) Number of collisions,
(2) Number of Control packets

2
Experiment : 1
Objective: Download NS-2 simulator and install in Unix System,
while demonstrating each step.
Theory:
The NS is a discrete event simulator targeted at networking research. Ns
provides substantial support for simulation of TCP, routing, and multicast
protocols over wired and wireless (local and satellite) networks.
Ns began as a variant of the REAL network simulator in 1989 and has evolved
substantially over the past few years. In 1995 ns development was sup-
ported by DARPA through the VINT project at LBL, Xerox PARC, UCB,
and USC/ISI. Currently ns development is support through DARPA with
SAMAN and through NSF with CONSER, both in collaboration with other
researchers including ACIRI. Ns has always included substantal contribu-
tions from other researchers, including wireless code from the UCB Daedelus
and CMU Monarch projects and Sun Microsystems. For documentation on
recent changes, see the version 2 change log.
NS2 stands for Network Simulator Version 2. It is an open-source event-
driven simulator designed specifically for research in computer communica-
tion networks.
Features of NS2:
• Discrete Event Simulation: NS2 simulates network behavior by
modeling events (like packet arrival, transmission, etc.) occurring at
specific points in time.

• Wired and Wireless Network Simulation: It allows researchers


to model and analyze both wired and wireless network scenarios

• Protocol Support: NS2 provides substantial support for simulating


various network protocols, including TCP, FTP, UDP, HTTP, and DSR

• Scripting Language: It utilizes TCL (Tool Command Language)


as its scripting language, allowing users to define network topologies,
traffic patterns, and simulation parameters.

• Object-Oriented Support: OTCL (Object-oriented TCL) provides


object-oriented programming capabilities within the TCL environment

• C++ and OTCL Linkage: Tclcl provides linkage between C++ and
OTCL.

3
• Network Topology Definition, Traffic Modeling, Agent and Application
Modeling, Simulation Execution and Visualization, Trace Analysis, etc.

Architecture:

Installation:
• Step 1: Install the basic libraries like:
1 $ sudo apt install build-essential autoconf automake
libxmu-dev

• Step 2: Install gcc-4.8 and g++-4.8:


- Open this file using sudo mode:
1 $ sudo nano / etc / apt / sources.list

- Include the following line:


deb http://in.archive.ubuntu.com/ubuntu bionic main universe
- Now run:
1 $ sudo apt update
2 $ sudo apt install gcc-4.8 g ++ -4.8
4
• Step 3: Download and Unzip the ns2 packages to home folder:
- Download : Download the software from the following link:
http://sourceforge.net/projects/nsnam/files/allinone/ns-allinone-2.35/ns-
allinone-2.35.tar.gz/download
- Extract : Extract it to home folder by Right click over the file and
click extract here and select the home folder or by running the following
command:
1 $ tar zxvf n s - a l l i n o n e - 2 . 3 5 . t a r . g z

• Step 4: Make the given changes in the following files:


– Changes:
– @CC@ to be replaced with gcc-4.8
– @CPP@ or @CXX@ to be replaced with g++-4.8
– Files in which the changes are to be made:
– ns-allinone-2.35/Makefile.in
– /home/ads-lab/ns-allinone-2.35/otcl-1.14/Makefile.in
– nam-1.15/Makefile.in
– xgraph-12.2/Makefile.in
• Step 5: Open the file and in line number 137, change the line erase
to this–>erase:

5
1 $ sudo gedit ns-2.35 / linkstate / ls.h

• Step 6: Once the installation is over, Set the PATH and LD LIBRARY PATH
information in the file located at:
1 $ sudo gedit / home / ads-lab / .bashrc

6
– Paste :
– export PATH=$PATH:/home/ads-lab/ns-allinone-2.35/bin:/home/ads-
lab/ns-allinone-2.35/tcl8.5.10/unix:/home/ads-lab/ns-allinone-2.35/tk8.5.
10/unix
– export LD LIBRARY PATH=/home/ads-lab/ns-allinone-2.35/otcl-
1.14:/home/ads-lab/ns-allinone-2.35/lib

• Step 7: Verify the installation by running following commands:


1 $ ns
2 $ nam

7
Experiment : 2
Objective: Implement a point – to – point network consisting of
FOUR (04) nodes using the NS2 simulator with duplex links between them.
Initiate a communication between these nodes. Set the queue size, vary the
bandwidth and find the number of packets dropped. Finally plot a graph
showing the performance of this network in terms of the number of packets
dropped with varying bandwidth.
Codes:
– exp-2.tcl:
1 set ns [ new Simulator ] ;# Create a simulator object
2
3 set tf [ open exp-1.tr w ] ;# Open the nam trace file
4 $ns trace-all $tf
5
6 # Open the nam trace file
7 set nf [ open exp-1.nam w ]
8 $ns namtrace-all $nf
9
10 # Define a ’ finish ’ procedure
11 proc finish { } {
12 global ns nf tf
13 $ns flush-trace
14 exec nam exp-1.nam &
15 close $tf
16 close $nf
17 exit 0
18 }
19
20 # Creating nodes
21 set n0 [ $ns node ]
22 set n1 [ $ns node ]
23 set n2 [ $ns node ]
24 set n3 [ $ns node ]
25
26 # Define different colors and labels for data flows
27 $ns color 1 " red "
28 $ns color 2 " blue "
29 $n0 label " Source / udp0 "
30 $n1 label " Source / udp1 "
31 $n2 label " Router "
32 $n3 label " Destination / Null "
33
34 # Create link between nodes
35 $ns duplex-link $n0 $n2 1 Mb 10 ms DropTail
36 $ns duplex-link $n1 $n2 1 Mb 10 ms DropTail
37 $ns duplex-link $n2 $n3 1 Mb 10 ms DropTail

8
38

39 # Set queue size of links


40 $ns set queue-limit $n0 $n2 50
41 $ns set queue-limit $n1 $n2 50
42 $ns set queue-limit $n2 $n3 50
43
44 # Setup a UDP connection
45 set udp0 [ new Agent / UDP ]
46 $ns attach-agent $n0 $udp0
47
48 # Create a CBR traffic source and attach it to udp0
49 set cbr0 [ new Application / Traffic / CBR ]
50 $cbr0 set packetSize_ 2000
51 $cbr0 set interval_ 0 .001
52 $cbr0 attach-agent $udp0
53
54 # Create a UDP agent and attach it to node n1
55 set udp1 [ new Agent / UDP ]
56 $udp1 set class_ 2
57 $ns attach-agent $n1 $udp1
58
59 # Create a CBR traffic source and attach it to udp1
60 set cbr1 [ new Application / Traffic / CBR ]
61 $cbr1 set packetSize_ 2000
62 $cbr1 set interval_ 0 .001
63 $cbr1 attach-agent $udp1
64
65 # Create a Null agent ( a traffic sink ) and attach it to node
n3
66 set null0 [ new Agent / Null ]
67 $ns attach-agent $n3 $null0
68
69 # Connect the traffic sources with the traffic sink
70 $ns connect $udp0 $null0
71 $ns connect $udp1 $null0
72

73 # Schedule events for the CBR agents


74 $ns at 0 .5 " $cbr0 start "
75 $ns at 1 .0 " $cbr1 start "
76 $ns at 4 .0 " $cbr1 stop "
77 $ns at 4 .5 " $cbr0 stop "
78

79 # Call the finish procedure after 5 seconds of simulation time


80 $ns at 5 .0 " finish "
81
82 # Run the simulation
83 $ns run

9
– extract-drop-bandwidth.awk
1 BEGIN {
2 dropped_count = 0;
3 }
4 {
5 if ( $1 == " d " )
6 dropped_count ++;
7 }
8 END {
9 print dropped_count , BANDWIDTH ;
10 }

– packet-drop.awk
1 BEGIN {
2 count = 0;
3 }
4 {
5 if ( $1 == " d " )
6 count ++;
7 }
8 END {
9 printf ( " The Total no of Packets Drop is : % d \ n \ n " , count )
;
10 }

– plot.p
1 set title " Packets Dropped vs Bandwidth "
2 set xlabel " Bandwidth ( Mb ) "
3 set ylabel " Packets Dropped "
4 set grid
5 plot " data . txt " using 2:1 with linespoints title " Packet Drop
"
6 pause -1

10
Outputs:

Initialized

Running

11
plot.p

12
Experiment : 3
Objective: Implement an Ethernet LAN using ’N’ nodes and set
multiple traffic nodes, and plot congestion windows for different
source/destination pairs in NS2/NS3.
Codes:
– exp-3.tcl:
1 set val ( stop ) 10 .0 ;# time of simulation end
2
3 # Initialization
4
5 # Create a ns simulator
6 set ns [ new Simulator ]
7
8 LanRouter set debug_ 0
9
10 # Open the NS trace file
11 set tracefile [ open exp-3.tr w ]
12 $ns trace-all $tracefile
13
14 # Open the NAM trace file
15 set namfile [ open exp-3.nam w ]
16 $ns namtrace-all $namfile
17
18 # add manually
19 set wf0 [ open WinFile0 w ]
20 set wf1 [ open WinFile1 w ]
21 proc PlotWindow { tcpSource file } {
22 global ns
23 set time 0 .1
24 set now [ $ns now ]
25 set cwnd [ $tcpSource set cwnd_ ]
26 puts $file " $now $cwnd "
27 $ns at [ expr $now + $time ] " PlotWindow $tcpSource $file "
28 }
29 # end
30

31 # # Create 6 nodes
32 set n0 [ $ns node ] ; $n0 label " Source0 "
33 set n1 [ $ns node ] ; $n1 label " Source1 "
34 set n2 [ $ns node ] ; $n2 label " R1 "
35 set n3 [ $ns node ] ; $n3 label " R2 "
36 set n4 [ $ns node ] ; $n4 label " Dest0 "
37 set n5 [ $ns node ] ; $n5 label " Dest1 "
38 $ns color 1 " red "
39 $ns color 2 " green "
40 $ns color 3 " blue "

13
41 $ns color 4 " orange "
42
43 # Links Definition
44
45 # add manually
46 set lan [ $ns newLan " $n0 $n1 $n2 " 0 .5Mb 40 ms LL Queue /
DropTail MAC /802 _3 Channel ]
47 $ns duplex-link $n2 $n3 10 Mb 100 ms DropTail
48 $ns duplex-link-op $n2 $n3 queuePos 0 .5
49 set lan [ $ns newLan " $n3 $n4 $n5 " 0 .5Mb 40 ms LL Queue /
DropTail MAC /802 _3 Channel ]
50 set loss_module [ new ErrorModel ]
51 $loss_module ranvar [ new RandomVariable / Uniform ]
52 $loss_module drop-target [ new Agent / Null ]
53 $ns lossmodel $loss_module $n2 $n3
54 # end
55
56 # Agents Definition
57

58 # Setup a TCP connection


59 set tcp0 [ new Agent / TCP ]
60 $ns attach-agent $n0 $tcp0
61 set sink2 [ new Agent / TCPSink ]
62 $ns attach-agent $n4 $sink2
63 $ns connect $tcp0 $sink2
64 $tcp0 set packetSize_ 1500
65
66 # Setup a TCP connection
67 set tcp1 [ new Agent / TCP ]
68 $ns attach-agent $n1 $tcp1
69 set sink3 [ new Agent / TCPSink ]
70 $ns attach-agent $n5 $sink3
71 $ns connect $tcp1 $sink3
72 $tcp1 set packetSize_ 1500
73
74 # Applications Definition
75
76 # Setup a FTP Application over TCP connection
77 set ftp0 [ new Application / FTP ]
78 $ftp0 attach-agent $tcp0
79 $ns at 0 .1 " $ftp0 start "
80 $ns at 9 .8 " $ftp0 stop "
81
82 # Setup a FTP Application over TCP connection
83 set ftp1 [ new Application / FTP ]
84 $ftp1 attach-agent $tcp1
85 $ns at 1 " $ftp1 start "
86 $ns at 9 .9 " $ftp1 stop "
87

14
88 # add manually
89 $ns at 0 .1 " PlotWindow $tcp0 $wf0 "
90 $ns at 0 .5 " PlotWindow $tcp1 $wf1 "
91 $tcp0 set class_ 1
92 $tcp1 set class_ 2
93 # end
94

95 # Termination
96
97 # Define a ’ finish ’ procedure
98 proc finish {} {
99 global ns tracefile namfile wf0 wf1
100

101 # Close all files


102 $ns flush-trace
103 close $tracefile
104 close $namfile
105 close $wf0
106 close $wf1
107
108 # Generate Python plot script
109 set pyplot [ open " plot_cwnd.py " w ]
110 puts $pyplot {
111 import ma tplotl ib.pyp lot as plt
112

113 def read_data ( filename ) :


114 x, y = [] , []
115 with open ( filename ) as f:
116 for line in f:
117 if line.strip () :
118 a, b = map ( float, line.split () )
119 x.append ( a )
120 y.append ( b )
121 return x, y
122
123 x0, y0 = read_data ( " WinFile0 " )
124 x1, y1 = read_data ( " WinFile1 " )
125
126 plt.figure ( figsize= (10 ,5 ) )
127 plt.plot ( x0, y0, label= " Flow 0 " , color= " red " )
128 plt.plot ( x1, y1, label= " Flow 1 " , color= " green " )
129 plt.xlabel ( " Time ( s ) " )
130 plt.ylabel ( " Congestion Window ( packets ) " )
131 plt.title ( " TCP Congestion Window Dynamics " )
132 plt.legend ()
133 plt.grid ()
134 plt.savefig ( " cwnd_plot.png " )
135 print ( " Plot saved as cwnd_plot.png " )
136 }

15
137 close $pyplot
138
139 # Execute plotting
140 exec python3 plot_cwnd.py
141 exec nam exp-3.nam &
142 exit 0
143 }
144 $ns at $val ( stop ) " $ns nam-end-wireless $val ( stop ) "
145 $ns at $val ( stop ) " finish "
146 $ns at $val ( stop ) " puts \ " done \ " ; $ns halt "
147 $ns run

– plot-cwnd.py
1 import matplotlib . pyplot as plt
2

3 def read_data ( filename ) :


4 x , y = [] , []
5 with open ( filename ) as f :
6 for line in f :
7 if line . strip () :
8 a , b = map ( float , line . split () )
9 x . append ( a )
10 y . append ( b )
11 return x , y
12
13 x0 , y0 = read_data ( " WinFile0 " )
14 x1 , y1 = read_data ( " WinFile1 " )
15
16 plt . figure ( figsize =(10 ,5) )
17 plt . plot ( x0 , y0 , label = " Flow 0 " , color = " red " )
18 plt . plot ( x1 , y1 , label = " Flow 1 " , color = " green " )
19 plt . xlabel ( " Time ( s ) " )
20 plt . ylabel ( " Congestion Window ( packets ) " )
21 plt . title ( " TCP Congestion Window Dynamics " )
22 plt . legend ()
23 plt . grid ()
24 plt . savefig ( " cwnd_plot . png " )
25 print ( " Plot saved as cwnd_plot . png " )

16
Outputs:

Initialized

Running

17
cwnd.py

18
Experiment : 4
Objective: Implement an Ethernet LAN comprising ’N’ nodes. Set
multiple traffic nodes and plot the performance for varying congestion
windows for different source/destination pairs in NS2/NS3.
Codes:
– exp-4.tcl:
1 # exp-4.tcl - Ethernet LAN with congestion window monitoring
2 set ns [ new Simulator ]
3
4 # Suppress LAN router warnings
5 LanRouter set debug_ 0
6

7 # Configure MAC backoff parameters


8 Mac /802 _3 set maxRetries_ 16
9 Mac /802 _3 set slotTime_ 0 .000512
10
11 # Color settings
12 $ns color 1 Red
13 $ns color 2 Blue
14
15 # Trace files
16 set namfile [ open exp-4.nam w ]
17 $ns namtrace-all $namfile
18 set tracefile [ open exp-4.tr w ]
19 $ns trace-all $tracefile
20
21 # Data files for congestion windows
22 set cwnd1_file [ open cwnd1.dat w ]
23 set cwnd2_file [ open cwnd2.dat w ]
24

25 # Create 6 nodes
26 for { set i 0} { $i < 6} { incr i } {
27 set n ( $i ) [ $ns node ]
28 }
29
30 # Configure LANs with proper parameters
31 $ns make-lan " $n (0) $n (1) $n (2) " 1 Mb 10 ms LL Queue / DropTail
Mac /802 _3
32 $ns make-lan " $n (3) $n (4) $n (5) " 2 Mb 10 ms LL Queue / DropTail
Mac /802 _3
33 $ns duplex-link $n (0) $n (3) 1 Mb 10 ms DropTail
34

35 # TCP and traffic setup


36 set tcp1 [ new Agent / TCP / Newreno ]
37 set tcp2 [ new Agent / TCP / Newreno ]
38 set sink1 [ new Agent / TCPSink ]

19
39 set sink2 [ new Agent / TCPSink ]
40
41 $ns attach-agent $n (4) $tcp1
42 $ns attach-agent $n (2) $sink1
43 $ns attach-agent $n (1) $tcp2
44 $ns attach-agent $n (5) $sink2
45

46 $ns connect $tcp1 $sink1


47 $ns connect $tcp2 $sink2
48
49 # Gentler traffic pattern
50 set ftp1 [ new Application / Traffic / Exponential ]
51 $ftp1 set packetSize_ 512
52 $ftp1 set burst_time_ 0 .1
53 $ftp1 set idle_time_ 0 .5
54 $ftp1 attach-agent $tcp1
55
56 set ftp2 [ new Application / Traffic / Exponential ]
57 $ftp2 set packetSize_ 512
58 $ftp2 set burst_time_ 0 .1
59 $ftp2 set idle_time_ 0 .5
60 $ftp2 attach-agent $tcp2
61
62 # Color classes
63 $tcp1 set class_ 1
64 $tcp2 set class_ 2
65
66 # Congestion window monitoring procedure
67 proc record_cwnd { tcp file } {
68 global ns
69 set now [ $ns now ]
70 set cwnd [ $tcp set cwnd_ ]
71 puts $file " $now $cwnd "
72 $ns at [ expr $now +0 .1 ] " record_cwnd $tcp $file "
73 }
74

75 # Finish procedure with Python plotting


76 proc finish {} {
77 global ns namfile tracefile cwnd1_file cwnd2_file
78
79 # Close all files
80 $ns flush-trace
81 close $namfile
82 close $tracefile
83 close $cwnd1_file
84 close $cwnd2_file
85
86 # Generate Python plot script
87 set py_script {

20
88 import ma tplotl ib.pyp lot as plt
89 import numpy as np
90
91 # Read data files
92 def read_data ( filename ) :
93 return np.loadtxt ( filename, unpack=True )
94

95 time1, cwnd1 = read_data ( " cwnd1.dat " )


96 time2, cwnd2 = read_data ( " cwnd2.dat " )
97
98 # Create plot
99 plt.figure ( figsize= (10 ,6 ) )
100 plt.plot ( time1, cwnd1, ’r- ’ , label= " Flow 1 ( n4- > n2 ) " )
101 plt.plot ( time2, cwnd2, ’b- ’ , label= " Flow 2 ( n1- > n5 ) " )
102 plt.title ( " TCP Congestion Window Dynamics " )
103 plt.xlabel ( " Time ( seconds ) " )
104 plt.ylabel ( " Congestion Window Size ( packets ) " )
105 plt.legend ()
106 plt.grid ( True )
107 plt.savefig ( " cwnd_plot.png " , dpi=300 )
108 print ( " Plot saved as cwnd_plot.png " )
109 }
110
111 set f [ open " plot_cwnd.py " w ]
112 puts $f $py_script
113 close $f
114
115 # Execute plotting
116 exec python3 plot_cwnd.py
117 exec nam exp-4.nam &
118 exit 0
119 }
120
121 # Schedule events
122 $ns at 0 .1 " record_cwnd $tcp1 $cwnd1_file "
123 $ns at 0 .1 " record_cwnd $tcp2 $cwnd2_file "
124 $ns at 1 .0 " $ftp1 start "
125 $ns at 2 .0 " $ftp2 start "
126 $ns at 15 .0 " $ftp1 stop "
127 $ns at 15 .0 " $ftp2 stop "
128 $ns at 16 .0 " finish "
129

130 # Run simulation


131 $ns run

21
– plot-cwnd.py
1 import matplotlib . pyplot as plt
2 import numpy as np
3
4 # Read data files
5 def read_data ( filename ) :
6 return np . loadtxt ( filename , unpack = True )
7 time1 , cwnd1 = read_data ( " cwnd1 . dat " )
8 time2 , cwnd2 = read_data ( " cwnd2 . dat " )
9
10 # Create plot
11 plt . figure ( figsize =(10 ,6) )
12 plt . plot ( time1 , cwnd1 , ’r - ’ , label = " Flow 1 ( n4 - > n2 ) " )
13 plt . plot ( time2 , cwnd2 , ’b - ’ , label = " Flow 2 ( n1 - > n5 ) " )
14 plt . title ( " TCP Congestion Window Dynamics " )
15 plt . xlabel ( " Time ( seconds ) " )
16 plt . ylabel ( " Congestion Window Size ( packets ) " )
17 plt . legend ()
18 plt . grid ( True )
19 plt . savefig ( " cwnd_plot . png " , dpi =300)
20 print ( " Plot saved as cwnd_plot . png " )

Outputs:

Initialized

22
Running

cwnd.py

23
Experiment : 5
Objective: Implement and study the performance of GSM on NS2/NS3
using MAC layer.
Codes:
– exp-5.tcl:
1 # exp-5.tcl - GSM Simulation with Matplotlib Visualization
2 set val ( stop ) 50 .0 ;# Simulation end time
3
4 # GSM PARAMETERS
5 set opt ( title ) " GSM_Network " ;
6 set opt ( stop ) 50;
7 set opt ( ecn ) 0;
8 set opt ( type ) gsm ;
9 set opt ( secondDelay ) 55; # Average delay in ms
10
11 # GSM-specific parameters
12 set bwDL ( gsm ) 9600 ;# Downlink bandwidth ( bps )
13 set bwUL ( gsm ) 9600 ;# Uplink bandwidth ( bps )
14 set propDL ( gsm ) 0 .500 ;# Downlink delay ( s )
15 set propUL ( gsm ) 0 .500 ;# Uplink delay ( s )
16 set buf ( gsm ) 10 ;# Buffer size ( packets )
17

18 # SIMULATION SETUP
19 set ns [ new Simulator ]
20
21 # Trace files
22 set tracefile [ open exp-5.tr w ]
23 $ns trace-all $tracefile
24 set namfile [ open exp-5.nam w ]
25 $ns namtrace-all $namfile
26
27 # Data files for matplotlib
28 set throughput_file [ open throughput.dat w ]
29 set delay_file [ open delay.dat w ]
30 set drop_file [ open drops.dat w ]
31
32 # GSM Node labels
33 set nodes ( n0 ) [ $ns node ] ;# Mobile Station ( MS )
34 set nodes ( n1 ) [ $ns node ] ;# Base Transceiver Station ( BTS )
35 set nodes ( n2 ) [ $ns node ] ;# Base Station Controller ( BSC )
36 set nodes ( n3 ) [ $ns node ] ;# Mobile Switching Center ( MSC )
37 set nodes ( n4 ) [ $ns node ] ;# Gateway MSC ( GMSC )
38
39 $ns at 0 .0 " $nodes ( n0 ) label MS "
40 $ns at 0 .0 " $nodes ( n1 ) label BTS "
41 $ns at 0 .0 " $nodes ( n2 ) label BSC "

24
42 $ns at 0 .0 " $nodes ( n3 ) label MSC "
43 $ns at 0 .0 " $nodes ( n4 ) label GMSC "
44
45 # GSM TOPOLOGY
46 proc cell_topo {} {
47 global ns nodes
48 $ns duplex-link $nodes ( n0 ) $nodes ( n1 ) 3 .0Mb 10 ms DropTail
49 $ns duplex-link $nodes ( n1 ) $nodes ( n2 ) 1 .0Mb 10 ms RED
50 $ns duplex-link $nodes ( n2 ) $nodes ( n3 ) 1 .0Mb 10 ms RED
51 $ns duplex-link $nodes ( n3 ) $nodes ( n4 ) 3 .0Mb 10 ms DropTail
52 puts " GSM Cellular Topology Created "
53 }
54

55 proc set_link_params { t } {
56 global ns nodes bwUL bwDL propUL propDL buf
57 $ns bandwidth $nodes ( n0 ) $nodes ( n1 ) $bwDL ( $t ) duplex
58 $ns bandwidth $nodes ( n1 ) $nodes ( n2 ) $bwUL ( $t ) duplex
59 $ns bandwidth $nodes ( n2 ) $nodes ( n3 ) $bwDL ( $t ) duplex
60 $ns bandwidth $nodes ( n3 ) $nodes ( n4 ) $bwUL ( $t ) duplex
61 $ns delay $nodes ( n0 ) $nodes ( n1 ) $propDL ( $t ) duplex
62 $ns delay $nodes ( n1 ) $nodes ( n2 ) $propUL ( $t ) duplex
63 $ns delay $nodes ( n2 ) $nodes ( n3 ) $propDL ( $t ) duplex
64 $ns delay $nodes ( n3 ) $nodes ( n4 ) $propUL ( $t ) duplex
65 $ns queue-limit $nodes ( n0 ) $nodes ( n1 ) $buf ( $t )
66 $ns queue-limit $nodes ( n1 ) $nodes ( n2 ) $buf ( $t )
67 $ns queue-limit $nodes ( n2 ) $nodes ( n3 ) $buf ( $t )
68 $ns queue-limit $nodes ( n3 ) $nodes ( n4 ) $buf ( $t )
69 }
70
71 cell_topo
72 set_link_params $opt ( type )
73
74 # TRAFFIC GENERATION
75 # TCP Connections
76 set tcp0 [ new Agent / TCP / Newreno ]
77 $ns attach-agent $nodes ( n0 ) $tcp0
78 set sink0 [ new Agent / TCPSink / Sack1 ]
79 $ns attach-agent $nodes ( n4 ) $sink0
80 $ns connect $tcp0 $sink0
81 $tcp0 set packetSize_ 1500
82 $tcp0 set window_ 30
83

84 set tcp1 [ new Agent / TCP / Newreno ]


85 $ns attach-agent $nodes ( n0 ) $tcp1
86 set sink1 [ new Agent / TCPSink / Sack1 ]
87 $ns attach-agent $nodes ( n4 ) $sink1
88 $ns connect $tcp1 $sink1
89 $tcp1 set packetSize_ 1500
90 $tcp1 set window_ 30

25
91

92 # FTP Applications
93 set ftp0 [ new Application / FTP ]
94 $ftp0 attach-agent $tcp0
95 $ns at 1 .0 " $ftp0 start "
96 $ns at 35 .0 " $ftp0 stop "
97

98 set ftp1 [ new Application / FTP ]


99 $ftp1 attach-agent $tcp1
100 $ns at 1 .0 " $ftp1 start "
101 $ns at 45 .0 " $ftp1 stop "
102
103 # PERFORMANCE MONITORING
104 proc record_stats {} {
105 global ns throughput_file delay_file drop_file
106 set now [ $ns now ]
107
108 # Placeholder for actual metric calculations
109 # These would be replaced with real measurements from
trace
110 set throughput [ expr 1000 + 500 * sin ( $now /10) ]
111 set delay [ expr 50 + 30 * sin ( $now /5) ]
112 set drops [ expr 5 + 3 * sin ( $now /3) ]
113
114 puts $throughput_file " $now $throughput "
115 puts $delay_file " $now $delay "
116 puts $drop_file " $now $drops "
117
118 $ns at [ expr $now +1 .0 ] " record_stats "
119 }
120 $ns at 1 .0 " record_stats "
121
122 # FINISH PROCEDURE
123 proc finish {} {
124 global ns tracefile namfile throughput_file delay_file
drop_file
125
126 # Close all files
127 $ns flush-trace
128 close $tracefile
129 close $namfile
130 close $throughput_file
131 close $delay_file
132 close $drop_file
133
134 # Generate Python plotting script
135 set py_script {
136 import ma tplotl ib.pyp lot as plt
137 import numpy as np

26
138

139 # Create figure with 3 subplots


140 plt.figure ( figsize= (12 , 8) )
141
142 # Throughput plot
143 plt.subplot (3 , 1 , 1)
144 time, throughput = np.loadtxt ( ’ throughput.dat ’ , unpack=True )
145 plt.plot ( time, throughput, ’b- ’)
146 plt.title ( ’ GSM Network Performance ’)
147 plt.ylabel ( ’ Throughput ( kbps ) ’)
148 plt.grid ( True )
149
150 # Delay plot
151 plt.subplot (3 , 1 , 2)
152 time, delay = np.loadtxt ( ’ delay.dat ’ , unpack=True )
153 plt.plot ( time, delay, ’r- ’)
154 plt.ylabel ( ’ Delay ( ms ) ’)
155 plt.grid ( True )
156

157 # Drop rate plot


158 plt.subplot (3 , 1 , 3)
159 time, drops = np.loadtxt ( ’ drops.dat ’ , unpack=True )
160 plt.plot ( time, drops, ’g- ’)
161 plt.xlabel ( ’ Time ( s ) ’)
162 plt.ylabel ( ’ Drops ( pkts / s ) ’)
163 plt.grid ( True )
164
165 # Save and show plot
166 plt.tight_layout ()
167 plt.savefig ( ’ gsm_performance.png ’ , dpi=300 )
168 print ( " Performance plots saved to g s m _p e r fo r m an c e .p n g " )
169 }
170
171 # Write and execute Python script
172 set f [ open " p lo t _ pe r f o rm a n ce . p y " w ]
173 puts $f $py_script
174 close $f
175
176 exec awk -f exp-5.awk exp-5.tr
177
178 # Execute analysis and visualization
179 exec python3 p lo t _ pe r f or m a nc e . py
180 exec nam exp-5.nam &
181 exit 0
182 }
183 $ns at $val ( stop ) " finish "
184 $ns run

27
– exp-5.awk
1 # exp -5. awk - GSM Network Analysis for Matplotlib
2 BEGIN {
3 # Initialize arrays for time - based metrics
4 for ( i = 0; i <= 50; i ++) {
5 throughput [ i ] = 0
6 delay [ i ] = 0
7 drops [ i ] = 0
8 count [ i ] = 0
9 }
10 }
11
12 {
13 event = $1
14 time = $2
15 time_bucket = int ( time )
16
17 if ( event == " r " ) {
18 pkt_size = $6
19 throughput [ time_bucket ] += pkt_size * 8 / 1000 # kbps
20 delay [ time_bucket ] += $10 * 1000 # ms
21 count [ time_bucket ]++
22 }
23 else if ( event == " d " ) {
24 drops [ time_bucket ]++
25 }
26 }
27
28 END {
29 # Output throughput data
30 print " # Time Throughput ( kbps ) " > " throughput . dat "
31 for ( i = 0; i <= 50; i ++) {
32 if ( count [ i ] > 0) {
33 print i , throughput [ i ] >> " throughput . dat "
34 }
35 }
36
37 # Output delay data
38 print " # Time Delay ( ms ) " > " delay . dat "
39 for ( i = 0; i <= 50; i ++) {
40 if ( count [ i ] > 0) {
41 print i , delay [ i ]/ count [ i ] >> " delay . dat "
42 }
43 }
44
45 # Output drop data
46 print " # Time Drops ( pkts ) " > " drops . dat "
47 for ( i = 0; i <= 50; i ++) {

28
48 print i , drops [ i ] >> " drops . dat "
49 }
50 }

– analyze.py
1 import matplotlib . pyplot as plt
2 import numpy as np
3
4 # Read throughput data
5 def read_data ( filename ) :
6 return np . loadtxt ( filename , unpack = True )
7
8 # Plot throughput
9 plt . figure ( figsize =(12 ,6) )
10 time0 , thr0 = read_data ( " throughput0 . dat " )
11 time1 , thr1 = read_data ( " throughput1 . dat " )
12 plt . plot ( time0 , thr0 , ’r - ’ , label = " Flow 0 Throughput " )
13 plt . plot ( time1 , thr1 , ’b - ’ , label = " Flow 1 Throughput " )
14 plt . title ( " GSM Network Throughput Analysis " )
15 plt . xlabel ( " Time ( s ) " )
16 plt . ylabel ( " Throughput ( kbps ) " )
17 plt . legend ()
18 plt . grid ( True )
19 plt . savefig ( " gsm_throughput . png " , dpi =300)
20
21 # Additional analysis can be added here
22 print ( " Analysis plots generated : gsm_throughput . png " )

– plot performance.py
1 import matplotlib . pyplot as plt
2 import numpy as np
3
4 # Create figure with 3 subplots
5 plt . figure ( figsize =(12 , 8) )
6
7 # Throughput plot
8 plt . subplot (3 , 1 , 1)
9 time , throughput = np . loadtxt ( ’ throughput . dat ’ , unpack = True )
10 plt . plot ( time , throughput , ’b - ’)
11 plt . title ( ’ GSM Network Performance ’)
12 plt . ylabel ( ’ Throughput ( kbps ) ’)
13 plt . grid ( True )
14
15 # Delay plot
16 plt . subplot (3 , 1 , 2)
17 time , delay = np . loadtxt ( ’ delay . dat ’ , unpack = True )

29
18 plt . plot ( time , delay , ’r - ’)
19 plt . ylabel ( ’ Delay ( ms ) ’)
20 plt . grid ( True )
21
22 # Drop rate plot
23 plt . subplot (3 , 1 , 3)
24 time , drops = np . loadtxt ( ’ drops . dat ’ , unpack = True )
25 plt . plot ( time , drops , ’g - ’)
26 plt . xlabel ( ’ Time ( s ) ’)
27 plt . ylabel ( ’ Drops ( pkts / s ) ’)
28 plt . grid ( True )
29
30 # Save and show plot
31 plt . tight_layout ()
32 plt . savefig ( ’ gsm_performance . png ’ , dpi =300)
33 print ( " Performance plots saved to gsm_performance . png " )

Outputs:

Initialized

30
Running

awk file results

31
throughput graphs

32
Experiment : 6
Objective: Implement an Infrastructure-less wireless network
comprising of ’N’ nodes in an area of 400m x 300m and set multiple traffic
nodes. After simulation plot the performance in terms of the End-to-End
delay, Throughput, packet delivery ratio for varying for No. of nodes with
different source/destination pair in NS2/NS3.
Codes:
– experiment.tcl:
1 # Simulation Parameters
2 set val ( chan ) Channel / WirelessChannel ;# Channel
type
3 set val ( prop ) Propagation / TwoRayGround ;# Propagation
model
4 set val ( netif ) Phy / WirelessPhy ;# Network
interface type
5 set val ( mac ) Mac /802 _11 ;# MAC type
6 set val ( ifq ) Queue / DropTail / PriQueue ;# Interface
queue type
7 set val ( ll ) LL ;# Link layer
type
8 set val ( ant ) Antenna / OmniAntenna ;# Antenna
model
9 set val ( ifqlen ) 50 ;# Maximum
packets in ifq
10
11 # Topology Parameters
12 set val ( nn ) 80 ;# Total
number of nodes changed from 20 to 100 , interval of 20
13 set val ( rp ) AODV ;# Use AODV
routing protocol
14 set val ( x ) 1000 ;# X dimension
(m)
15 set val ( y ) 1000 ;# Y dimension
(m)
16 set val ( stop ) 80 .0 ;# Simulation
stop time ( sec )
17
18 # Create Simulator, Trace & NAM Files
19 set ns [ new Simulator ]
20 set tracef [ open experiment.tr w ]
21 $ns trace-all $tracef
22 set namf [ open experiment.nam w ]
23 $ns n a m t r a c e - a l l - w i r e l e s s $namf $val ( x ) $val ( y )
24
25 # Topography and GOD Object
26 set topo [ new Topography ]

33
27 $topo load_flatgrid $val ( x ) $val ( y )
28 create-god $val ( nn )
29
30 # Configure Nodes
31 $ns node-config -adhocRouting $val ( rp ) \
32 -llType $val ( ll ) \
33 -macType $val ( mac ) \
34 -ifqType $val ( ifq ) \
35 -ifqLen $val ( ifqlen ) \
36 -antType $val ( ant ) \
37 -propType $val ( prop ) \
38 -phyType $val ( netif ) \
39 -channelType $val ( chan ) \
40 -topoInstance $topo \
41 -agentTrace ON \
42 -routerTrace ON \
43 -macTrace ON \
44 -movementTrace ON
45

46 # Create Nodes and assign initial random positions


47 for { set i 0} { $i < $val ( nn ) } { incr i } {
48 set node_ ( $i ) [ $ns node ]
49 $node_ ( $i ) random-motion 0 ;# Disable NS-2 ’ s built-in
random motion
50 set posX [ expr int ( rand () *$val ( x ) ) ]
51 set posY [ expr int ( rand () *$val ( y ) ) ]
52 $node_ ( $i ) set X_ $posX
53 $node_ ( $i ) set Y_ $posY
54 $node_ ( $i ) set Z_ 0 .0
55 $ns initial_node_pos $node_ ( $i ) 20
56 }
57
58 # Procedure to continuously move a node using a random
waypoint model
59 proc move { node } {
60 global ns val
61 if { [ $ns now ] >= $val ( stop ) } { return }
62
63 # Ensure the node exists before moving it
64 if { ![ info exists node ] } {
65 return
66 }
67
68 set new_x [ expr int ( rand () *$val ( x ) ) ]
69 set new_y [ expr int ( rand () *$val ( y ) ) ]
70 set speed 60 .0
71 catch { $node setdest $new_x $new_y $speed } ;# Catch
errors if node doesn ’ t support setdest
72

34
73 $ns at [ expr [ $ns now ] + 5 .0 ] [ list move $node ]
74 }
75
76 # Schedule node movements
77 for { set i 0} { $i < $val ( nn ) } { incr i } {
78 $ns at 1 .0 [ list move $node_ ( $i ) ]
79 }
80
81 # Create Multiple Traffic Flows (3 CBR flows )
82 set numFlows 3 ;# Changed the number of flows from 2 to 3
83 for { set i 0} { $i < $numFlows } { incr i } {
84 # Choose random source and destination nodes
85 set src [ expr int ( rand () *$val ( nn ) ) ]
86 set dst [ expr int ( rand () *$val ( nn ) ) ]
87 while { $dst == $src } { set dst [ expr int ( rand () *$val ( nn ) )
] }
88
89 # Create UDP agents and attach to nodes
90 set udp_ ( $i ) [ new Agent / UDP ]
91 set null_ ( $i ) [ new Agent / Null ]
92 $ns attach-agent $node_ ( $src ) $udp_ ( $i )
93 $ns attach-agent $node_ ( $dst ) $null_ ( $i )
94 $ns connect $udp_ ( $i ) $null_ ( $i )
95
96 # Create a CBR traffic application
97 set cbr_ ( $i ) [ new Application / Traffic / CBR ]
98 $cbr_ ( $i ) set packetSize_ 512
99 $cbr_ ( $i ) set rate_ 200 Kb
100 $cbr_ ( $i ) attach-agent $udp_ ( $i )
101
102 # Schedule the traffic flow to start and stop
103 set startTime [ expr 1 .0 + $i*0.5 ]
104 set stopTime 60 .0
105 $ns at $startTime " $cbr_ ( $i ) start "
106 $ns at $stopTime " $cbr_ ( $i ) stop "
107 }
108
109 # Termination Procedure
110 proc finish {} {
111 global ns tracef namf
112 $ns flush-trace
113 close $tracef
114 close $namf
115 exec nam experiment.nam &
116 exit 0
117 }
118
119 # Schedule Node Reset and Simulation End
120 for { set i 0} { $i < $val ( nn ) } { incr i } {

35
121 $ns at $val ( stop ) " \ $node_ ( $i ) reset "
122 }
123 $ns at $val ( stop ) " finish "
124 $ns at $val ( stop ) " puts \ " NS EXITING... \ " ; $ns halt "
125
126 puts " Starting Experiment Simulation... "
127 $ns run

– e2e.awk
1 # !/ usr / bin / awk -f
2 BEGIN {
3 sentCount = 0;
4 delaySum = 0;
5 deliveredCount = 0;
6 }
7
8 /^ s / && $4 == " AGT " {
9 # Record send time ; sequence number is in field 6.
10 seq = $6 ;
11 startTime [ seq ] = $2 + 0;
12 sentCount ++;
13 }
14
15 /^ r / && $4 == " AGT " {
16 # Record receive time for the same sequence number .
17 seq = $6 ;
18 if ( seq in startTime ) {
19 delay = ( $2 + 0) - startTime [ seq ];
20 delaySum += delay ;
21 deliveredCount ++;
22 }
23 }
24

25 END {
26 if ( deliveredCount > 0) {
27 avgDelay = ( delaySum / deliveredCount ) * 1000; #
convert sec to ms
28 printf " Average End - to - End Delay = %.3 f ms \ n " ,
avgDelay ;
29 } else {
30 print " No delivered packets to compute delay " ;
31 }
32 }

36
– throughput.awk
1 # !/ usr / bin / awk -f
2 BEGIN {
3 recvdSize = 0;
4 firstTime = -1;
5 lastTime = -1;
6 }
7

8 /^ r / && $4 == " AGT " {


9 # Only consider received packets at the AGT layer
10 # Field 2 is time , field 8 is packet size
11 time = $2 + 0;
12 size = $8 + 0;
13 recvdSize += size ;
14 if ( firstTime < 0 || time < firstTime )
15 firstTime = time ;
16 if ( time > lastTime )
17 lastTime = time ;
18 }
19

20 END {
21 if ( firstTime >= 0 && lastTime > firstTime ) {
22 # Throughput in kbps : ( total bytes * 8) /( duration in
sec ) divided by 1000
23 throughput = ( recvdSize * 8) / ( lastTime - firstTime )
/ 1000;
24 printf " Average Throughput [ kbps ] = %.2 f \ tStartTime
=%.2 f \ tStopTime =%.2 f \ n " , throughput , firstTime ,
lastTime ;
25 } else {
26 print " Insufficient data to compute throughput " ;
27 }
28 }

– pdr.awk
1 # !/ usr / bin / awk -f
2 BEGIN {
3 sentCount = 0;
4 recvCount = 0;
5 }
6

7 /^ s / && $4 == " AGT " {


8 sentCount ++;
9 }
10
11 /^ r / && $4 == " AGT " {

37
12 recvCount ++;
13 }
14
15 END {
16 if ( sentCount > 0) {
17 pdr = ( recvCount / sentCount ) * 100;
18 printf " Sent = %d , Received = %d , PDR = %.2 f %%\ n " ,
sentCount , recvCount , pdr ;
19 } else {
20 print " No packets sent to compute PDR " ;
21 }
22 }

– plot results.py
1 import matplotlib . pyplot as plt
2 import numpy as np
3 import os
4
5 # Data
6 nodes = [20 , 40 , 60 , 80 , 100]
7 avg_e2e_delay = [90.182 , 112.388 , 382.026 , 388.602 , 197.426]
# ms
8 pdr = [88.87 , 83.53 , 72.76 , 74.10 , 84.70] # %
9 throughput = [554.19 , 520.12 , 453.21 , 455.52 , 523.73] # kbps
10
11 # Set position of bars on X axis
12 x = np . arange ( len ( nodes ) ) # the label locations
13 width = 0.25 # width of the bars
14
15 # Get current directory
16 save_path = os . path . dirname ( os . path . abspath ( __file__ ) )
17
18 # Create grouped bar chart
19 plt . figure ( figsize =(10 , 6) )
20 plt . bar ( x - width , avg_e2e_delay , width , label = ’ Avg E2E Delay
( ms ) ’ , color = ’ skyblue ’)
21 plt . bar (x , pdr , width , label = ’ PDR (%) ’ , color = ’ lightgreen ’)
22 plt . bar ( x + width , throughput , width , label = ’ Throughput ( kbps
) ’ , color = ’ salmon ’)
23
24 # Labels and title
25 plt . xlabel ( " Number of Nodes " )
26 plt . ylabel ( " Value " )
27 plt . title ( " Performance Metrics vs Number of Nodes " )
28 plt . xticks (x , nodes )
29 plt . grid ( axis = ’y ’ , linestyle = ’ -- ’ , alpha =0.7)
30 plt . legend ()

38
31 plt . tight_layout ()
32
33 # Save plot
34 plt . savefig ( os . path . join ( save_path , " metrics_vs_nodes . png " ) )
35 plt . close ()
36
37 print ( " Grouped bar chart saved successfully in : " , save_path )

Outputs:

tcl file run

39
Simulation initialize

Starting

40
Running

Graph

41
Experiment : 7
Objective: Implement an Infrastructure-less wireless network
comprising ’N’ nodes in an area of 1000 x 1000 square meters. At the
routing layer use AODV and DSR protocols. Perform the simulations with
a varying number of nodes. Plot and compare the performance of AODV
and DSR in terms of the End-to-End delay, Throughput, and packet
delivery ratio using the NS2/NS3 simulator.
Codes:
– aodv.tcl:
1 # Simulation Parameters
2 set val ( chan ) Channel / WirelessChannel ;# Channel
type
3 set val ( prop ) Propagation / TwoRayGround ;# Propagation
model
4 set val ( netif ) Phy / WirelessPhy ;# Network
interface type
5 set val ( mac ) Mac /802 _11 ;# MAC type
6 set val ( ifq ) Queue / DropTail / PriQueue ;# Interface
queue type
7 set val ( ll ) LL ;# Link layer
type
8 set val ( ant ) Antenna / OmniAntenna ;# Antenna
model
9 set val ( ifqlen ) 50 ;# Maximum
packets in ifq
10
11 # Topology Parameters
12 set val ( nn ) 100 ;# Total
number of nodes changed from 20 to 100 , interval of 20
13 set val ( rp ) AODV ;# Use DSDV
routing protocol
14 set val ( x ) 1000 ;# X dimension
(m)
15 set val ( y ) 1000 ;# Y dimension
(m)
16 set val ( stop ) 80 .0 ;# Simulation
stop time ( sec )
17
18 # Create Simulator, Trace & NAM Files
19 set ns [ new Simulator ]
20 set tracef [ open aodv.tr w ]
21 $ns trace-all $tracef
22 set namf [ open aodv.nam w ]
23 $ns n a m t r a c e - a l l - w i r e l e s s $namf $val ( x ) $val ( y )
24

42
25 # Create Topography and GOD Object
26 set topo [ new Topography ]
27 $topo load_flatgrid $val ( x ) $val ( y )
28 create-god $val ( nn )
29
30 # Configure Nodes
31 $ns node-config -adhocRouting $val ( rp ) \
32 -llType $val ( ll ) \
33 -macType $val ( mac ) \
34 -ifqType $val ( ifq ) \
35 -ifqLen $val ( ifqlen ) \
36 -antType $val ( ant ) \
37 -propType $val ( prop ) \
38 -phyType $val ( netif ) \
39 -channelType $val ( chan ) \
40 -topoInstance $topo \
41 -agentTrace ON \
42 -routerTrace ON \
43 -macTrace ON \
44 -movementTrace ON
45
46 # Create Nodes and assign initial random positions
47 for { set i 0} { $i < $val ( nn ) } { incr i } {
48 set node_ ( $i ) [ $ns node ]
49 $node_ ( $i ) random-motion 0 ;# Disable NS-2 ’ s built-in
random motion
50 set posX [ expr int ( rand () *$val ( x ) ) ]
51 set posY [ expr int ( rand () *$val ( y ) ) ]
52 $node_ ( $i ) set X_ $posX
53 $node_ ( $i ) set Y_ $posY
54 $node_ ( $i ) set Z_ 0 .0
55 $ns initial_node_pos $node_ ( $i ) 20
56 }
57
58 # Procedure to continuously move a node using a random
waypoint model
59 proc move { node } {
60 global ns val
61 if { [ $ns now ] >= $val ( stop ) } { return }
62
63 # Ensure the node exists before moving it
64 if { ![ info exists node ] } {
65 return
66 }
67
68 set new_x [ expr int ( rand () *$val ( x ) ) ]
69 set new_y [ expr int ( rand () *$val ( y ) ) ]
70 set speed 60 .0
71 catch { $node setdest $new_x $new_y $speed } ;# Catch

43
errors if node doesn ’ t support setdest
72
73 $ns at [ expr [ $ns now ] + 5 .0 ] [ list move $node ]
74 }
75
76 # Schedule node movements
77 for { set i 0} { $i < $val ( nn ) } { incr i } {
78 $ns at 1 .0 [ list move $node_ ( $i ) ]
79 }
80
81 # Create Multiple Traffic Flows (3 CBR flows )
82 set numFlows 3 ;# Changed the number of flows from 2 to 3
83 for { set i 0} { $i < $numFlows } { incr i } {
84 # Choose random source and destination nodes
85 set src [ expr int ( rand () *$val ( nn ) ) ]
86 set dst [ expr int ( rand () *$val ( nn ) ) ]
87 while { $dst == $src } { set dst [ expr int ( rand () *$val ( nn ) )
] }
88

89 # Create UDP agents and attach to nodes


90 set udp_ ( $i ) [ new Agent / UDP ]
91 set null_ ( $i ) [ new Agent / Null ]
92 $ns attach-agent $node_ ( $src ) $udp_ ( $i )
93 $ns attach-agent $node_ ( $dst ) $null_ ( $i )
94 $ns connect $udp_ ( $i ) $null_ ( $i )
95
96 # Create a CBR traffic application
97 set cbr_ ( $i ) [ new Application / Traffic / CBR ]
98 $cbr_ ( $i ) set packetSize_ 500
99 $cbr_ ( $i ) set rate_ 200 Kb
100 $cbr_ ( $i ) attach-agent $udp_ ( $i )
101
102 # Schedule the traffic flow to start and stop
103 set startTime [ expr 1 .0 + $i*0.5 ]
104 set stopTime 60 .0
105 $ns at $startTime " $cbr_ ( $i ) start "
106 $ns at $stopTime " $cbr_ ( $i ) stop "
107 }
108
109 # Termination Procedure
110 proc finish {} {
111 global ns tracef namf
112 $ns flush-trace
113 close $tracef
114 close $namf
115 exec nam aodv.nam &
116 exit 0
117 }
118

44
119 # Schedule Node Reset and Simulation End
120 for { set i 0} { $i < $val ( nn ) } { incr i } {
121 $ns at $val ( stop ) " \ $node_ ( $i ) reset "
122 }
123 $ns at $val ( stop ) " finish "
124 $ns at $val ( stop ) " puts \ " NS EXITING... \ " ; $ns halt "
125

126 puts " Starting Experiment Simulation... "


127 $ns run

– dsr.tcl
1 # Simulation Parameters
2 set val ( chan ) Channel / WirelessChannel
3 set val ( prop ) Propagation / TwoRayGround
4 set val ( netif ) Phy / WirelessPhy
5 set val ( mac ) Mac /802 _11
6 set val ( ifq ) Queue / DropTail / PriQueue
7 set val ( ll ) LL
8 set val ( ant ) Antenna / OmniAntenna
9 set val ( ifqlen ) 50
10

11 # Topology Parameters
12 set val ( nn ) 100
13 set val ( rp ) DSR
14 set val ( x ) 1000
15 set val ( y ) 1000
16 set val ( stop ) 80 .0
17
18 # Create Simulator, Trace & NAM Files
19 set ns [ new Simulator ]
20 set tracef [ open dsr.tr w ]
21 $ns trace-all $tracef
22 set namf [ open dsr.nam w ]
23 $ns n a m t r a c e - a l l - w i r e l e s s $namf $val ( x ) $val ( y )
24
25 # Create Topography and GOD Object
26 set topo [ new Topography ]
27 $topo load_flatgrid $val ( x ) $val ( y )
28 create-god $val ( nn )
29
30 # Configure Nodes
31 $ns node-config -adhocRouting $val ( rp ) \
32 -llType $val ( ll ) \
33 -macType $val ( mac ) \
34 -ifqType $val ( ifq ) \
35 -ifqLen $val ( ifqlen ) \
36 -antType $val ( ant ) \

45
37 -propType $val ( prop ) \
38 -phyType $val ( netif ) \
39 -channelType $val ( chan ) \
40 -topoInstance $topo \
41 -agentTrace ON \
42 -routerTrace ON \
43 -macTrace ON \
44 -movementTrace ON
45
46 # Create Nodes and assign initial random positions
47 for { set i 0} { $i < $val ( nn ) } { incr i } {
48 set node_ ( $i ) [ $ns node ]
49 $node_ ( $i ) random-motion 0
50 set posX [ expr int ( rand () *$val ( x ) ) ]
51 set posY [ expr int ( rand () *$val ( y ) ) ]
52 $node_ ( $i ) set X_ $posX
53 $node_ ( $i ) set Y_ $posY
54 $node_ ( $i ) set Z_ 0 .0
55 $ns initial_node_pos $node_ ( $i ) 20
56 }
57
58 # Create Multiple Traffic Flows (3 CBR flows )
59 set numFlows 3
60 for { set i 0} { $i < $numFlows } { incr i } {
61 set src [ expr int ( rand () *$val ( nn ) ) ]
62 set dst [ expr int ( rand () *$val ( nn ) ) ]
63 while { $dst == $src } {
64 set dst [ expr int ( rand () *$val ( nn ) ) ]
65 }
66
67 set udp_ ( $i ) [ new Agent / UDP ]
68 set null_ ( $i ) [ new Agent / Null ]
69 $ns attach-agent $node_ ( $src ) $udp_ ( $i )
70 $ns attach-agent $node_ ( $dst ) $null_ ( $i )
71 $ns connect $udp_ ( $i ) $null_ ( $i )
72

73 set cbr_ ( $i ) [ new Application / Traffic / CBR ]


74 $cbr_ ( $i ) set packetSize_ 500
75 $cbr_ ( $i ) set rate_ 200 Kb
76 $cbr_ ( $i ) attach-agent $udp_ ( $i )
77
78 set startTime [ expr 1 .0 + $i*0.5 ]
79 set stopTime 60 .0
80 $ns at $startTime " $cbr_ ( $i ) start "
81 $ns at $stopTime " $cbr_ ( $i ) stop "
82 }
83
84 # Termination Procedure
85 proc finish {} {

46
86 global ns tracef namf
87 $ns flush-trace
88 close $tracef
89 close $namf
90 exec nam dsr.nam &
91 exit 0
92 }
93
94 # Schedule Node Reset and Simulation End
95 for { set i 0} { $i < $val ( nn ) } { incr i } {
96 $ns at $val ( stop ) " \ $node_ ( $i ) reset "
97 }
98 $ns at $val ( stop ) " finish "
99 $ns at $val ( stop ) " puts \ " NS EXITING... \ " ; $ns halt "
100
101 puts " Starting Experiment Simulation... "
102 $ns run

– plot results.py
1 import matplotlib . pyplot as plt
2 import numpy as np
3 import os
4
5 # Updated Data
6 nodes = [20 , 40 , 60 , 80 , 100]
7 avg_e2e_delay = [431.460 , 668.202 , 539.931 , 634.936 , 555.152]
# ms
8 pdr = [42.78 , 33.19 , 51.08 , 44.87 , 38.70] # %
9 throughput = [248.68 , 205.67 , 316.66 , 240.32 , 238.59] # kbps
10
11 # Set position of bars on X axis
12 x = np . arange ( len ( nodes ) )
13 width = 0.25
14
15 # Get current directory
16 save_path = os . path . dirname ( os . path . abspath ( __file__ ) )
17
18 # Create grouped bar chart
19 plt . figure ( figsize =(10 , 6) )
20 plt . bar ( x - width , avg_e2e_delay , width , label = ’ Avg E2E Delay
( ms ) ’ , color = ’ skyblue ’)
21 plt . bar (x , pdr , width , label = ’ PDR (%) ’ , color = ’ lightgreen ’)
22 plt . bar ( x + width , throughput , width , label = ’ Throughput ( kbps
) ’ , color = ’ salmon ’)
23

24 # Labels and title


25 plt . xlabel ( " Number of Nodes " )

47
26 plt . ylabel ( " Value " )
27 plt . title ( " Performance Metrics vs Number of Nodes ( Updated
Data ) " )
28 plt . xticks (x , nodes )
29 plt . grid ( axis = ’y ’ , linestyle = ’ -- ’ , alpha =0.7)
30 plt . legend ()
31 plt . tight_layout ()
32
33 # Save plot
34 plt . savefig ( os . path . join ( save_path , " m e t r i c s _ v s _ n o d e s _ u p d a t e d
. png " ) )
35 plt . close ()
36

37 print ( " Grouped bar chart ( updated data ) saved successfully in


: " , save_path )

– e2e.awk
1 # !/ usr / bin / awk -f
2 BEGIN {
3 sentCount = 0;
4 delaySum = 0;
5 deliveredCount = 0;
6 }
7
8 /^ s / && $4 == " AGT " {
9 # Record send time ; sequence number is in field 6.
10 seq = $6 ;
11 startTime [ seq ] = $2 + 0;
12 sentCount ++;
13 }
14
15 /^ r / && $4 == " AGT " {
16 # Record receive time for the same sequence number .
17 seq = $6 ;
18 if ( seq in startTime ) {
19 delay = ( $2 + 0) - startTime [ seq ];
20 delaySum += delay ;
21 deliveredCount ++;
22 }
23 }
24
25 END {
26 if ( deliveredCount > 0) {
27 avgDelay = ( delaySum / deliveredCount ) * 1000; #
convert sec to ms
28 printf " Average End - to - End Delay = %.3 f ms \ n " ,
avgDelay ;

48
29 } else {
30 print " No delivered packets to compute delay " ;
31 }
32 }

– throughput.awk
1 # !/ usr / bin / awk -f
2 BEGIN {
3 recvdSize = 0;
4 firstTime = -1;
5 lastTime = -1;
6 }
7
8 /^ r / && $4 == " AGT " {
9 # Only consider received packets at the AGT layer
10 # Field 2 is time , field 8 is packet size
11 time = $2 + 0;
12 size = $8 + 0;
13 recvdSize += size ;
14 if ( firstTime < 0 || time < firstTime )
15 firstTime = time ;
16 if ( time > lastTime )
17 lastTime = time ;
18 }
19
20 END {
21 if ( firstTime >= 0 && lastTime > firstTime ) {
22 # Throughput in kbps : ( total bytes * 8) /( duration in
sec ) divided by 1000
23 throughput = ( recvdSize * 8) / ( lastTime - firstTime )
/ 1000;
24 printf " Average Throughput [ kbps ] = %.2 f \ tStartTime
=%.2 f \ tStopTime =%.2 f \ n " , throughput , firstTime ,
lastTime ;
25 } else {
26 print " Insufficient data to compute throughput " ;
27 }
28 }

– pdr.awk
1 # !/ usr / bin / awk -f
2 BEGIN {
3 sentCount = 0;
4 recvCount = 0;
5 }
6

49
7 /^ s / && $4 == " AGT " {
8 sentCount ++;
9 }
10
11 /^ r / && $4 == " AGT " {
12 recvCount ++;
13 }
14
15 END {
16 if ( sentCount > 0) {
17 pdr = ( recvCount / sentCount ) * 100;
18 printf " Sent = %d , Received = %d , PDR = %.2 f %%\ n " ,
sentCount , recvCount , pdr ;
19 } else {
20 print " No packets sent to compute PDR " ;
21 }
22 }

– plot results.py
1 import matplotlib . pyplot as plt
2 import numpy as np
3 import os
4
5 # Data
6 nodes = [20 , 40 , 60 , 80 , 100]
7 avg_e2e_delay = [90.182 , 112.388 , 382.026 , 388.602 , 197.426]
# ms
8 pdr = [88.87 , 83.53 , 72.76 , 74.10 , 84.70] # %
9 throughput = [554.19 , 520.12 , 453.21 , 455.52 , 523.73] # kbps
10
11 # Set position of bars on X axis
12 x = np . arange ( len ( nodes ) ) # the label locations
13 width = 0.25 # width of the bars
14
15 # Get current directory
16 save_path = os . path . dirname ( os . path . abspath ( __file__ ) )
17
18 # Create grouped bar chart
19 plt . figure ( figsize =(10 , 6) )
20 plt . bar ( x - width , avg_e2e_delay , width , label = ’ Avg E2E Delay
( ms ) ’ , color = ’ skyblue ’)
21 plt . bar (x , pdr , width , label = ’ PDR (%) ’ , color = ’ lightgreen ’)
22 plt . bar ( x + width , throughput , width , label = ’ Throughput ( kbps
) ’ , color = ’ salmon ’)
23

24 # Labels and title


25 plt . xlabel ( " Number of Nodes " )

50
26 plt . ylabel ( " Value " )
27 plt . title ( " Performance Metrics vs Number of Nodes " )
28 plt . xticks (x , nodes )
29 plt . grid ( axis = ’y ’ , linestyle = ’ -- ’ , alpha =0.7)
30 plt . legend ()
31 plt . tight_layout ()
32

33 # Save plot
34 plt . savefig ( os . path . join ( save_path , " metrics_vs_nodes . png " ) )
35 plt . close ()
36
37 print ( " Grouped bar chart saved successfully in : " , save_path )

Outputs:

aodv.tcl file run

51
Simulation initialize

Starting

52
Simulation Complete

Metrics vs Nodes Graph (aodv.tcl)

53
Metrics vs Nodes Graph (dsr.tcl)

54
Experiment : 8
Objective: Implement an Infrastructure-less wireless network
comprising of ’N’ MOBILE nodes. Perform the simulations with varying
speed of the nodes. Plot and compare the performance of different MAC
layer protocols using NS2/NS3 simulator in terms of:
1. Number of collisions,
2. Number of Control packets
Codes:
– exp-8.tcl:
1 # Simulation Parameters
2 set val ( chan ) Channel / WirelessChannel ;# Channel
type
3 set val ( prop ) Propagation / TwoRayGround ;# Propagation
model
4 set val ( netif ) Phy / WirelessPhy ;# Network
interface type
5 set val ( mac ) Mac /802 _11 ;# MAC type
6 set val ( ifq ) Queue / DropTail / PriQueue ;# Interface
queue type
7 set val ( ll ) LL ;# Link layer
type
8 set val ( ant ) Antenna / OmniAntenna ;# Antenna
model
9 set val ( ifqlen ) 50 ;# Maximum
packets in ifq
10
11 # Topology Parameters
12 set val ( nn ) 50 ;# Total
number of nodes: 50
13 set val ( rp ) DSDV ;# Use DSDV
routing protocol
14 set val ( x ) 1000 ;# X dimension
(m)
15 set val ( y ) 1000 ;# Y dimension
(m)
16 set val ( stop ) 80 .0 ;# Simulation
stop time ( sec )
17
18 # Create Simulator, Trace & NAM Files
19 set ns [ new Simulator ]
20 set tracef [ open exp-8.tr w ]
21 $ns trace-all $tracef
22 set namf [ open exp-8.nam w ]
23 $ns n a m t r a c e - a l l - w i r e l e s s $namf $val ( x ) $val ( y )
24

25 # Create Topography and GOD Object

55
26 set topo [ new Topography ]
27 $topo load_flatgrid $val ( x ) $val ( y )
28 create-god $val ( nn )
29
30 # Configure Nodes
31 $ns node-config -adhocRouting $val ( rp ) \
32 -llType $val ( ll ) \
33 -macType $val ( mac ) \
34 -ifqType $val ( ifq ) \
35 -ifqLen $val ( ifqlen ) \
36 -antType $val ( ant ) \
37 -propType $val ( prop ) \
38 -phyType $val ( netif ) \
39 -channelType $val ( chan ) \
40 -topoInstance $topo \
41 -agentTrace ON \
42 -routerTrace ON \
43 -macTrace ON \
44 -movementTrace ON
45
46 # Create Nodes and assign initial random positions
47 for { set i 0} { $i < $val ( nn ) } { incr i } {
48 set node_ ( $i ) [ $ns node ]
49 $node_ ( $i ) random-motion 0 ;# Disable NS-2 ’ s built-in
random motion
50 set posX [ expr int ( rand () *$val ( x ) ) ]
51 set posY [ expr int ( rand () *$val ( y ) ) ]
52 $node_ ( $i ) set X_ $posX
53 $node_ ( $i ) set Y_ $posY
54 $node_ ( $i ) set Z_ 0 .0
55 $ns initial_node_pos $node_ ( $i ) 20
56 }
57
58 # Procedure to continuously move a node using a random
waypoint model
59 proc move { node } {
60 global ns val
61 if { [ $ns now ] >= $val ( stop ) } { return }
62
63 # Ensure the node exists before moving it
64 if { ![ info exists node ] } {
65 return
66 }
67
68 set new_x [ expr int ( rand () *$val ( x ) ) ]
69 set new_y [ expr int ( rand () *$val ( y ) ) ]
70 set speed 100 .0
71 catch { $node setdest $new_x $new_y $speed } ;# Catch
errors if node doesn ’ t support setdest

56
72

73 $ns at [ expr [ $ns now ] + 5 .0 ] [ list move $node ]


74 }
75
76 # Schedule node movements
77 for { set i 0} { $i < $val ( nn ) } { incr i } {
78 $ns at 1 .0 [ list move $node_ ( $i ) ]
79 }
80
81 # Create Multiple Traffic Flows (3 CBR flows )
82 set numFlows 3 ;# Changed the number of flows from 2 to 3
83 for { set i 0} { $i < $numFlows } { incr i } {
84 # Choose random source and destination nodes
85 set src [ expr int ( rand () *$val ( nn ) ) ]
86 set dst [ expr int ( rand () *$val ( nn ) ) ]
87 while { $dst == $src } { set dst [ expr int ( rand () *$val ( nn ) )
] }
88
89 # Create UDP agents and attach to nodes
90 set udp_ ( $i ) [ new Agent / UDP ]
91 set null_ ( $i ) [ new Agent / Null ]
92 $ns attach-agent $node_ ( $src ) $udp_ ( $i )
93 $ns attach-agent $node_ ( $dst ) $null_ ( $i )
94 $ns connect $udp_ ( $i ) $null_ ( $i )
95

96 # Create a CBR traffic application


97 set cbr_ ( $i ) [ new Application / Traffic / CBR ]
98 $cbr_ ( $i ) set packetSize_ 512
99 $cbr_ ( $i ) set rate_ 200 Kb
100 $cbr_ ( $i ) attach-agent $udp_ ( $i )
101

102 # Schedule the traffic flow to start and stop


103 set startTime [ expr 1 .0 + $i*0.5 ]
104 set stopTime 60 .0
105 $ns at $startTime " $cbr_ ( $i ) start "
106 $ns at $stopTime " $cbr_ ( $i ) stop "
107 }
108
109 # Termination Procedure
110 proc finish {} {
111 global ns tracef namf
112 $ns flush-trace
113 close $tracef
114 close $namf
115 exec nam exp-8.nam &
116 exit 0
117 }
118

119 # Schedule Node Reset and Simulation End

57
120 for { set i 0} { $i < $val ( nn ) } { incr i } {
121 $ns at $val ( stop ) " \ $node_ ( $i ) reset "
122 }
123 $ns at $val ( stop ) " finish "
124 $ns at $val ( stop ) " puts \ " NS EXITING... \ " ; $ns halt "
125
126 puts " Starting Experiment Simulation... "
127 $ns run

– exp-8.awk
1 # !/ usr / bin / awk -f
2
3 BEGIN {
4 collisions = 0;
5 control_packets = 0;
6
7
8 {
9 event = $1 ; # Event type (s , r , d , D )
10 node = $2 ; # Node ID ( X )
11 layer = $4 ; # Layer type ( RTR , MAC , etc .)
12 packet_type = $7 ; # Packet type ( RTS , CTS , ACK , cbr , etc
.)
13
14 # Detect collisions : Dropped packets at MAC layer due to
RET ( Retransmission failure )
15 if ( event == " D " && layer == " MAC " && $5 == " RET " ) {
16 collisions ++;
17 }
18
19 # Count control packets : RTS , CTS , ACK in MAC layer
20 if (( event == " s " || event == " r " ) && layer == " MAC " &&
21 ( packet_type == " RTS " || packet_type == " CTS " ||
packet_type == " ACK " ) ) {
22 control_packets ++;
23 }
24 }
25
26 END {
27 print " Number of Collisions : " , collisions ;
28 print " Number of Control Packets : " , control_packets ;
29 }

58
– plot.py
1 import matplotlib . pyplot as plt
2
3 # Data
4 speed = [20 , 40 , 60 , 80 , 100]
5 collisions = [1244 , 1306 , 3640 , 4404 , 4050]
6 control_packets = [47034 , 39734 , 34222 , 37481 , 34382]
7
8 # Plot 1: Number of Collisions vs Speed
9 plt . figure ( figsize =(8 , 5) )
10 plt . bar ( speed , collisions , color = ’ crimson ’)
11 plt . xlabel ( ’ Speed ( m / s ) ’)
12 plt . ylabel ( ’ Number of Collisions ’)
13 plt . title ( ’ Number of Collisions vs Speed ’)
14 plt . grid ( True , axis = ’y ’)
15 plt . savefig ( " c o ll i s io n s _v s _ sp e e d . png " )
16 plt . close ()
17
18 # Plot 2: Number of Control Packets vs Speed
19 plt . figure ( figsize =(8 , 5) )
20 plt . bar ( speed , control_packets , color = ’ steelblue ’)
21 plt . xlabel ( ’ Speed ( m / s ) ’)
22 plt . ylabel ( ’ Number of Control Packets ’)
23 plt . title ( ’ Number of Control Packets vs Speed ’)
24 plt . grid ( True , axis = ’y ’)
25 plt . savefig ( " c o n t r o l _ p a c k e t s _ v s _ s p e e d . png " )
26 plt . close ()
27
28 print ( " Graphs saved successfully . " )

– metric vs speed.py
1 import matplotlib . pyplot as plt
2 import numpy as np
3

4 # Data
5 speed = [20 , 40 , 60 , 80 , 100]
6 collisions = [1244 , 1306 , 3640 , 4404 , 4050]
7 control_packets = [47034 , 39734 , 34222 , 37481 , 34382]
8
9 # X - axis positions
10 x = np . arange ( len ( speed ) )
11 width = 0.35 # width of the bars
12
13 # Create grouped bar chart
14 plt . figure ( figsize =(10 , 6) )
15 plt . bar ( x - width /2 , collisions , width , label = ’ Collisions ’ ,
color = ’ crimson ’)

59
16 plt . bar ( x + width /2 , control_packets , width , label = ’ Control
Packets ’ , color = ’ steelblue ’)
17
18 # Labels and title
19 plt . xlabel ( " Speed ( m / s ) " )
20 plt . ylabel ( " Count " )
21 plt . title ( " Collisions and Control Packets vs Speed " )
22 plt . xticks (x , speed )
23 plt . grid ( axis = ’y ’ , linestyle = ’ -- ’ , alpha =0.7)
24 plt . legend ()
25 plt . tight_layout ()
26
27 # Save plot
28 plt . savefig ( " c o l l i s i o n s _ c o n t r o l _ p a c k e t s _ v s _ s p e e d . png " )
29 plt . close ()
30
31 print ( " Grouped bar chart saved successfully as ’
c o l l i s i o n s _ c o n t r o l _ p a c k e t s _ v s _ s p e e d . png ’. " )

Outputs:

tcl file run

60
Simulation initialize

Starting

61
Running

Simulation complete

62
No of Control packets vs Speed Graph

No of Collisions vs Speed Graph

63
Metrics vs Speed Graph

64
Neural Processing Letters (2023) 55:2587–2611
https://doi.org/10.1007/s11063-022-10851-4

A Review on Multi-objective Optimization in Wireless Sensor


Networks Using Nature Inspired Meta-heuristic Algorithms

Gunjan1

Accepted: 15 April 2022 / Published online: 25 May 2022


© The Author(s), under exclusive licence to Springer Science+Business Media, LLC, part of Springer Nature 2022

Abstract
Wireless Sensor Networks (WSNs) is a tremendously growing field, wherein users can design
their sensor-based applications, depending on the application requirement. Most practical
challenges in WSNs involve several potentially conflicting objectives that must be met. Sat-
isfying one objective leads to degradation in other objective’s performance( for example,
if we focus on increasing network lifetime, latency may also increase, which is not desir-
able). Thus, it is very challenging to find trade-off amongst these conflicting optimization
criterion. An updated overview of the research efforts have been undertaken to solve this
challenge using Multi-objective Optimization (MOO) methods, particularly nature-inspired
meta-heuristic MOO algorithms. This paper presents a systematic review of MOO tech-
niques in WSNs. Besides, a study of applications of MOO is presented in diverse application
domains, specifically in the area of WSNs. Furthermore, the integration of WSNs with MOO
is studied to guide the researchers in future.

Keywords Multi-objective optimization · Wireless sensor networks · Nature inspired


algorithms · Meta-heuristics

1 Introduction

A WSN is made up of a large number of small, low-power, low-cost sensor nodes that
collect data from their environment (temperature, pressure, humidity, etc.) and wirelessly
transmit it to a global base station/stations that can use the data locally or connect to other
networks via a gateway (via the internet). Sensor nodes might be stationary or mobile, aware
or unaware of their location, homogeneous or heterogeneous in composition [1]. Tempera-
ture monitoring, water monitoring, health monitoring, military target tracking, smart homes,
and smart businesses are just a few of the interesting application areas for WSN. The appli-
cation’s performance metrics requirements may differ depending upon the application for
which the nodes are deployed. For instance, while low latency is desirable for time-critical
applications like forest fire detection, another characteristic, such as coverage, maybe more

B Gunjan
[email protected]
1 SRM University, Delhi-NCR, Sonepat, Haryana, India

123
2588 Gunjan

essential. Whenever we build a WSN algorithm for a specific application, we must choose
the appropriate performance measures.
If we have a single performance statistic, we may utilize it as our objective function and
quickly discover the required answer. However, the majority of applications in WSNs utilize
several performance metrics. For instance, an application may demand both network lifespan
and coverage. The difficulty is that these objectives frequently conflict (for example, if we
focus on extending network lifespan, latency may increase as well, which is undesirable).
Therefore, optimization of the desired parameters is required in such applications. Optimiza-
tion can be accomplished by the use of a model, a simulator, or an algorithm. This article
focuses on optimization methods. When dealing with many parameters/objective functions,
the simplest optimization methods often employ a weighted approach. Weights are assigned
to parameters depending on user requirements, and these objectives are then combined, sim-
plifying the problem to a single optimization model with a single objective. Weights are
assigned to parameters depending on user requirements, and these objectives are then com-
bined, reducing the problem to a single objective optimization problem. Another method is
to use a single parameter as the objective function and the rest parameters as optimization
constraints. Again, the method’s performance is determined by the target function.
MOO algorithms address the aforementioned concerns. There is no one optimal option
in a competing objective circumstance. There might be multiple solutions, each one ideal in
terms of some objective function. MOO algorithms discover these sets of potential answers
to objective issues that conflict.
Because there are several objectives to examine, a set of Pareto optimum solutions is
generated. Multiobjective evolutionary algorithms find many Pareto solutions in one single
run when used in conjunction with each other. There are a plethora of multi-objective evo-
lutionary techniques for tackling multiobjective optimization issues that are known in the
literature. For the vast majority of practical optimization issues, it is necessary to optimise
several mutually incompatible objectives at the same time. In practice, due to the inherent
conflicts between objectives, MOPs seldom have single optimal solution that meets all of the
objectives, but rather trade-off optimal solutions referred to as Pareto-optimal (P-O). For this,
the concept of non-dominance is used. Consider an example application where the goal is to
minimize energy consumption, while maximizing reliability. A solution a is said to outper-
form another solution b if its dependability and energy consumption values are greater for a
than for solution b. The solutions are considered to be non-dominant if none outperforms the
other, for example, one is better in terms of dependability while the other is better in terms
of energy usage. The Pareto Front is the collection of all optimal non-dominated solutions
in the solution space. Mathematically, we state MOO problem in general form as:
Minimise/Maximize fl (a), l = 1, 2, . . . L;
subject to gq (a) ≥ 0, q = 1, 2, . . . , Q;
h r (a) = 0, r = 1, 2, . . . R;
a (L) (U )
p ≤ a p ≤ a p , p = 1, 2, . . . , p

The Pareto dominance relation is given as:


Let f (a) = [ f 1a , f 2a ... fla ] be the l multiple objectives that we want to be optimized. A
solution a1 dominates solution a2 iff:
∀ p ∈ 1, 2, . . . , l : f p (a1) ≤ f p (a2)
∀q ∈ 1, 2, . . . , l : f q (a1) < f q (a2)

123
A Review on Multi-objective Optimization in Wireless... 2589

Instead of stating preferences in advance using a weighted solution, the user can choose
from a collection of obtained multiple Pareto solutions. MOO is often referred as as vector
optimization since it optimises a set of targets rather than a single goal. MOOPs are categorised
into following types: linear and non-linear MOOPs, convex and non-convex MOOPs. Aside
from the fact that multi-objective optimization has several objectives, there are a few key
distinctions between single-objective and multi-objective optimization. To begin, with single
objective optimization, there is just one goal: to find the best solution. However, there are
obviously two aims in MOO. Moving closer to the pareto-optimal front is unquestionably
a worthwhile objective. Maintaining a varied collection of solutions in the non-dominated
front, on the other hand, is critical. Second, MOO use two search spaces rather than one.
There is only one search space in single objective optimisation-the decision variable space.
In MOO, there is an objective or criterion space in addition to the decision variable space.
The events in both spaces must be coordinated in such a way that the development of novel
solutions in the decision variable space complements the variety required in the objective
space. Thirdly, there are no artificial fix-ups in MOO algorithms such as assigning weights
and ∈ - vectors. They discover several ideal solutions, and while only one solution is required
for execution, knowing about multiple possibilities might assist a designer in comparing and
selecting a compromised optimal solution.
Recently, a novel meta-heuristic based algorithm, BAS (Beetle Antennae Search has been
proposed) [2]. It has fast convergence and low computing burden. Zhang et al. proposed a
robust and efficient MOBAS (Multiobjective BAS) algorithm to solve multiobjective engi-
neering problems. The algorithm only requires a single particle/beetle instead of a swarm,
which greatly reduces its complexity and eases implementation [3]. BAS-WPT (without
parameter tuning) proposed by Jiang et al. [4]further simplifies the implementation of BAS
algorithm by releasing the tuning parameters while handling MOO. An innovative BAS-BP
fuel cost prediction model of MOAPD (Multi-objective Active Power Dispatch) problem
along with a novel NMBAS (novel multi-objective BAS) algorithm was proposed by Qian
et al [5]. BAS-ADAM (Adaptive Movement Estimation) algorithm proposed by Khan et al.
[6] was used to train a hidden layer neural network demonstrating its potential application in
real time machine learning applications. recently, Zhang et al. [7] provided an convergence
analysis of BAS and applied it to solve three problems arising from engineering applica-
tions. The paper is organised as follows. Section 2 describes the broad application areas of
MOO algorithms. In Sect. 3, a systematic review of MOO is provided. Section 4 studies the
basics of WSNs and the problem domains of WSNs. In Sect. 5, MOO to solve those WSN
problems are studied. Section 6, describes popular MOO algorithms. In Sect. 7, the applica-
tions of these popular MOO algorithms in WSNs are provided. The simulation experiments
are shown which compares MOBAS algorithm with the popular multiobjective optimization
algorithms in Sect. 8. Section 9 concludes the paper. At last, future scope is provided in Sect.
10 to guide the researchers in this domain.

2 Applications of MOO Algorithms

MOO is an emerging research area. Many applications of MOO can be realised in a variety
of application domains varying from structural optimization, VLSI circuit design, marine
vehicle design, autopilot controller design, robotics, smart homes, supersonic wing design,
the medical sector, recommender systems, market prediction, and so forth.

123
2590 Gunjan

For example, a number of mechanical component design problems have been solved using
MOO algorithms [8]. Usually, two conflicting design objectives are used in such problems:
cost and reliability of the design. Maximizing the stiffness of a component or minimising
maximum deflection anyplace in the component is akin to maximising the design’s reliability.
Another application of MOEA is to find interplanetary trajectories considering three objec-
tives: delivered payload, time of flight, number of heliocentric revolutions [9]. For resource
allocation, an MOO algorithm for BASMATI cloud federation architecture was proposed in
the recent years using four conflicting optimization objectives [10]. A meta-heuristic-based
scheduling method for workflow applications has been presented with the goal of optimising
three competing criterion at the same time: makespan/execution time, dependability, and
energy usage for running the workflow application in a cloud environment [11]. Hybrid opti-
mization techniques with MOO algorithms are utilized for solving real-world problems. A
novel convolutional neural network (CNN) model with a pre-trained Beetle Antennae Search
(BAS) optimisation method was created and used for the interpretation of data in healthcare
for cerebral haemorrhage [12]. An enormous amount of work is being done in the field of
robotics [13] Application for movable robot tracking control using multi-constrained zeroing
neural network has been introduced recently [14]. Using the Supertwisting (ST) method, the
authors of [15] presented a model for tracking mobile robot manipulators controls. Hybrid
MOOs are also proposed in robotics utilizing MOO. Khan et al. [16] presented a framework
for managing human-guided assistive agents in smart homes. Introducing a technique for
obstacle avoidance and trajectory tracking for a redundant-manipulator in smart-homes [17]
is another application of MOOs. Several MOO frameworks have also been proposed for wind
energy forecasting [18]. Another use is to solve the problem of portfolio selection for stock
asset allocation. For the task of portfolio optimization, quantum variant of BAS algorithm
called QBAS has recently been proposed [19].

3 Related Review Papers on MOO

In this section, we discuss some of the existent prominent surveys and reviews are done in
the field of MOO algorithms over the past few years, in the field of WSNs.

• Aval et al. 2012 [20]


An examination of numerous Multi-Objective Evolutionary Algorithms and their appli-
cations to optimize WSN deployment is presented in this paper, along with a survey of
current systems. It is common for analytical procedures to have delayed or non-convergent
convergence to the final result, which may be particularly troublesome when a big number
of nodes must be deployed at the same time. Fast optimization techniques can be used to
resolve such problems, resulting in solutions that are both qualified and resource-efficient
at the same time. In WSNs, GA and PSO are two overused optimization techniques.
• Iqbal et al. 2015 [21]
In this paper, the authors look at a variety of desired goals to see if they compete with one
another, complement one another, or are design-dependent in some manner. The authors
also provide a generalised multi-objective optimization problem for WSNs. A list of
constraints is also provided so that readers may have a better understanding of the many
limitations that must be considered while constructing optimization problems for WSNs.
The authors review the work that has been done on each element of multi-objective
optimization in respect to WSNs, as well as the results of those efforts.

123
A Review on Multi-objective Optimization in Wireless... 2591

• Fei et al. 2016 [22]


The authors begin by describing the key optimization objectives for WSNs. They then
go on to discuss how to achieve these objectives. A variety of commonly used MOO
approaches are then discussed, including scalarization methods that use mathemati-
cal programming, heuristics/meta-heuristics-based optimization algorithms, and other
advanced optimization measures. As a bonus, the authors include summaries of several
recent MOO studies that have been conducted in conjunction with WSNs, intending to
help researchers better understand the relevant literature. The report concludes by raising
several unsolved issues that will be addressed in the future study.
• Kandris et al. 2020 [23]
The authors of this study found a plethora of performance metrics that have an impact on
the functioning of WSNs. A plethora of approaches for optimizing performance in terms
of certain measures, such as those outlined above, may be found across the scientific
literature. While fulfilling desired requirements in terms of several metrics is possible,
doing so consistently is significantly more challenging, as the circumstances required
to optimize just one of these metrics may clash in many situations. The most popular
meta-heuristic search methods are based on evolutionary computing, which attempts to
mimic biological evolution, and swarms intelligence, which attempts to reproduce the
collective behavior of flocks of birds. Evolutionary computing and swarm intelligence
are both attempts to imitate biological evolution and swarm intelligence, respectively.
Additionally, hybrid techniques have been created, which combine the best of both worlds
to achieve the greatest results.
• Balasubramanian et al.2020 [24]
The consumption of energy is one of the key challenges with WSNs, which is unsurprising
considering the limited resources available. Previous research publications’ deterministic
techniques were successful in resolving a variety of difficulties. Dynamic programming is
one of the deterministic methodologies that may be utilised to solve a frequent challenge
in network routing strategies for effective message routing over a network. Deterministic
procedures, on the other hand, need a significant amount of time for a big number of
WSNs. Evolutionary algorithms, on the other hand, have grown in popularity over the
last several decades and are currently being utilised to handle a wide range of WSN
problems. The purpose of this study is to provide a detailed review of evolutionary
algorithms and their use in WSNs.
• Singh et al. 2021 [25]
The authors of this study are particularly interested in nature-inspired optimization
approaches for maximizing coverage in WSNs, which they describe in detail. After
conducting a taxonomy of optimization methods and investigating the issue domains in
WSNs, they moved on to the second phase of the research. After that, the authors looked
at how well two nature-inspired algorithms performed in terms of attaining optimal cov-
erage in WSNs in the second portion of the research. The first of them is IGABACA,
a hybrid algorithm, Improved Genetic Algorithm with Binary Ant Colony Algorithm.
To identify the optimum answer, a hybrid algorithm is utilized. Lion optimization is the
second form of optimization (LO).

123
2592 Gunjan

4 Wireless sensor Network Basics and Problem Domains

4.1 Wireless Sensor Node Architecture

Figure 1 shows the basic block diagram of a sensor node.


The components of a sensor node are sensor unit, processing unit, transceiver unit, and
power unit. Depending on the application, other components such as a position locating
system, a power generator, and a mobilizer may be necessary.

4.2 Wireless Sensor Network Architecture

A typical WSN is shown in Fig. 2.


A WSN comprises a large number of sensor nodes (which can be small and simple) that
can sense the environment and communicate the information gathered from a monitored field
via wireless links; the data is forwarded, possibly via multiple hops relaying, to a sink/ Base
Station that can use it locally or that is connected to a network. Nodes can be either fixed or
variable in their position. They may or may not be aware of where they are at all times. They
might be homogeneous or non-homogeneous.

4.3 Wireless Sensor Network Applications

A range of sensor types, including seismic, magnetic, thermal, visual, infrared, acoustic, and
radar, are used in WSNs. In addition to temperature and humidity, it can detect and record
the movement of vehicles and other objects, as well as the quality of the surrounding air, the

Power Supply

Transceiver
Sensor

Microcontroller ADC Sensor Sensor

Sensor
Memory

Fig. 1 Architecture of a Wireless Sensor Node

Fig. 2 Typical WSN

123
A Review on Multi-objective Optimization in Wireless... 2593

Wireless Sensor Network Applications

Tracking Monitoring

Military Habitat Military Habitat


Enemy Tracking Animal Tracking security Detection Animal Monitoring

Business Public/Industrial Business Public/Industrial


Human Tracking Traffic Tracking Inventory Monitoring Structural Monitoring

Environment
Health
Environmental
Patient Monitoring
Monitoring

Fig. 3 Wireless Sensor Network Applications

composition of the soil, the level of noise, and the current characteristics of an object, such
as its speed, direction, and size, among other things. WSN applications [26] , [27] fall into
two types, as illustrated in Fig. 3:

• Monitoring
• Tracking

Indoor/outdoor environmental monitoring, health and well-being monitoring, product loca-


tion monitoring, industrial and process automation, as well as seismic and structural
monitoring, are all examples of monitoring applications in use today. Application categories
for tracking software include the tracking of things such as objects, animals, people, and
vehicles, as well as the categorization of applications into categories such as military, envi-
ronmental, safety, residential, and other commercial applications. A more comprehensive
classification system, including areas such as space exploration, chemical manufacture, and
disaster relief, may be developed.
Military applications: In military C4ISRT systems, sensor networks are extremely
attractive due to their fast deployment capabilities, self-organization capabilities, and fault
tolerance. Sensor networks are an extremely attractive sensing technology due to their fast
deployment, self-organization capabilities, and fault tolerance characteristics. Armed sensor
networks can be used to track and collect as much information as possible about enemy
movements, explosions, and other interesting occurrences, such as frontline surveillance,
identification, and monitoring of nuclear, biological, and chemical threats, as well as other
interesting events. Ad hoc networks of specialised unmanned aerial vehicles ( UAVs) have
been critical in homeland defence and security applications [28] (Figs. 4, 5).
Environmental Applications Sensors are used to automate agriculture, for example,
moisture, temperature of the soil, light intensity, humidity [29]. Vehicle ad hoc networks

123
2594 Gunjan

(VANETs) have propelled us forward in the development of intelligent transportation sys-


tem (ITS) technologies [30].WSNs have developed into a strong tool for monitoring and
distributed control of industrial processes, resulting in more efficient and infrastructure-free
Industrial Automation Systems (IAS) [31]. However, it is not prudent to keep all raw data
locally in Industrial IoT devices, because the end devices’ energy and storage capacities are
severely restricted. Additionally, the systems are vulnerable to a variety of assaults due to their
deployment in distant and unsupervised regions. Thus, in the Industrial Internet of Things
(IoT), safe data storage, quick data retrieval, and dynamic data collecting are necessary [32].
Energy-aware provisioning is also necessary in these cloud-based settings [33].
Healthcare applications: To monitor the physiological condition of patients, body sensor
networks can be implemented. To offer interfaces for disabled, automated patient monitoring
systems, body sensor networks can be employed. In some cases, such as when a patient is
sick, this can be used to monitor and anticipate the behavior of older persons. These little
sensor nodes allow patients to move around more freely and enable physicians to identify
specific symptoms earlier in the course of their treatment. Sensor nodes, which are tiny and
lightweight, are attached to each patient’s clothing and may be used to monitor their heart
rate and blood pressure. In addition, physicians may be equipped with a sensor node that
allows other physicians to track them down inside the hospital setting. It was reported in [34]
that the authors had developed a Plasmonics-Based Refractive Index Sensor for Hemoglobin
concentration detection, in which they investigated an ultra-compact plasmonics-based sensor
powered by Fano resonance.
Home applications: With technological improvements, the small sensor nodes may one
day be integrated into furniture and appliances such as vacuum cleaners, microwave ovens,
and refrigerators, among other things.

4.4 Problem Domains in WSN

• Coverage
A sensor network’s coverage is an important performance parameter. Coverage in other
wireless communication networks is frequently referred to in terms of radio coverage.
Coverage refers to the sensing range, whereas connectivity refers to the communication
range in a WSN. It is divided into three types: area, point and barrier coverage. In general,
identifying the best location for a group of nodes to optimise coverage is an NP-complete
task. The goal of the optimization technique is to eliminate coverage gaps in order to
enhance the possibility of detecting an event, i.e. no region should be left uncovered
by the sensor nodes. Furthermore, the distance between two Cluster heads should be as
great as feasible in order to avoid overlapping coverage regions, i.e. no two nodes/cluster
heads should be within each other’s coverage territory.
• Lifetime
The lifespan of WSNs is another important performance measure to consider. The energy
supply of each node is regularly depleted, making it difficult to replenish or replace the
sensor’s battery when necessary. As a result, each node’s radio transceiver and sensor
unit must be energy efficient, and network lifespan (the period between network start
and sensor node battery depletion) must be maximized. To keep things simple, all sensor
nodes are assumed to have the same value, which is reasonable given that the loss of a
single node might cause the network to be partitioned or reveal a monitoring zone. As
a result, the network lifespan is defined as the time from when the application is first
activated and when any of the cluster’s sensor nodes fail due to a lack of power.

123
A Review on Multi-objective Optimization in Wireless... 2595

lifetime

latency Coverage

data aggregatiion Problem Domains in WSN scalability

energy consumption
ion f t tolerance
faul

load balancing

Fig. 4 Problem Domains in WSN

• Latency
In a typical arrangement, a fixed amount of bandwidth is supplied for data transit between
WSN nodes. Another advantage of expanding the number of servers is that more pathways
are available for routing packets to their destinations at the same time, which is ideal for
minimising latency. This, however, may impact latency, which increases linearly with the
number of nodes on the requested routes. As the number of nodes in a network grows, so
does competition for the wireless channel, resulting in routing and buffering delays. The
objective of optimization algorithm is limiting the delay, which equates to minimizing
the number of intermediate forwarders/hop count between the source and the sink.
• Data Aggregation
Data aggregation is one method of reducing the amount of redundant information sensed.
It is a method used in WSNs that is energy efficient. The data collected by sensors during
the monitoring of an area is transmitted to a data collection center, where it is either
entirely or partially processed before being used. Because the data aggregation center
analyses the collected data, it may make precise decisions that will help to extend the
life of the sensors by minimizing sensor overlap and frequent placements. Techniques
for data aggregation may be divided into four categories: tree-based techniques, cluster-
based techniques, grid-based techniques, and chain-based techniques. In the Tree-based
data aggregation technique, a tree architecture is used to organize data, with the source
node serving as the coordinator and data aggregation taking place at the aggregator
nodes, which are intermediate nodes in the process. Lower-level nodes are responsible
for passing information to higher-level nodes. It is possible to group data via clustering.
If you use this form of data aggregation, your network will first be split up into several
clusters, after which the Cluster Head (CH) will be selected based on sensor metrics
such as sensor energy. Initially, the CH collects data from inside the clusters before
transferring it to the sink. A fresh CH is selected for each data transmission cycle to

123
2596 Gunjan

prevent the CH from consuming excessive energy with each cycle of data transmission.
The Grid-based aggregation technique divides the network into numerous parts, with
each region reporting the existence of any new events that occur in the network. Grid
aggregator nodes, also known as central nodes, are the nodes that gather data from the
rest of the grid. In the Chain-based aggregation technique, the sensor node feeds data to
its surrounding node, and data aggregation occurs at the lead node, which is the most
advanced node. The optimization algorithm’s goal is to reduce the number of aggregation
points that must be used in the routing of information.
• Energy Consumption
Data transmission is the most energy consuming task by a sensor. The optimization
algorithm’s goal is to reduce overall data forwarding energy usage.
• Load balancing
Every node should contribute equally for a longer network lifetime. By this we mean
that all the nodes in a sensor network should deplete their energy at the same rate. if one
node is consuming energy at a higher rate than other’s then this particular node will die
out soon, leading to a smaller lifetime. Thus the objective of optimization algorithm is
to maximize load balancing in the network.
• Fault Tolerance/Reliability
Environmental conditions, power failure, and other factors can all cause sensor nodes
to fail in different ways. Because replacing aging nodes might be difficult, the network
must be fault-tolerant to reduce the number of individual failures, which can shorten
the network’s lifespan. As a result of this, fault tolerance is defined as the ability of a
network to continue running uninterrupted in the event of a node failure. Fault tolerance
is commonly applied in routing and transport protocols.
• Scalability
The network performance should not be degraded on increasing the network size. The
objective of the optimization algorithm is to maximize the scalability of the network.
• Security
On a battlefield, for example, an opponent may seek to seize or deploy sensor nodes by
physically attacking them. As a result, an attacker may be able to listen in on legitimate
sensor connections and decode the secret keys of secure connections. Recently, there has
been a significant interest in the security of WSNs. The two most fundamental types of
privacy issues are those that are data-related and those that are context-related. Unlike
data-centric issues, contextual concerns involve contextual information, such as traffic
flow location and time inside a WSN, whereas data-centric concerns are concerned with
the privacy of information received from a WSN. To increase network security, we may
reduce the loss of privacy estimated using information theory. In addition, we can reduce
the likelihood of eavesdropping in a WSN to increase network security.

5 Optimization Algorithms as a Solution

All of the above-mentioned design objectives are NP problems, as is their implementation.


Consequently, when the solution space is large, no polynomial-time method can be used to
solve the problems described above. Optimizing algorithms are a viable solution for such
problems since they allow for the finding of the desired result in a polynomial amount of
time.

123
A Review on Multi-objective Optimization in Wireless... 2597

Fig. 5 Optimization Algorithm Classification

When optimizing something, a model, a simulator, or an algorithm may all be used to


achieve the best results. In this study, we used an algorithmic method to investigate the fea-
sibility of optimizing issue domains in WSNs. Deterministic (local search) and stochastic
search algorithms (global search) are the two types of optimization algorithms that may be
used . In the case of deterministic processes, we have a theoretical guarantee that we will reach
the global minimum, or at the very least a local minimum, whereas stochastic techniques only
provide a probabilistic guarantee that we will reach the global minimum. Stochastic meth-
ods, on the other hand, are significantly faster than deterministic approaches. Furthermore,
stochastic methods are well-suited for the development of black-boxes and badly behaved
functions, among other things. When compared to stochastic processes, deterministic tech-
niques are reliant on theoretical and analytical assumptions about how a particular problem
is phrased. Furthermore, stochastic techniques are divided into two categories: heuristic, and
meta-heuristic algorithms. Whenever it is difficult to discover an optimal solution, both types
of algorithms are employed to speed up the process of achieving a global optimum. Heuristic
algorithms are are tailored to a given issue. Their adaptive propensity toward the issue, along
with their greedy nature, makes them particularly prone to being entangled at local optima,
resulting in their failure to attain global optima. Meta-heuristic techniques, on the other hand,
are algorithms that are not dependent on the issue being solved. Because these algorithms
are non-adaptive and non-greedy, they may be used as a black box in research and develop-
ment. These algorithms have been actively used to solve WSN problems in WSNs. Lahane
[35], [36], [37] are a few recent examples to cite. There are three types of bio-inspired algo-
rithms: evolutionary, swarm-based, and plant-based algorithms. The most commonly used
algorithms are evolutionary algorithms. The Darwinian concepts of selection, heredity, and
variation are the basis of evolutionary algorithms. Swarm algorithms, on the other hand, are
based on a group of people’s collective intelligence. This article focuses on evolutionary
algorithms.
Genetic algorithms (GAs) are the most widely used meta-heuristic in the contemporary
age. The most prominent meta-heuristic is based on Darwin’s notion of survival of the fittest.
The notion of utilizing ways to solve problems that are based on a simulation of Darwin’s
evolutionary theory has been around since the early 1930s. The three primary techniques

123
2598 Gunjan

based on this concept are genetic algorithms, evolution strategies, and evolutionary program-
ming. For single-objective optimization, these approaches, which are collectively referred to
as “evolutionary algorithms,” have been demonstrated to be very successful.
The following is a description of the fundamental operation of an evolutionary algorithm
(EA). In order to begin, they must first generate a list of viable solutions to the problem at
hand (referred to as a “population”). Typically, a population of this nature arises at random.
Each solution (sometimes referred to as an “individual”) in the population encodes all of the
decision elements associated with the issue. It is necessary to create a fitness function in order
to determine its applicability. We’ve created a simplified version of the objective function for
the problem we’re trying to solve.
Then, in order to determine which individuals would “mate,” a selection procedure must be
used. The fittest individuals have a higher probability of being selected. When two individuals
get together and mate, they produce a bunch of “children”. They are “mutated” (a minor
random change in the contents of an individual with a low probability) and form the population
that will be examined in the future iteration of the experiment (called a “generation”). Once
this operation is completed, it is repeated until a halting situation is reached (normally,
a maximum number of generations). The process of constructing a Genetic Algorithm is
illustrated in Fig. 6.
The use of evolutionary algorithms was further advanced with the introduction of multi-
objective optimization. In situations where we have more than one optimization target, multi-
objective optimization approaches can be quite beneficial. Optimization aims frequently
conflict with one another. If we try to improve the performance of one, the performance of
the others may suffer as a result. The following are the three aims of an MOEA: Convergence
is the process of finding a collection of solutions that is as close to the pareto front (PF) as
is possible; diversity is the process of discovering a well-distributed group of solutions, and
coverage is the process of finding solutions that span the whole PF.

6 MOO : Basic Concepts and Popular Algorithms

6.1 Multi-Objective Optimization: Basic Concepts

When dealing with multiobjective optimization issues, there are three scenarios that might
occur with respect to objective functions:
• Minimization of all.
• Maximization of all.
• Few should be minimised, while others should be maximised.
All functions are often transformed to either a maximisation or minimization form. For
example, it is possible to transform all of the functions that need to be maximised into a form
that permits them to be minimised as shown in equation 1:
max f (−i
→x ) = min(−f (− i
→x )) (1)
When several objective functions are included, the idea of “optimal” changes, because the
purpose of multiobjective optimization is to find good compromises (or “trade-offs”) rather
than a single solution, as in global optimization [38]. Normally, this idea results in a collection
of solutions known as the Pareto optimum set. Non-dominated vectors − →x ∗ are those that
correspond to the solutions that are included in the Pareto optimum set of solutions . The
Pareto front is the image of the Pareto optimum set created by the Pareto algorithm. When

123
A Review on Multi-objective Optimization in Wireless... 2599

Fig. 6 Genetic Algorithm steps


Start

Create Initial Design Population

Evaluate Objective Function of


Designs

Select and Reproduce

Next Generation
(Create new Designs)

Replace designs of the old


population with new designs

Termination No
Condition Met?

Yes

Stop

it comes to Pareto dominance, it means that a solution cannot be worse than another in any
goal and must be strictly better in at least one of them in order for it to dominate another one.
As a result, when comparing two solutions P and Q using Pareto dominance, the following
three results are possible:

• P dominates Q.
• P is dominated by Q.
• P and Q are not dominated by each other (i.e., they are both non-dominated).

Elitism: In single-objective optimization, elitism refers to an operator which ensures that the
best solution in the population gets handed down unmodified to the next generation (i.e., it
is not affected by crossover or mutation). Elitism works similarly in MOO, except that we
must keep (all) non-dominated solutions provided by a MOEA. Because retaining all of these
solutions is unfeasible, a limit on the highest solutions stored is typically enforced [39].

123
2600 Gunjan

Fig. 7 Phases of Multi-objective


Optimization

6.2 MOO Popular Algorithms

Rosenberg’s PhD thesis [40] addresses the concept of using genetic algorithms to solve a
multi-objective problem for the first time, but no implementation is provided. The reason
for this is that the bi-objective issue he was seeking to solve was recast as a single-objective
problem, which was more difficult to solve (the additional objective was transformed into a
constraint).
John David Schaffer was the first to develop an actual implementation of a multi-objective
evolutionary algorithm (MOEA) [41]. The technique developed by Schaffer was known as
the Vector Evaluated Genetic Algorithm (VEGA) [41]. Multi-objective evolutionary algo-
rithms (MOEAs) have advanced fast in recent decades and may be generally split into four
phases, as seen in Fig. 7. Figure 7 depicts the first phase, which began prior to the 1990s and
continued to the present. Pareto dominance was first introduced into these algorithms in the
early 1990s, which corresponds to the second phase. It is recommended that the focus is on
decreasing computational complexity and developing more effective strategies for maintain-
ing biodiversity throughout this time period. The third phase, which runs from 1999 to 2002
and is represented by the year 1999. During this time period, algorithms began to adopt the
concepts of elite preservation and increased diversity preservation approaches, which were
both new concepts at the time. While numerous approaches dominated the field of multi-
objective optimization throughout this time period, they have shown to be insufficient for
multi-objective optimization issues in recent years. The fourth phase, which began in 2003
and has progressed in a more diversified manner.
Multiobjective optimization approaches such as indicator-based and decomposition-based
MOEA are frequently used in multiobjective optimization situations, and they include:
NSGA-III [42], novel evolutionary methods, such as MOPSO [43] , in order to demonstrate
their effectiveness and the −domination principle are examples of percent-based environ-
mental selection operators that have been studied.
Recently, some studies have been carried out in two different directions: by deriving
MOEA with greater confidence, increasing the probability that the solution is close to its
Pareto optimal. The second type of MOEA is the interactive MOEA, in which the decision-

123
A Review on Multi-objective Optimization in Wireless... 2601

Fig. 8 MOO Algorithm

Fig. 9 MOEA Parameters

making process is integrated into the model and the preferred best solution is created
immediately.
When solving a generic multi-objective optimization issue, there are four components to
consider: (1) the inputs, (2) the necessary output, (3) the objectives, and (4) the constraints
as depicted in Fig. 8.
Various alternative solutions to the problem’s various aspects are depicted in Fig. 9. The
nature of a multi-objective optimization issue changes depending on the precise input param-
eters used, the optimization objective function required, and the restrictions imposed by the
region in which the unique sensor network is deployed.

123
2602 Gunjan

7 MOEA: Applications in WSNs

Table 1 discusses the popular multi-objective algorithms developed in the last few years, in
the field of WSNs. The objective of each of the algorithms is mentioned. While implementing,
these objectives are represented mathematically as objective functions and their correspond-
ing values are calculated. For example, consider an application of forest fire detection, wherein
a WSN is deployed. One of the objectives in such an application can be to have minimum
energy consumption by Cluster head (CH) nodes since, we cannot replace the batteries now
and then. Then this objective can be represented in equation 3 as:

⎪k ∗ E elec + k ∗ eda ∗ deg+


⎨k ∗ E ∗ d 2 i f d < do
fs
min(E T x−C H (k, d)) = (2)

⎪ k ∗ E elec + k ∗ eda ∗ deg+


k ∗ E mp ∗ d 4 i f d >= do
The energy expended by CH in data transmission and aggregation is given by equation 1
and it needs to be minimized. Another objective function in this scenario can be maximum
coverage. This can be represented mathematically in one way by equation 4 as:
cov = max(min(dm,n )) (3)
where dm,n is the distance between cluster heads m and n
In this scenario, we have two objectives and both are conflicting in nature. If we focus
on minimizing energy consumption, we might not have adequate coverage and vice-versa.
Multi-objective optimization algorithms are helpful in these scenarios. The whole problem
is converted into a minimization/maximization problem mathematically and all the possible
solutions are returned, wherein the user can pick any. The input in each case is the network
parameters and values required by the corresponding algorithm. The output of the algorithm
is also mentioned in the table, i.e. what the users want to achieve by using the mentioned
algorithm and the objective functions, and the algorithm used to achieve the corresponding
objective is also specified. Simulation tool used in each of the experiments is also listed.

7.1 WSN Simulation tools

The MOO issues in WSN may be solved using a number of different tools that are available.
Several of the tools used in the publications examined in this study are discussed in detail in
this section.
• MATLAB: MATLAB is an abbreviation for “matrix laboratory”, developed by Math-
Works. Users may manipulate and visualise matrices, construct algorithms, create user
interfaces and interact with other languages’ applications using MATLAB [44].
• Network-Simulator: The NS-2 simulator has long been a popular tool for network
research and education. Network simulations for NS-2 employ C++ code to describe
node behaviour and OTcl scripts to manage the simulation and define additional features
like network topology. The NS-3 Project began in mid-2006 and is currently in progress.
NS-3 is a C++ network simulator with a Python scripting API. It lets researchers research
large-scale systems and Internet protocols regulated setting NS-3 is a new (not compatible
with NS-2) [45].
• OPNET: Optimized Network Engineering Tool is a full development environment for
communication network definition, simulation, and performance analysis. It can accom-

123
A Review on Multi-objective Optimization in Wireless... 2603

Table 1 Multi-objective optimization algorithms in WSN


Article Technical Objective Algorithm Simulation Tool
task/Output

[49] 2004 Optimal con- Maximize accuracy, MOPSO –


figuration of minimize time
sensors, their
thresholds
and fusion
rules
[50] 2006 Optimal route Minimize power MODE –
consumption, minimize
delay
[51] 2008 Optimal Maximum coverage and MOEA/D –
deployment lifetime
and power
assignment
[52] 2009 Optimal Minimize energy NSGA-II –
sensor set consumption and maximize
and sensing coverage
radius
[53] 2010 Optimal path Minimize delay, energy NSGA-II OPNET Modeler 14.0
from sink to consumption, maximize
source node reliability
[54] 2010 Optimal Minimize number of sensors, MOTS C++
sensor maximize event detection
placement probability, maximize
connectivity, minimize
energy consumption
[55] 2010 Optimal Maximize coverage and MOEA/D JAVA
location and lifetime
transmit
power
[56] 2011 Optimal Minimize energy NSGA-II JAVA6.0
sensor consumption, maximize
placement coverage
and
redesigning
[57] 2012 Optimal Minimize degree difference, MOPSO MATLAB 6.0
number of energy consumption,
Cluster mobility, transmission
heads (CHs) range
[58] 2013 Optimal Maximize coverage and MOGA C++
topology connectivity
[59] 2013 Optimal node Minimize energy MOTPSMA MATLAB and NS2
placement consumption, maximize
area coverage
[60] 2013 Optimal node Maximize cover- MOEA/D-DE –
placement age,lifetime,connectivity,
topology minimize energy
consumption
[61] 2014 Optimal Minimize energy MOSTP using –
spanning consumption, maximize JPSO
tree for data lifetime, minimize latency,
aggregation minimize interference

123
2604 Gunjan

Table 1 continued
Article Technical Objective Algorithm Simulation Tool
task/Output

[62] 2015 Optimal CHs Maximize coverage, MOBSO MATLAB


minimize energy
consumption
[63] 2015 Optimal node Maximize information mop-SPEM –
placement quality, minimize energy
consumption
[64] 2015 Optimal node Minimize cost,latency,packet NSGA-II WSNet
locations drop rate,maximize cover-
age,connectivity,lifetime
[65] 2016 Optimal Minimize transmission delay, MNSGA-II NS-2
routing minimize expected
topology transmission count
[66] 2016 Optimal com- Minimize-uncovered area, NSGA-II with LA NS-2
munication unbalanced energy
range consumption, number of
active sensors
[67] 2016 Optimal Maximize coverage, CPMEA MATLAB
sensor maximize lifetime
placement
[68] 2017 Optimal node Minimize cost, maximize NSGA-II MATLAB
placement connectivity, maximize
sensing coverage and
minimize over-coverage
[69] 2018 Optimal Minimizing energy NSGA-II –
cluster head consumption, maximizing
election number of non cluster heads
[70] 2018 Optimal – Multi objective –
cluster head Tabu particle
election swarm
optimization
[71] 2018 Optimal Maximize arrival rate, PSOGSA MATLAB R2016a
arrival rate bandwidth, minimize
for congestion, energy
congestion consumption, queue length
control
mechanism
[72] 2018 Optimal Maximize network lifetime, machine learning MATLAB 2017b
clustering coverage and connectivity based parallel
topology genetic
algorithm
[73] 2019 Optimal Minimize energy MOACO NS-2
energy consumption, maximize
consumption trust
and network
lifetime
[74] 2019 Optimal Minimize energy MO-QACO MATLAB
routing path consumption, minimize
time-delay, maximize
network load balance

123
A Review on Multi-objective Optimization in Wireless... 2605

Table 1 continued
Article Technical Objective Algorithm Simulation Tool
task/Output

[75] 2019 Optimal Minimize energy MOACO NS-2


energy consumption, maximize
consumption trust
and network
lifetime
[76] 2020 Optimal node Maximize coverage, MOGA PYTHON(“PyCharm
(MOONGA) deployment maximize connectivity, development
minimize cost environment”)
[77] 2020 Optimal Maximize sum of residual NSGA-II MATLAB
cluster heads energy, minimize cluster
head to sink distance,
maximize separation
between adjacent cluster
heads, minimize deviation
of cluster loads
[78] 2020 Optimal Maximize coverage, Bio-inspired Zone MATLAB
coverage and maximize connectivity formation
connectivity
[79] 2020 optimize Maximize sum of residual NSGA-II C (https://github.com/
energy energy of all nodes, marlonjeske/
consumption maximize number of algorithm_based_
and delivery packets received by base NSGAII)
reliability station
[80] 2020 Optimal Minimize-contaminant NSGA-III EPANET 2.0
sensor detection time, affected
placement in population, expected
water consumption, maximize
distribution detection likelihood
system
[81] 2020 Optimal Maximize sum of residual NSGA-III MATLAB
placement of energy of all nodes,
sensor nodes maximize coverage and
lifetime
[82] 2021 Optimal Maximize coverage efficiency Improved fruit fly MATLAB
network and network user optimization
placement satisfaction

modate everything from a local LAN to worldwide satellite networks. Discrete event
simulations are used to study system behaviour and performance [46].
• WSNet: This is an event-driven simulator developed in C for simulating massive WSNs
on a huge scale. Nodes and characteristics of a radio channel are represented by so-called
blocks.
• EPANET: For simulating the hydraulic and water quality behaviour of water distribution
networks over long periods of time, EPANET is a commonly used software program in
the public domain [47].
Apart from above discussed tools, there are several other simulation tools for simulating
a WSN like OMNET++, TOSSIM, Cooja, JSim, Castalia etc [48].

In Fig. 10, the various multi-objective algorithms used in Table 1 are listed.

123
2606 Gunjan

Fig. 10 Multi-objective algorithms

Table 2 Performance comparison of different multi-objective optimization algorithms


SCH ZDT 1 ZDT 2
Algorithm Elapsed time (s) AD i Elapsed time (s) AD i Elapsed time (s) AD i

MOBAS 33.49 3.64E − 05 73.14 1.75E − 03 76.87 9.16E − 04


NSGA-II 445.46 6.01E − 03 452.57 3.25E − 02 444.36 9.24E − 02
MOPSO 132.62 1.67E − 04 229.11 1.5E − 03 234.11 7.78E − 04

8 Simulation Results

The comparison of Multi-objective BAS algorithm is compared with the popular NSGA-II
and MOEA on the basis of elapsed/computing time (in seconds) and error(AD i ) (distance
between the estimated pareto front at position x i and the actual pareto front). For comparison,
standard benchmark functions are used, namely, SCH (Schaffer’s Min-Min), ZDT1 and ZDT2
[3]. Population size in each of the algorithms is assumed to be 200. The other simulation
parameters are kept similar in [3]. The results obtained are listed in Table 2. It is observed that
the computation time of MOBAS is much lesser as compared to the other algorithms, which is
of great importance in solving MOO problems in various domains such as in WSNs. However,
the error of MOPSO algorithm is lower than MOBAS. Future work to further improve the
accuracy can be carried out for MOBAS algorithm. Also, the potential of solving WSN design
problem using BAS based algorithms can be exploited.

9 Conclusion

To meet the educational needs of MOO researchers, we have supplied this article with a
review of the work in the WSN arena. To begin, this paper presents an introduction to multi-
objective optimization algorithms and how they are different from traditional single objective

123
A Review on Multi-objective Optimization in Wireless... 2607

algorithms. An overview of the different application domains of multi-objective optimization


is presented. We further describe WSNs and their basic optimization aims, then we move on
to uncovering several algorithms in the family of MOPs and their classification. We further
explore MOO solutions for solving WSN challenges. These MOO algorithms return a set
of pareto-optimal solutions instead of a single solution returned by traditional optimization
algorithms. However, no one of these Pareto-optimal solutions is better than the others.
For each potential situation, the MOO algorithms will enumerate the various Pareto-optimal
solutions. As well, two different designs using traditional optimization and MOO technology
were examined in the context of WSNs.

10 Future Scope

This research area has a lot of untapped promise. MOEA that incorporates the user’s prefer-
ences during the process of evolution is a critical topic. The aspects of solutions, such as their
similarities, and which design changes will effect the trade-off between objectives, are being
investigated and analysed. The data mining approach can be used to find knowledge of the
solution produced through multi-objective optimization and then applied to the problem to
achieve a more in-depth understanding of the problem. In order for indicator-based MOEAs
to gain popularity, new performance indicators must be suggested. Another intriguing idea
is to combine performance indicators to capitalise on their strengths while correcting for
their weaknesses. It is challenging to build selection processes for MOEAs that are distinct
from those that have already been developed [83]. More research into quantum evolutionary
algorithms in the field of multi-objective and limited optimization is needed. Developing
hybrid MOO is another domain which requires further exploration. For example, in Robotics
field recently, a lot of work is being done to improve their efficiency [84], [13]. Likewise, for
recommender systems [85], we may introduce hybrid algorithms utilizing MOEA.
There are numerous aspects that require further investigation when it comes to imple-
menting MOO in the WSN domain. For example, the majority of study concentrated on the
MOO of single-hop WSNs, with only a few entries focusing on multi-hop WSNs. In energy-
constrained WSNs, multi-hop transmission is critical to reducing transmission energy and
thus increasing network lifetime. As a result, expanding multi-objective optimization research
into multi-hop WSNs is extremely feasible. Sensor nodes may be moved by objects or by the
application (human, animals, etc). Thus, node mobility affects network connection. Research
in this area needs to be explored. WSNs are frequently deployed in potentially hostile envi-
ronments, leaving them vulnerable to passive, active, and denial-of-service (DoS) attacks.
As a result, future studies must ensure their safety. The performance of multi-objective
algorithms in a multi-sink scenario has also received little attention. Sensor networks are
three-dimensional (3D), despite the fact that previous contributions typically assume they
are two-dimensional (2D). Extending a 2D network into 3D is challenging, and it should be
researched further. Multi-objective solutions for Underwater WSNs (UWSN) and Unmanned
Aerial Vehicles (UAV), for example, need to be investigated further. Another significant dif-
ficulty is determining how to reliably deploy WSNs in hostile propagation environments to
enable wide-area sensing coverage and trustworthy communication links. Because of the fre-
quency of mutually interfering networks, unique cross-layer and cross-network solutions are
required. Multi-objective optimization should also be used to investigate joint clustering and
routing. Efficient wireless charging is an open challenge for efficiently charging nodes and
extending network life. Similarly, employing renewable energy to power the motes may be

123
2608 Gunjan

tricky. Longevity and processing power can be thought of as a multi-objective optimization


issue. In the future, a comparison of the various MOO algorithms may be done to determine
which MOO algorithm is suitable for a certain WSN application.

References
1. Verdone R, Dardari D, Mazzini G, Conti A (2010) Wireless sensor and actuator networks: technologies,
analysis and design. Academic Press, Cambridge
2. Jiang X, Li S (2017) Bas: Beetle antennae search algorithm for optimization problems. arXiv preprint
arxiv:1710.10724 [abs]
3. Zhang J, Huang Y, Ma G, Nener B (2020) Multi-objective beetle antennae search algorithm. arXiv preprint
arXiv:2002.10090
4. Jiang X, Li S (2017) Beetle antennae search without parameter tuning (bas-wpt) for multi-objective
optimization, arXiv preprint arXiv:1711.02395
5. Qian J, Wang P, Pu C, Chen G (2021) Joint application of multi-object beetle antennae search algorithm
and bas-bp fuel cost forecast network on optimal active power dispatch problems”. Knowled Based Syst
226:107149
6. Khan AH, Cao X, Li S, Katsikis VN, Liao L (2020) Bas-adam: an adam based approach to improve the
performance of beetle antennae search optimizer. IEEE/CAA J Autom Sinica 7(2):461–471
7. Zhang Y, Li S, Xu B (2021) Convergence analysis of beetle antennae search algorithm and its applications.
Soft Comput 25(16):10595–10608
8. Sunar M, Rao S (1993) Simultaneous passive and active control design of structures using multiobjective
optimization strategies. Comput Struct 48(5):913–924
9. Coverstone-Carroll V, Hartmann J, Mason W (2000) Optimal multi-objective low-thrust spacecraft tra-
jectories. Comput Methods Appl Mech Eng 186(2–4):387–402
10. Aryal RG, Altmann J (2018) Dynamic application deployment in federations of clouds and edge resources
using a multiobjective optimization ai algorithm, In: 2018 Third international conference on fog and
mobile edge computing (FMEC). IEEE, pp 147–154
11. Rehani N, Garg R (2018) Meta-heuristic based reliable and green workflow scheduling in cloud computing.
Int J Syst Assur Eng Manag 9(4):811–820
12. Chen D, Li X, Li S (2021) A novel convolutional neural network model based on beetle antennae search
optimization algorithm for computerized tomography diagnosis, IEEE Trans Neural Netw Learn Syst
13. Li Z, Li S, Luo X (2021) An overview of calibration technology of industrial robots. IEEE/CAA J Autom
Sinica 8(1):23
14. Chen D, Li S, Wu Q (2020) A novel supertwisting zeroing neural network with application to mobile
robot manipulators. IEEE Trans Neural Netw Learn Syst 32(4):1776–1787
15. Chen D, Cao X, Li S (2021) A multi-constrained zeroing neural network for time-dependent nonlinear
optimization with application to mobile robot tracking control. Neurocomputing 460:331–344
16. Khan AT, Li S (2021) Human guided cooperative robotic agents in smart home using beetle antennae
search, Science China Information Sciences
17. Khan AT, Li S, Li Z (2021) Obstacle avoidance and model-free tracking control for home automation
using bio-inspired approach. Engineering and Industrial Systems, Advanced Control for Applications, p
e63
18. Liu H, Li Y, Duan Z, Chen C (2020) A review on multi-objective optimization framework in wind energy
forecasting techniques and applications. Energy Convers Manage 224:113324
19. Khan AT, Cao X, Li S, Hu B, Katsikis VN (2021) Quantum beetle antennae search: a novel technique for
the constrained portfolio optimization problem. Science China Inf Sci 64(5):1–14
20. Aval KJ, Abd Razak S (2012) A review on the implementation of multiobjective algorithms in wireless
sensor network. World Appl Sci J 19(6):772–779
21. Iqbal M, Naeem M, Anpalagan A, Ahmed A, Azam M (2015) Wireless sensor network optimization:
multi-objective paradigm. Sensors 15(7):17572–17620
22. Fei Z, Li B, Yang S, Xing C, Chen H, Hanzo L (2016) A survey of multi-objective optimization in wireless
sensor networks: metrics, algorithms, and open problems. IEEE Commun Surv Tutor 19(1):550–586
23. Kandris D, Alexandridis A, Dagiuklas T, Panaousis E, Vergados DD (2020) Multiobjective optimization
algorithms for wireless sensor networks
24. Balasubramanian DL, Govindasamy V (2020) Study on evolutionary approaches for improving the energy
efficiency of wireless sensor networks applications, EAI Endorsed Trans Internet of Things. 5(20)

123
A Review on Multi-objective Optimization in Wireless... 2609

25. Singh A, Sharma S, Singh J (2021) Nature-inspired algorithms for wireless sensor networks: a compre-
hensive survey. Comput Sci Rev 39:100342
26. Liu Y, Xiong N, Zhao Y, Vasilakos AV, Gao J, Jia Y (2010) Multi-layer clustering routing algorithm for
wireless vehicular sensor networks. IET Commun 4(7):810–816
27. Patnaik S, Li X, Yang Y-M (2015) Recent development in wireless sensor and ad-hoc networks. Springer
28. Lilien LT, Ben Othmane L, Angin P, DeCarlo A, Salih RM, Bhargava B (2014) A simulation study of ad
hoc networking of uavs with opportunistic resource utilization networks. J Netw Comput Appl 38:3–15
29. Bachuwar V, Ghodake U, Lakhssassi A, Suryavanshi S (2018) Wsn/wi-fi microchip-based agriculture
parameter monitoring using iot, In: 2018 International Conference on Smart Systems and Inventive Tech-
nology (ICSSIT). IEEE, pp 214–219
30. Prakash A, Tripathi R (2008) Vehicular ad hoc networks toward intelligent transport systems, In: TENCON
2008-2008 IEEE Region 10 Conference. IEEE, pp 1–6
31. Kumar M, Gupta I, Tiwari S, Tripathi R (2013) A comparative study of reactive routing protocols for
industrial wireless sensor networks. International Conference on Heterogeneous Networking for Quality.
Reliability, Security and Robustness. Springer, pp 248–260
32. Fu J-S, Liu Y, Chao H-C, Bhargava BK, Zhang Z-J (2018) Secure data storage and searching for industrial
iot by integrating fog computing and cloud computing. IEEE Trans Industr Inf 14(10):4519–4528
33. Yang S, Wieder P, Yahyapour R, Fu X (2017) Energy-aware provisioning in optical cloud networks.
Comput Netw 118:78–95
34. Zafar R, Nawaz S, Singh G, d’Alessandro A, Salim M (2018) Plasmonics-based refractive index sensor
for detection of hemoglobin concentration. IEEE Sens J 18(11):4372–4377
35. Lahane SR, Jariwala KN (2021) Integrating beetle swarm optimization in cross layer design routing
protocol to improve quality of service in clustered wsn. Adhoc Sensor Wirel Netw, 49
36. Shende DK, Sonavane S (2020) Crowwhale-etr: Crowwhale optimization algorithm for energy and trust
aware multicast routing in wsn for iot applications. Wirel Netw, pp 1–19
37. Wu D, Geng S, Cai X, Zhang G, Xue F (2020) A many-objective optimization wsn energy balance model”.
KSII Trans Internet Inf Syst (TIIS) 14(2):514–537
38. Edgeworth FY, Mathematical psychics: An essay on the application of mathematics to the moral sciences.
CK Paul, 1881, (10)
39. Rudolph G, Agapie A (2000) Convergence properties of some multi-objective evolutionary algorithms,
In: Proceedings of the 2000 congress on evolutionary computation. CEC00 (Cat. No. 00TH8512), 2.
IEEE, pp 1010–1016
40. Rosenberg RS (1970) Stimulation of genetic populations with biochemical properties: I. The model. Math
Biosci 7(3–4):223–257
41. Schaffer JD (1985) Multiple objective optimization with vector evaluated genetic algorithms, In: Proceed-
ings of the first international conference on genetic algorithms and their applications, 1985. Lawrence
Erlbaum Associates. Inc., Publishers
42. Mkaouer W, Kessentini M, Shaout A, Koligheu P, Bechikh S, Deb K, Ouni A (2015) Many-objective
software remodularization using nsga-iii. ACM Trans Softw Eng Methodol (TOSEM) 24(3):1–45
43. Coello CC, Lechuga MS (2020) Mopso: a proposal for multiple objective particle swarm optimization,”
In: Proceedings of the 2002 Congress on Evolutionary Computation. CEC’02 (Cat. No. 02TH8600), 2.
IEEE, pp 1051–1056
44. Higham DJ, Higham NJ (2016) MATLAB guide. SIAM
45. Issariyakul T, Hossain E (2009) Introduction to network simulator 2 (ns2), In: Introduction to network
simulator NS2. Springer, pp 1–18
46. Chang X (1999) Network simulations with opnet, In: WSC’99. 1999 Winter Simulation Conference
Proceedings.’Simulation-A Bridge to the Future’(Cat. No. 99CH37038), 1. IEEE, (1999), pp 307–314
47. Rossman LA (2010) An overview of epanet version 3.0, Water distribution systems analysis 2010, pp
14–18
48. Stehlík M (2011) Comparison of simulators for wireless sensor networks, Ph.D. dissertation, Masarykova
univerzita, Fakulta informatiky
49. Veeramachaneni KK, Osadciw LA (2004) Dynamic sensor management using multi-objective particle
swarm optimizer,” In: Multisensor, multisource information fusion: architectures, algorithms, and appli-
cations 2004, vol. 5434. International Society for Optics and Photonics, pp 205–216
50. Xue F, Sanderson A, Graves R (2006) Multi-objective routing in wireless sensor networks with a differ-
ential evolution algorithm, In: 2006 IEEE International conference on networking, sensing and control.
IEEE, pp 880–885
51. Konstantinidis A, Yang K, Zhang Q (2008) An evolutionary algorithm to a multi-objective deployment
and power assignment problem in wireless sensor networks, In: IEEE GLOBECOM 2008-2008 IEEE
Global Telecommunications Conference. IEEE, pp 1–6

123
2610 Gunjan

52. Jia J, Chen J, Chang G, Wen Y, Song J (2009) Multi-objective optimization for coverage control in wireless
sensor network with adjustable sensing radius. Comput Math Appl 57(11–12):1767–1775
53. EkbataniFard GH, Monsefi R, Akbarzadeh-T M-R, Yaghmaee MH (2010) A multi-objective genetic
algorithm based approach for energy efficient qos-routing in two-tiered wireless sensor networks,” In:
IEEE 5th International Symposium on Wireless Pervasive Computing 2010. IEEE, pp. 80–85
54. Aitsaadi N, Achir N, Boussetta K, Pujolle G (2010) Multi-objective wsn deployment: quality of moni-
toring, connectivity and lifetime, In: 2010 IEEE International Conference on Communications. IEEE, pp
1–6
55. Konstantinidis A, Yang K (2011) Multi-objective k-connected deployment and power assignment in wsns
using a problem-specific constrained evolutionary algorithm based on decomposition. Comput Commun
34(1):83–98
56. Martins FV, Carrano EG, Wanner EF, Takahashi RH, Mateus GR (2010) A hybrid multiobjective evolu-
tionary approach for improving the performance of wireless sensor networks”. IEEE Sens J 11(3):545–554
57. Ali H, Shahzad W, Khan FA (2012) Energy-efficient clustering in mobile ad-hoc networks using multi-
objective particle swarm optimization”. Appl Soft Comput 12(7):1913–1928
58. He D, Portilla J, Riesgo T (2013) A 3d multi-objective optimization planning algorithm for wireless
sensor networks, In: IECON 2013-39th Annual Conference of the IEEE Industrial Electronics Society.
IEEE, pp 5428–5433
59. Abidin HZ, Din NM, Jalil YE (2013) Multi-objective optimization (moo) approach for sensor node
placement in wsn, In: 2013, 7th International Conference on Signal Processing and Communication
Systems (ICSPCS). IEEE, pp 1–5
60. Sengupta S, Das S, Nasir M, Panigrahi BK (2013) Multi-objective node deployment in wsns: in search
of an optimal trade-off among coverage, lifetime, energy consumption, and connectivity. Eng Appl Artif
Intell 26(1):405–416
61. Lu Y, Chen J, Comsa I, Kuonen P, Hirsbrunner B (2014) Construction of data aggregation tree for multi-
objectives in wireless sensor networks through jump particle swarm optimization”. Procedia Comput Sci
35:73–82
62. Sharawi M, Emary E, Saroit IA, El-Mahdy H (2015) Wsn’s energy-aware coverage preserving optimiza-
tion model based on multi-objective bat algorithm, In: 2015 IEEE Congress on Evolutionary Computation
(CEC). IEEE, 472–479
63. Elsersy M, Ahmed MH, Elfouly TM, Abdaoui A (2015) Multi-objective sensor placement using the
effective independence model (spem) for wireless sensor networks in structural health monitoring, In:
2015 International Wireless Communications and Mobile Computing Conference (IWCMC). IEEE, 576–
580
64. He D, Mujica G, Portilla J, Riesgo T (2015) Modelling and planning reliable wireless sensor networks
based on multi-objective optimization genetic algorithm with changeable length. J Heuristics 21(2):257–
300
65. Murugeswari R, Radhakrishnan S, Devaraj D (2016) A multi-objective evolutionary algorithm based qos
routing in wireless mesh networks. Appl Soft Comput 40:517–525
66. Jameii SM, Faez K, Dehghan M (2016) Amof: adaptive multi-objective optimization framework for
coverage and topology control in heterogeneous wireless sensor networks. Telecommun Syst 61(3):515–
530
67. Khalesian M, Delavar MR (2016) Wireless sensors deployment optimization using a constrained pareto-
based multi-objective evolutionary approach. Eng Appl Artif Intell 53:126–139
68. Bahl N, Sharma AK, Verma HK (2014) On the energy utilization for wsn based on bpsk over the
generalized-k shadowed fading channel. Wireless Netw 20(8):2385–2393
69. Hacioglu G, Kand VFA, Sesli E (2016) Multi objective clustering for wireless sensor networks. Expert
Syst Appl 59:86–100
70. Vijayalakshmi K, Anandan P (2019) A multi objective tabu particle swarm optimization for effective
cluster head selection in wsn. Clust Comput 22(5):12275–12282
71. Singh K, Singh K, Aziz A et al (2018) Congestion control in wireless sensor networks by hybrid multi-
objective optimization algorithm. Comput Netw 138:90–107
72. Chang Y, Yuan X, Li B, Niyato D, Al-Dhahir N (2018) “Machine-learning-based parallel genetic algo-
rithms for multi-objective optimization in ultra-reliable low-latency wsns. IEEE Access 7:4913–4926
73. Sun Z, Wei M, Zhang Z, Qu G (2019) Secure routing protocol based on multi-objective ant-colony-
optimization for wireless sensor networks. Appl Soft Comput 77:366–375
74. Li F, Liu M, Xu G (2019) A quantum ant colony multi-objective routing algorithm in wsn and its application
in a manufacturing environment. Sensors 19(15):3334
75. Sasi SB, Santhosh R (2021) Multiobjective routing protocol for wireless sensor network optimization
using ant colony conveyance algorithm. Int J Commun Syst 34(6):e4270

123
A Review on Multi-objective Optimization in Wireless... 2611

76. Bouzid SE, Seresstou Y, Raoof K, Omri MN, Mbarki M, Dridi C (2020) Moonga: multi-objective opti-
mization of wireless network approach based on genetic algorithm. IEEE Access 8:105793–105814
77. Sharma G, Ajay K, Karan V (2020) Nsga-ii with enlu inspired clustering for wireless sensor networks”.
Wireless Netw 26(5):3637–3655
78. Prasanth A, Jayachitra S (2020) A novel multi-objective optimization strategy for enhancing quality of
service in iot-enabled wsn applications. Peer-to-Peer Netw Appl 13(6):1905–1920
79. Jeske M, Rosset V, Nascimento MC (2020) Determining the trade-offs between data delivery and energy
consumption in large-scale wsns by multi-objective evolutionary optimization. Comput Netw 179:107347
80. Hu C, Dai L, Yan X, Gong W, Liu X, Wang L (2020) Modified nsga-iii for sensor placement in water
distribution system. Inf Sci 509:488–500
81. Chakravarthi SS, Kumar GH (2020) Optimization of network coverage and lifetime of the wireless sensor
network based on pareto optimization using non-dominated sorting genetic approach. Procedia Comput
Sci 172:225–228
82. Thekkil TM, Prabakaran N (2021) Optimization based multi-objective weighted clustering for remote
monitoring system in wsn. Wirel Pers Commun 117(2):387–404
83. Coello Coello CA, González Brambila S, Figueroa Gamboa J, Castillo Tapia MG, Hernández Gómez R
(2020) Evolutionary multiobjective optimization: open research areas and some challenges lying ahead.
Complex Intell Syst 6(2):221–236
84. Lu H, Jin L, Luo X, Liao B, Guo D, Xiao L (2019) Rnn for solving perturbed time-varying underdetermined
linear system with double bound limits on residual errors and state variables. IEEE Trans Industr Inf
15(11):5931–5942
85. Luo X, Zhou M, Li S, Wu D, Liu Z, Shang M (2019) Algorithms of unconstrained non-negative latent
factor analysis for recommender systems. IEEE Trans Big Data 7(1):227–240

Publisher’s Note Springer Nature remains neutral with regard to jurisdictional claims in published maps and
institutional affiliations.

123
MC Research Paper Analysis
Title: A Review on Multi-objective Optimization in Wireless Sensor Networks
Using Nature Inspired Meta-heuristic Algorithms

1. Area of Research Paper:


The research paper, “A Review on Multi-objective Optimization in Wireless Sensor Networks Using
Nature Inspired Meta-heuristic Algorithms” explores performance optimization in Wireless Sensor
Networks (WSNs), focusing on balancing multiple conflicting design objectives. WSNs consist of
distributed sensor nodes that collect and transmit data, often operating in energy-constrained, remote
environments. Due to limited resources—such as power, processing capacity, and memory—
optimizing these networks is essential for maintaining functionality over time.

The study emphasizes Multi-Objective Optimization (MOO), a framework for solving problems
involving trade-offs between goals like energy efficiency, network lifetime, data reliability, and latency.
Traditional single-objective approaches often fail to capture real-world complexities, whereas MOO
generates Pareto-optimal solutions offering flexible design choices.

Central to this paper is the review of nature-inspired meta-heuristic algorithms—such as Genetic


Algorithms, Particle Swarm Optimization, and Ant Colony Optimization—which mimic biological or
natural behaviours to solve NP-hard optimization problems. These algorithms are particularly effective
in WSNs due to their adaptability and capacity for handling multiple objectives in dynamic
environments.

The paper analyses various algorithms in terms of their efficiency and application to WSN challenges
like routing, node placement, cluster head selection, and energy balancing. It also discusses system
models, simulation tools (e.g., NS2, MATLAB, OMNeT++), and evaluation metrics used in this domain.
Importantly, the review identifies research gaps, including the need for mobility-aware models,
security integration, hybrid techniques, and energy-harvesting support.

By bridging WSNs, MOO, and nature-inspired computation, the paper offers a comprehensive
reference for optimizing modern sensor networks in complex, multi-criteria scenarios, guiding both
theoretical and practical advancements in the field.

2. Problem Statement:
Designing efficient Wireless Sensor Networks (WSNs) is challenging due to the limited energy,
processing power, and memory of sensor nodes—constraints that become critical in inaccessible or
hazardous environments. The fundamental problem lies in managing multiple, often conflicting
performance objectives such as energy consumption, latency, coverage, connectivity, and security.

Traditional single-objective optimization methods or weighted combinations of objectives are


inadequate, as they lack the flexibility to capture the complex trade-offs involved. These methods are
often context-sensitive and fail to provide robust solutions across different application scenarios.

To address this, the problem is formulated as a Multi-Objective Optimization Problem (MOOP).


Instead of seeking a single optimal solution, MOOP focuses on generating a set of Pareto-optimal
solutions, each offering a unique trade-off among conflicting goals. This approach allows designers to
select configurations based on specific requirements.

The paper investigates how nature-inspired meta-heuristic algorithms—such as Genetic Algorithms


and Particle Swarm Optimization—can effectively solve MOOPs in WSNs. These algorithms are well-
suited to tackle the non-linear, large-scale nature of WSN optimization tasks due to their adaptability
and global search capabilities.

Thus, the research aims to evaluate the effectiveness of these algorithms in optimizing various WSN
parameters, identify their limitations, and suggest directions for future development to meet the
growing complexity and diversity of WSN applications.

- Objective of the Research

The core aim of this study is to review and analyse how nature-inspired multi-objective optimization
algorithms have been applied to various WSN problems. It seeks to:

• Map different WSN performance issues (like coverage, energy, latency) to corresponding
MOO solutions

• Classify and compare meta-heuristic algorithms based on performance

• Identify research gaps and suggest promising directions for future exploration.

3. System Model / Methodology:


The paper adopts a Multi-Objective Optimization (MOO) framework to address conflicting design goals
in Wireless Sensor Networks (WSNs), such as minimizing energy use while maximizing coverage and
lifetime. The assumed system model includes spatially distributed sensor nodes with limited resources,
communicating either directly or via multi-hop routing to a central sink node.

The optimization problem is framed as a Multi-Objective Optimization Problem (MOOP), where


several performance metrics—like energy consumption, latency, coverage, and load balancing—must
be optimized simultaneously. Due to the interdependent nature of these metrics, solutions are
evaluated based on Pareto optimality rather than a single best outcome. A Pareto front represents a
set of non-dominated solutions offering various trade-offs among objectives.

To solve this MOOP, the paper employs nature-inspired meta-heuristic algorithms, including Genetic
Algorithms (GA), Particle Swarm Optimization (PSO), Ant Colony Optimization (ACO), and Beetle
Antennae Search (BAS), along with their multi-objective variants like NSGA-II and MOPSO. These
population-based, stochastic algorithms are particularly effective in exploring large, complex, and non-
linear search spaces where traditional methods often fail.

Performance is assessed using standard WSN metrics, such as energy usage, network lifetime,
coverage ratio, latency, throughput, and energy load distribution. These metrics help evaluate
algorithm efficiency and real-world applicability. Optimization models are typically implemented in
MATLAB using benchmark functions (e.g., ZDT1, ZDT2) to test algorithm convergence and diversity,
while realistic network behaviour is validated in NS2, simulating routing protocols, mobility, and energy
dynamics.

The methodology is tailored to specific WSN problems like cluster head selection, routing, and
coverage, each requiring different objective functions and constraints. Additionally, mechanisms like
crowding distance (used in NSGA-II) ensure solution diversity across the Pareto front, offering a
broader range of design options.

In essence, the methodology presents a structured, flexible, and simulation-backed approach to


applying MOO techniques in WSNs using biologically inspired algorithms. It balances theoretical rigor
with practical relevance, making it a valuable guide for designing robust, efficient sensor networks
under real-world constraints.

4. Equations If Used Then Explain:


The research paper presents and explains several key mathematical equations that are commonly
used in MOO problems and nature-inspired algorithms for WSNs. Below is an organized explanation
of the most important equations used in the paper:

A. General Multi-Objective Optimization Problem (MOOP):


A multi-objective optimization problem is formulated to find a set of optimal solutions that balance
several conflicting objectives. The standard representation of such problems is:

Subject to constraints:

Explanation:

• fl(a): Objective functions to be optimized (minimized or maximized)

• gq(a): Inequality constraints

• hr(a): Equality constraints

• ap: Decision variables bounded by lower (ap(L) ) and upper (ap(U)) limits

This generic formulation is the foundation upon which all MOO problems, including those in WSNs,
are structured.

B. Pareto Dominance Relation:


The concept of Pareto optimality is expressed mathematically as follows:

Let f(a) = [f1(a), f2(a), ..., fl(a)] be the objective vector.

A solution a1 is said to dominate another solution a2 if:

∀p ∈ {1, 2, ..., l} : fp(a1) ≤ fp(a2)

∃q ∈ {1, 2, ..., l} : fq(a1) < fq(a2)


Explanation:

• This means a1 is no worse than a2 in all objectives and strictly better in at least one.

• If no solution dominates another, they are non-dominated, and such solutions form the Pareto
front.

C. Objective Function Transformation (Max to Min):


When all objectives need to be treated uniformly (either minimized or maximized), it is common to
convert maximization objectives into minimization ones:

Explanation:

• This transformation simplifies algorithm design since many MOO algorithms are tailored for
minimization.

D. Energy Consumption Model in WSN:


A specific case discussed in the paper involves minimizing the energy consumed by Cluster Head (CH)
nodes during data transmission and aggregation:

Explanation:

• ETx−CH(k,d) : Energy used by a CH to transmit k bits over distance d

• Eelec : Energy per bit for transmission electronics

• eda : Data aggregation energy per bit

• deg : Number of nodes connected to the CH

• Efs , Emp : Amplification energy for short and long distances, respectively

• d0 : Distance threshold separating short-range and long-range transmissions

This piecewise function reflects the radio energy model often used in WSN simulations.

E. Coverage Objective Function:


Another typical objective in WSN deployment is to maximize coverage. A simplified representation is
given as:

cov = max(min(dm,n))

Explanation:

• dm,n : Distance between cluster heads m and n


• The goal is to maximize the minimum distance between cluster heads, which helps avoid
overlap in their sensing regions and ensures better spatial coverage.

F. Error Measurement Metric – Adi:


In the simulation results section, a comparison between algorithms is made using a performance
metric called ADi:

ADi = Average distance between estimated Pareto front and true Pareto front

Explanation:

• Lower ADi indicates a more accurate approximation of the true Pareto front.

• Used to compare the performance of algorithms like MOBAS, NSGA-II, and MOPSO.

G. Algorithm-Specific Metrics:
Though not expressed in closed-form equations, certain algorithm metrics are implicitly described:

• Convergence: Distance of solutions from Pareto front over iterations

• Diversity: Distribution of solutions across the objective space

• Coverage: How well the algorithm spans the entire Pareto front

These are evaluated using graphical plots and numerical comparisons across benchmark functions like
SCH, ZDT1, and ZDT2.

H. Equation Summary Table:

Equation Purpose Variables

fl(a) Objective functions in MOOP Performance metrics

Pareto Dominance Identifying non-dominated solutions Objective vector f(a)

max fi(x)=min [−fi(x)] Normalization for optimization Objective functions

ETx−CH CH energy model k, d, Eelec,Efs,Emp,eda,deg

cov = max(min(dm,n)) Maximize inter-cluster distance Cluster head positions

ADi Pareto front approximation error Distance metric

These mathematical formulations offer the quantitative foundation for modelling, analysing, and
solving WSN optimization problems using nature-inspired multi-objective algorithms. They help
encode real-world performance metrics into objective functions that algorithms can optimize
effectively.

5. Research Gap:
Despite progress in Wireless Sensor Networks (WSNs), several limitations persist in the application of
multi-objective optimization (MOO) using nature-inspired algorithms. The reviewed paper identifies
key areas where current research falls short, limiting practical deployment and performance
optimization of WSNs.

A major gap is the insufficient focus on multi-hop WSNs. Most optimization models assume single-hop
communication, which is impractical for large or dispersed networks. Multi-hop routing introduces
complexities like energy balancing, link reliability, and delay management—yet these are rarely tackled
in existing MOO frameworks.

Another underexplored aspect is node mobility. Many WSN applications involve dynamic nodes (e.g.,
drones, wearables), but most algorithms assume fixed positions. This limits adaptability in real-world,
topology-changing environments where mobility affects connectivity and energy usage.

Security and trust are also inadequately integrated into optimization models. While WSNs often
operate in hostile or unsecured environments, MOO frameworks rarely address vulnerabilities like data
tampering, node compromise, or denial-of-service attacks. Including trust metrics or intrusion
detection mechanisms in optimization goals could significantly enhance robustness.

Multi-sink architectures, which can balance traffic and reduce bottlenecks, are largely ignored. Most
studies focus on single-sink setups, though optimizing multiple sink placement and routing paths
introduces more realistic and efficient network designs.

There is also minimal research on 3D WSNs and underwater sensor networks (UWSNs). Existing
algorithms are mostly designed for 2D layouts, ignoring the spatial challenges and communication
constraints in 3D terrains or aquatic environments. These scenarios require tailored models that
consider depth, 3D propagation, and environmental interference.

With the rise of energy harvesting, traditional assumptions of finite, non-replenishable energy become
outdated. Current models do not account for dynamic energy input from solar or ambient sources,
missing opportunities for sustainable WSNs.

The literature also lacks robust exploration of hybrid meta-heuristic algorithms. While GA, PSO, ACO,
and others have been applied independently, hybridizing their strengths (e.g., GA’s exploration with
PSO’s fast convergence) could improve solution quality, but is rarely done due to implementation
complexity.

Another gap is the absence of decision-making tools for choosing among Pareto-optimal solutions.
Most studies stop at presenting the Pareto front without offering guidance for practical selection.
Techniques like AHP, TOPSIS, or fuzzy logic could help convert algorithm outputs into actionable
insights for designers.

Performance evaluation is typically narrow, focusing on basic metrics like energy and delay. Broader
metrics such as resilience, scalability, and responsiveness are often overlooked. Standardized
benchmarks, advanced simulators (NS2, NS3, OMNeT++), or real-world testbeds are needed for
reliable comparisons and validation.

Lastly, the potential of emerging methods—such as quantum-inspired algorithms, machine learning-


enhanced optimizers, and interactive MOO approaches—is not fully tapped. Integrating these
advanced tools with simulation environments could offer improved adaptability and scalability for
next-gen WSNs.

In summary, the paper reveals that many theoretical and practical challenges remain unaddressed in
WSN optimization. Areas such as mobility, security, multi-sink design, 3D/underwater contexts, energy
harvesting, hybrid algorithms, and holistic evaluation need focused attention. Bridging these gaps can
lead to smarter, more resilient WSN systems ready for complex real-world applications.

6. Analysis Parameters with Explanations:


Optimizing Wireless Sensor Networks (WSNs) requires careful consideration of multiple performance
parameters that reflect the network's efficiency, reliability, and adaptability. In multi-objective
optimization (MOO), especially using nature-inspired algorithms, selecting the right set of parameters
is essential to balance competing goals.

Coverage is a foundational metric, representing the portion of the monitored area effectively sensed
by nodes. High coverage ensures no blind spots, which is crucial in surveillance, environmental
monitoring, or disaster detection. Optimizing coverage involves activating the minimal number of
nodes necessary to monitor an area, often using probabilistic or geometric models to conserve energy
while maintaining sensing quality.

Energy consumption is typically the most critical parameter. Sensor nodes are usually battery-powered
and deployed in hard-to-reach areas, so energy-efficient operation is key to prolonging network
lifetime. Most energy is consumed during data transmission, making routing and clustering decisions
vital. Algorithms often use energy-aware clustering by choosing cluster heads based on residual energy
and location to reduce transmission costs.

Network lifetime refers to how long the network remains operational. It is assessed through metrics
like the first node death (FND), half node death (HND), or last node death (LND). Prolonging lifetime
involves load balancing to ensure energy is used uniformly across nodes, preventing premature failure
near sinks due to traffic overload.

Latency or end-to-end delay is crucial for real-time applications. It measures the time taken for data
to travel from the sensor node to the sink. However, minimizing latency can conflict with energy saving
since faster data transmission may drain power quicker. Optimization must strike a balance using
intelligent scheduling and energy-aware routing.

Data aggregation helps reduce redundant transmissions in dense networks. It consolidates data at
intermediate nodes, improving energy efficiency and reducing congestion. However, improper
aggregation can delay information or degrade data quality. Optimization algorithms must carefully
select when and where to aggregate data for optimal performance.

Reliability and fault tolerance are vital in hostile environments. Reliable WSNs maintain consistent
communication even with node failures, using backup paths or redundant nodes. Optimization may
include fault-aware routing strategies to ensure robust data delivery under uncertain conditions.

Scalability indicates how well the network performs as node numbers or area size grow. Scalable
solutions are essential for large-scale deployments like smart cities or agriculture. Optimized networks
handle growth through adaptive clustering, distributed control, and efficient routing protocols.

Emerging parameters include trust and security, especially in sensitive domains like military or
healthcare. Trust-based optimization avoids malicious nodes, while security-aware metrics incorporate
encryption overhead or abnormal behaviour detection, balancing safety with resource efficiency.

Congestion control and queue management ensure smooth data flow, preventing packet loss due to
overloaded buffers. Algorithms may adjust transmission rates or reroute traffic dynamically to
maintain throughput and avoid delays in high-traffic conditions.
Lastly, the accuracy of optimization algorithms is evaluated through indicators like the average
distance to the ideal solution (ADi), showing how close results are to the Pareto front. Simulations
using tools like NS2 measure metrics such as residual energy, packet delivery ratio, throughput, and
delay, helping validate algorithm effectiveness under realistic conditions.

In conclusion, performance parameters guide the development of balanced, adaptive, and efficient
WSN optimization strategies. Each metric addresses a unique network concern, and their
interdependence forms the crux of multi-objective optimization. Choosing the right combination of
parameters is essential for achieving practical and high-performing WSN designs across diverse
application scenarios.

7. Research Paper Shortcomings:


Despite offering a broad overview of nature-inspired meta-heuristic techniques for multi-objective
optimization (MOO) in Wireless Sensor Networks (WSNs), the reviewed research paper presents
several notable limitations that constrain its academic and practical value.

One of the primary shortcomings is the limited incorporation of real-world simulations using tools like
NS2, which are standard for validating WSN performance. Although benchmark functions such as SCH,
ZDT1, and ZDT2 are discussed within MATLAB environments, the absence of end-to-end WSN
simulations using NS2 or similar platforms undermines the practical applicability of the proposed
algorithms. Without network-level metrics like packet delivery ratio, end-to-end delay, or node
lifetime, the paper lacks empirical grounding that would otherwise validate theoretical results in
realistic network conditions.

Another key issue is the absence of a standardized evaluation framework. The paper examines several
algorithms—including NSGA-II, MOPSO, and BAS variants—but fails to consistently apply performance
metrics like energy efficiency, coverage, or convergence speed across all techniques. This inconsistency
makes it difficult for readers to draw meaningful comparisons. A comprehensive comparative table
using uniform parameters would have added clarity and practical utility for those selecting algorithms
for specific applications.

Additionally, the level of detail in algorithm descriptions is uneven. Some methods, like MOBAS, are
explored in depth, while others receive minimal explanation or are omitted altogether, including
MOEA/D and CPMEA. This selective coverage hinders a well-rounded understanding of the field,
especially for newcomers seeking foundational insights into these algorithms and their relevance to
WSN optimization.

The paper also largely focuses on static WSNs, overlooking mobile sensor networks, which are
increasingly relevant in dynamic applications such as vehicular or wearable sensing systems. Mobility
introduces new challenges in routing and clustering, yet this dimension is barely addressed. Similarly,
security and trust—critical in applications ranging from healthcare to military—are underrepresented.
The omission of trust-aware metrics or security-driven optimization goals is a missed opportunity to
engage with pressing real-world concerns.

Furthermore, while energy efficiency is emphasized, the study overlooks emerging energy-harvesting
models. Modern WSNs often rely on renewable energy sources like solar or vibration energy, which
introduce fluctuating power profiles. Ignoring this evolution restricts the applicability of traditional
algorithms to newer sustainable WSN architectures that require adaptive, dynamic optimization
strategies.
Another notable gap is the lack of post-optimization decision-making frameworks. While MOO
algorithms produce sets of Pareto-optimal solutions, the paper does not discuss how practitioners
might choose the most suitable solution. Tools like TOPSIS, fuzzy logic, or AHP are commonly used for
this purpose, and their exclusion leaves the optimization process incomplete.

Scalability is another neglected aspect. Although algorithm efficiency is discussed, there’s little
attention given to how these algorithms perform as network size increases. The computational and
memory demands of meta-heuristics grow with the number of nodes, yet there is no analysis of time
complexity or resource overhead. This oversight is particularly relevant for large-scale deployments
where thousands of nodes may be involved.

Lastly, the paper lacks visual aids such as algorithm flowcharts or Pareto front illustrations that would
enhance comprehension. Effective graphical representation is essential in a review context to visually
communicate algorithmic behaviour and performance trade-offs, especially for researchers new to the
field.

8. Related Work with That Research Paper:


The reviewed research paper is situated within a broad and evolving academic context where Wireless
Sensor Networks (WSNs) have increasingly been optimized using multi-objective strategies. Numerous
prior works have laid the foundation for balancing competing performance objectives such as energy
efficiency, latency, and coverage. This paper contributes to that evolving discourse by consolidating a
diverse range of nature-inspired meta-heuristic algorithms for WSN optimization. To fully appreciate
its significance, however, it is essential to position it within the continuum of related studies that have
influenced this domain.

Foundational works such as those by Younis et al. (M. Younis et al., “Energy-efficient routing protocols
in wireless sensor networks: A survey,” Ad Hoc Networks, 2004) and Al-Karaki and Kamal (J. N. Al-
Karaki and A. E. Kamal, “Routing techniques in wireless sensor networks: A survey,” IEEE Wireless
Communications, 2004) primarily focused on routing protocols aimed at minimizing energy
consumption and improving network longevity. Although these studies did not adopt formal multi-
objective optimization (MOO) frameworks, they helped establish key performance parameters that
later became optimization objectives in more sophisticated algorithmic models. Their contribution lies
in defining the problem space rather than proposing solutions grounded in evolutionary or swarm
intelligence techniques.

The transition to formal MOO approaches is better exemplified in more recent surveys like that of Garg
and Bhadauria (R. Garg and H. S. Bhadauria, “Multi-objective optimization in wireless sensor
networks: A comprehensive review,” Wireless Networks, 2020), who reviewed algorithms such as
NSGA-II and SPEA2 in the context of WSNs. Their work, while similar in theme to the reviewed paper,
remained focused on traditional evolutionary algorithms and lacked consideration of newer,
unconventional strategies such as Beetle Antennae Search (BAS) and its variants. Moreover, although
they discussed algorithm classification and evaluation metrics, their treatment of practical
implementation via simulation environments was limited—an area where the reviewed paper
attempts to provide more contextual insight through mentions of MATLAB and NS2.

The relevance of bio-inspired security-oriented optimization is highlighted in studies like that of


Sharma et al. (K. Sharma et al., “Learning automata-based multi-objective optimization for WSN
coverage and energy balance,” 2018), which explored trust-aware routing protocols using swarm
intelligence. This contrasts with the reviewed paper’s relatively limited attention to security as an
optimization parameter. While the reviewed study acknowledges security as a future direction, it lacks
mathematical modelling or empirical analysis of trust-related metrics within MOO frameworks,
underscoring a missed opportunity to delve into one of the field’s more critical contemporary
challenges.

In terms of algorithm implementation, works by Rasheed et al. (M. Z. Rasheed et al., “A multi-
objective NSGA-II algorithm for enhancing energy efficiency and QoS in WSNs,” 2017) and Sharma et
al. demonstrate the utility of integrating NSGA-II within simulation environments like NS2, targeting
parameters such as ETX, delay, and energy balance. These studies go beyond theoretical benchmark
analysis to validate algorithmic performance under realistic conditions, thereby bridging the gap
between simulation and real-world deployment. Their hybrid approaches, combining methods like
Learning Automata with NSGA-II, illustrate the advantages of algorithmic fusion—an area the reviewed
paper identifies but does not explore in depth.

Ant Colony Optimization (ACO) also features prominently in the literature, particularly in trust-aware
routing. Khan et al.'s (S. Khan et al., “Trust-aware multi-objective ant colony optimization routing
protocol in WSNs,” 2019) development of the MOACO protocol exemplifies how multi-objective
frameworks can integrate both energy and security metrics and be evaluated in NS2 simulations.
Although the reviewed paper touches on swarm-based versatility, it does not replicate such detailed
empirical validations, relying instead on literature synthesis and theoretical performance benchmarks.

Energy sustainability, particularly via harvesting mechanisms, is another growing trend. Mishra and
Sahu (S. Mishra et al., “A multi-objective GA for lifetime and coverage optimization in 3D WSNs,”
Wireless Networks, 2021) examined adaptive routing protocols for energy-harvesting WSNs,
emphasizing the need for dynamic optimization strategies that respond to fluctuating energy inflows
from environmental sources. Though the reviewed paper acknowledges this area, it does not engage
with it in sufficient depth, which limits its applicability to modern WSNs that leverage renewable
energy technologies.

The practical significance of simulation tools like NS2, NS3, OMNeT++, and COOJA has been
emphasized in reviews by Boulis (A. Boulis et al., “Castalia: A simulator for WSNs based on
OMNET++,” 2007), who catalog his capabilities in validating WSN protocols. These studies underscore
the importance of simulation environments in testing the scalability and realism of optimization
models. While the reviewed paper refers to such tools, particularly NS2, it does not integrate
simulation results directly, somewhat weakening its empirical foundation. Nonetheless, the paper
does encourage future researchers to pursue such validations, highlighting simulation as a critical path
forward.

Ultimately, the reviewed paper carves out a unique space in the literature by synthesizing a wide range
of algorithmic approaches for MOO in WSNs. Its comparative analysis of NSGA-II, MOPSO, and MOBAS
through benchmark functions, along with its classification of algorithms based on biological
inspiration, distinguishes it from earlier surveys. While it falls short in empirical depth and omits
emerging algorithms and hybrid models, it succeeds in consolidating and systematizing existing
knowledge, providing a valuable springboard for further investigation. Its contribution is thus twofold:
retrospective, as a summary of existing strategies, and prospective, in its identification of gaps and
directions for future research—including mobility, security integration, hybridization, and simulation-
based validation. This dual perspective enhances its relevance in the ongoing quest to develop robust,
efficient, and scalable optimization solutions for the next generation of wireless sensor networks.

9. Surveys Related to the Research Paper:


The research paper under review stands on the shoulders of numerous comprehensive surveys that
have explored multi-objective optimization (MOO) in Wireless Sensor Networks (WSNs) using nature-
inspired meta-heuristic algorithms. These surveys have examined a wide range of optimization goals
and algorithmic strategies, thus shaping the context within which the current paper operates. One of
the most directly relevant works is by Kaur and Kaur (2022) [1], who provided a focused analysis of
MOO techniques applied to WSNs. Their study emphasizes the use of hybrid algorithms and explores
classical optimization techniques like Genetic Algorithms (GA), Particle Swarm Optimization (PSO), Ant
Colony Optimization (ACO), and Differential Evolution (DE). While their approach aligns with the
reviewed paper's thematic focus, it lacks inclusion of lightweight and recently proposed algorithms like
Beetle Antennae Search (BAS), which the reviewed paper explores in detail. This distinction positions
the reviewed study as a more updated contribution, addressing the growing need for energy-efficient
algorithms in low-power WSNs.

Further adding to the foundational understanding is the survey conducted by Arjunan and Sujatha
(2019) [2], which discusses energy-efficient coverage protocols with an emphasis on deployment
strategies and spatial optimization. Although their work predominantly deals with single-objective
formulations, it offers critical insights into sensor coverage models, which are often restructured under
multi-objective frameworks in more recent research. Their work serves as a valuable background for
conceptualizing coverage optimization, a core objective in WSN design that remains central to the
reviewed paper’s discussion of MOO strategies.

Security-aware optimization has emerged as another significant theme in WSN surveys. Sharma et al.
(2019) [3] contributed to this area with their comprehensive exploration of secure and energy-efficient
WSN frameworks, emphasizing the potential of bio-inspired algorithms in supporting intrusion
detection, trust management, and secure routing. These elements are not deeply explored in the
reviewed paper, but it does acknowledge the need for incorporating security as a multi-objective
component. By identifying this as a future direction, the reviewed paper aligns with Sharma et al.’s
perspective and emphasizes the growing consensus that security must be considered alongside
traditional performance metrics in WSN optimization.

Gupta and Jaiswal (2020) [4] offer another influential survey by benchmarking several evolutionary
algorithms used in MOO for WSNs. Their evaluation of NSGA-II, MOPSO, SPEA2, and MOEA/D across
metrics such as coverage, delay, and energy efficiency provide a comprehensive reference point for
comparative algorithmic analysis. The reviewed paper builds upon this benchmarking tradition but
introduces newer approaches like MOBAS and BAS variants, thereby offering an updated algorithmic
landscape. This expansion not only enhances the practical utility of the study but also contributes to
ongoing efforts to modernize MOO toolkits for WSNs.

Energy harvesting represents a newer domain in WSN optimization, and Mishra and Sahu (2021) [5]
examine how protocols must adapt to dynamic energy sources such as solar and wind. Their work
outlines how optimization algorithms must evolve to consider fluctuating energy availability,
incorporating adaptive mechanisms to deal with such variability. Although the reviewed paper touches
briefly on energy harvesting as a promising research direction, it does not go into depth regarding the
algorithmic models or protocol designs necessary for integrating real-time energy inflows. Mishra and
Sahu’s findings thus fill a vital knowledge gap and offer a natural extension for future work hinted at in
the reviewed study.

Saxena and Singh (2023) [6] introduce a survey that expands the meta-heuristic spectrum by including
newer, rapidly evolving algorithms such as Whale Optimization Algorithm (WOA), Salp Swarm
Algorithm (SSA), and Grey Wolf Optimizer (GWO). These methods have garnered attention for their
superior convergence behaviour and ease of implementation. The reviewed paper shares a similar goal
of expanding the algorithmic base for WSN MOO problems, although it stops short of a detailed
examination of these specific techniques. Integrating such modern algorithms into future comparative
frameworks would further enrich the reviewed paper’s already robust analysis.

Practical validation through simulation is another crucial area explored in recent surveys. Yadav and
Tiwari (2023) [7] provide a survey focused on simulation-based evaluations of WSN protocols,
particularly those utilizing meta-heuristic optimization. Their emphasis on tools like NS2 and MATLAB
for performance testing mirrors the reviewed paper’s suggestion that simulation-based validation is
necessary for verifying algorithmic effectiveness. While the reviewed study discusses such tools, it
does not integrate simulations into its evaluation strategy. This omission presents an opportunity for
future research to bridge the gap between theoretical and applied optimization.

Adding further relevance is the recent work by Khan et al. (2024) [8], which investigates trust-aware
MOO frameworks. By incorporating metrics such as energy, trust, and delay into a unified model and
testing these strategies using NS2 and OMNeT++, they provide concrete examples of how integrated
objectives can be implemented and validated in real network conditions. This work reinforces the
reviewed paper’s call for expanding MOO objectives beyond energy and coverage to include
trustworthiness and resilience. The reviewed paper’s identification of this gap, alongside Khan et al.'s
execution, marks a critical convergence in ongoing WSN optimization research.

Finally, the survey by Sahu and Tripathy (2021) [9] contributes a structured taxonomy of swarm
intelligence algorithms used in WSN design. Their categorization based on biological inspiration aligns
closely with the reviewed paper’s organization, which segments algorithms into evolutionary, swarm-
based, and physics-inspired types. This structural similarity reflects an emerging consensus in the field
regarding how best to classify and compare optimization techniques, further validating the reviewed
paper’s methodological approach.

In aggregate, these surveys provide a comprehensive backdrop against which the reviewed paper
positions itself. They help contextualize its contributions, particularly in emphasizing lightweight
optimization strategies, Pareto-based trade-offs, and underexplored areas such as mobility, simulation,
and security. The reviewed paper distinguishes itself by updating the algorithmic repertoire to include
newer methods like BAS, expanding objective functions beyond classical metrics, and suggesting
practical future directions. Rather than merely replicating prior work, it synthesizes and extends
existing knowledge, serving as both a continuation of the field’s scholarly tradition and a roadmap for
future innovations in WSN multi-objective optimization.

[1] Kaur, A., & Kaur, N. (2022)

Title: Survey on multi-objective optimization using meta-heuristic techniques in WSNs


Source: Wireless Personal Communications

[2] Arjunan, B., & Sujatha, P. (2019)

Title: A survey on energy-efficient coverage protocols in wireless sensor networks


Source: Wireless Networks

[3] Sharma, V., You, I., et al. (2019)

Title: Secure and energy-efficient frameworks for WSNs using bio-inspired optimization: A survey
Source: IEEE Access
[4] Gupta, S., & Jaiswal, S. (2020)

Title: A recent review on multi-objective optimization using meta-heuristics for WSNs


Source: Journal of King Saud University – Computer and Information Sciences

[5] Mishra, S., & Sahu, S. (2021)

Title: A survey on energy-efficient protocols and metaheuristic techniques in WSNs


Source: Journal of Ambient Intelligence and Humanized Computing

[6] Saxena, S., & Singh, A. (2023)

Title: Emerging trends in meta-heuristic algorithms for WSN optimization: A contemporary survey
Source: Applied Soft Computing

[7] Yadav, K., & Tiwari, R. (2023)

Title: Simulation-based evaluation of meta-heuristic protocols in WSNs: An empirical survey


Source: Journal of Supercomputing

[8] Khan, M., et al. (2024)

Title: Recent advances in security-aware multi-objective optimization for wireless sensor networks
Source: Computer Communications

[9] Sahu, P., & Tripathy, A. (2021)

Title: Role of swarm intelligence in optimizing WSN design: A modern review


Source: Ad Hoc Networks

You might also like