Skip to content

Commit 55638e9

Browse files
committed
ESS commented
1 parent 7293538 commit 55638e9

File tree

1 file changed

+45
-3
lines changed

1 file changed

+45
-3
lines changed

sim4ESS/ess_code.tcl

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
#-------------------------------------------------------------------------------
88
# AIM
99
#-------------------------------------------------------------------------------
10-
#Implement simple ESS and with transmitting nodes in wire-less LAN by simulation
11-
#and determine the performance with respect to transmission of packets.
10+
# Implement simple ESS and with transmitting nodes in wire-less LAN by simulation
11+
# and determine the performance with respect to transmission of packets.
1212
#-------------------------------------------------------------------------------
1313

1414
#STEP1
@@ -27,6 +27,27 @@ $ns namtrace-all-wireless $nf 1000 1000
2727

2828
#https://www.nsnam.com/2012/09/wireless-node-configuration-in-network.html
2929

30+
# adhoc routing DSDV = Destination-Sequenced Distance-Vector Routing (DSDV)
31+
# -is a table-driven routing scheme for ad hoc mobile networks based on the Bellman–Ford algorithm.
32+
#
33+
# LL = Link Layer , phyType=Physical Layer Type
34+
#
35+
# ifqType = Interface Queue type , ifqLen = Interface Queue Length
36+
#
37+
# channelType = Channel to be used for communication(Wired/Wireless)
38+
#
39+
# propType = Propogation Type of the signal
40+
# -The Two-Rays Ground Reflected Model is a radio propagation model which predicts the
41+
# path losses between a transmitting antenna and a receiving antenna when they are in LOS (line of sight).
42+
# Generally, the two antenna each have different height.
43+
#
44+
# antType = Antenna Type
45+
# -Omni Antenna : is a class of antenna which radiates equal radio power in all directions perpendicular to an axis,
46+
# with power varying with angle to the axis, declining to zero on the axis.
47+
#
48+
#
49+
#
50+
#
3051
$ns node-config -adhocRouting DSDV \
3152
-llType LL \
3253
-ifqType Queue/DropTail \
@@ -40,16 +61,30 @@ $ns node-config -adhocRouting DSDV \
4061
-agentTrace ON \
4162
-routeTrace ON \
4263

64+
# GOD --> General Operations Director
4365
create-god 3
4466

67+
#Create Nodes
4568
set n0 [$ns node]
4669
set n1 [$ns node]
4770
set n2 [$ns node]
4871

72+
#Label the nodes
4973
$n0 label "tcp0"
5074
$n1 label "sink1/tcp1"
5175
$n2 label "sink2"
5276

77+
78+
# Mobile Node Movement
79+
#--------------------
80+
# Node position defined in a 3-D model.
81+
# However z axis not used
82+
# $node set X_ <x1>
83+
# $node set Y_ <y1>
84+
# $node set Z_ <z1>$node at
85+
# $time setdest<x2> <y2> <speed>
86+
# Node movement may be logged
87+
5388
$n0 set X_ 50
5489
$n0 set Y_ 50
5590
$n0 set Z_ 0
@@ -64,11 +99,12 @@ $n2 set X_ 200
6499
$n2 set Y_ 200
65100
$n2 set Z_ 0
66101

67-
102+
# $time setdest<x2> <y2> <speed> from above comment ^^^^
68103
$ns at 0.1 "$n0 setdest 50 50 15"
69104
$ns at 0.1 "$n1 setdest 100 100 25"
70105
$ns at 0.1 "$n2 setdest 600 600 25"
71106

107+
# Attaching agents to Nodes
72108
set tcp0 [new Agent/TCP]
73109
$ns attach-agent $n0 $tcp0
74110
set ftp0 [new Application/FTP]
@@ -87,19 +123,25 @@ set sink1 [new Agent/TCPSink]
87123
$ns attach-agent $n2 $sink1
88124
$ns connect $tcp1 $sink1
89125

126+
#Start sending traffic at 0.5 seconds
90127
$ns at 0.5 "$ftp0 start"
91128
$ns at 0.5 "$ftp1 start"
92129

130+
#Move n2 node towards 150 150 till 100s
93131
$ns at 100 "$n2 setdest 150 150 35"
132+
#Move n2 node towards 70 70 from 100s to 190s
94133
$ns at 190 "$n2 setdest 70 70 15"
95134

135+
#Same as previous simulations
96136
proc finish { } {
97137
global ns nf tf
98138
$ns flush-trace
99139
exec nam ess_code.nam &
140+
exec awk -f perf_test.awk ess_code.tr &
100141
close $tf
101142
exit 0
102143
}
103144

145+
# Terminate simulation at 200
104146
$ns at 200 finish
105147
$ns run

0 commit comments

Comments
 (0)