Wireless Sensor Network
VerifiedAdded on  2023/03/17
|30
|4941
|52
AI Summary
This document provides an introduction to wireless sensor networks and discusses their design, simulation, and analysis. It explores the use of the DSDV and AODV routing protocols and their impact on energy consumption. The document also offers study material and solved assignments on wireless sensor networks available at Desklib.
Contribute Materials
Your contribution can guide someone’s learning journey. Share your
documents today.
Wireless Sensor Network
Student Name
College
Student Name
College
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
Introduction
In PC systems, remote systems can be characterized as a field that is worried about the interconnection
of medium less nodes. Remote PC systems reenactment can be accomplished by the utilization of the
NS-3 or NS-2 reproduction devices that function admirably in a Linux domain [1]. Be that as it may, they
can be utilized in the windows condition with the guide of the NSG2-1 and NAM instrument. The
instruments offer an incredible virtual condition to make organizes before physical usage.
Wireless Network Design
A basic plan of a system is accomplished with the guide of a structure instrument; NAM device. The
apparatus is helpful in both the following and reenactment of packets over a system. Reenactment is
done after the system plan that is accomplished with the guide of an uncommon programming (NetSim
programming) and sparing the tlc. Another apparatus; Cygwin, is utilized to think of the fundamental
directions required in producing the nam and tr file[2]. A NAM apparatus can be utilized to open and
adjust the nam record . The substance of the nam record is the recreations and the method utilized in
planning the product.
The image underneath is a portrayal of a system configuration before being reproduced and vivified by a
reenactment device.
After the system has be structured , the plan is spared as a nam record. This record is then opened
utilizing a NAM apparatus. The structure is shown int the NAM instrument as outlined underneath.
In PC systems, remote systems can be characterized as a field that is worried about the interconnection
of medium less nodes. Remote PC systems reenactment can be accomplished by the utilization of the
NS-3 or NS-2 reproduction devices that function admirably in a Linux domain [1]. Be that as it may, they
can be utilized in the windows condition with the guide of the NSG2-1 and NAM instrument. The
instruments offer an incredible virtual condition to make organizes before physical usage.
Wireless Network Design
A basic plan of a system is accomplished with the guide of a structure instrument; NAM device. The
apparatus is helpful in both the following and reenactment of packets over a system. Reenactment is
done after the system plan that is accomplished with the guide of an uncommon programming (NetSim
programming) and sparing the tlc. Another apparatus; Cygwin, is utilized to think of the fundamental
directions required in producing the nam and tr file[2]. A NAM apparatus can be utilized to open and
adjust the nam record . The substance of the nam record is the recreations and the method utilized in
planning the product.
The image underneath is a portrayal of a system configuration before being reproduced and vivified by a
reenactment device.
After the system has be structured , the plan is spared as a nam record. This record is then opened
utilizing a NAM apparatus. The structure is shown int the NAM instrument as outlined underneath.
A packet information is sent from one node as it is received by another. This denotes the start of the
reproduction. This is appeared as follows.
A receiver can receive information from one node as well as many. The figure beneath demonstrates this
idea.
reproduction. This is appeared as follows.
A receiver can receive information from one node as well as many. The figure beneath demonstrates this
idea.
Simulation
Utilization of energy happens at a point/node where information is being sent from, on the grounds that
recreation happens at energy model. Energy utilization incredibly depends on the chose protocol for
routing. As referenced before, the chose protocols are the AODV and DSDV routing protocols. 20 nodes
are accessible for reenactment and can work for around five minutes before ceasing. The following is an
image showing the condition and how the recreation conduct at different timeframes ( 50sec,250sec and
500sec)in line with the routing protocols [3].
Utilization of energy happens at a point/node where information is being sent from, on the grounds that
recreation happens at energy model. Energy utilization incredibly depends on the chose protocol for
routing. As referenced before, the chose protocols are the AODV and DSDV routing protocols. 20 nodes
are accessible for reenactment and can work for around five minutes before ceasing. The following is an
image showing the condition and how the recreation conduct at different timeframes ( 50sec,250sec and
500sec)in line with the routing protocols [3].
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
DSDV routing protocol
This is the showcase at 50 seconds by a DSDV protocol
As appeared, packets are being sent starting with one point then onto the next. The nodes are believed
to move from their unique position as delineated by node 20 which movements to a substitute position
of specialist getting node 4. As packets and information are being sent and received, an energy lose
happens at the nodes. It is seen that there is an impact between two nodes; 11 and 16 and the node
number 3. This is basically in light of the fact that we set the route indicates for these nodes that of node
number 3. It is consistent with state that amid the 50 seconds reproduction, there is a finished exchange
of packets of information with an equivalent loss of energy[4].
This is the showcase at 50 seconds by a DSDV protocol
As appeared, packets are being sent starting with one point then onto the next. The nodes are believed
to move from their unique position as delineated by node 20 which movements to a substitute position
of specialist getting node 4. As packets and information are being sent and received, an energy lose
happens at the nodes. It is seen that there is an impact between two nodes; 11 and 16 and the node
number 3. This is basically in light of the fact that we set the route indicates for these nodes that of node
number 3. It is consistent with state that amid the 50 seconds reproduction, there is a finished exchange
of packets of information with an equivalent loss of energy[4].
The following is a screen capture that demonstrates the recreation state in a DSDV protocol at 150
seconds of DSDV with the guide of a NAM device.
As showed above, at 150 seconds packets of information transmission rate has diminished.
Notwithstanding, packets are as yet being sent and received. Development of nodes from a point to
another has ceased. Energy levels have dropped at all the nodes. Be that as it may, the energy level is
still over 30J. The underlying energy was double the present energy.
seconds of DSDV with the guide of a NAM device.
As showed above, at 150 seconds packets of information transmission rate has diminished.
Notwithstanding, packets are as yet being sent and received. Development of nodes from a point to
another has ceased. Energy levels have dropped at all the nodes. Be that as it may, the energy level is
still over 30J. The underlying energy was double the present energy.
At around 250 seconds of recreation utilizing the DSDV protocol, the image shows what is watched
A further decrease of energy from 30 joules to 29 joules causes a noteworthy decrease in the rate of
sending and accepting of information packets. An adjustment in shading in the vast majority of the nodes
is an unmistakable sign of this. As the energy being expended at every node drops to half of the
underlying energy, the nodes swing to yellow. Its sister imperative to take note of that at this dimension
none of the nodes have totally lost their energy [5].
A further decrease of energy from 30 joules to 29 joules causes a noteworthy decrease in the rate of
sending and accepting of information packets. An adjustment in shading in the vast majority of the nodes
is an unmistakable sign of this. As the energy being expended at every node drops to half of the
underlying energy, the nodes swing to yellow. Its sister imperative to take note of that at this dimension
none of the nodes have totally lost their energy [5].
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
AODV routing protocol
The following is a screen capture demonstrating the reenactment condition of the nodes at 50 seconds
utilizing the AODV routing protocol.
At this timeframe, a more prominent exchange of information packets move is seen in the start of the 5
seconds of the reproduction. After this greatest development of packets of information, it is seen that
nodes started moving as 20 nodes move toward the invalid 4 node. For our situation, this node is the
receiver operator. Correspondingly, an impact happens at node 3 as two nodes, 11 and 16 moved
towards it. This is happening in the range of the second 5 seconds that is between the fifth and tenth
seconds. No development of nodes and packets are sent or received after the tenth second.
The following is a screen capture demonstrating the reenactment condition of the nodes at 50 seconds
utilizing the AODV routing protocol.
At this timeframe, a more prominent exchange of information packets move is seen in the start of the 5
seconds of the reproduction. After this greatest development of packets of information, it is seen that
nodes started moving as 20 nodes move toward the invalid 4 node. For our situation, this node is the
receiver operator. Correspondingly, an impact happens at node 3 as two nodes, 11 and 16 moved
towards it. This is happening in the range of the second 5 seconds that is between the fifth and tenth
seconds. No development of nodes and packets are sent or received after the tenth second.
The following is a screen capture that demonstrates the AODV routing protocol state at 150 seconds.
It is seen that, no exchange of information packets occurs at this period. Exchange and accepting of
packets occurred in the start of the reproduction (5 seconds). Correspondingly, no development of nodes
was experienced. There was no energy utilization amid this period (50-150 seconds) of reproduction.
This is because of no packets exchange or getting nor development of nodes [6].
It is seen that, no exchange of information packets occurs at this period. Exchange and accepting of
packets occurred in the start of the reproduction (5 seconds). Correspondingly, no development of nodes
was experienced. There was no energy utilization amid this period (50-150 seconds) of reproduction.
This is because of no packets exchange or getting nor development of nodes [6].
The following is a screen capture that shows the AODV routing protocol state as at 250 seconds.
Like the 150 seconds time frame, no exchange of packets and the nodes did not move their positions as
well. Zero exercises and procedures occurred. The entire exercises in recreation of AODV occurred amid
the start of the reenactment, that the initial 5 seconds.
Analysis of trace files
DSDV routing Protocol
In accordance with the follow document, as the reenactment started the absolute first message is sent
by node o at 0.004166565 seconds. With the principal energy level being 60 joules. An energy misfortune
happens at precisely 0.004262 second a period at which all nodes experience an energy misfortune. This
is logical on the grounds that it's the phase at which packets of information are being sent as different
nodes receive these packets.
There's an equivalent information sending amid the recreation utilizing the DSDV routing protocol.
Information sending is done each second which clarifies the loss of energy consistently all through the
reenactment. AS recorded by the follow document, a more noteworthy sending of packets is seen in the
initial 50 seconds.
Essentially, information packets gathering was additionally uniform in the 300 seconds of reproduction.
Packets being sent were to be received by invalid 4 and 3 operators of gathering [7].
Like the 150 seconds time frame, no exchange of packets and the nodes did not move their positions as
well. Zero exercises and procedures occurred. The entire exercises in recreation of AODV occurred amid
the start of the reenactment, that the initial 5 seconds.
Analysis of trace files
DSDV routing Protocol
In accordance with the follow document, as the reenactment started the absolute first message is sent
by node o at 0.004166565 seconds. With the principal energy level being 60 joules. An energy misfortune
happens at precisely 0.004262 second a period at which all nodes experience an energy misfortune. This
is logical on the grounds that it's the phase at which packets of information are being sent as different
nodes receive these packets.
There's an equivalent information sending amid the recreation utilizing the DSDV routing protocol.
Information sending is done each second which clarifies the loss of energy consistently all through the
reenactment. AS recorded by the follow document, a more noteworthy sending of packets is seen in the
initial 50 seconds.
Essentially, information packets gathering was additionally uniform in the 300 seconds of reproduction.
Packets being sent were to be received by invalid 4 and 3 operators of gathering [7].
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Energy misfortune was experienced all through the entire procedure. The energy was lost to a large
portion of the underlying at around 250 seconds, that is from 60 joules to just 30 joules of energy. This
delineates the procedure was methodical and uniform.
An expanded development of nodes and crash at different indicates by nodes drove the drop of packets
in the initial 50 seconds. To be increasingly precise a more prominent drop of packets is seen in the
following 5 seconds (fifth second to tenth second) as an ever increasing number of nodes moved their
positions.
AODV routing Protocol
This protocol somewhat fluctuates from the DSDV routing protocol as far as sending and getting of
information, packets dropping and utilization of energy.
Sending of packets of information happens in the initial couple of moments; 5 seconds. It is detectable
that packets of information are hugely sent from nodes to nodes amid this extremely brief period, after
which information was not being sent at all [8].
So also, the gathering of information is seen in a similar initial 5 seconds of reproduction. This is a similar
time at which information is being sent from different nodes to the required receiver nodes. This is the
reason with respect to why information gathering happens amid this stage. Information sending and
gathering does not happen after the fifth second; no information can be followed from the fifth seconds
to 300 seconds where the reenactment closes [8].
An enormous dropping of packets occurs amid the initial ten seconds. Additional dropping of packets
occurs amid the initial couple of minutes where an expanded packets exchange is experienced. There's a
decrease in the rate of dropping packets as the exchange of packets stops [9].
portion of the underlying at around 250 seconds, that is from 60 joules to just 30 joules of energy. This
delineates the procedure was methodical and uniform.
An expanded development of nodes and crash at different indicates by nodes drove the drop of packets
in the initial 50 seconds. To be increasingly precise a more prominent drop of packets is seen in the
following 5 seconds (fifth second to tenth second) as an ever increasing number of nodes moved their
positions.
AODV routing Protocol
This protocol somewhat fluctuates from the DSDV routing protocol as far as sending and getting of
information, packets dropping and utilization of energy.
Sending of packets of information happens in the initial couple of moments; 5 seconds. It is detectable
that packets of information are hugely sent from nodes to nodes amid this extremely brief period, after
which information was not being sent at all [8].
So also, the gathering of information is seen in a similar initial 5 seconds of reproduction. This is a similar
time at which information is being sent from different nodes to the required receiver nodes. This is the
reason with respect to why information gathering happens amid this stage. Information sending and
gathering does not happen after the fifth second; no information can be followed from the fifth seconds
to 300 seconds where the reenactment closes [8].
An enormous dropping of packets occurs amid the initial ten seconds. Additional dropping of packets
occurs amid the initial couple of minutes where an expanded packets exchange is experienced. There's a
decrease in the rate of dropping packets as the exchange of packets stops [9].
Results
The outline underneath speaks to an investigation of information of the DSDV routing protocol in
accordance with packets of information sent, received, dropped, and utilization of energy.
The outline underneath speaks to an investigation of information in an AODV routing protocol as far as
the packets of information being received, sent, dropped and utilization of energy.
Conclusion
As appeared in the examination above, it is consistent with infer that;
The outline underneath speaks to an investigation of information of the DSDV routing protocol in
accordance with packets of information sent, received, dropped, and utilization of energy.
The outline underneath speaks to an investigation of information in an AODV routing protocol as far as
the packets of information being received, sent, dropped and utilization of energy.
Conclusion
As appeared in the examination above, it is consistent with infer that;
The DSDV protocol is a routing protocol to be utilized to get quick and equivalent/uniform information
sending and getting. DSDV has a higher utilization of energy when contrasted with AODV therefore this
settles on AODV a superior decision regarding rapid exchange of information with restricted a
constrained energy task at every node [9].
Energy utilization in the DSDV routing protocol amid the reenactment of information packets is higher
which is brought about by its uniform moderate information packets exchange technique.
Notwithstanding, this protocol is viewed as the best and viable method for achieving right and
dependable outcomes instead of AODV. Why? Since DSDV routing protocol has a limited information
packets dropping rate when contrasted with AODV routing protocol. AODV routing protocol exchanges
packets of information in a brief term of time which is the explanation for the expanded dropping of
packets. This makes it inadmissible with regards to accomplishing exact and expanded exchange of
information packets [10].
sending and getting. DSDV has a higher utilization of energy when contrasted with AODV therefore this
settles on AODV a superior decision regarding rapid exchange of information with restricted a
constrained energy task at every node [9].
Energy utilization in the DSDV routing protocol amid the reenactment of information packets is higher
which is brought about by its uniform moderate information packets exchange technique.
Notwithstanding, this protocol is viewed as the best and viable method for achieving right and
dependable outcomes instead of AODV. Why? Since DSDV routing protocol has a limited information
packets dropping rate when contrasted with AODV routing protocol. AODV routing protocol exchanges
packets of information in a brief term of time which is the explanation for the expanded dropping of
packets. This makes it inadmissible with regards to accomplishing exact and expanded exchange of
information packets [10].
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
References
[1]H. Karatza, "Introduction to the Special Issue: On Internet and Wireless Network Performance",
SIMULATION, vol. 82, no. 5, pp. 277-278, 2006. Available: 10.1177/0037549706068694.
[2]L. Hou, "Virtual Simulation Technology of Wireless Sensor Neural Network in Basketball Movement
Distribution", Applied Mechanics and Materials, vol. 651-653, pp. 579-583, 2014. Available:
10.4028/www.scientific.net/amm.651-653.579.
[3]Y. Xiao and H. Guo, "Coverage Model of Wireless Network Based on Computer Virtual Simulation",
Applied Mechanics and Materials, vol. 539, pp. 378-381, 2014. Available:
10.4028/www.scientific.net/amm.539.378.
[4]G. Gautam and B. Sen, "Design and Simulation of Wireless Sensor Network in NS2", International
Journal of Computer Applications, vol. 113, no. 16, pp. 14-16, 2015. Available: 10.5120/19910-2018.
[5]L. Zhang and L. Wang, "Industrial Monitoring Wireless Sensor Network Routing Algorithm and
Simulation", Advanced Materials Research, vol. 457-458, pp. 1149-1154, 2012. Available:
10.4028/scientific5/amr.457-458.1149.
[6]"CSEE 4240 Wireless Sensor Networks - University of Georgia". [Online]. Available:
http://sensorweb.engr.uga.edu/index.php/csee-4240-wireless-sensor-networks/. [Accessed: 03- May-
2019].
[10]A. Rozali, R. Stewart and S. Kennedy, "A Simulation Study of Wireless Network Performance",
Applied Mechanics and Materials, vol. 679, pp. 176-183, 2014. Available:
10.4028/www.scientific.net/amm.679.176.
[8]"Wireless Sensor Network Market Report - Forecast to 2022 ...". [Online]. Available:
https://www.marketresearchfuture.com/reports/wireless-sensor-network-market-1805. [Accessed: 03-
May- 2019].
[9]J. Short, R. Bagrodia and L. Kleinrock, "Mobile wireless network system simulation", Wireless
Networks, vol. 1, no. 4, pp. 451-467, 2012. Available: 10.1007/bf01985756.
[10]"Wireless Sensor Networks | LORD Sensing Systems". [Online]. Available:
https://www.microstrain.com/wireless. [Accessed: 2019].
[1]H. Karatza, "Introduction to the Special Issue: On Internet and Wireless Network Performance",
SIMULATION, vol. 82, no. 5, pp. 277-278, 2006. Available: 10.1177/0037549706068694.
[2]L. Hou, "Virtual Simulation Technology of Wireless Sensor Neural Network in Basketball Movement
Distribution", Applied Mechanics and Materials, vol. 651-653, pp. 579-583, 2014. Available:
10.4028/www.scientific.net/amm.651-653.579.
[3]Y. Xiao and H. Guo, "Coverage Model of Wireless Network Based on Computer Virtual Simulation",
Applied Mechanics and Materials, vol. 539, pp. 378-381, 2014. Available:
10.4028/www.scientific.net/amm.539.378.
[4]G. Gautam and B. Sen, "Design and Simulation of Wireless Sensor Network in NS2", International
Journal of Computer Applications, vol. 113, no. 16, pp. 14-16, 2015. Available: 10.5120/19910-2018.
[5]L. Zhang and L. Wang, "Industrial Monitoring Wireless Sensor Network Routing Algorithm and
Simulation", Advanced Materials Research, vol. 457-458, pp. 1149-1154, 2012. Available:
10.4028/scientific5/amr.457-458.1149.
[6]"CSEE 4240 Wireless Sensor Networks - University of Georgia". [Online]. Available:
http://sensorweb.engr.uga.edu/index.php/csee-4240-wireless-sensor-networks/. [Accessed: 03- May-
2019].
[10]A. Rozali, R. Stewart and S. Kennedy, "A Simulation Study of Wireless Network Performance",
Applied Mechanics and Materials, vol. 679, pp. 176-183, 2014. Available:
10.4028/www.scientific.net/amm.679.176.
[8]"Wireless Sensor Network Market Report - Forecast to 2022 ...". [Online]. Available:
https://www.marketresearchfuture.com/reports/wireless-sensor-network-market-1805. [Accessed: 03-
May- 2019].
[9]J. Short, R. Bagrodia and L. Kleinrock, "Mobile wireless network system simulation", Wireless
Networks, vol. 1, no. 4, pp. 451-467, 2012. Available: 10.1007/bf01985756.
[10]"Wireless Sensor Networks | LORD Sensing Systems". [Online]. Available:
https://www.microstrain.com/wireless. [Accessed: 2019].
Appendix
SimDSDV.tcl File
# This script is created by NSG2 beta1
# <http://wushoupong.googlepages.com/nsg>
#===================================
# Simulation parameters setup
#===================================
set val(chan) Channel/WirelessChannel ;# channel type
set val(prop) Propagation/TwoRayGround ;# radio-propagation model
set val(netif) Phy/WirelessPhy ;# network interface type
set val(mac) Mac/802_11 ;# MAC type
set val(ifq) Queue/DropTail/PriQueue ;# interface queue type
set val(ll) LL ;# link layer type
set val(ant) Antenna/OmniAntenna ;# antenna model
set val(ifqlen) 50 ;# max packet in ifq
set val(nn) 21 ;# number of mobilenodes
set val(rp) DSDV ;# routing protocol
set val(x) 1000 ;# X dimension of topography
set val(y) 678 ;# Y dimension of topography
set val(stop) 300.0 ;# time of simulation end
#===================================
# Initialization
#===================================
#Create a ns simulator
set ns [new Simulator]
#Setup topography object
set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)
create-god $val(nn)
SimDSDV.tcl File
# This script is created by NSG2 beta1
# <http://wushoupong.googlepages.com/nsg>
#===================================
# Simulation parameters setup
#===================================
set val(chan) Channel/WirelessChannel ;# channel type
set val(prop) Propagation/TwoRayGround ;# radio-propagation model
set val(netif) Phy/WirelessPhy ;# network interface type
set val(mac) Mac/802_11 ;# MAC type
set val(ifq) Queue/DropTail/PriQueue ;# interface queue type
set val(ll) LL ;# link layer type
set val(ant) Antenna/OmniAntenna ;# antenna model
set val(ifqlen) 50 ;# max packet in ifq
set val(nn) 21 ;# number of mobilenodes
set val(rp) DSDV ;# routing protocol
set val(x) 1000 ;# X dimension of topography
set val(y) 678 ;# Y dimension of topography
set val(stop) 300.0 ;# time of simulation end
#===================================
# Initialization
#===================================
#Create a ns simulator
set ns [new Simulator]
#Setup topography object
set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)
create-god $val(nn)
#Open the NS trace file
set tracefile [open SimDSDV.tr w]
$ns trace-all $tracefile
#Open the NAM trace file
set namfile [open SimDSDV.nam w]
$ns namtrace-all $namfile
$ns namtrace-all-wireless $namfile $val(x) $val(y)
set chan [new $val(chan)];#Create wireless channel
#===================================
# Mobile node parameter setup
#===================================
$ns node-config -adhocRouting $val(rp) \
-llType $val(ll) \
-macType $val(mac) \
-ifqType $val(ifq) \
-ifqLen $val(ifqlen) \
-antType $val(ant) \
-propType $val(prop) \
-phyType $val(netif) \
-channel $chan \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace ON \
-movementTrace ON
#Energy Moddel
$ns node-config -energyModel \
-rxPower .3 \
-txPower .3 \
set tracefile [open SimDSDV.tr w]
$ns trace-all $tracefile
#Open the NAM trace file
set namfile [open SimDSDV.nam w]
$ns namtrace-all $namfile
$ns namtrace-all-wireless $namfile $val(x) $val(y)
set chan [new $val(chan)];#Create wireless channel
#===================================
# Mobile node parameter setup
#===================================
$ns node-config -adhocRouting $val(rp) \
-llType $val(ll) \
-macType $val(mac) \
-ifqType $val(ifq) \
-ifqLen $val(ifqlen) \
-antType $val(ant) \
-propType $val(prop) \
-phyType $val(netif) \
-channel $chan \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace ON \
-movementTrace ON
#Energy Moddel
$ns node-config -energyModel \
-rxPower .3 \
-txPower .3 \
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
-initialEnergy 60 \
-sleepPower .5 \
-idlePower .1
#===================================
# Nodes Definition
#===================================
#Create 21 nodes
set n0 [$ns node]
$n0 set X_ 359
$n0 set Y_ 429
$n0 set Z_ 0.0
$ns initial_node_pos $n0 20
set n1 [$ns node]
$n1 set X_ 420
$n1 set Y_ 443
$n1 set Z_ 0.0
$ns initial_node_pos $n1 20
set n2 [$ns node]
$n2 set X_ 467
$n2 set Y_ 486
$n2 set Z_ 0.0
$ns initial_node_pos $n2 20
set n3 [$ns node]
$n3 set X_ 499
$n3 set Y_ 406
$n3 set Z_ 0.0
$ns initial_node_pos $n3 20
set n4 [$ns node]
$n4 set X_ 537
$n4 set Y_ 468
$n4 set Z_ 0.0
$ns initial_node_pos $n4 20
-sleepPower .5 \
-idlePower .1
#===================================
# Nodes Definition
#===================================
#Create 21 nodes
set n0 [$ns node]
$n0 set X_ 359
$n0 set Y_ 429
$n0 set Z_ 0.0
$ns initial_node_pos $n0 20
set n1 [$ns node]
$n1 set X_ 420
$n1 set Y_ 443
$n1 set Z_ 0.0
$ns initial_node_pos $n1 20
set n2 [$ns node]
$n2 set X_ 467
$n2 set Y_ 486
$n2 set Z_ 0.0
$ns initial_node_pos $n2 20
set n3 [$ns node]
$n3 set X_ 499
$n3 set Y_ 406
$n3 set Z_ 0.0
$ns initial_node_pos $n3 20
set n4 [$ns node]
$n4 set X_ 537
$n4 set Y_ 468
$n4 set Z_ 0.0
$ns initial_node_pos $n4 20
set n5 [$ns node]
$n5 set X_ 609
$n5 set Y_ 499
$n5 set Z_ 0.0
$ns initial_node_pos $n5 20
set n6 [$ns node]
$n6 set X_ 682
$n6 set Y_ 410
$n6 set Z_ 0.0
$ns initial_node_pos $n6 20
set n7 [$ns node]
$n7 set X_ 599
$n7 set Y_ 420
$n7 set Z_ 0.0
$ns initial_node_pos $n7 20
set n8 [$ns node]
$n8 set X_ 622
$n8 set Y_ 347
$n8 set Z_ 0.0
$ns initial_node_pos $n8 20
set n9 [$ns node]
$n9 set X_ 522
$n9 set Y_ 330
$n9 set Z_ 0.0
$ns initial_node_pos $n9 20
set n10 [$ns node]
$n10 set X_ 423
$n10 set Y_ 347
$n10 set Z_ 0.0
$ns initial_node_pos $n10 20
set n11 [$ns node]
$n11 set X_ 449
$n5 set X_ 609
$n5 set Y_ 499
$n5 set Z_ 0.0
$ns initial_node_pos $n5 20
set n6 [$ns node]
$n6 set X_ 682
$n6 set Y_ 410
$n6 set Z_ 0.0
$ns initial_node_pos $n6 20
set n7 [$ns node]
$n7 set X_ 599
$n7 set Y_ 420
$n7 set Z_ 0.0
$ns initial_node_pos $n7 20
set n8 [$ns node]
$n8 set X_ 622
$n8 set Y_ 347
$n8 set Z_ 0.0
$ns initial_node_pos $n8 20
set n9 [$ns node]
$n9 set X_ 522
$n9 set Y_ 330
$n9 set Z_ 0.0
$ns initial_node_pos $n9 20
set n10 [$ns node]
$n10 set X_ 423
$n10 set Y_ 347
$n10 set Z_ 0.0
$ns initial_node_pos $n10 20
set n11 [$ns node]
$n11 set X_ 449
$n11 set Y_ 260
$n11 set Z_ 0.0
$ns initial_node_pos $n11 20
set n12 [$ns node]
$n12 set X_ 595
$n12 set Y_ 218
$n12 set Z_ 0.0
$ns initial_node_pos $n12 20
set n13 [$ns node]
$n13 set X_ 675
$n13 set Y_ 272
$n13 set Z_ 0.0
$ns initial_node_pos $n13 20
set n14 [$ns node]
$n14 set X_ 724
$n14 set Y_ 343
$n14 set Z_ 0.0
$ns initial_node_pos $n14 20
set n15 [$ns node]
$n15 set X_ 754
$n15 set Y_ 445
$n15 set Z_ 0.0
$ns initial_node_pos $n15 20
set n16 [$ns node]
$n16 set X_ 693
$n16 set Y_ 526
$n16 set Z_ 0.0
$ns initial_node_pos $n16 20
set n17 [$ns node]
$n17 set X_ 605
$n17 set Y_ 578
$n17 set Z_ 0.0
$n11 set Z_ 0.0
$ns initial_node_pos $n11 20
set n12 [$ns node]
$n12 set X_ 595
$n12 set Y_ 218
$n12 set Z_ 0.0
$ns initial_node_pos $n12 20
set n13 [$ns node]
$n13 set X_ 675
$n13 set Y_ 272
$n13 set Z_ 0.0
$ns initial_node_pos $n13 20
set n14 [$ns node]
$n14 set X_ 724
$n14 set Y_ 343
$n14 set Z_ 0.0
$ns initial_node_pos $n14 20
set n15 [$ns node]
$n15 set X_ 754
$n15 set Y_ 445
$n15 set Z_ 0.0
$ns initial_node_pos $n15 20
set n16 [$ns node]
$n16 set X_ 693
$n16 set Y_ 526
$n16 set Z_ 0.0
$ns initial_node_pos $n16 20
set n17 [$ns node]
$n17 set X_ 605
$n17 set Y_ 578
$n17 set Z_ 0.0
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
$ns initial_node_pos $n17 20
set n18 [$ns node]
$n18 set X_ 504
$n18 set Y_ 565
$n18 set Z_ 0.0
$ns initial_node_pos $n18 20
set n19 [$ns node]
$n19 set X_ 399
$n19 set Y_ 560
$n19 set Z_ 0.0
$ns initial_node_pos $n19 20
set n20 [$ns node]
$n20 set X_ 305
$n20 set Y_ 519
$n20 set Z_ 0.0
$ns initial_node_pos $n20 20
#===================================
# Generate movement
#===================================
$ns at 4 " $n1 setdest 822 341 50 "
$ns at 6 " $n11 setdest 499 400 40 "
$ns at 6 " $n16 setdest 499 400 40 "
$ns at 2 " $n20 setdest 900 420 20 "
#===================================
# Agents Definition
#===================================
#Setup a UDP connection
set udp0 [new Agent/UDP]
$ns attach-agent $n20 $udp0
set null2 [new Agent/Null]
set n18 [$ns node]
$n18 set X_ 504
$n18 set Y_ 565
$n18 set Z_ 0.0
$ns initial_node_pos $n18 20
set n19 [$ns node]
$n19 set X_ 399
$n19 set Y_ 560
$n19 set Z_ 0.0
$ns initial_node_pos $n19 20
set n20 [$ns node]
$n20 set X_ 305
$n20 set Y_ 519
$n20 set Z_ 0.0
$ns initial_node_pos $n20 20
#===================================
# Generate movement
#===================================
$ns at 4 " $n1 setdest 822 341 50 "
$ns at 6 " $n11 setdest 499 400 40 "
$ns at 6 " $n16 setdest 499 400 40 "
$ns at 2 " $n20 setdest 900 420 20 "
#===================================
# Agents Definition
#===================================
#Setup a UDP connection
set udp0 [new Agent/UDP]
$ns attach-agent $n20 $udp0
set null2 [new Agent/Null]
$ns attach-agent $n15 $null2
$ns connect $udp0 $null2
$udp0 set packetSize_ 1500
#Setup a UDP connection
set udp1 [new Agent/UDP]
$ns attach-agent $n0 $udp1
set null3 [new Agent/Null]
$ns attach-agent $n14 $null3
$ns connect $udp1 $null3
$udp1 set packetSize_ 1500
#===================================
# Applications Definition
#===================================
#Setup a CBR Application over UDP connection
set cbr0 [new Application/Traffic/CBR]
$cbr0 attach-agent $udp0
$cbr0 set packetSize_ 1000
$cbr0 set rate_ 1.0Mb
$cbr0 set random_ null
$ns at 1.0 "$cbr0 start"
$ns at 2.0 "$cbr0 stop"
#Setup a CBR Application over UDP connection
set cbr1 [new Application/Traffic/CBR]
$cbr1 attach-agent $udp1
$cbr1 set packetSize_ 1000
$cbr1 set rate_ 1.0Mb
$cbr1 set random_ null
$ns at 1.0 "$cbr1 start"
$ns connect $udp0 $null2
$udp0 set packetSize_ 1500
#Setup a UDP connection
set udp1 [new Agent/UDP]
$ns attach-agent $n0 $udp1
set null3 [new Agent/Null]
$ns attach-agent $n14 $null3
$ns connect $udp1 $null3
$udp1 set packetSize_ 1500
#===================================
# Applications Definition
#===================================
#Setup a CBR Application over UDP connection
set cbr0 [new Application/Traffic/CBR]
$cbr0 attach-agent $udp0
$cbr0 set packetSize_ 1000
$cbr0 set rate_ 1.0Mb
$cbr0 set random_ null
$ns at 1.0 "$cbr0 start"
$ns at 2.0 "$cbr0 stop"
#Setup a CBR Application over UDP connection
set cbr1 [new Application/Traffic/CBR]
$cbr1 attach-agent $udp1
$cbr1 set packetSize_ 1000
$cbr1 set rate_ 1.0Mb
$cbr1 set random_ null
$ns at 1.0 "$cbr1 start"
$ns at 2.0 "$cbr1 stop"
#===================================
# Termination
#===================================
#Define a 'finish' procedure
proc finish {} {
global ns tracefile namfile
$ns flush-trace
close $tracefile
close $namfile
exec nam SimDSDV.nam &
exit 0
}
for {set i 0} {$i < $val(nn) } { incr i } {
$ns at $val(stop) "\$n$i reset"
}
$ns at $val(stop) "$ns nam-end-wireless $val(stop)"
$ns at $val(stop) "finish"
$ns at $val(stop) "puts \"done\" ; $ns halt"
$ns run
#===================================
# Termination
#===================================
#Define a 'finish' procedure
proc finish {} {
global ns tracefile namfile
$ns flush-trace
close $tracefile
close $namfile
exec nam SimDSDV.nam &
exit 0
}
for {set i 0} {$i < $val(nn) } { incr i } {
$ns at $val(stop) "\$n$i reset"
}
$ns at $val(stop) "$ns nam-end-wireless $val(stop)"
$ns at $val(stop) "finish"
$ns at $val(stop) "puts \"done\" ; $ns halt"
$ns run
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
SimAODV.tcl File
# This script is created by NSG2 beta1
# <http://wushoupong.googlepages.com/nsg>
#===================================
# Simulation parameters setup
#===================================
set val(chan) Channel/WirelessChannel ;# channel type
set val(prop) Propagation/TwoRayGround ;# radio-propagation model
set val(netif) Phy/WirelessPhy ;# network interface type
set val(mac) Mac/802_11 ;# MAC type
set val(ifq) Queue/DropTail/PriQueue ;# interface queue type
set val(ll) LL ;# link layer type
set val(ant) Antenna/OmniAntenna ;# antenna model
set val(ifqlen) 50 ;# max packet in ifq
set val(nn) 21 ;# number of mobilenodes
set val(rp) AODV ;# routing protocol
set val(x) 1000 ;# X dimension of topography
set val(y) 678 ;# Y dimension of topography
set val(stop) 300.0 ;# time of simulation end
#===================================
# Initialization
#===================================
#Create a ns simulator
set ns [new Simulator]
#Setup topography object
set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)
create-god $val(nn)
# This script is created by NSG2 beta1
# <http://wushoupong.googlepages.com/nsg>
#===================================
# Simulation parameters setup
#===================================
set val(chan) Channel/WirelessChannel ;# channel type
set val(prop) Propagation/TwoRayGround ;# radio-propagation model
set val(netif) Phy/WirelessPhy ;# network interface type
set val(mac) Mac/802_11 ;# MAC type
set val(ifq) Queue/DropTail/PriQueue ;# interface queue type
set val(ll) LL ;# link layer type
set val(ant) Antenna/OmniAntenna ;# antenna model
set val(ifqlen) 50 ;# max packet in ifq
set val(nn) 21 ;# number of mobilenodes
set val(rp) AODV ;# routing protocol
set val(x) 1000 ;# X dimension of topography
set val(y) 678 ;# Y dimension of topography
set val(stop) 300.0 ;# time of simulation end
#===================================
# Initialization
#===================================
#Create a ns simulator
set ns [new Simulator]
#Setup topography object
set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)
create-god $val(nn)
#Open the NS trace file
set tracefile [open SimAODV.tr w]
$ns trace-all $tracefile
#Open the NAM trace file
set namfile [open SimAODV.nam w]
$ns namtrace-all $namfile
$ns namtrace-all-wireless $namfile $val(x) $val(y)
set chan [new $val(chan)];#Create wireless channel
#===================================
# Mobile node parameter setup
#===================================
$ns node-config -adhocRouting $val(rp) \
-llType $val(ll) \
-macType $val(mac) \
-ifqType $val(ifq) \
-ifqLen $val(ifqlen) \
-antType $val(ant) \
-propType $val(prop) \
-phyType $val(netif) \
-channel $chan \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace ON \
-movementTrace ON
#Energy Moddel
$ns node-config -energyModel \
-rxPower .3 \
-txPower .3 \
-initialEnergy 60 \
set tracefile [open SimAODV.tr w]
$ns trace-all $tracefile
#Open the NAM trace file
set namfile [open SimAODV.nam w]
$ns namtrace-all $namfile
$ns namtrace-all-wireless $namfile $val(x) $val(y)
set chan [new $val(chan)];#Create wireless channel
#===================================
# Mobile node parameter setup
#===================================
$ns node-config -adhocRouting $val(rp) \
-llType $val(ll) \
-macType $val(mac) \
-ifqType $val(ifq) \
-ifqLen $val(ifqlen) \
-antType $val(ant) \
-propType $val(prop) \
-phyType $val(netif) \
-channel $chan \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace ON \
-movementTrace ON
#Energy Moddel
$ns node-config -energyModel \
-rxPower .3 \
-txPower .3 \
-initialEnergy 60 \
-sleepPower .5 \
-idlePower .1
#===================================
# Nodes Definition
#===================================
#Create 21 nodes
set n0 [$ns node]
$n0 set X_ 359
$n0 set Y_ 429
$n0 set Z_ 0.0
$ns initial_node_pos $n0 20
set n1 [$ns node]
$n1 set X_ 420
$n1 set Y_ 443
$n1 set Z_ 0.0
$ns initial_node_pos $n1 20
set n2 [$ns node]
$n2 set X_ 467
$n2 set Y_ 486
$n2 set Z_ 0.0
$ns initial_node_pos $n2 20
set n3 [$ns node]
$n3 set X_ 499
$n3 set Y_ 406
$n3 set Z_ 0.0
$ns initial_node_pos $n3 20
set n4 [$ns node]
$n4 set X_ 537
$n4 set Y_ 468
$n4 set Z_ 0.0
$ns initial_node_pos $n4 20
set n5 [$ns node]
-idlePower .1
#===================================
# Nodes Definition
#===================================
#Create 21 nodes
set n0 [$ns node]
$n0 set X_ 359
$n0 set Y_ 429
$n0 set Z_ 0.0
$ns initial_node_pos $n0 20
set n1 [$ns node]
$n1 set X_ 420
$n1 set Y_ 443
$n1 set Z_ 0.0
$ns initial_node_pos $n1 20
set n2 [$ns node]
$n2 set X_ 467
$n2 set Y_ 486
$n2 set Z_ 0.0
$ns initial_node_pos $n2 20
set n3 [$ns node]
$n3 set X_ 499
$n3 set Y_ 406
$n3 set Z_ 0.0
$ns initial_node_pos $n3 20
set n4 [$ns node]
$n4 set X_ 537
$n4 set Y_ 468
$n4 set Z_ 0.0
$ns initial_node_pos $n4 20
set n5 [$ns node]
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
$n5 set X_ 609
$n5 set Y_ 499
$n5 set Z_ 0.0
$ns initial_node_pos $n5 20
set n6 [$ns node]
$n6 set X_ 682
$n6 set Y_ 410
$n6 set Z_ 0.0
$ns initial_node_pos $n6 20
set n7 [$ns node]
$n7 set X_ 599
$n7 set Y_ 420
$n7 set Z_ 0.0
$ns initial_node_pos $n7 20
set n8 [$ns node]
$n8 set X_ 622
$n8 set Y_ 347
$n8 set Z_ 0.0
$ns initial_node_pos $n8 20
set n9 [$ns node]
$n9 set X_ 522
$n9 set Y_ 330
$n9 set Z_ 0.0
$ns initial_node_pos $n9 20
set n10 [$ns node]
$n10 set X_ 423
$n10 set Y_ 347
$n10 set Z_ 0.0
$ns initial_node_pos $n10 20
set n11 [$ns node]
$n11 set X_ 449
$n11 set Y_ 260
$n5 set Y_ 499
$n5 set Z_ 0.0
$ns initial_node_pos $n5 20
set n6 [$ns node]
$n6 set X_ 682
$n6 set Y_ 410
$n6 set Z_ 0.0
$ns initial_node_pos $n6 20
set n7 [$ns node]
$n7 set X_ 599
$n7 set Y_ 420
$n7 set Z_ 0.0
$ns initial_node_pos $n7 20
set n8 [$ns node]
$n8 set X_ 622
$n8 set Y_ 347
$n8 set Z_ 0.0
$ns initial_node_pos $n8 20
set n9 [$ns node]
$n9 set X_ 522
$n9 set Y_ 330
$n9 set Z_ 0.0
$ns initial_node_pos $n9 20
set n10 [$ns node]
$n10 set X_ 423
$n10 set Y_ 347
$n10 set Z_ 0.0
$ns initial_node_pos $n10 20
set n11 [$ns node]
$n11 set X_ 449
$n11 set Y_ 260
$n11 set Z_ 0.0
$ns initial_node_pos $n11 20
set n12 [$ns node]
$n12 set X_ 595
$n12 set Y_ 218
$n12 set Z_ 0.0
$ns initial_node_pos $n12 20
set n13 [$ns node]
$n13 set X_ 675
$n13 set Y_ 272
$n13 set Z_ 0.0
$ns initial_node_pos $n13 20
set n14 [$ns node]
$n14 set X_ 724
$n14 set Y_ 343
$n14 set Z_ 0.0
$ns initial_node_pos $n14 20
set n15 [$ns node]
$n15 set X_ 754
$n15 set Y_ 445
$n15 set Z_ 0.0
$ns initial_node_pos $n15 20
set n16 [$ns node]
$n16 set X_ 693
$n16 set Y_ 526
$n16 set Z_ 0.0
$ns initial_node_pos $n16 20
set n17 [$ns node]
$n17 set X_ 605
$n17 set Y_ 578
$n17 set Z_ 0.0
$ns initial_node_pos $n17 20
$ns initial_node_pos $n11 20
set n12 [$ns node]
$n12 set X_ 595
$n12 set Y_ 218
$n12 set Z_ 0.0
$ns initial_node_pos $n12 20
set n13 [$ns node]
$n13 set X_ 675
$n13 set Y_ 272
$n13 set Z_ 0.0
$ns initial_node_pos $n13 20
set n14 [$ns node]
$n14 set X_ 724
$n14 set Y_ 343
$n14 set Z_ 0.0
$ns initial_node_pos $n14 20
set n15 [$ns node]
$n15 set X_ 754
$n15 set Y_ 445
$n15 set Z_ 0.0
$ns initial_node_pos $n15 20
set n16 [$ns node]
$n16 set X_ 693
$n16 set Y_ 526
$n16 set Z_ 0.0
$ns initial_node_pos $n16 20
set n17 [$ns node]
$n17 set X_ 605
$n17 set Y_ 578
$n17 set Z_ 0.0
$ns initial_node_pos $n17 20
set n18 [$ns node]
$n18 set X_ 504
$n18 set Y_ 565
$n18 set Z_ 0.0
$ns initial_node_pos $n18 20
set n19 [$ns node]
$n19 set X_ 399
$n19 set Y_ 560
$n19 set Z_ 0.0
$ns initial_node_pos $n19 20
set n20 [$ns node]
$n20 set X_ 305
$n20 set Y_ 519
$n20 set Z_ 0.0
$ns initial_node_pos $n20 20
#===================================
# Generate movement
#===================================
$ns at 4 " $n1 setdest 822 341 50 "
$ns at 6 " $n11 setdest 499 400 40 "
$ns at 6 " $n16 setdest 499 400 40 "
$ns at 2 " $n20 setdest 900 420 20 "
#===================================
# Agents Definition
#===================================
#Setup a UDP connection
set udp0 [new Agent/UDP]
$ns attach-agent $n20 $udp0
set null2 [new Agent/Null]
$ns attach-agent $n15 $null2
$n18 set X_ 504
$n18 set Y_ 565
$n18 set Z_ 0.0
$ns initial_node_pos $n18 20
set n19 [$ns node]
$n19 set X_ 399
$n19 set Y_ 560
$n19 set Z_ 0.0
$ns initial_node_pos $n19 20
set n20 [$ns node]
$n20 set X_ 305
$n20 set Y_ 519
$n20 set Z_ 0.0
$ns initial_node_pos $n20 20
#===================================
# Generate movement
#===================================
$ns at 4 " $n1 setdest 822 341 50 "
$ns at 6 " $n11 setdest 499 400 40 "
$ns at 6 " $n16 setdest 499 400 40 "
$ns at 2 " $n20 setdest 900 420 20 "
#===================================
# Agents Definition
#===================================
#Setup a UDP connection
set udp0 [new Agent/UDP]
$ns attach-agent $n20 $udp0
set null2 [new Agent/Null]
$ns attach-agent $n15 $null2
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
$ns connect $udp0 $null2
$udp0 set packetSize_ 1500
#Setup a UDP connection
set udp1 [new Agent/UDP]
$ns attach-agent $n0 $udp1
set null3 [new Agent/Null]
$ns attach-agent $n14 $null3
$ns connect $udp1 $null3
$udp1 set packetSize_ 1500
#===================================
# Applications Definition
#===================================
#Setup a CBR Application over UDP connection
set cbr0 [new Application/Traffic/CBR]
$cbr0 attach-agent $udp0
$cbr0 set packetSize_ 1000
$cbr0 set rate_ 1.0Mb
$cbr0 set random_ null
$ns at 1.0 "$cbr0 start"
$ns at 2.0 "$cbr0 stop"
#Setup a CBR Application over UDP connection
set cbr1 [new Application/Traffic/CBR]
$cbr1 attach-agent $udp1
$cbr1 set packetSize_ 1000
$cbr1 set rate_ 1.0Mb
$cbr1 set random_ null
$ns at 1.0 "$cbr1 start"
$ns at 2.0 "$cbr1 stop"
$udp0 set packetSize_ 1500
#Setup a UDP connection
set udp1 [new Agent/UDP]
$ns attach-agent $n0 $udp1
set null3 [new Agent/Null]
$ns attach-agent $n14 $null3
$ns connect $udp1 $null3
$udp1 set packetSize_ 1500
#===================================
# Applications Definition
#===================================
#Setup a CBR Application over UDP connection
set cbr0 [new Application/Traffic/CBR]
$cbr0 attach-agent $udp0
$cbr0 set packetSize_ 1000
$cbr0 set rate_ 1.0Mb
$cbr0 set random_ null
$ns at 1.0 "$cbr0 start"
$ns at 2.0 "$cbr0 stop"
#Setup a CBR Application over UDP connection
set cbr1 [new Application/Traffic/CBR]
$cbr1 attach-agent $udp1
$cbr1 set packetSize_ 1000
$cbr1 set rate_ 1.0Mb
$cbr1 set random_ null
$ns at 1.0 "$cbr1 start"
$ns at 2.0 "$cbr1 stop"
#===================================
# Termination
#===================================
#Define a 'finish' procedure
proc finish {} {
global ns tracefile namfile
$ns flush-trace
close $tracefile
close $namfile
exec nam SimAODV.nam &
exit 0
}
for {set i 0} {$i < $val(nn) } { incr i } {
$ns at $val(stop) "\$n$i reset"
}
$ns at $val(stop) "$ns nam-end-wireless $val(stop)"
$ns at $val(stop) "finish"
$ns at $val(stop) "puts \"done\" ; $ns halt"
$ns run
# Termination
#===================================
#Define a 'finish' procedure
proc finish {} {
global ns tracefile namfile
$ns flush-trace
close $tracefile
close $namfile
exec nam SimAODV.nam &
exit 0
}
for {set i 0} {$i < $val(nn) } { incr i } {
$ns at $val(stop) "\$n$i reset"
}
$ns at $val(stop) "$ns nam-end-wireless $val(stop)"
$ns at $val(stop) "finish"
$ns at $val(stop) "puts \"done\" ; $ns halt"
$ns run
1 out of 30
Related Documents
Your All-in-One AI-Powered Toolkit for Academic Success.
 +13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
© 2024  |  Zucol Services PVT LTD  |  All rights reserved.