229 WMN Activity 2
229 WMN Activity 2
Class : WMN
PRN : 202101040251
Activity 2
Self Evaluation:
1.Exercise 1
#
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) 3 ;# number of mobilenodes
set val(rp) AODV ;# routing protocol
set val(x) 500
set val(y) 500
#set val(scene)
"/home/barun/Desktop/ns2/ns-2.34/indep-utils/cmu-scen-gen/setdest/ant/scene-3n-2" set
val(stop) 70.0 ;# simulation time
# Initialize Global Variables set
ns_ [new Simulator]
$ns_ use-newtrace
set tracefd [open wireless2.tr w]
$ns_ trace-all $tracefd
Exercise 2 :
Output:
Solution
Screenshot
Analyze the trace file and determine when the use of second route commence
Here the node 0 is the source node and node 5 is the destination node. Initially data moves
from node 0 to node 5 through the route 0-3-4-5. This movement begins at time 3.080088359
as shown below.
SFESTs 3.080088359 _0_ 0 [0 -> 5] 1(1) to 3 [0 |3 4 5 ]
• The first field is Established Flowstate (SFEST)
• The second field is the time
• The third field is the node number
• The fourth field is the Header UID
• The fifth field is the source
• The sixth field is the destination
• The next field is the Flow ID and Flow Header
• The next number is the next hop id.
• The next numbers in the square brackets concerns the adresses through which the
data travels to destination.
The above trace indicates flowstate established from source 0 to destination 5 with 3 is the
next hop address through the route 0-3-4-5.
When we see 'D' or SSendFailure in the first field of trace and node number '3' or '4' or '5' in
the -Hs field of the trace(as shown below), then the existing route breaks and data will not
reach to the destination.
d -t 34.114865014 -Hs 3 -Hd -2 -Ni 3 -Nx 300.00 -Ny 250.57 -Nz 0.00 -Ne -
1.000000 -Nl MAC -Nw RET -Ma 256e -Md 4 -Ms 3 -Mt 0