MC File Final
MC File Final
Mobile Computing
(ITMDE01)
Master of Technology
In
By
KSHITIJ SHARMA
2024PMN4205
Master of Technology
In
By
BHUPESH SINGH
2024PMN4216
Master of Technology
In
By
MAYANK SINGH
2024PMN4215
1
S NO TITLE DATE SIGN
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.
• 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
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
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
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
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
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
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
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
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
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
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
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
26
138
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
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
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
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
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:
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
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
– 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
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
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
– 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
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:
51
Simulation initialize
Starting
52
Simulation Complete
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
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
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:
60
Simulation initialize
Starting
61
Running
Simulation complete
62
No of Control packets 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
Gunjan1
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.
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
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.
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].
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.
123
A Review on Multi-objective Optimization in Wireless... 2591
123
2592 Gunjan
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
Sensor
Memory
123
A Review on Multi-objective Optimization in Wireless... 2593
Tracking Monitoring
Environment
Health
Environmental
Patient Monitoring
Monitoring
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
123
2594 Gunjan
• 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
energy consumption
ion f t tolerance
faul
load balancing
• 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.
123
A Review on Multi-objective Optimization in Wireless... 2597
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.
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
Next Generation
(Create 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
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
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
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.
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
123
2604 Gunjan
Table 1 continued
Article Technical Objective Algorithm Simulation Tool
task/Output
123
A Review on Multi-objective Optimization in Wireless... 2605
Table 1 continued
Article Technical Objective Algorithm Simulation Tool
task/Output
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
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
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
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
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.
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.
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.
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
• Identify research gaps and suggest promising directions for future exploration.
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.
Subject to constraints:
Explanation:
• 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.
• 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.
Explanation:
• This transformation simplifies algorithm design since many MOO algorithms are tailored for
minimization.
Explanation:
• Efs , Emp : Amplification energy for short and long distances, respectively
This piecewise function reflects the radio energy model often used in WSN simulations.
cov = max(min(dm,n))
Explanation:
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:
• 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.
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.
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.
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.
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.
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.
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.
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.
Title: Secure and energy-efficient frameworks for WSNs using bio-inspired optimization: A survey
Source: IEEE Access
[4] Gupta, S., & Jaiswal, S. (2020)
Title: Emerging trends in meta-heuristic algorithms for WSN optimization: A contemporary survey
Source: Applied Soft Computing
Title: Recent advances in security-aware multi-objective optimization for wireless sensor networks
Source: Computer Communications