[ns] How to find out all path from one node to other node in AODV??????????

2008-01-05 Thread Amin Irandoost

Hi all
how to find out all path from one node to other node in aodv routing
protocol ??
is saved aodv all path??
-- 
Amin Irandoost


[ns] Trace file and question about each item of it

2007-11-30 Thread Amin Irandoost

hi dear all
what means each item of Trace file??

s 13.48600 _3_ MAC  --- 0 xcp 9 [0.10 3 3] [energy 300.00 ei 0.000es
0.000 et 0.000 er 0.000]

s 50.0 _0_ AGT  --- 0 cbr 50 [0.00 0 0] [energy 292.611523 ei 7.318es
0.029 et 0.006 er 0.036] --- [0:0 9:0 32 0] [0] 0 0

s 52.845200467 _0_ MAC  --- 0 AODV 48 [0.00 -1 0] [energy 292.503779 ei
7.419 es 0.031 et 0.008 er 0.038] --- [0:255 -1:255 30 0] [0x2 1 1 [9 0]
[0 4]] (REQUEST)

D 98.0 _0_ RTR NRTE 4 cbr 70 [0.00 0 0] [energy 291.576225 ei 8.138es
0.067 et 0.095 er 0.124] --- [0:0 9:0 30 0] [4] 0 0



for calculating end2end latency which items is useful??
i use SMAC with energy model and routing protocol is AODV.
please guide me

-- 
Amin Irandoost


[ns] What is diffrent between Radio transmission range and radio interference range ?

2007-11-22 Thread Amin Irandoost

Hi all
What is diffrent between  Radio transmission range and radio interference range?
and how to calculate they???
please guide me

-- 
Amin Irandoost



[ns] please read email emergency

2007-11-21 Thread Amin Irandoost

Hi all
Why changing CBR rate of node doesn't effect on energy consumption of
nodes that use SMAC protocol for MAC layer??
 For example in 5*5 grids with 25 nodes, node 1 is sender and node 25 is Sink .
Please guide me
Very Thanks in advanced
I'm waiting for your reply


-- 
Amin Irandoost



[ns] why no body doesn't help !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2007-11-19 Thread Amin Irandoost

Hi all

In wireless scenario that picture of this show at below

Node 0 is sender and node 24 is receiver

I want to use UDP agent for this nodes

I use follow code for this purpose

Please tell me is the following file correct and suitable?

Why the CBR interval has not effect on time when the nodes' energy is
finished?
picture of nam file that show my topology is :
http://rapidshare.com/files/70500344/Screenshot.png


I'm waiting for your reply
very thanks

-- 
Amin Irandoost

# ==
# Define options
# ==
#set val(lifetime)   4000;
set opt(chan)   Channel/WirelessChannel
set opt(prop)   Propagation/TwoRayGround
set opt(netif)  Phy/WirelessPhy
set opt(mac)Mac/SMAC
set opt(ifq)Queue/DropTail/PriQueue
set opt(ll) LL
set opt(ant)Antenna/OmniAntenna
set opt(x)  200.0  ;# X dimension of the topography
set opt(y)  200.0  ;# Y dimension of the topography
set opt(ifqlen) 50   ;# max packet in ifq
set opt(seed)   0.0
set opt(tr) 2.tr  ;# trace file
set opt(nam)2.nam
set opt(adhocRouting)   AODV
set opt(nn) 25  ;# how many nodes are simulated
set opt(energymodel)EnergyModel
set opt(stop)   4000.0;# simulation time
set val(initialenergy)  300.0
set val(receivepower)   0.395 ;# Receiving Power
set val(transmitpower)  0.660 ;# Transmitting Power
set val(idlepower)  0.350 ;# Idle Power
set val(sleeppower) 0.001 ;# sleep Power
LL set bandwidth_
20kb



# =


# unity gain, omni-directional antennas
# set up the antennas to be centered in the node and 1.5 meters above it
Antenna/OmniAntenna set X_ 0
Antenna/OmniAntenna set Y_ 0
Antenna/OmniAntenna set Z_ 1.5
Antenna/OmniAntenna set Gt_ 1.0
Antenna/OmniAntenna set Gr_ 1.0


# Initialize the SharedMedia interface with parameters to make
# it work like the 914MHz Lucent WaveLAN DSSS radio interface
Phy/WirelessPhy set CPThresh_ 10.0
Phy/WirelessPhy set CSThresh_ 1.559e-11
Phy/WirelessPhy set RXThresh_ 2.13643e-07
Phy/WirelessPhy set Rb_ 2*1e6
Phy/WirelessPhy set Pt_ 0.281838
Phy/WirelessPhy set freq_ 9.14e+8
Phy/WirelessPhy set L_ 1.0

proc finish {} {
global ns_ tracefd namtrace
$ns_ flush-trace
close $namtrace
close $tracefd
puts \n running nam...\n
 #   exec nam 1.nam 
exit 0
}



# AMAC settings
Mac/SMAC set syncFlag_ 1; # sleep wakeup cycles
Mac/SMAC set dutyCycle_ 60


set ns_[new Simulator]
$ns_ use-scheduler Heap
$ns_ set WirelessNewTrace_ ON
set topo[new Topography]
set tracefd[open $opt(tr) w]
set namtrace[open $opt(nam) w]
$ns_ trace-all $tracefd
$topo load_flatgrid $opt(x) $opt(y)
$ns_ namtrace-all-wireless $namtrace 200.0 200.0
set cha [new $opt(chan)]
#
# Create god
#
create-god $opt(nn)
$ns_ node-config -adhocRouting $opt(adhocRouting) \
 -llType $opt(ll) \
 -macType $opt(mac) \
 -ifqType $opt(ifq) \
 -ifqLen $opt(ifqlen) \
 -antType $opt(ant) \
 -propType $opt(prop) \
 -phyType $opt(netif) \
 -channel $cha \
 -topoInstance $topo \
 -WiredRouting OFF \
 -energyModel $opt(energymodel) \
 -idlePower $val(idlepower) \
 -rxPower $val(receivepower) \
 -txPower $val(transmitpower) \
 -sleepPower $val(sleeppower) \
 -initialEnergy $val(initialenergy) \
 -agentTrace ON \
 -routerTrace OFF \
 -macTrace OFF

set j 0
set k 0
for {set i 0} {$i  $opt(nn) } {incr i} {
set node_($i) [$ns_ node]
   $node_($i) random-motion 0;# disable random motion
   if {$i%5==0} {
   set j [expr $j+20]
   if {$i!=0} {
set k 0} }
   $node_($i) set X_ [set k [expr $k+20]]
$node_($i) set Y_ $j
$node_($i) set Z_ 0.0
}


for { set j 0} { $j  $opt(nn)} {incr j} {
  $ns_ initial_node_pos $node_($j) 2
  $node_($j) color blue
  $node_($j) log-energy
   }

*for { set j 0} { $j  $opt(nn)} {incr j} {
set udp_($j) [new Agent/UDP]
$ns_ attach-agent $node_($j) $udp_($j)
}

set null_(0) [new Agent/Null]
$ns_ attach-agent $node_([expr $opt(nn)-1]) $null_(0)*


*set cbr [new Application/Traffic/CBR]
$cbr set packetSize_ 50
$cbr set interval_ 3.0
$cbr attach-agent $udp_(0)
$ns_ connect $udp_(0) $null_(0)

$ns_ at 50.0 $cbr star*t

#
# Tell all the nodes when the simulation ends
#
for {set i 0} {$i  $opt(nn) } {incr i} {
$ns_ at $opt(stop) $node_($i

[ns] Please help me emergency!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2007-11-17 Thread Amin Irandoost

Hi all

In wireless scenario that picture of this show at below

Node 0 is sender and node 24 is receiver

I want to use UDP agent for this nodes

I use follow code for this purpose

Please tell me is the following file correct and suitable?

Why the CBR interval has not effect on time when the nodes' energy is
finished?
picture of nam file that show my topology is :
http://rapidshare.com/files/70500344/Screenshot.png

I'm waiting for your reply
very thanks

-- 
Amin Irandoost

# ==
# Define options
# ==
#set val(lifetime)   4000;
set opt(chan)   Channel/WirelessChannel
set opt(prop)   Propagation/TwoRayGround
set opt(netif)  Phy/WirelessPhy
set opt(mac)Mac/SMAC
set opt(ifq)Queue/DropTail/PriQueue
set opt(ll) LL
set opt(ant)Antenna/OmniAntenna
set opt(x)  200.0  ;# X dimension of the topography
set opt(y)  200.0  ;# Y dimension of the topography
set opt(ifqlen) 50   ;# max packet in ifq
set opt(seed)   0.0
set opt(tr) 2.tr  ;# trace file
set opt(nam)2.nam
set opt(adhocRouting)   AODV
set opt(nn) 25  ;# how many nodes are simulated
set opt(energymodel)EnergyModel
set opt(stop)   4000.0;# simulation time
set val(initialenergy)  300.0
set val(receivepower)   0.395 ;# Receiving Power
set val(transmitpower)  0.660 ;# Transmitting Power
set val(idlepower)  0.350 ;# Idle Power
set val(sleeppower) 0.001 ;# sleep Power
LL set bandwidth_
20kb



# =


# unity gain, omni-directional antennas
# set up the antennas to be centered in the node and 1.5 meters above it
Antenna/OmniAntenna set X_ 0
Antenna/OmniAntenna set Y_ 0
Antenna/OmniAntenna set Z_ 1.5
Antenna/OmniAntenna set Gt_ 1.0
Antenna/OmniAntenna set Gr_ 1.0


# Initialize the SharedMedia interface with parameters to make
# it work like the 914MHz Lucent WaveLAN DSSS radio interface
Phy/WirelessPhy set CPThresh_ 10.0
Phy/WirelessPhy set CSThresh_ 1.559e-11
Phy/WirelessPhy set RXThresh_ 2.13643e-07
Phy/WirelessPhy set Rb_ 2*1e6
Phy/WirelessPhy set Pt_ 0.281838
Phy/WirelessPhy set freq_ 9.14e+8
Phy/WirelessPhy set L_ 1.0

proc finish {} {
global ns_ tracefd namtrace
$ns_ flush-trace
close $namtrace
close $tracefd
puts \n running nam...\n
 #   exec nam 1.nam 
exit 0
}



# AMAC settings
Mac/SMAC set syncFlag_ 1; # sleep wakeup cycles
Mac/SMAC set dutyCycle_ 60


set ns_[new Simulator]
$ns_ use-scheduler Heap
$ns_ set WirelessNewTrace_ ON
set topo[new Topography]
set tracefd[open $opt(tr) w]
set namtrace[open $opt(nam) w]
$ns_ trace-all $tracefd
$topo load_flatgrid $opt(x) $opt(y)
$ns_ namtrace-all-wireless $namtrace 200.0 200.0
set cha [new $opt(chan)]
#
# Create god
#
create-god $opt(nn)
$ns_ node-config -adhocRouting $opt(adhocRouting) \
 -llType $opt(ll) \
 -macType $opt(mac) \
 -ifqType $opt(ifq) \
 -ifqLen $opt(ifqlen) \
 -antType $opt(ant) \
 -propType $opt(prop) \
 -phyType $opt(netif) \
 -channel $cha \
 -topoInstance $topo \
 -WiredRouting OFF \
 -energyModel $opt(energymodel) \
 -idlePower $val(idlepower) \
 -rxPower $val(receivepower) \
 -txPower $val(transmitpower) \
 -sleepPower $val(sleeppower) \
 -initialEnergy $val(initialenergy) \
 -agentTrace ON \
 -routerTrace OFF \
 -macTrace OFF

set j 0
set k 0
for {set i 0} {$i  $opt(nn) } {incr i} {
set node_($i) [$ns_ node]
   $node_($i) random-motion 0;# disable random motion
   if {$i%5==0} {
   set j [expr $j+20]
   if {$i!=0} {
set k 0} }
   $node_($i) set X_ [set k [expr $k+20]]
$node_($i) set Y_ $j
$node_($i) set Z_ 0.0
}


for { set j 0} { $j  $opt(nn)} {incr j} {
  $ns_ initial_node_pos $node_($j) 2
  $node_($j) color blue
  $node_($j) log-energy
   }

*for { set j 0} { $j  $opt(nn)} {incr j} {
set udp_($j) [new Agent/UDP]
$ns_ attach-agent $node_($j) $udp_($j)
}

set null_(0) [new Agent/Null]
$ns_ attach-agent $node_([expr $opt(nn)-1]) $null_(0)*


*set cbr [new Application/Traffic/CBR]
$cbr set packetSize_ 50
$cbr set interval_ 3.0
$cbr attach-agent $udp_(0)
$ns_ connect $udp_(0) $null_(0)

$ns_ at 50.0 $cbr star*t

#
# Tell all the nodes when the simulation ends
#
for {set i 0} {$i  $opt(nn) } {incr i} {
$ns_ at $opt(stop) $node_($i

[ns] C compiler cannot create executables(cygwin)(help me!!!!!!!!!!!!!!!!!!!!!!!)(emergency)

2007-04-14 Thread Amin Irandoost


hi all
i have installed gcc compiler on cygwin environment but during install Ns
2.30
i have received C compiler cannot create executables
my version of cygwin is 1.3.12...1.5.21
check for gcc ... ok
check for gcc-g++ ... ok

I'm waiting for your reply
please help me
--
Amin Irandoost

--
Amin Irandoost
Cygwin Package Information
Package  VersionStatus
a2ps 4.13-1 OK
aalib1.4rc5-1   OK
aalib-devel  1.4rc5-1   OK
alternatives 1.3.20a-2  OK
antiword 0.34-2 OK
apache   1.3.33-2   Incomplete
apache2  2.2.2-1OK
apache2-devel2.2.2-1OK
apache2-manual   2.2.2-1OK
apr  0.9.7-1OK
apr-util 0.9.7-1OK
apr1 1.2.7-1OK
aprutil1 1.2.7-1OK
ash  20040127-3 OK
aspell   0.50.3-1   OK
aspell-de0.50.2-1   OK
aspell-dev   0.50.3-1   OK
aspell-doc   0.50.3-1   OK
aspell-en0.51.0-1   OK
aspell-pl0.50.2-1   OK
astyle   1.15.3-3   OK
atk  1.10.3-1   OK
atk-devel1.10.3-1   OK
atk-doc  1.10.3-1   OK
atk-runtime  1.10.3-1   OK
audiofile0.2.6-2OK
autoconf 2.59-2 OK
autoconf2.1  2.13-1 OK
autoconf2.5  2.59-2 OK
automake 1.7.9-2OK
automake1.4  1.4p6-3OK
automake1.5  1.5-1  OK
automake1.6  1.6.3-2OK
automake1.7  1.7.9-2OK
automake1.8  1.8.5-2OK
automake1.9  1.9.6-1OK
base-files   3.7-1  OK
base-passwd  2.2-1  OK
bash 3.1-6  OK
bash-completion  20060301-1 OK
bashdb   3.1_0.05-1 OK
bc   1.06-2 OK
bison2.3-1  OK
boost1.33.1-2   OK
boost-devel  1.33.1-2   OK
bsflite  0.81p2-1   OK
byacc1.9-1  OK
bzip21.0.3-1OK
c-client 2002e-3OK
cabextract   1.1-1  OK
cadaver  0.22.3-1   OK
cairo1.0.2-1OK
cairo-doc1.0.2-1OK
catgets  1.0-1  OK
ccache   2.2-1  OK
ccdoc0.8.41-2   OK
ccrypt   1.7-1  OK
cgoban   1.9.14-2   OK
check0.9.2-2OK
checkx   0.1.0-1OK
chere0.6-4  OK
chkconfig1.2.24h-1  OK
clear1.0-2  OK
clisp2.38-1 OK
cmake2.4.3-1OK
cocom0.995-1OK
compface 1.5.2-1OK
coreutils5.97-1 OK
cpio 2.6-5  OK
cppunit  1.9.14-1   OK
cramfs   1.1-1  OK
cron 3.0.1-19   OK
crypt1.1-1  OK
ctags5.6-1  OK
curl 7.15.4-1   OK
curl-devel   7.15.4-1   OK
cvs  1.11.17-1  OK
cvsutils 0.2.3-1OK
cygport  0.2.2-1OK
cygrunsrv1.17-1 OK
cygutils 1.3.0-1OK
cygwin   1.5.21-2   OK
cygwin-x-doc 1.0.4-1OK
cyrus-sasl   2.1.19-3   OK
d1.2.0-1OK
db2  2.7.7-4OK
db3.13.1.17-2   OK
db4.14.1.25-1   OK
db4.24.2.52-1   OK
db4.34.3.28-1   OK
ddd  3.3.9-1OK
dejagnu  20021217-2 OK
desktop-file-utils   0.10-1 OK
diffstat 1.43-1 OK
diffutils2.8.7-1OK
distcc   2.18.3-1   OK
dmalloc  5.4.2-2OK
docbook-xml412   4.1.2-1OK
docbook-xml424.2-3  OK
docbook-xml434.3-1  OK
docbook-xml444.4-1  OK
docbook-xsl  1.69.1-1   OK
doxygen  1.4.6-1OK
dpkg 1.10.4-2   OK
e2fsimage0.2.0-2OK
e2fsprogs1.35-3 OK
ec-fonts-mftraced1.0.8-4OK
ed

[ns] C compiler cannot create executables(cygwin)(help me!!!!!!!!!!!!!!!!!!!!!!!)

2007-04-13 Thread Amin Irandoost

hi all
i have installed gcc compiler on cygwin environment but during install
i have received C compiler cannot create executables
my version of cygwin is 1.3.12...1.5.21
check for gcc ... ok
check for gcc-g++ ... ok

I'm waiting for your reply
please help me
-- 
Amin Irandoost


[ns] is there in NS Poisson Process function for generating random number??

2007-04-06 Thread Amin Irandoost

hi all
is there in NS Poisson Process function for generating random number??

I'm waiting for reply
Thanks in advance

-- 
Amin Irandoost


[ns] What distribution function suitable for distribute sensor in NS(help me!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!)

2007-04-05 Thread Amin Irandoost

hi all
what random function suitable for distribute sensor
for example i want that 30 senor(node) distribute in 50*50 area

Uniform random is  suitable ?
normal is suitable ?
or ...?

please help me

-- 
Amin Irandoost


[ns] How to trace Segmentation fault error(help me!!!!!!!!!!!!!!!!)

2007-03-26 Thread Amin Irandoost

Hi dear friends
How can i trace Segmentation fault error in NS?
Please help me
Thanks in advance


-- 
Amin Irandoost


[ns] scenario with static and mobile node

2007-03-22 Thread Amin Irandoost

hi all
how to in NS have scenario with static and mobile node
for example 20% mobile and 80% static

-- 
Amin Irandoost


[ns] problem with Scheduler(please see this code and tell me mistake)

2007-03-22 Thread Amin Irandoost

hi all
what is problem this code?

set k 0

$ns at 0.2 set k 4

$ns at 0.3 puts \k=$k\print 0 lieu 4 on screen !!!


Thanks in advance

-- 
Amin Irandoost


[ns] Please help me (emergency) (emergency)

2007-03-21 Thread Amin Irandoost

hi dear friends
when i run my tcl code i get Following error.
what is your idea about this error?
I'm waiting for your reply
Thanks in advance


ns: MobileDeployment 5 5 10 20: can't schedule command in past
(_o5 cmd line 1)
invoked from within
_o5 cmd at 0.0 {_o135 start-dsdv}
invoked from within
catch $self cmd $args ret
invoked from within
if [catch $self cmd $args ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error error when calling class $cls: $args $...
(procedure _o5 line 2)
(SplitObject unknown line 2)
invoked from within
_o5 at 0.0 {_o135 start-dsdv}
(eval body line 1)
invoked from within
eval $scheduler_ at $args
(procedure _o3 line 3)
(Simulator at line 3)
invoked from within
$self at 0.0 $ragent start-dsdv
(procedure _o3 line 11)
(Simulator create-dsdv-agent line 11)
invoked from within
$self create-dsdv-agent $node
(DSDV arm line 2)
invoked from within
switch -exact $routingAgent_ {
DSDV {
set ragent [$self create-dsdv-agent $node]
}
DSR {
$self at 0.0 $node start-dsr
}
AODV {
set ragent [$self cre...
(procedure _o3 line 11)
(Simulator create-wireless-node line 11)
invoked from within
_o3 create-wireless-node 5
(eval body line 1)
invoked from within
eval $self create-wireless-node $args
(procedure _o3 line 23)
(Simulator node line 23)
invoked from within
$ns_ node $i
(procedure MobileDeployment line 7)
invoked from within
MobileDeployment 5 5 10 20

-- 
Amin Irandoost


[ns] create mobile node in specified time

2007-03-21 Thread Amin Irandoost

hi dear friends
how to create Mobile node with DSDV routing protocol in specified Time at
simulation

for example
$ns at 2.0 set node_(1) [$ns node]

in default at 0.0 only create node happens

I'm waiting for your reply

Thanks in advance

please reply me emergency



-- 
Amin Irandoost


[ns] deploy nodes

2007-03-21 Thread Amin Irandoost

hi dear friends
I'm work on scenario in sensor networks that in two step ( in Two time of
simulation First in begin and second after several seconds)  deploy nodes in
space
therefor what solution exist in NS for it ??

I'm waiting for your reply
Please guide me



-- 
Amin Irandoost


[ns] (emergency)help me[about reading variable value in tcl]

2007-03-20 Thread Amin Irandoost

hi dear friends
how to read  variable value of C++ in OTCL??
for example a partial of code are
class test:public TclObject{
public:
int i;
test();
.
.
.};

test::test(){
bind(i_,i);
}

in Tcl write this:
set te [new test]
set x [$te $i???] ??

-- 
Amin Irandoost

-- 
Amin Irandoost


[ns] Please help me (emergency) about reading variable value

2007-03-20 Thread Amin Irandoost

hi dear friends
how to read  variable value of C++ in OTCL??
for example a partial of code are
class test:public TclObject{
public:
int i;
test();
.
.
.};

test::test(){
bind(i_,i);
}

in Tcl write this:
set te [new test]
set x [$te $i???] ??

-- 
Amin Irandoost


[ns] Floating point exception(Help me emergency)

2007-03-15 Thread Amin Irandoost

hi dear friends
I write new protocol for solving Coverage problem in sensor network
this protocol run successfully in C++  with main function but when run in NS
i received a Floating point exception

please guide me

I'm waiting for reply

Thanks in advance

-- 
Amin Irandoost


[ns] Plz guide me(Emergency)

2007-02-04 Thread Amin Irandoost

Hi all
I wrote the following code for broadcasting a message in Wireless sensor
network,but i couldn't see any message passing in NAM
please tell me whether or not I can see this event in NAM and Is
broadcasting work truly?
How can I test the VERITY of broadcasting?

please Help me
i'm waitng for your reply
Thanks in advances

# ==
# Define options
# ==
 set opt(chan) Channel/WirelessChannel  ;# channel type
 set opt(prop) Propagation/TwoRayGround ;# radio-propagation model
 set opt(ant)  Antenna/OmniAntenna  ;# Antenna type
 set val(ll)   LL   ;# Link layer type
 set opt(ifq)  Queue/DropTail/PriQueue  ;# Interface queue type
 set opt(ifqlen)   500  ;# max packet in ifq
 set opt(netif)Phy/WirelessPhy  ;# network interface type
 set opt(mac)  Mac/802_11   ;# MAC type
 set opt(nn)   5;# number of mobilenodes
 set val(rp)   DSDV ;# routing protocol
 set opt(x)100;# X dimension of the topography
 set opt(y)100;# Y dimension of the topography
 set opt(stop)20.0;# simulation time

proc finish {} {
global ns_ f na
$ns_ flush-trace
close $f
close $na
exec nam 1.nam 
exit 0
}

set ns_ [new Simulator]

set f [open 1.tr w]
$ns_ trace-all $f

set na [open 1.nam w]
$ns_ namtrace-all-wireless $na 100 100

set topo [new Topography]
$topo load_flatgrid $opt(x) $opt(y)

set god_ [create-god $opt(nn)]

$ns_ node-config -adhocRouting $val(rp)  \
 -llType $val(ll) \
 -macType $opt(mac) \
 -ifqType $opt(ifq) \
 -ifqLen  $opt(ifqlen) \
 -antType $opt(ant) \
 -propType  $opt(prop) \
 -phyType $opt(netif) \
 -channel [new $opt(chan)] \
 -topoInstance $topo \
 -WiredRouting OFF \
 -agentTrace ON \
 -macTrace OFF \
 -movementTrace OFF \
 -routerTrace OFF


for { set j 0} { $j  $opt(nn)} {incr j} {
   set node_($j) [$ns_ node]
   $node_($j) random-motion 0
   }

$node_(0) set X_ 5
$node_(0) set Y_ 5
$node_(1) set X_ 1
$node_(1) set Y_ 1
$node_(2) set X_ 9
$node_(2) set Y_ 9
$node_(3) set X_ 6
$node_(3) set Y_ 6
$node_(4) set X_ 8
$node_(4) set Y_ 20

$ns_ at 0.1 $node_(0) setdest 70 90 10
$ns_ at 0.1 $node_(1) setdest 4 10 10
$ns_ at 0.1 $node_(2) setdest 2 90 10
$ns_ at 0.1 $node_(3) setdest 40 90 10
$ns_ at 0.1 $node_(4) setdest 20 90 10

$ns_ color $node_(1) blue ; #why the color is not set???
$ns_ color $node_(4) red  ; #why the color is not set???

set udp [new Agent/MessagePassing]
$ns_ attach-agent $node_(1) $udp

set sink [new Agent/MessagePassing]
$ns_ attach-agent $node_(4) $sink

set sink1 [new Agent/MessagePassing]
$ns_ attach-agent $node_(0) $sink1

set sink2 [new Agent/MessagePassing]
$ns_ attach-agent $node_(2) $sink2

set sink3 [new Agent/MessagePassing]
$ns_ attach-agent $node_(3) $sink3

$ns_ connect $udp $sink2 ;#do this code is needed for broadcasting
$ns_ connect $udp $sink1
$ns_ connect $udp $sink
$ns_ connect $udp $sink3

$udp set dst_addr_ -1  ;#set destination address -1 for
broadcasting
$udp set dst_port_ 255 ;#set destination port -255 on DSDV for
broadcasting?

$ns_ at 6.0 amin
$ns_ at 7.0 amin
$ns_ at 8.0 amin

proc amin {} {
global udp , node_
for { set i 0 } { $i  4 } { incr i }  {
$udp send 1 {[$node_($i) id]}
;#broadcasting
puts \nNode [$node_($i) node-addr] send [$node_($i) node-addr] \n
}
}



for {set i 0} {$i  $opt(nn) } {incr i} {
$ns_ at $opt(stop).1 $node_($i) reset;
}


$ns_ at $opt(stop).0001 puts \NS EXITING...\ ; $ns_ halt

$ns_ at 19.99 finish

puts Starting Simulation...
$ns_ run


[ns] Plz Help me (((Emergency)))

2007-02-03 Thread Amin Irandoost

Hi
Please tell me :
In NS, how can a mobile node broadcast its address in sensor network?
Please, send to me a sample code for doing this task.
I test too many ways but i don't get a reliable result

thanks a lot in advance
I'm waiting for your reply IMPATIENTLY



-- 
Amin Irandoost