Академический Документы
Профессиональный Документы
Культура Документы
V. Salai Selvam
Assistant Professor & HOD
Department of Electronics & Communication Engineering
Sriram Engineering College, Perumalpattu 602 024
Related commands
$nsptr version
- Returns ns version
$nsptr now
$nsptr halt
- Stop/pause simulation
$nsptr cancel
<namtracetype>
Read Only
namtrace-all
10
<tracetype>
Read Only
trace-all
11
Add nodes
#Add nodes
set ndh [$nsptr node]
ndh
nsptr
12
<val>
Handle to node
color
Color of node
shape
Shape of node
red
blue
green
circle
box
hexagon
13
ndh
Handle to node
<time>
<num_double>
<text>
<anytext>
14
Add links
#Add links
$nsptr <ltype> $fnd $snd <bw> <dly> <qtype>
nsptr
fnd, snd
<ltype>
simplex-link
duplex-link
<bw>
<num_double>
<dly>
<num_double>
<qtype>
DropTail
FQ
SFQ
DRR
CBQ
RED
15
Related commands
#Return instance variable head_ of link between fnd and snd
[$nsptr link $fnd $snd] head
#Return instance variable link_ of link between fnd and snd
[$nsptr link $fnd $snd] link
#Return instance variable queue_ of link between fnd and snd
[$nsptr link $fnd $snd] queue
nsptr
fnd, snd
16
<param>
Color of link
label
queuePos
<val>
red
blue
green
anytext
<num_double>
Queue position
And more for color
Any text as label
Number for queuePos
17
orient
<val>
right
Left
up
down
right-up
right-down
left-up
left-down
up-right
down-right
up-left
down-left
<deg_double>
18
19
fnd, snd
qptr
<val>
limit_
Queue size in packets
blocked_
Enabling/disabling queue block
unblock_on_resume_ Enabling/disabling automatic queue unblock
<num_int>
true, false
true, false
Number of packets
If true, queue is blocked; unable to sent packet to link
If true, queue is unblocked after last pkt is txed.
20
secsPerByte_
<val>
<num_double>
maxqueue_
buckets_
<val>
<num_int>
<num_int>
buckets_
blimit_
quantum_
mask_
<val>
<num_int>
<num_int>
<num_int>
true, false
21
<val>
true, false
true, false
<num_double>
<num_double>
<num_int>
<num_double>
true, false
<num_double>
true, false
true, false
22
Add agents
#Add agents
#Create desired agent
set agptr [new Agent/<agent>]
#Attach agent to desired node
$nsptr attach-agent $ndh $agptr
agptr
nsptr
ndh
<agent>
TCP
TCP/Reno
TCP/Newreno
TCP/Sack1
TCP/Fack
TCP senders
23
<agent>
TCP/FullTcp
TCP/Vegas
TCP/Vegas/RBP
TCP/Reno/RBP
TCP/Asym
TCP/Reno/Asym
TCP/Newreno/Asym
TCP senders
TCPSink
TCPSink/DelAck
TCPSink/Asym
TCPSink/Sack1
TCPSink/Sack1/DelAck
TCP receivers
UDP
UDP sender
Null
RTP
RTP sender/receiver
24
<agent>
IVS/Source
IVS sender
IVS/Receiver
IVS receiver
CrtMcast/Encap
CrtMcast/Decap
Message
Message/Prune
SRM
SRM/Adaptive
Tap
rtProto/DV
25
26
27
28
pptr
An integer as flow ID
An integer as priority
An integer as address of this agent
Port no of this agent in integer
Destination address of this agent in integer
Destination port of this agent in integer
29
<parameter> State variables (read only) for all source TCP agents
dupacks_
seqno_
t_seqno_
ack_
30
<fid_>
<num_int>
<val>
red
blue
green
31
Create connection
#Create connection
$nsptr connect $srcag $dstag
nsptr
srcag
dstag
32
<srcag>
Source agent
<dstag>
Destination agent
srcndh
dstndh
agptr
33
<srcag>
Source agent
<dstag>
Destination agent
srcndh
dstndh
agptrl
sagptr
dagptr
34
Add traffics
#Add traffic
#Create traffic
set trptr [new Application/<traffic>]
#Attach it to desired agent
$trptr attach-agent $agptr
trptr
agptr
<traffic>
Traffic/CBR
Traffic/Exponential
Traffic/Pareto
35
packetSize_
rate_
<val>
<num_int>
<num_double>
random_
maxpkts_
<val>
true, false
<num_double>
36
burst_time_
idle_time_
<val>
<num_double>
<num_double>
burst_time_
idle_time_
shape_
<val>
<num_double>
<num_double>
<num_double>
37
<event> <tcl_command>
38
List
Heap
<shdlr>
Calendar
ReatTime
39
trptr
<time>
<num_double>
40
finish
<time>
<num_double>
<text>
<anytext>
<rate>
<num_double>
41
Run simulation
#Run simulation
$nsptr run
nsptr
42
Creating procedures
#Creating procedures
proc pname {parg1 parg2 } {pbody}
pname
parg1, parg2
pbody
43
ntfptr
ntfname
44
<errormodel>
ErrorModel
ErrorModel/Periodic
ErrorModel/Uniform
SelectErrorModel
ErrorModel/List
45
For ErrorModel
<param>
enable_
rate_
delay_
bandwidth_
markecn_
delay_pkt_
<val>
true or false
<num_double>
<num_in_secs>
<num_in_bps>
true or false
true or false
46
period_
offset_
burstlen_
default_drop_
<val>
<num_double>
<num_double>
<num_double>
true or false
47
<param>
enable_
rate_
delay_
bandwidth_
markecn_
delay_pkt_
pkt_type_
drop_cycle_
drop_offset_
<val>
true, false
<num_double>
<num_double>
<num_double>
true, false
true, false
0, 1 or 2
<no_of_pkts>
<no_of_pkts>
48
cnt_
droplist_
dropcnt_
cur_
<val>
<num_int>
<num_int_list>
<num_int>
<num_int>
49
ranvar
<ranvar>
50
nsptr
srcndh, dstndh
51
<seedvalue>
<num_double>
<ranvar>
52
<num_double>
<num_double>
<param> & <val> Configurable parameters & their values for Exponential
avg_
<num_double>
<param> & <val> Configurable parameters & their values for Pareto & ParetoII
avg_
shape_
<num_double>
<num_double>
<param> & <val> Configurable parameters & their values for Constant
val_
<num_double>
<param> & <val> Configurable parameters & their values for HyperExponential
avg_
cov_
<num_double>
<num_double>
53
<num_double>
<param> & <val> Configurable parameters & their values for Empirical
minCDF_
maxCDF_
interpolation_
maxEntry_
<num_double>
<num_double>
0, 1 or 2
<num_int>
<param> & <val> Configurable parameters & their values for Weibull
shape_
scale_
<num_double>
<num_double>
54
<rtmodel>
Trace
Exponential
Deterministic
Manual
<ts>
$tracefile
{<stt> <upp> <dnp> <fin>}
{<stt> <upp> <dnp> <fin>}
<time> <lnkst>
55
<num_double>
<time>
<num_double>
<lnkst>
up or down
56
<lnkst>
up or down
<time>
<num_double>
57
Insert routing
#Select routing protocol
$nsptr rtproto <rtprotcol> <$nodelist>
nsptr
<rtprotcol>
<$nodelist>
Static
Session
DV
LS
Manual
hierarchical
58
<$nodelist>
59
60
Creating LAN
#Steps to create a LAN
#Step 1: Create new simulator object
#Step 2: Set NAM tracing
#Step 3: Add nodes
#Step 4: Add links if required
#Step 5: Create LAN including all or some nodes created
#Step 6: Add agents & Add traffics
#Step 7: Set event scheduling
#Step 8: Run simulation
61
<nodelist>
$ndh1 $ndh2
<bw>
<num_double>
Bandwidth in bps
<dly>
<num_double>
Delay in secs
<LL>
LL
<ifq>
Queue/DropTail
<MAC>
Mac/Csma/Cd
Mac/Csma/Ca
62
Mac/802_3
Mac/802_11
<chan>
Channel
WirelessChannel
<phy>
Phy/WiredPhy
Phy/WirelessPhy
63
64
65
Array to options
Channel/WirelessChannel
Channel type
<phy>
Phy/WirelessPhy
<mac>
Mac/802_11
<ifq>
Queue/DropTail/PriQueue
CMUPriQueue
<ll>
LL
<ant>
Antenna/OmniAntenna
Antenna type
<ifqlen>
<num_int>
<nmn>
<num_int>
Mac type
Interface queue type for dsdv
Interface queue for dsr
66
DSDV
DSR
TORA
AODV
<x>
<num_double>
X dimension of topography
<y>
<num_double>
Y dimension of topography
<seed>
<num_double>
<stp>
<num_double>
67
<param>
CPThresh_
CSThresh_
RXThresh_
Pt_
freq_
L_
<val>
<num_double>
<num_double>
<num_double>
<num_double>
<num_double>
<num_double>
Capture threshold in dB
Carrier sense threshold in watts
Receive power threshold in watts
Transmitted signal power in watts
Frequency in Hz
System loss factor
68
mindelay_
delay_
bandwith_
<val>
<num_double>
<num_double>
<num_double>
69
<param>
X_
Y_
Z_
Gt_
Gr_
<val>
<num_double>
<num_double>
<num_double>
<num_double>
<num_double>
X position of antenna
Y position of antenna
Z position of antenna
Transmitting gain of antenna in dB
Receiving gain of antenna in dB
70
Read only
Read/write or create
71
72
<param>
-addressingType
-adhocRouting
-llType
-macType
-propType
-ifqType
-ifqLen
-phyType
-antType
-channelType
-topoInstance
-wiredRouting
-mobileIP
-energyModel
<opt>
opt(val)
73
<param>
initialEnergy
rxPower
txPower
agentTrace
routerTrace
macTrace
movementTrace
<opt>
opt(val)
Specified in Joules
Specified in W
Specified in W
Tracing at agent level turned ON or OFF
Tracing at router level turned ON or OFF
Tracing at mac level turned ON or OFF
Mobilenode movement logging turned ON or OFF
Respective opt array element already defined
74
Handle to node
nsptr
<pos>
X_
Y_
Z_
<val>
<num_double>
X coordinate
Y coordinate
Z coordinate
75
<num_double>
<x>, <y>
<num_double>
<speed>
<num_double>
<num_double>
<arg>
true or false
0 or 1
76
ndh
Handle to node
opt(val)
77
ndh
Handle to node
opt(val)
78
79