Introduction to Wireless Networking

Verified

Added on  2023/01/23

|29
|4859
|85
AI Summary
A remote system can be characterized as a system of PCs that utilizes a remote innovation to make data association between at least two network nodes in a specific system of network nodes. Various media transmission organizations, organizations and even homes have eliminated their systems administration costs by embracing remote systems.

Contribute Materials

Your contribution can guide someone’s learning journey. Share your documents today.
Document Page
Wireless Sensor Network
Student Name
College

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Introduction to Wireless Networking
A remote system can be characterized as a system of PCs that utilizes a remote innovation to make data
association between at least two network nodes in a specific system of network nodes [1]. Various media
transmission organizations, organizations and even homes have eliminated their systems administration
costs by embracing remote systems. Remote innovation is less expensive as it doesn't require link
associations for data to be transmitted between network nodes [2]. Before remote systems can be sent,
the Network Simulation - 2 programming (NetSim-2) can be utilized to reenact the associations, much
the same as wired associations can be mimicked. The Network Simulation – 2 device can keep running on
windows working framework just as on Linux working framework.
Network System Design
The Network Simulator programming utilizes the Network Animation programming (NAM) programming
to delineate reenacted system and view the data bundle follows in the system. The Network Animation
device offers the accompanying devices: the format of the topology, the bundle level movement, data
review and investigation devices [3]. For both the AODV and he DSDV routing protocols, the NAM
programming was utilized for system reproduction. A system is first planned in the NetSim device before
it is reproduced in the NAM.
The accompanying screen captures demonstrate the structure of the topology as appeared by the NAM
instrument.
Document Page
The screen capture beneath shows packets being sent to the foreordained hub, demonstrated by the
circle.
Document Page
The screen capture beneath a few network nodes sending packets to foreordained network nodes.
Network Simulation
Toward the beginning of the reenactment, energy is utilized as packets are sent starting with one hub
then onto the next. Network nodes carry on distinctively relying upon the kind of protocol chose. The
two routing protocols that were chosen for this case are DSDV and AODV routing protocols [4].
The plan has 20 network nodes and the reenactment is set to keep running for 300 seconds.
The screen capture beneath demonstrates the recreation of DSDV at 50 seconds, 150 seconds and 250
seconds.
DSDV routing protocol Simulation
The screen capture beneath speaks to the conduct of DSDV routing protocol at 50 seconds.

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
At 50 seconds, there is transmission of packets starting with one hub then onto the next. Hub 20 changes
its situation to invalid (4), and there is energy misfortune amid the procedure. There is impact of
network nodes because of the development, and hub o3 and hub 11 impacted in light of the fact that
there were all on the x-hub line, at position 499. In synopsis, from 0-50 seconds, the network nodes
displayed greatest energy and accordingly enormous data packets were sent and received quickly [5].
Document Page
The DSDV routing protocol is appeared in the screen capture beneath at 150 seconds.
At 150 seconds, bundle transmission rate apparently decreases. This is on the grounds that there was a
high energy utilization at each hub. Generally energy utilization relies upon relies upon the beginning
energy and the power doled out to every hub. Hub development isn't seen at this stage since all network
nodes have touched base at their different goals [6].
The screen capture underneath demonstrates the DSDV routing protocol at 250 seconds.
Document Page
At 250, protocol transmission supposedly decreases and the network nodes are believed to change hues
showing an abatement in energy that was utilized to transmission data packets. The vast majority of the
network nodes gave a notice that their energy had been drained. When the network nodes turn red,
data packets transmission would stop as there will be no energy to encourage the transmission
procedure [7].
Production of AODV routing protocol
AODV routing protocol is appeared in the screen capture beneath at 50 seconds.
From 0-50 seconds, a mass of packets is transmissiond inside the initial 5 seconds. Hub movement starts
following 5 seconds of transmission, following the suspension of the data packets transmission. Hub 20
movements to null3 as node1 shifts towards node14, the underlying positions where the network nodes
were indicated during the time spent the structure. Hub 11 and hub 16 move towards hub 3, the position

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
where it was pointed towards. From 5-50 seconds, data the packets process of transmission totally
ground to a halt.
The AODV routing protocol appeared then screen capture beneath at 150 seconds.
At 150 seconds, the packets process of transmission did not happen and network nodes stayed
stationary. Be that as it may, some energy was being expended at this stage in light of the fact that the
initial five seconds saw a gigantic the packets process of transmission, which is typical with the AODV
routing protocol. The other motivation behind why some energy was utilized now even the noes small
stationary is on the grounds that the data bundle transmission process was not consistently conveyed all
through the reenactment procedure, since the packets are just transmission inside the initial 5 seconds
before hub migration starts to occur [8].
The screen capture beneath shows AODV routing protocol at 250 seconds.
Document Page
There is no the packets process of transmission occurring at 250 seconds, and there is no sign of energy
misfortune as all network nodes demonstrate their underlying shading. This is because of the way that
the bundle transmission process, which utilizes a ton of energy, has effectively occurred. Data packets
have just been moved in the initial five seconds and the procedure has ground to a halt. Since the
procedure has stopped, the network nodes are not utilizing any energy and this clarifies the motivation
behind why energy misfortune isn't seen at the degree of 250 seconds [9].
Document Page
Analyzing of Trace file record
DSDV routing Protocol Trace file
At precisely 0.004166565 seconds, hub 0 sends a bundle with a clear message and there is no energy
utilization that happens. The energy at the hub in this way is kept at 60 joules. At precisely 0.004262
seconds, energy misfortune is seen in every one of the network nodes, with network nodes losing
practically the entirety of their energy. This is on the grounds that the bundle transmission process has
just started [10].
From 0.004981773 to 0.005007365 seconds, the packets process of transmission process had effectively
finished. Energy was spent amid this stage and subsequently an energy drop was seen in every one of
the network nodes. The bundle transmission process went on from 0.005007365 seconds with a
consistent energy decrease in light of the exercises occurring in the packets process of transmission
process, that is, sending and accepting of packets. This procedure devours energy.
By 0.005007365 seconds, all data packets have achieved their different goals. Energy in each hub has
diminished to 59.999358 joules. Data the packets process of transmission process proceeds with a
consistent loss of energy[10].
The reenactment procedure ground to a halt a far distance 300 seconds, and 30 joules of energy was
spent altogether. While the various network nodes dropped their energy to 30 joules, 4 network nodes
had the capacity to hold some energy. Notwithstanding, it was seen that there was no hub that had
totally spent its energy. Before the finish of the recreation, 846 data packets had been received.
AODV routing Protocol Trace file
Network nodes began sending packets at 1 seconds precisely, with every hub having 60 joules of energy.
Monstrous bundle transmission was observers n the initial 5 seconds, and data dropped basically amid
this stage. A drop in energy was seen in 5 seconds, after which energy stayed steady as there was no
more data transmission process occurring [10].
A the packets process of that was sent by hub 19 bound for hub 19 was dropped before it achieved its
goal due to a crash. The impact occurred at hub 0. About the sum total of what packets have been
believed to drop at hub 0.

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Reenactment process ground to a halt at 30 seconds, and all network nodes kept up their energy as
pitiful energy was utilized amid the procedure.
Results
The diagram beneath shows how packets were sent and received, and how bundle dropping occurred
and energy utilization in the DSDV routing protocol
The diagram beneath is an AODV routing protocol indicating bundle transmission process, the packets
process of dropping and energy use.
Document Page
Conclusion
Coming up next are the resolutions that have been made after the investigation of the DSDV and the
AODV routing protocols.
DSDV routing protocol demonstrated a uniform bundle transmission rate from the beginning of the
reproduction procedure as far as possible, keeping up a 60 joules energy use through the entire
procedure. Along these lines, it is desirable over use DSDV routing protocol in system reenactment as
this routing protocol guarantees a uniform transmission of data packets with least energy decrease in
every hub. Be that as it may, the DSDV routing protocol has one drawback. It delivers a danger of
spending all energy before the data packets transmission process is finished. This may prompt pointless
data bundle droppings.
AODV routing protocol attempts to guarantee that there is as less energy utilization a conceivable. This
routing protocol can serve best in a state whereby the network nodes included have restricted energy.
To amplify energy utilization, the protocol guarantees that there is an enormous transmission of data
packets toward the beginning of the reenactment procedure, with the goal that data packets achieve
their goals before the energy in the individual network nodes is spent. Consequently, AODV routing
protocol is prescribed to be utilized where the energy accessible for use is restricted, as it will empower
effective utilization of the accessible energy before it is depleted.
Document Page
References
[1]"Global Wireless Sensor Network Market Trends, Applications ...". [Online]. Available:
https://marketresearch.biz/report/wireless-sensor-network-market/. [Accessed: 03- May- 2019].
[2]"Wireless Sensor Network - an overview | ScienceDirect Topics". [Online]. Available:
https://www.sciencedirect.com/topics/engineering/wireless-sensor-network. [Accessed: 03- May- 2019].
[3]"Wireless Sensor Networks - Computer Science". [Online]. Available:
https://www.cs.virginia.edu/~stankovic/psfiles/wsn.pdf. [Accessed: 03- May- 2019].
[4]"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].
[5]"Wireless Sensor Network Market Report - Forecast to 2022 ...". [Online]. Available:
https://www.marketresearchfuture.com/reports/wireless-sensor-network-market-1805. [Accessed: 03-
May- 2019].
[6]"Omnet++ Wireless Sensor Network simulation projects". [Online]. Available:
https://omnetplusplus.com/omnet-wireless-sensor-network/. [Accessed: 03- May- 2019].
[7]"Wireless sensor network | Request PDF". [Online]. Available:
https://www.researchgate.net/publication/260819256_Wireless_sensor_network. [Accessed: 03- May-
2019].
[8]M. Wójcikowski, "Transmission Protocol Simulation Framework For The Resource-Constrained
Wireless Sensor Network", Metrology and Measurement Systems, vol. 22, no. 2, pp. 221-228, 2015.
Available: 10.1515/mms-2015-0019.
[9]T. M.Alfaqih, A. M. Al-Dhelaan and M. Mehedi Hassan, "Wireless Sensor Network Simulation
Environment", International Journal of Computer Applications, vol. 118, no. 17, pp. 44-50, 2015.
Available: 10.5120/20841-3643.
[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.

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
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)
Document Page
#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 EnergyModel \
-rxPower .3 \
-txPower .3 \
Document Page
-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

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
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
Document Page
$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
Document Page
$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]

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
$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"
Document Page
$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
Document Page
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)

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
#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 EnergyModel \
-rxPower .3 \
-txPower .3 \
-initialEnergy 60 \
Document Page
-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]
Document Page
$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

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
$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
Document Page
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
Document Page
$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"

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
#===================================
# 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 29
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]