[ns] plz , help me with this issue ..

2011-08-31 Thread Sandy Haff

hi everyone 


i want to generate a movement scenario pattern 
using cmu-scen-gen , ./setdest  , for 200 MNs, moving at speed 30 m/s  


but i want The position of MNs and its movement are set randomly. 
can anyone just show me how , i really need this urgentlly ..


[ns] ERROR when run my fist tcl example

2011-08-31 Thread Bety Barreto Soares



 
# myfirst_ns.tcl
# create a simulator
set ns [new simulator]
 
create a trace file
set mytrace [open out.tr w]
$ns trace-all $mytrace
 
create a NAM trace file
set myNAM [open out.nam w]
$ns namtrace-all $myNAM
 
define a procedure finish
proc finish {} {
  global ns mytrace myNAM
  $ns flush-trace
  close $mytrace
  close $myNAM
  exec nam out.nam 
  exit 0
}
 
create nodes
set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
set n4 [$ns node]
 
connect nodes with links
$ns duplex-link $n0 $n2 100Mb 5ms DropTail
$ns duplex-link $n1 $n2 100Mb 5ms DropTail
$ns duplex-link $n2 $n4 54Mb 10ms DropTail
$ns duplex-link $n2 $n3 54Mb 10ms DropTail
$ns duplex-link $n3 $n4 10Mb 15ms DropTail
$ns queue-limit $n2 n3 40
 
create a UDP agent
set udp [new Agent/UDP]
$ns attach-agent $n0 $udp
set null [new Agent/Null]
$ns attach-agent $n3 $null
$ns connect $udp $null
$udp set fid_1
 
create a CBR traffic source
set cbr [new Application/Traffic/CBR]
$cbr attach-agent $udp
$cbr set packetSize_1000
$cbr set rate_2Mb
 
create a TCP agent
set tcp [new Agent/TCP]
$ns attach-agent $n1 $tcp
set sink [new Agent/TCPSink]
$ns attach-agent $n4 $sink
$ns connect $tcp $sink
$tcp set fid_2
 
create an FTP session
set ftp [new Application/FTP]
$ftp attach-agent $tcp
 
schedule events
ns at 0.05 $ftp start
ns at 0.1 $cbr start
ns at 60.0 $ftp stop
ns at 60.5 $cbr stop
ns at 61 finish
}
 
# Start the simulation
$ns run
 
ON THE CYGWIN I RUN THE FILE
$ ns myfirst_ns.tcl
 
IT'S ERROR SHOW BELOW

 
$ myfirst_ns.tcl
invalid command
name simulator
while executing
simulator
create _o3
invoked from
within
catch$className
create $o $args msg
invoked from
within
if [catch
$className create $o $args msg] {
if [string match
_FAILED _SHADOW_OBJECT_$msg] {
delete $o
return
}
global errorInfo
error class
$..
 procedure new line 3
invoked from
within
new
simulator
invoked from
within
set ns [new
simulator]
file
myfirst_ns.tcl line3
 
 
 
 
How to solve this?please help me out..i’m
very new



Re: [ns] ERROR when run my fist tcl example

2011-08-31 Thread nicholas mbonimpa

Hi Soares,

Try writing simulator with capital S instead of small s.

Try this tutorial for your first experience. Run the examples in it. They'll
help you get used to the simulator.

http://www.isi.edu/nsnam/ns/tutorial/

Kind regards,

Nicholas Mbonimpa


On Wed, Aug 31, 2011 at 7:46 AM, Bety Barreto Soares betyb...@yahoo.comwrote:





 # myfirst_ns.tcl
 # create a simulator
 set ns [new simulator]

 create a trace file
 set mytrace [open out.tr w]
 $ns trace-all $mytrace

 create a NAM trace file
 set myNAM [open out.nam w]
 $ns namtrace-all $myNAM

 define a procedure finish
 proc finish {} {
   global ns mytrace myNAM
   $ns flush-trace
   close $mytrace
   close $myNAM
   exec nam out.nam 
   exit 0
 }

 create nodes
 set n0 [$ns node]
 set n1 [$ns node]
 set n2 [$ns node]
 set n3 [$ns node]
 set n4 [$ns node]

 connect nodes with links
 $ns duplex-link $n0 $n2 100Mb 5ms DropTail
 $ns duplex-link $n1 $n2 100Mb 5ms DropTail
 $ns duplex-link $n2 $n4 54Mb 10ms DropTail
 $ns duplex-link $n2 $n3 54Mb 10ms DropTail
 $ns duplex-link $n3 $n4 10Mb 15ms DropTail
 $ns queue-limit $n2 n3 40

 create a UDP agent
 set udp [new Agent/UDP]
 $ns attach-agent $n0 $udp
 set null [new Agent/Null]
 $ns attach-agent $n3 $null
 $ns connect $udp $null
 $udp set fid_1

 create a CBR traffic source
 set cbr [new Application/Traffic/CBR]
 $cbr attach-agent $udp
 $cbr set packetSize_1000
 $cbr set rate_2Mb

 create a TCP agent
 set tcp [new Agent/TCP]
 $ns attach-agent $n1 $tcp
 set sink [new Agent/TCPSink]
 $ns attach-agent $n4 $sink
 $ns connect $tcp $sink
 $tcp set fid_2

 create an FTP session
 set ftp [new Application/FTP]
 $ftp attach-agent $tcp

 schedule events
 ns at 0.05 $ftp start
 ns at 0.1 $cbr start
 ns at 60.0 $ftp stop
 ns at 60.5 $cbr stop
 ns at 61 finish
 }

 # Start the simulation
 $ns run

 ON THE CYGWIN I RUN THE FILE
 $ ns myfirst_ns.tcl

 IT'S ERROR SHOW BELOW


 $ myfirst_ns.tcl
 invalid command
 name simulator
 while executing
 simulator
 create _o3
 invoked from
 within
 catch$className
 create $o $args msg
 invoked from
 within
 if [catch
 $className create $o $args msg] {
 if [string match
 _FAILED _SHADOW_OBJECT_$msg] {
 delete $o
 return
 }
 global errorInfo
 error class
 $..
  procedure new line 3
 invoked from
 within
 new
 simulator
 invoked from
 within
 set ns [new
 simulator]
 file
 myfirst_ns.tcl line3




 How to solve this?please help me out..i’m
 very new




[ns] Interdisciplinary relevance

2011-08-31 Thread Rajib Das

Can anybody tell me or suggest me what will be the Interdisciplinary
relevance of Routing Attack in MANET with other subjects like physics ,
Mathematics or any other area?

-- 
*With regards*
*
Rajib Das, MCA, M.Phil
**
Research Scholar, Dept. of Comp. Sc.
**
Assam University, Silchar
Assam. Pin - 788 011.
*


[ns] Diffusion RMSt (diffagent, routing table, reinforcement messages )

2011-08-31 Thread Anas

Dear ns-2 users and developers 
I have been working on ns2.29 using Directed Diffusion (RMST) to
simulate my network.

1- I attached the rmst as DiffApp to the node that conflict NS2 that
says agents should be attached to nodes and applications to the agents
so should i create diffusion agents and attach it to the nodes before.


2- i managed to run the simulation with zigbee and in the trace file i
can see packets being sent and received but as diffusion is defined to
do gradient reinforcement so can i see the packets which execute these
reinforcements in the trace file and what will they be labelled.

3- in term of packets forwarding i cannot see any packet being forwarded
from the far nodes toward the rmst sink in the trace file so should i
add the routing tables manually to each node or it is internally
implemented in the diffusion application

i have added my scripts at the end 

With all appreciate to any reply or suggestion 
Regards 
Anas   


#===
# Simulation parameters setup
#===

set val(chan)   Channel/WirelessChannel;# channel type
set val(prop)   Propagation/TwoRayGround   ;# radio-propagation model
set val(netif)  Phy/WirelessPhy/802_15_4;# network interface
type
set val(mac)Mac/802_15_4;# 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(seed)   00.0
set val(nn) 20  ;# number of mobilenodes
set val(filters)   GradientFilter ;# filters  
set val(adhocRouting)   Directed_Diffusion ;# routing protocol
set val(x)  400  ;# X dimension of topography
set val(y)  400  ;# Y dimension of topography
set val(stop)   80 ;# time of simulation end
set val(en) EnergyModel;
set val(initialenergy)  10.0   ;  

Phy/WirelessPhy set L_ 1.0 ;#System Loss Factor
Phy/WirelessPhy set freq_ 2.472e9  ;#channel
Phy/WirelessPhy set bandwidth_ 11Mb;#Data Rate
Phy/WirelessPhy set Pt_ 1.8;#Transmit Power
Phy/WirelessPhy set CPThresh_ 100.0 ;#Collision Threshold
Phy/WirelessPhy set CSThresh_ 5.011872e-12 ;#Carrier Sense Power
Phy/WirelessPhy set RXThresh_ 5.82587e-09  ;#Receive Power Threshold
Mac/802_11 set dataRate_ 11Mb  ;#Rate for   ta Frames
Mac/802_11 set basicRate_ 1Mb  ;#Rate for Control Frames


LL set mindelay_50us
LL set delay_   25us
LL set bandwidth_   0   ;# not used

Queue/DropTail/PriQueue set Prefer_Routing_Protocols1
# 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
#set the default ports 
#Agent/UDP set sport_ 0
#Agent/UDP set dport_ 1
#Agent/Null set sport_ 2 
#Agent/Null set dport_ 3
#Application/DiffApp/RmstSource set sport_ 4
#Application/DiffApp/RmstSink set dport_ 5
#===
#Initialization
#===
#Create a ns simulator
set ns_ [new Simulator]
$ns_ use-newtrace

#$ns_ puts simulation starts

# Create the God

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

#Setup topography object

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


#Open the NS trace file

set tracefile [open out.tr w]
$ns_ trace-all $tracefile

#Open the NAM trace file
set namfile [open rmst.nam w]
$ns_ namtrace-all $namfile
$ns_ namtrace-all-wireless $namfile $val(x) $val(y)
set chan [new $val(chan)]; #Create wireless channel

#===
# Mobile node parameter setup
#===
#Setting the sensing nodes 
#set val(adhocrouting) AODV
$ns_ node-config -adhocRouting $val(adhocRouting) \
 -MPLS ON \
 -llType $val(ll) \
 -macType $val(mac) \
 -ifqType $val(ifq) \
 -ifqLen $val(ifqlen) \
 -antType $val(ant) \
 -propType $val(prop) \
 -phyType $val(netif) \
 -channel  $chan \
 -topoInstance $topo \
 -diffusionFilter $val(filters) \
 -agentTrace ON \
 -routerTrace OFF \
 -macTrace ON \
 -idlePower 1.0 \
 -rxPower 1.0 \
 -txPower 1.0 \
 -sleepPower 0.001 \
 -transitionPower 0.2 \
 -transitionTime 0.005 \
 -initialEnergy $val(initialenergy) \
 -energyModel