[ns] Need help for Wireless Simulation

2008-03-18 Thread Sarwan Sivaji

hi all,

I am new to NS 2. I want to simulate a Wireless network.  The network consists 
of some static nodes (non-mobile nodes) and one mobile node.  The mobile node 
move around the specified topography.  While it moves it should broadcast its 
current location at regular intervals (beacon message).  The other nodes 
receives the message and should give acknowledgement. The ack also broadcasted 
by the receiving nodes.  Each node has communication range of 30m.  When the 
mobile node enters the communication range of the static node, they can receive 
the beacon message. 

Can any one tell me...
1.  how to make the wireless mobile node to broadcast its current location?
2.  which agents to use? which is suitable for broadcasting?


my topography is 200 X 200m
I want to set the communication range of each node to be 30m.  How to set the 
communication range of  nodes?

please...kindly give suggestions...


regards
Sarwan
   
-
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.


Re: [ns] need help on wireless simulation

2007-02-26 Thread romzyi prasetyo

I want to observe the queue scheduling inside the router node,here is the
complete picture:

FTP0
 |
tcp0
 |
n1
\ sink0
  \  /
n2 - - - - - - - - - - -n3
   / \
 / sink1
 n0
  |
tcp1
  |
ftp1

I want the packets to go through node 2 before they are sent by node 2 to
node 3, that means it will be one-hope away right? I set tcp agent and ftp
application in node 0 and node 1, as well as attached 2 tcpsink to
node 3.Imade node 3 out of the sensing range of the source nodes so
that i can make
sure that the packets from source node did not go directly to node 3.However,
after the simulation, they are not only didnt go directly to node 3 but also
not sent to node 2. Thats why I am wondering what is wrong with my
simulation.Do you know the situation?
Thanks for your help.

On 2/26/07, Matthias Kuhnert [EMAIL PROTECTED] wrote:

 Hi,

 do you have any traffic between source and sink at all?
 If so, then they simply have a direct connection and communicate without
 the other node. So then either put the nodes further away from each other,
 or decrease the rx/tx range...
 If not, you have a completely different problem and perhaps the nodes too
 far apart from each other...


 Greets,
 Matthias

  Original-Nachricht 
 Datum: Mon, 26 Feb 2007 21:51:04 +0800
 Von: romzyi prasetyo [EMAIL PROTECTED]
 An: ns milis ns-users@ISI.EDU
 CC:
 Betreff: [ns] need help on wireless simulation

 
  hi all,
 
  I am new in NS2. Currently I am doing wireless simulation which consists
  of
  4 nodes. 2 as the source nodes, 1 as a router, the other one as a sink
  node.
  I want to simulate such that when the source nodes generate packets, the
  packets will be queued in relay node  before they are sent to the sink
  node.However,the problem is there is no packet received in node 2 .I
  wonder
  what has caused this error.I have made sure that the relay node is
 located
  pretty near to the source nodes, but still no packets received there.
  Below is the code:
  #
 ===
  # PRIORITY-BASED DROPTAIL QUEUE SIMULATION#
  #
 ===
  # Scheme:
  #
 ---
 
  #n1(100,200,0)
  #  \
  #   n2(150,150,0) --- n3(500,150,0)
  #  /
  #n0(100,100,0)
  #
  # ==

  # 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) 10;# max packet in ifq
  set val(nn) 4  ;# number of
  mobilenodes
  set val(rp) DSDV   ;# routing protocol
  set val(drate)2.0e6   ;# default
 datarate
 
  # ==
  # Main Program
  # ==
 
 
  proc getopt {argc argv} {
  global val
  lappend optlist drate
 
  for {set i 0} {$i  $argc} {incr i} {
  set arg [lindex $argv $i]
  if {[string range $arg 0 0] != -} continue
 
  set name [string range $arg 1 end]
  set val($name) [lindex $argv [expr $i+1]]
  }
 
  }
 
  getopt $argc $argv
 
  # Initialize Global Variables
  set ns_[new Simulator]
  set tracefd [open fyp6.tr w]
  #set tracefd0 [open fyp4_0.tr w]
  #set tracefd1 [open fyp4_1.tr w]
  #set cmt [cmu-trace Send RTR $tracefd]
  $ns_ use-newtrace
  $ns_ trace-all $tracefd
 
  # set up topography object
  set topo   [new Topography]
  $topo load_flatgrid 500 500
 
  # Create God
  create-god $val(nn)
 
  set data0 0
  set data1 0
 
  # Parameter values
  $val(mac) set dataRate_ $val(drate)
  #$val(mac) set bandwidth_ 22.0e6
  #$val(netif) set Pt_ 0.28
  $val(netif) set bandwidth_ 2.0e6
 
 
  #  Create the specified number of mobilenodes [$val(nn)] and attach
 them
  #  to the channel
  #  Here 4 nodes are created : node(0),node(1), node(2)  and node(3)
 
  # configure node
  $ns_ node-config -adhocRouting $val(rp) \
  -llType $val(ll) \
  -macType $val(mac) \
  -ifqType $val(ifq) \
  -ifqLen $val