WCN LAB NS-2 Procedure
WCN LAB NS-2 Procedure
PROCEDURE FOR NS
NS-2
2 EXPERIMENTS (EXP.1 & 2)
Procedure:
STEP 2. Terminal
Page 1 of 5
©Developed by Ayaskanta Mishra
Assistant Professor (II)
Faculty In
In-charge
charge Wireless Communication & Networking Lab
SYNTAX: $ ns <filename.tcl><ENTER>
e.g: $ ns expt1.tcl <ENTER>
Page 2 of 5
©Developed by Ayaskanta Mishra
Assistant Professor (II)
Faculty In
In-charge
charge Wireless Communication & Networking Lab
Execute trace-file
file (.tr) software required: tracegraph202:
In Terminal execute following:
STEP-1:
1: Go to tracegraph202 directory by change directory command (cd)
SYNTAX:
cd / <ENTER>
cd home/wcn/tracegraph202/bin/glnx86 <ENTER>
STEP-2:
2: export library PATH
Page 3 of 5
©Developed by Ayaskanta Mishra
Assistant Professor (II)
Faculty In
In-charge
charge Wireless Communication & Networking Lab
Experiment-3
Simulation and invertigation of impact of Contention Window size on the
performance of IEEE 802.11 MAC Protocol(NS
Protocol(NS-2)
2)
Procedure:
STEP-1:Put thecwsim.tclscript
script in /home/wcnfolder
STEP-2: Open >Terminal
STEP-3: 3: After opening Terminal Execute following in Terminal Window
$ cd / <ENTER>
$ cd home/wcn
$ gedit cwsim.tcl
STEP-4: In geditwindow thecwsim.tcl
cwsim.tcl code will open
Go to line number 112 and 113 change the Contention Window Size (CW)
2,7,15,31,63,127 for populating the table given in manual.
$val(mac) set CWMin_ 2
$val(mac) set CWMax_ 2
6 set of experiment has to be perform to populate the table.
Each time you change the CW_Min and CW_Max value once you have to run the
script in terminal as follws:
Go to STEP-44 and change the value CW_Min and CW_Max 7 then 15 then 31 so on upto
127. For each change in script, you have to excute the cwsim.
cwsim.tcl
tcl in terminal as given in
STEP-5.
Page 4 of 5
©Developed by Ayaskanta Mishra
Assistant Professor (II)
Faculty In
In-charge
charge Wireless Communication & Networking Lab
Throughput Calculation:
Comparation
omparation PDR for 3 x 3 ; 4 x 4 ;5 x 5 node matrix and finding the optimum
Contention Window Size (CW) by plotting graph using xx-graph
In terminal:
STEP-1: $ gedit 3x3 <ENTER>
In gedit write following in two columns as shown below and save and close.
Example:
2 0.00134
7 0.03415
15 0.07889
31 0.04515
63 0.03678
127 0.01234
STEP-3: After creating all 3 files 3x3, 4x4 and 5x5 PDR vs.CW files plot the x-graph
x by
follwing command in terminal window:
Save the graph and comment upon the optimum Contention Winow Size.
Page 5 of 5