[ns] send data from one node to special node.. help please

2009-07-26 Thread soheila rahmani

hi friends
 i write a wireless simulation with 6 nodes and want to s1 send to s2 send
to r1 send to r2 send to r3 and at last send to d1
but in the nam file node 0 send to node 2 !! and dont send to node 1 then
from node 1 to node 2!!!
and node 3 send to node 5 directly .
how do i do for solving this problem . this below is my simulation i use god
and node's position are showed
please help me


$god_ set-dist 0 1 1
$god_ set-dist 0 2 2
$god_ set-dist 0 3 3
$god_ set-dist 0 4 4
$god_ set-dist 0 5 5
$god_ set-dist 1 2 1
$god_ set-dist 1 3 2
$god_ set-dist 1 4 3
$god_ set-dist 1 5 4
$god_ set-dist 2 3 1
$god_ set-dist 2 4 2
$god_ set-dist 2 5 3
$god_ set-dist 3 4 1
$god_ set-dist 3 5 2
$god_ set-dist 4 5 1


$s1 set Z_ 0.
$s1 set Y_ 199.373306816804
$s1 set X_ 1.364418416244

$s2 set Z_ 0.
$s2 set Y_ 199.373306816804
$s2 set X_ 100.364418416244

$r1 set Z_ 0.
$r1 set Y_ 199.373306816804
$r1 set X_ 250.046298323157

$r2 set Z_ 0.
$r2 set Y_ 199.373306816804
$r2 set X_ 350.256560093833

$r3 set Z_ 0.
$r3 set Y_ 199.373306816804
$r3 set X_ 400.256560093833

$d1 set Z_ 0.
$d1 set Y_ 199.373306816804
$d1 set X_ 550.256560093833


[ns] hwo to connect a wireless node to aother nod

2009-07-26 Thread soheila rahmani

hi friends
 i write a wireless simulation with 6 nodes and want to s1 send to s2 send
to r1 send to r2 send to r3 and at last send to d1
but in the nam file node 0 send to node 2 !! and dont send to node 1 then
from node 1 to node 2!!!
and node 3 send to node 5 directly .
how do i do for solving this problem . this below is my simulation i use god
and node's position are showed
please help me


$god_ set-dist 0 1 1
$god_ set-dist 0 2 2
$god_ set-dist 0 3 3
$god_ set-dist 0 4 4
$god_ set-dist 0 5 5
$god_ set-dist 1 2 1
$god_ set-dist 1 3 2
$god_ set-dist 1 4 3
$god_ set-dist 1 5 4
$god_ set-dist 2 3 1
$god_ set-dist 2 4 2
$god_ set-dist 2 5 3
$god_ set-dist 3 4 1
$god_ set-dist 3 5 2
$god_ set-dist 4 5 1


$s1 set Z_ 0.
$s1 set Y_ 199.373306816804
$s1 set X_ 1.364418416244

$s2 set Z_ 0.
$s2 set Y_ 199.373306816804
$s2 set X_ 100.364418416244

$r1 set Z_ 0.
$r1 set Y_ 199.373306816804
$r1 set X_ 250.046298323157

$r2 set Z_ 0.
$r2 set Y_ 199.373306816804
$r2 set X_ 350.256560093833

$r3 set Z_ 0.
$r3 set Y_ 199.373306816804
$r3 set X_ 400.256560093833

$d1 set Z_ 0.
$d1 set Y_ 199.373306816804
$d1 set X_ 550.256560093833


[ns] adaptive algorithm and carrier sensing

2009-07-26 Thread neerajgupta


hi all

 i am simulating a scenario where i have 5 nodes arranged in following order 


 2 4


   0

 1  3

the script of the file is


# Define options
# ==
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) 5  ;# number of mobilenodes
set val(rp) DumbAgent  ;# routing protocol
set val(x)  500;# X dimension of topography
set val(y)  500;# Y dimension of topography
set val(finish) 50;# time of simulation end
# ==

# Main Program
# ==

# Initialize Global Variables

set ns [new Simulator]
set tracefd [open tracefile.tr w]
set namtrace [open out.nam w]

$ns use-newtrace
$ns trace-all $tracefd
$ns namtrace-all-wireless $namtrace $val(x) $val(y)

# Define a 'finish' procedure

proc finish {} {
global ns tracefd namtrace
$ns flush-trace
close $tracefd
close $namtrace
exec nam out.nam 

}

# Set up topography object

set topo   [new Topography]

$topo load_flatgrid $val(x) $val(y)

# Create God

create-god $val(nn)

#Create channel
set chan_1 [new $val(chan)]

#  Create the specified number of mobilenodes [$val(nn)] and attach them to 
the channel.
#  Here five nodes are created 

# Configure nodes

$ns node-config -adhocRouting $val(rp) \
 -llType $val(ll) \
 -macType $val(mac) \
 -ifqType $val(ifq) \
 -ifqLen $val(ifqlen) \
 -antType $val(ant) \
 -propType $val(prop) \
 -phyType $val(netif) \
 -channel $chan_1 \
 -topoInstance $topo \
 -agentTrace ON \
 -routerTrace OFF \
 -macTrace ON \
 -movementTrace OFF \
 

Phy/WirelessPhy set CPThresh_ 10.0
Phy/WirelessPhy set CSThresh_ 1.55903e-11 ;#550m
Phy/WirelessPhy set RXThresh_ 3.65213e-10 ;#250m
Phy/WirelessPhy set bandwidth_ 1Mb
Phy/WirelessPhy set Pt_ 0.2818
Phy/WirelessPhy set freq_ 2.4e+9
Phy/WirelessPhy set L_ 1.0
#Antenna/OmniAntenna set X_ 0
#Antenna/OmniAntenna set Y_ 0
#Antenna/OmniAntenna set Z_ 0.25
Antenna/OmniAntenna set Gt_ 1
Antenna/OmniAntenna set Gr_ 1
Mac/802_11 set SlotTime_  0.50;# 50us
Mac/802_11 set SIFS_  0.28;# 28us
Mac/802_11 set DIFS_  0.000128;# 128us
Mac/802_11 set PreambleLength_72 ;# 144 bit
Mac/802_11 set PLCPHeaderLength_  48  ;# 48 bits
Mac/802_11 set PLCPDataRate_  1.0e6   ;# 1Mbps
#Mac/802_11 set dataRate_  1.0e6  ;# 1Mbps
#Mac/802_11 set basicRate_ 1.0e6   ;# 1Mbps


for {set i 0} {$i  $val(nn) } {incr i} {
set node_($i) [$ns node]
$node_($i) random-motion 0 ;
}

# Provide initial (X,Y, for now Z=0) co-ordinates for mobilenodes

$node_(0) set X_ 150.0
$node_(0) set Y_ 200.0
$node_(0) set Z_ 0.0

$node_(1) set X_ 250.0
$node_(1) set Y_ 100.0
$node_(1) set Z_ 0.0

$node_(2) set X_ 50.0
$node_(2) set Y_ 300.0
$node_(2) set Z_ 0.0

$node_(3) set X_ 50.0
$node_(3) set Y_ 100.0
$node_(3) set Z_ 0.0

$node_(4) set X_ 250.0
$node_(4) set Y_ 300.0
$node_(4) set Z_ 0.0

# Setup traffic flow between nodes
# UDP connections between node_(2) and node_(3)

set udp [new Agent/UDP]
set sink [new Agent/Null]
$ns attach-agent $node_(2) $udp
$ns attach-agent $node_(3) $sink
$ns connect $udp $sink

set cbr [new Application/Traffic/CBR]
$cbr set packetSize_ 1024
$cbr attach-agent $udp
$ns at 1.0 $cbr start

# Define node initial position in nam

for { set i 0 } { $i  $val(nn) } { incr i } {
$ns initial_node_pos $node_($i) 30
}

# Telling nodes when the simulation ends
for {set i 0 } {$i  $val(nn) } {incr i} {
$ns at $val(finish) $node_($i) reset;
}

# Ending nam and the simulation

$ns at $val(finish) $ns nam-end-wireless $val(finish)
$ns at $val(finish) finish
$ns at 50.01 puts \ns EXITING...\ ; $ns halt

puts Starting Simulation...
$ns run

the problem is in 802_11.cc file. actually there is adaptive fidelity 

[ns] show result DSR, DSDV in ns 2, please help me

2009-07-26 Thread Wei Zhang

 
Dear all,
 
I try to test DSR and DSDV in ns 2(version 2.33). It run well but show nothing. 
I can not find its trace file. Where is its trace file or its result file? How 
I can see its result? who could please help me?
 
Thanks in advance.




  


[ns] awk scripts for calculating delay, throughput and packet loss in wireless networks

2009-07-26 Thread Yota Alexiou


Hello everyone!!
Has anyone have any awk scripts for calculating delay, throughput and loss in 
wireless ad hoc networks?
If yes, I would be GRATEFULL to send me those cause I need them for my final 
project!!
Thank you all in advance!! 
 
Giotuel

_
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.

http://www.microsoft.com/windows/windowslive/products/photos.aspx