[ns] how to broadcast/multicast

2010-04-14 Thread pradeep bansal

how to broadcast/multicast in ns-2
i have 5 nodes
number 1 is coneected to other 4's
i want node number 1 to send packets to all 4


-- 
Pradeep Bansal
Computer Science and Engineering
NIT Kurukshetra


[ns] multicast communication in wireless mesh network

2010-04-14 Thread gurudevi patil

hi
 i need some sample code for multicast communication in wireless mesh
network.plz send that very soon.

regards
g.m.patil


[ns] Fwd: multicast communication in wireless mesh network

2010-04-14 Thread gurudevi patil

-- Forwarded message --
From: gurudevi patil patilgurude...@gmail.com
Date: Wed, Apr 14, 2010 at 11:37 AM
Subject: multicast communication in wireless mesh network
To: ns-users@isi.edu, ns-users-requ...@isi.edu, ns-users-boun...@isi.edu


hi
 i need some sample code for multicast communication in wireless mesh
network using ns2.34.plz send that very soon.

regards
g.m.patil


[ns] dijkistras algorithm using ns2

2010-04-14 Thread gurudevi patil

hi,
  if anybody can implemented dijkistras algorithm in wireless network using
ns2.plz send that otcl code to me.


[ns] Invitation to connect on LinkedIn

2010-04-14 Thread Barkat Qureshi

LinkedIn
Barkat Qureshi requested to add you as a connection on LinkedIn:
--

Rishabh,

I'd like to add you to my professional network on LinkedIn.

- Barkat

Accept invitation from Barkat Qureshi
http://www.linkedin.com/e/XYLt_3zkkGuzoc16gPkCk3Z-PrP/blk/I630169329_3/pmpxnSRJrSdvj4R5fnhv9ClRsDgZp6lQs6lzoQ5AomZIpn8_cRYVczcVdz4McPp9bTBjt5hFdRBPbPgTejsVej8Ocz4LrCBxbOYWrSlI/EML_comm_afe/

View invitation from Barkat Qureshi
http://www.linkedin.com/e/XYLt_3zkkGuzoc16gPkCk3Z-PrP/blk/I630169329_3/0PnPAOcPAScj0PdAALqnpPbOYWrSlI/svi/

--

Why might connecting with Barkat Qureshi be a good idea?

Have a question? Barkat Qureshi's network will probably have an answer:
You can use LinkedIn Answers to distribute your professional questions to 
Barkat Qureshi and your extended network. You can get high-quality answers from 
experienced professionals.

http://www.linkedin.com/e/ash/inv19_ayn/

 
--
(c) 2010, LinkedIn Corporation


Re: [ns] Regarding capacity(Bottleneck) bandwidth estimation

2010-04-14 Thread Aurelien Lafranchise

Yes I can do that !

You need to modify the code where dijkstra is implemented. (route.cc)

Set the cost of the link to 1/BW

and in addition to $ns run you have to write your own proc run to call
the dijkstra like algorithm that calculate the bottleneck of the path
and try to  find the path where the bottleneck is max.

Aurélien


naveen gowda a écrit :
 Can u help me regarding this pls

 On Wed, Apr 14, 2010 at 11:00 AM, naveen gowda
 naveengowd...@gmail.com mailto:naveengowd...@gmail.com wrote:

 Its basically measuring capacity(bottleneck) bandwidth of targeted
 path segments..


 On Tue, Apr 13, 2010 at 1:14 PM, Aurelien Lafranchise
 aurelien.lafranch...@ens-lyon.fr
 mailto:aurelien.lafranch...@ens-lyon.fr wrote:

 Hi,

 Is your problem related to the widest shotest path ? If yes I
 can help you.

 Aurélien

 naveen gowda a écrit :
  Hi All,
 
  If any one worked or working with estimating bottleneck
 bandwidth of path
  pls help me regarding this... I need tcl code of this..
 
  Thankin you
  --
  With regards
  Navi
 




 -- 
 With regards
 Navi




 -- 
 With regards
 Navi




[ns] Fwd: help - get node_id from tcl to c++

2010-04-14 Thread Ramprasath M

-- Forwarded message --
From: Ramprasath M ramprasathma...@gmail.com
Date: Wed, Apr 14, 2010 at 1:31 PM
Subject: help - get node_id from tcl to c++
To: ns-users-requ...@isi.edu, ns-users@isi.edu



Hi,

 We are doing project in VANET, now we got a problem with the
implementation...V need to have node_id in our protocol.cc as like we used
in tcl file..Our protocol is much similar to DSR, v need compare the node_id
which now requested for route from cc file with the node_id we traced from
an another file..The ids from this file will be like the ids in tcl
file.Please help us...its so urgent...thank u



-- 
Regards,
Ramprasath.M


[ns] problem with creating connection between N node error whan runnig the tcl script

2010-04-14 Thread Emma Ch

I wanted to create a connection between 8 nodes and one AP, the transmission is 
in full duplex mode, for that i used this script:


set ns [new Simulator]

# les dix noeuds: 
set node_0 [$ns node]

# création des outputs trace et nam:
set f [open glad.tr w]
$ns trace-all $f
set nf [open glad.nam w]
$ns namtrace-all $nf
# ==
# 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(rp) DumbAgent      ;# routing protocol
set val(start)  0.0
set val(ifqlen) 50 ;# max packet in ifq
set val(nn) 9
set val(tr) trace
set val(X)  500
set val(Y)  500
set val(CWmin)  16
set val(CWmax)  1024
set val(SlotTime)   0.09
set val(SIFS)   0.16
set val(basicRate)  2Mb
set val(dataRate)   54Mb
set val(PreambleLength)   104 
set val(PLCPHeaderLength)   48
#
# Codec:  G.711
#
#set val(ON) 1500ms
#set val(OFF)    1500ms
#set val(AppRate)    96Kb
#set val(pktsize) 160 #160 octets
#set val(pktinterval) 0.020
#set pktsize $val(pktsize) #160 octets
#set pktinterval $val(pktinterval)   
#set val(run) 50.0
#
# MAC MIB
#
Mac/802_11         set basicRate $val(basicRate)Mb
Mac/802_11         set dataRate  $val(dataRate)Mb
Mac/802_11         set CWMin $val(CWmin)
Mac/802_11         set CWMax $val(CWmax)
Mac/802_11         set SlotTime  $val(SlotTime)
Mac/802_11         set SIFS  $val(SIFS)
Mac/802_11  set PreambleLength    $val(PreambleLength);# no preamble
Mac/802_11  set PLCPHeaderLength  
$val(PLCPHeaderLength) ;# 128 bits
Mac/802_11  set PLCPDataRate  1.0e6   ;# 1Mbps

# set up topography object
set topo   [new Topography]
#$topo load_flatgrid $val(X) $val(Y)

# Create God
create-god $val(nn)

# configure node
 
    $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) \
             -channelType $val(chan) \
             -topoInstance $topo \
             -agentTrace ON \
             -routerTrace OFF \
             -macTrace OFF \
             -movementTrace OFF             
             
    for {set i 0} {$i  $val(nn) } {incr i} {
        set node_($i) [$ns node]     
        $node_($i) random-motion 0        ;# disable random motion
    }


  
set rtp0 [new Agent/RTP]
$ns attach-agent $node_0 $rtp0
set cbr0 [new Application/Traffic/CBR]
$cbr0 attach-agent $rtp0
$ns at 0.5 $cbr0 start
set null0 [new Agent/Null]
$ns attach-agent $node_0 $null0

# multi flows
for {set i 1} {$i  $val(nn) } {incr i 1} {
    set node_($i) [$ns node]
    $ns duplex-link $node_($i) $node_0 1Mb 20ms DropTail
    set rtp_($i) [new Agent/RTP]
    set null_($i) [new Agent/Null]
    $ns attach-agent $node_($i) $rtp_($i)
    $ns attach-agent $node_($i) $null_($i)
    #$rtp($node_($i) set class_($node_($i))
    $ns connect $rtp_($i) $null0
    $ns connect $rtp0 $null_($i)
    set cbr_($i) [new Application/Traffic/CBR]
    $cbr_($i) attach-agent $rtp_($i)
    puts [$cbr_($i) set packetSize_ 160]
    puts [$cbr_($i) set interval_ 20ms]
    $ns at 1.0 cbr_($i) start
}



$ns at 10.0 finish

proc finish {} {
    global ns f nf
    $ns flush-trace
    close $f
    close $nf

    puts running nam...
    exec nam glad.nam 
    exit 0
}

$ns run



when this runnig this script, i have this error in setting cbr_(1)
num_nodes is set 9
160

160

160

160

160

160

160

160

ns: cbr_(1) start: invalid command name cbr_(1)
    while executing
cbr_(1) start



please some help



  


Re: [ns] wireless-wired-satellite scenario problem

2010-04-14 Thread sahib







HI Luigi RICOBON
 I am facing the same problem, I need to use
wireless+satellite scenario and also need to use hierarchical addresses in
wireless. I have spent lot of time in making this scenario, but still can't
figure it out. 
Did you manage to have wireless+satellite scenario in ns2?

Can you please tell me how to use wireless+satellite node with hierarchical
addresses.

Thanks in advance.

Sahib


















Alex Luigi RICOBON wrote:
 
 
 Hi guys,
  
 i want to create a mixed scenario, using wireless and satellite nodes. the
 problem is that in wireless i have to use hiererchical addressing, and in
 satellite nodes i can't do that.
  
 can anyone help me? 
 
  
 
 
 
 Alex Luigi RICOBON
 Tel: +393928007579
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around 
 http://mail.yahoo.com 
 
 

-- 
View this message in context: 
http://old.nabble.com/wireless-wired-satellite-scenario-problem-tp10421147p28241062.html
Sent from the ns-users mailing list archive at Nabble.com.



[ns] hierarchical address for satellite node

2010-04-14 Thread sahib



Dear All
I have been trying to assign hierarchical addressing to
satellite node in ns2, and spent about three days but still can't figure it
out.

Can anyone please tell me how to assign hierarchical address to a satellite
node, or wether its possible in ns2 or not?

Thanks in advance.
-- 
View this message in context: 
http://old.nabble.com/hierarchical-address-for-satellite-node-tp28240951p28240951.html
Sent from the ns-users mailing list archive at Nabble.com.



Re: [ns] problem: Classfier::no-slot{} default handler (tcl/lib/ns-lib.tcl)

2010-04-14 Thread Teerawat Issariyakul


Hello Meriem,

I just put up a no-slot error on the following link.

http://www.ns2ultimate.com/post/520626807/classifier-no-slot-error

It might solve your problem.

Best Regards,

Teerawat Issariyakul
http://www.ns2ultimate.com/
http://www.facebook.com/pages/Teerawat-Issariyakul/358240861417
http://twitter.com/T_Bear
http://www.t-issariyakul.blogspot.com
http://www.ece.ubc.ca/~teerawat




On 4/13/2010, meriem bouzouita bouzouita_mer...@yahoo.fr wrote:


Hello,
My simulation generates the following error message:
Simulation is running...please wait...
--- Classfier::no-slot{} default handler (tcl/lib/ns-lib.tcl) ---
    _o14: no target for slot -1
 _o14 type: Classifier/Hash/Dest
 content dump:
 classifier _o14
 0 offset
 0 shift
 2147483647 mask
 1 slots
 slot 5: _o16 (Classifier/Port)
 -1 default
 -- Finished standard no-slot{} default handler --
I don't have any idea how to solve it,
please can you help me,
Thanks in advance
Best regards.


  




[ns] problem with runnig tcl script new $ANIMATOR_CLASS_ $tracefile [join $args]

2010-04-14 Thread Emma Ch

I have tried with this example, for creationg my own topologie,

when running the tcl code, I have this problem:

class
Animator: constructor failed: class NetworkModel/Auto: constructor
failed: error when calling class NetworkModel/Auto: link 0 11 1.0 20.0
0 1.0
node 0 or 11 is not defined... 
    (_o34 cmd line 1)
    invoked from within
_o34 cmd link 0 11 1.0 20.0 0 1.0
    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 _o34 line 2)
    (SplitObject unknown line 2)
    invoked from within
$self
 link $dst $src $rate $delay $length $rev
    (procedure _o34 line 59)
    (NetworkModel layout_link line 59)
    invoked from within
$self layout_link [lrange $line 1 end]
    (l arm line 2)
    invoked from within
switch $cmd {
n {
$self node $line
}
g {
$self layout_agent [lrange $line 1 end]
}
l {
$self layout_link [lrange $line 1 end]
}
L {
$self layo...
    (procedure _o34 line 17)
    (NetworkModel nam_layout line 17)
    invoked from within
$self nam_layout $tracefile
    (procedure _o34 line 7)
    (Object next line 7)
    invoked from within
_o34 next _o31 /home/emna/ns-allinone-2.34/ns-2.34/glad.nam
    (eval body line 1)
    invoked from
 within
eval $self next $animator $tracefile
    (procedure _o34 line 2)
    (NetworkModel/Auto init line 2)
    invoked from within
_o34 init _o31 /home/emna/ns-allinone-2.34/ns-2.34/glad.nam
    (Class create line 1)
    invoked from within
NetworkModel/Auto create _o34 _o31 
/home/emna/ns-allinone-2.34/ns-2.34/glad.nam
    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 $NETWORK_MODEL $self $tracefile
    (procedure _o31 line 87)
    (Animator init line
 87)
    invoked from within
_o31 init /home/emna/ns-allinone-2.34/ns-2.34/glad.nam {}
    (Class create line 1)
    invoked from within
Animator create _o31 /home/emna/ns-allinone-2.34/ns-2.34/glad.nam {}
    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 $ANIMATOR_CLASS_ $tracefile  [join $args]

--
i denote that my own tcl script is:


set ns [new Simulator]

# les dix noeuds: 
set node_0 [$ns node]


# création des outputs trace et nam:
set f [open glad.tr w]
$ns trace-all $f
set nf [open
 glad.nam w]
$ns namtrace-all $nf
# ==
# 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(rp) DumbAgent      ;# routing protocol
set val(start)  0.0
set
 val(ifqlen) 50 ;# max packet in ifq
set val(n)  10
set val(tr) trace
set val(X)  500
set val(Y)  500
set val(CWmin)  16
set val(CWmax)  1024
set val(SlotTime)   0.09
set val(SIFS)   0.16
set val(basicRate) 
 2Mb
set val(dataRate)   54Mb
set val(PreambleLength)   104 
set val(PLCPHeaderLength)   48
#
# Codec:  G.711
#
#set val(ON) 1500ms
#set val(OFF)    1500ms
#set val(AppRate)    96Kb
#set val(pktsize) 160 #160 octets
#set val(pktinterval) 0.020
#set pktsize $val(pktsize) #160 octets
#set pktinterval $val(pktinterval)   
#set val(run)
 50.0
#
# MAC MIB
#
Mac/802_11         set basicRate $val(basicRate)Mb
Mac/802_11         set dataRate  $val(dataRate)Mb
Mac/802_11         set CWMin $val(CWmin)
Mac/802_11         set CWMax $val(CWmax)
Mac/802_11         set SlotTime  $val(SlotTime)
Mac/802_11         set
 SIFS  $val(SIFS)
Mac/802_11   

[ns] add a new protocol to ns

2010-04-14 Thread lianxiaoxu

Hello all:
today I tried to add a new protocol to ns, the new protocol is called:protoname 
in the webpage http://blog.csdn.net/charming520/archive/2009/05/25/4215418.aspx 
,but when I use the make command to generate .o file. I used the Makefile:
protoname.o:protoname.cc protoname.h
gcc -c protoname.cc 
It seems that all the included file in protoname.h had not been found during 
the edit time.
And I could find a solution,could someone help me?
Thank you and look forward to hearing from you!
the appendix is the errors.


Re: [ns] add a new protocol to ns

2010-04-14 Thread Teerawat Issariyakul


Hi,

If you have a new module you would like to add to NS2, please go to

http://www.ns2ultimate.com/post/454001969/including-new-modules-into-ns-2

I hope it will help.

Best Regards,

Teerawat Issariyakul
http://www.ns2ultimate.com/
http://www.facebook.com/pages/Teerawat-Issariyakul/358240861417
http://twitter.com/T_Bear
http://www.t-issariyakul.blogspot.com
http://www.ece.ubc.ca/~teerawat


On 4/14/2010, lianxiaoxu lianxia...@126.com wrote:





[ns] Fw: error in geting value from Routing table field

2010-04-14 Thread iftikhar ahmed











dear sir /madam,
 
  i m getting blank trace file .when i assign routing table field to RREQ 
mmesssag field.
when i m getting through pointer as well.
can any body help me for the following;
 
1- is there any to get value from routing table field or variable?
2- how can i get the value which is in routing table field in Rtable.cc?
3- how can i print that value or any  value in any field of routingtable?
 
plz help me in this regard,
 
iftikhar ahmad 
from pakistan



  


[ns] error in geting value from Routing table field

2010-04-14 Thread iftikhar ahmed



















dear sir /madam,
 
  i m getting blank trace file .when i assign routing table field to RREQ 
mmesssag field.
when i m getting through pointer as well.
can any body help me for the following;
 
1- is there any to get value from routing table field or variable?
2- how can i get the value which is in routing table field in Rtable.cc?
3- how can i print that value or any  value in any field of routingtable?
 
plz help me in this regard,
 
iftikhar ahmad 
from pakistan




  


[ns] ns use-newtrace question about new trace format

2010-04-14 Thread Jin Woo Kim

In ns2 manual, page 158, it mentioned use-newtrace format. Is it available also 
to 802.15.4?
I simulated 802.15.4 with error model using new trace format (use-newtrace 
format) 
Is it also availalbe trace format to 802.15.4?



[ns] use of full duplex transmission for wireless nodes

2010-04-14 Thread Emma Ch

I want to make a scenario in wireless WLAN ,where nodes tramits data in full 
duplex mode
I want to know: Is it true the use the command duplex-link in wireless 
trasmission
Thanks



  


[ns] problem in satellite+wired+wireless with hierarchical addresses

2010-04-14 Thread sahib



Dear All
   I am trying to make a simulation with
satellite+wired+wireless nodes in the scenario using hierarchical addresses.
I have downloaded and modified the example given below: when i run the
example without hierarchical addresses it runs fine but when i use
hierarchical addresses it gives me following error:
**
ERROR:
[...@localhost NS2]$ ns aawal.tcl
num_nodes is set 6
Stub No. 1
size of istr[i] is  unsigned long
Error!!
str2addr:Address 1784827763 outside range of address field length 2048

**



**
Source code Example  Starts here
***

### This simulation is an example of combination of wired, wireless
### and geo-satellite topologies.

set ns   [new Simulator]



$ns node-config -addressType hierarchical
AddrParams set domain_num_  2  ;# domain number
AddrParams set cluster_num_ {5 5};# cluster number for each domain 
lappend tmp 5  ;# CN
lappend tmp 5  ;# RCST 1
lappend tmp 5  ;# Satellite
lappend tmp 5  ;# RCST 0
lappend tmp 5  ;# router
lappend tmp 5  ;# 802.16 MNs+BS
lappend tmp 5  ;# 802.16 MNs+BS
lappend tmp 5  ;# 802.11 MNs+AP
lappend tmp 5  ;# 802.11 MNs+AP
lappend tmp 5  ;# MultifaceNode
lappend tmp 5  ;# MultifaceNode
lappend tmp 5  ;# MultifaceNode
AddrParams set nodes_num_ $tmp






global opt_sat
set opt_sat(chan)   Channel/Sat
set opt_sat(bw_up)  0.5Mb
set opt_sat(bw_down)0.5Mb
set opt_sat(phy)Phy/Sat
set opt_sat(mac)Mac/Sat
set opt_sat(ifq)Queue/DropTail
set opt_sat(qlim)   50
set opt_sat(ll) LL/Sat

global opt_mobile
set opt_mobile(chan)   Channel/WirelessChannel
set opt_mobile(prop)   Propagation/TwoRayGround
set opt_mobile(netif)  Phy/WirelessPhy
set opt_mobile(mac)Mac/802_11
set opt_mobile(ifq)Queue/DropTail/PriQueue
set opt_mobile(ll) LL
set opt_mobile(ant)Antenna/OmniAntenna
set opt_mobile(ifqlen) 50
set opt_mobile(tr)  test-mobile-satellite.tr
set opt_mobile(namtr)   test-mobile-satellite.nam
set opt_mobile(nn) 5
set opt_mobile(adhocRouting)   NOAH
set opt_mobile(stop)   50
set num_wired_nodes  2
set num_bs_nodes 1
set net_distance1.0

set opt_mobile(x) [expr $opt_mobile(nn) * 100.0 * 2 + 100.0 + $net_distance]
set opt_mobile(y) 1000

# set up for hierarchical routing
#  $ns node-config -addressType hierarchical
#  AddrParams set domain_num_ 4
#  lappend cluster_num 1 1 1 1
#  AddrParams set cluster_num_ $cluster_num
#  lappend eilastlevel 20 20 20 20
#  AddrParams set nodes_num_ $eilastlevel

# create topology of the wireless nodes to keep connectivity info
  set topo   [new Topography]
  $topo load_flatgrid $opt_mobile(x) $opt_mobile(y)
  # god needs to know the number of all wireless interfaces
  create-god [expr $opt_mobile(nn) + $num_bs_nodes]

# setup the trace file
  set tracefd  [open $opt_mobile(tr) w]
  $ns trace-all $tracefd
  $ns trace-all-satlinks $tracefd
  set namtracefd [open $opt_mobile(namtr) w]
  $ns namtrace-all $namtracefd

# Set up satellite and terrestrial nodes
# Configure the node generator for bent-pipe satellite
# geo-repeater uses type Phy/Repeater
  $ns node-config -satNodeType geo-repeater \
-phyType Phy/Repeater \
-channelType $opt_sat(chan) \
-downlinkBW $opt_sat(bw_down)  \
-wiredRouting ON

# GEO satellite at 95 degrees longitude West
puts Stub No. 1
  set geo [$ns node 0.2.0]
puts Stub No. 2
  $geo set-position 13#-95

$geo color red
$geo shape box

# Configure the node generator for satellite terminals
 $ns node-config -satNodeType terminal \
-llType $opt_sat(ll) \
-ifqType $opt_sat(ifq) \
-ifqLen $opt_sat(qlim) \
-macType $opt_sat(mac) \
-phyType $opt_sat(phy) \
-channelType $opt_sat(chan) \
-downlinkBW $opt_sat(bw_down) \
-wiredRouting ON

# Two terminals: one in NY and one in SF
 set vsat1 [$ns node 0.3.0]
 $vsat1 set-position 43.71 10.38; # NY
 set vsat2 [$ns node 0.1.0]
 $vsat2 set-position 43.71 10.38; # SF


#new-terminal 

[ns] problem in Wireless+wired+satellite using hierarchical addresses

2010-04-14 Thread sahib


Dear All 
   I am trying to make a simulation with
satellite+wired+wireless nodes in the scenario using hierarchical addresses.
I have downloaded and modified the example given below: when i run the
example without hierarchical addresses it runs fine but when i use
hierarchical addresses it gives me following error: 
**
ERROR: 
[...@localhost NS2]$ ns aawal.tcl 
num_nodes is set 6 
Stub No. 1 
size of istr[i] is  unsigned long 
Error!! 
str2addr:Address 1784827763 outside range of address field length 2048 

**



** 
Source code Example  Starts here 
*** 

### This simulation is an example of combination of wired, wireless 
### and geo-satellite topologies. 

set ns   [new Simulator] 



$ns node-config -addressType hierarchical 
AddrParams set domain_num_  2  ;# domain number 
AddrParams set cluster_num_ {5 5};# cluster number for each domain 
lappend tmp 5  
lappend tmp 5  
lappend tmp 5  
lappend tmp 5  
lappend tmp 5  
lappend tmp 5  
lappend tmp 5  
lappend tmp 5  
lappend tmp 5  
lappend tmp 5  
lappend tmp 5  
lappend tmp 5  
AddrParams set nodes_num_ $tmp 






global opt_sat 
set opt_sat(chan)   Channel/Sat 
set opt_sat(bw_up)  0.5Mb 
set opt_sat(bw_down)0.5Mb 
set opt_sat(phy)Phy/Sat 
set opt_sat(mac)Mac/Sat 
set opt_sat(ifq)Queue/DropTail 
set opt_sat(qlim)   50 
set opt_sat(ll) LL/Sat 

global opt_mobile 
set opt_mobile(chan)   Channel/WirelessChannel 
set opt_mobile(prop)   Propagation/TwoRayGround 
set opt_mobile(netif)  Phy/WirelessPhy 
set opt_mobile(mac)Mac/802_11 
set opt_mobile(ifq)Queue/DropTail/PriQueue 
set opt_mobile(ll) LL 
set opt_mobile(ant)Antenna/OmniAntenna 
set opt_mobile(ifqlen) 50 
set opt_mobile(tr)  test-mobile-satellite.tr 
set opt_mobile(namtr)   test-mobile-satellite.nam 
set opt_mobile(nn) 5 
set opt_mobile(adhocRouting)   NOAH 
set opt_mobile(stop)   50 
set num_wired_nodes  2 
set num_bs_nodes 1 
set net_distance1.0 

set opt_mobile(x) [expr $opt_mobile(nn) * 100.0 * 2 + 100.0 + $net_distance] 
set opt_mobile(y) 1000 

# set up for hierarchical routing 
#  $ns node-config -addressType hierarchical 
#  AddrParams set domain_num_ 4 
#  lappend cluster_num 1 1 1 1 
#  AddrParams set cluster_num_ $cluster_num 
#  lappend eilastlevel 20 20 20 20 
#  AddrParams set nodes_num_ $eilastlevel 

# create topology of the wireless nodes to keep connectivity info 
  set topo   [new Topography] 
  $topo load_flatgrid $opt_mobile(x) $opt_mobile(y) 
  # god needs to know the number of all wireless interfaces 
  create-god [expr $opt_mobile(nn) + $num_bs_nodes] 

# setup the trace file 
  set tracefd  [open $opt_mobile(tr) w] 
  $ns trace-all $tracefd 
  $ns trace-all-satlinks $tracefd 
  set namtracefd [open $opt_mobile(namtr) w] 
  $ns namtrace-all $namtracefd 

# Set up satellite and terrestrial nodes 
# Configure the node generator for bent-pipe satellite 
# geo-repeater uses type Phy/Repeater 
  $ns node-config -satNodeType geo-repeater \ 
-phyType Phy/Repeater \ 
-channelType $opt_sat(chan) \ 
-downlinkBW $opt_sat(bw_down)  \ 
-wiredRouting ON 

# GEO satellite at 95 degrees longitude West 
puts Stub No. 1 
  set geo [$ns node 0.2.0] 
puts Stub No. 2 
  $geo set-position 13#-95 

$geo color red 
$geo shape box 

# Configure the node generator for satellite terminals 
 $ns node-config -satNodeType terminal \ 
-llType $opt_sat(ll) \ 
-ifqType $opt_sat(ifq) \ 
-ifqLen $opt_sat(qlim) \ 
-macType $opt_sat(mac) \ 
-phyType $opt_sat(phy) \ 
-channelType $opt_sat(chan) \ 
-downlinkBW $opt_sat(bw_down) \ 
-wiredRouting ON 

# Two terminals: one in NY and one in SF 
 set vsat1 [$ns node 0.3.0] 
 $vsat1 set-position 43.71 10.38; # NY 
 set vsat2 [$ns node 0.1.0] 
 $vsat2 set-position 43.71 10.38; # SF 


#new-terminal 43.71 10.38 
#new-terminal 43.71 10.38 



$vsat1 color blue 

[ns] static routing help!!!

2010-04-14 Thread fenomeno83


Hello.I am a noob of NS2.I must be some simulations, but i must modify in
this tcl routing.I must usiing a statiic routing.How modify this tcl to work
static routing leaving the rest?thanks

set MESSAGE_PORT 42
set ACK_SIZE 12
set HEADER_SIZE 12
set PAYLOAD_UNIT 6
set DIFS 0.0;
set AckTimeout 0.02;
set BER 1e-6;

set val(Nsink) 2 ;# sink number
set val(L) 3  ; # node number

set val(chan)   Channel/WirelessChannel;
set val(prop)   Propagation/TwoRayGround   ;
set val(netif)  Phy/WirelessPhy
set val(mac)Mac/802_11
set val(ifq)Queue/DropTail/PriQueue;
set val(ll) LL ;
set val(ant)Antenna/OmniAntenna;
set val(ifqlen) 50 ;
set val(rp) DumbAgent  ;
set val(x)  10
set val(y)  10

Mac/802_11 set RTSThreshold_  1500

global defaultRNG
set the_seed [eval exec /bin/date \+%s\]
puts stderr Il seed è $the_seed
$defaultRNG seed $the_seed


#read command line arguments
proc getCmdArgu {argc argv} {
global val
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]]
}
}
getCmdArgu $argc $argv

set N_tot [expr $val(Nsink) + $val(Nsink)*$val(L)]

source SimpleMSTP_agent.tcl

# Create scheduler
set ns [new Simulator]

set filename scenario-$val(Nsink)x$val(L)
set tracefd [open ./$filename.tr w]
$ns trace-all $tracefd
set namtrace [open ./$filename.nam w]
$ns namtrace-all-wireless $namtrace $val(x) $val(y)

$ns puts-nam-traceall {# nam4wpan #};# inform nam that this is a 
trace
file for wpan (special handling needed)

Mac/802_15_4 wpanNam namStatus on   ;# default = off (should be 
turned on
before other 'wpanNam' commands can work)
#Mac/802_15_4 wpanNam ColFlashClr gold  ;# default = gold
#Mac/802_15_4 wpanNam NodeFailClr grey  ;# default = grey

Mac/802_15_4 wpanCmd ack4data off

proc finish {} {
#   global ns namfile tracefile
#   $ns flush-trace
#   close $namfile

global ns tracefd
$ns flush-trace
close $tracefd

#   exec nam prova_wireless.nam 
exit 0
}

# For model 'TwoRayGround'
set dist(5m)  7.69113e-06
set dist(9m)  2.37381e-06
set dist(10m) 1.92278e-06
set dist(11m) 1.58908e-06
set dist(12m) 1.33527e-06
set dist(13m) 1.13774e-06
set dist(14m) 9.81011e-07
set dist(15m) 8.54570e-07
set dist(16m) 7.51087e-07
set dist(20m) 4.80696e-07
set dist(25m) 3.07645e-07
set dist(30m) 2.13643e-07
set dist(35m) 1.56962e-07
set dist(40m) 1.20174e-07
Phy/WirelessPhy set CSThresh_ $dist(15m)
Phy/WirelessPhy set RXThresh_ $dist(15m)

# set up topography object
set topo   [new Topography]
$topo load_flatgrid $val(x) $val(y)

# Create God
set god_ [create-god $N_tot]

set chan_1_ [new $val(chan)]

# configure node

$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) \
-topoInstance $topo \
-agentTrace ON \
-routerTrace OFF \
-macTrace ON \
-movementTrace OFF \
#-energyModel EnergyModel \
#-initialEnergy 1 \
#-rxPower 0.3 \
#-txPower 0.3 \
-channel $chan_1_ 

set u [new RandomVariable/Uniform]
$u set min_ 0
for {set i 0} {$i  $N_tot} {incr i} {
set n($i) [$ns node]

$n($i) random-motion 0  ;# disable random motion
$u set max_ $val(x)
$n($i) set X_ [$u value]
$u set max_ $val(y)
$n($i) set Y_ [$u value] 
}


for {set i 0} {$i  $N_tot} {incr i} {
set agent($i) [new Agent/MessagePassing/SimpleMSTP]
if [expr ($i%(1+$val(L))) != 0] {$agent($i) set type_ Node}

$agent($i) set successor_ [expr ($i+1)%$N_tot]
if {$i != 0} {
$agent($i) set predecessor_ [expr $i-1]
} else {
$agent($i) set predecessor_ [expr $N_tot-1]
}

$n($i) attach  $agent($i) $MESSAGE_PORT
}



$ns at 0.1 $agent(0) send-token



$ns at 100 finish


$ns run



THANKS
-- 
View this message in context: 
http://old.nabble.com/static-routing-help%21%21%21-tp28247482p28247482.html
Sent from the ns-users mailing list archive at Nabble.com.




[ns] static routing help!!!

2010-04-14 Thread alessandro lazzara


Hello.I am a noob of NS2.I must be some simulations, but i must modify in this 
tcl routing.I must usiing a statiic routing.How modify this tcl to work static 
routing leaving the rest?thanks 

set MESSAGE_PORT 42 
set ACK_SIZE 12 
set HEADER_SIZE 12 
set PAYLOAD_UNIT 6 
set DIFS 0.0; 
set AckTimeout 0.02; 
set BER 1e-6; 

set val(Nsink) 2 ;# sink number 
set val(L) 3  ; # node number 

set val(chan)   Channel/WirelessChannel; 
set val(prop)   Propagation/TwoRayGround   ; 
set val(netif)  Phy/WirelessPhy 
set val(mac)Mac/802_11 
set val(ifq)Queue/DropTail/PriQueue; 
set val(ll) LL ; 
set val(ant)Antenna/OmniAntenna; 
set val(ifqlen) 50 ; 
set val(rp) DumbAgent  ; 
set val(x)   10 
set val(y)   10 

Mac/802_11 set RTSThreshold_  1500 

global defaultRNG 
set the_seed [eval exec /bin/date \+%s\] 
puts stderr Il seed è $the_seed 
$defaultRNG seed $the_seed 


#read command line arguments 
proc getCmdArgu {argc argv} { 
global val 
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]] 
} 
} 
getCmdArgu $argc $argv 

set N_tot [expr $val(Nsink) + $val(Nsink)*$val(L)] 

source SimpleMSTP_agent.tcl 

# Create scheduler 
set ns [new Simulator] 

set filename scenario-$val(Nsink)x$val(L) 
set tracefd [open ./$filename.tr w] 
$ns trace-all $tracefd 
set namtrace [open ./$filename.nam w] 
$ns namtrace-all-wireless $namtrace $val(x) $val(y) 

$ns puts-nam-traceall {# nam4wpan #} ;# inform nam that this is a trace 
file for wpan (special handling needed) 

Mac/802_15_4 wpanNam namStatus on;# default = off (should be turned on 
before other 'wpanNam' commands can work) 
#Mac/802_15_4 wpanNam ColFlashClr gold   ;# default = gold 
#Mac/802_15_4 wpanNam NodeFailClr grey   ;# default = grey 

Mac/802_15_4 wpanCmd ack4data off 

proc finish {} { 
#   global ns namfile tracefile 
#   $ns flush-trace 
#   close $namfile 

global ns tracefd 
$ns flush-trace 
close $tracefd 

#   exec nam prova_wireless.nam  
exit 0 
} 

# For model 'TwoRayGround' 
set dist(5m)  7.69113e-06 
set dist(9m)  2.37381e-06 
set dist(10m) 1.92278e-06 
set dist(11m) 1.58908e-06 
set dist(12m) 1.33527e-06 
set dist(13m) 1.13774e-06 
set dist(14m) 9.81011e-07 
set dist(15m) 8.54570e-07 
set dist(16m) 7.51087e-07 
set dist(20m) 4.80696e-07 
set dist(25m) 3.07645e-07 
set dist(30m) 2.13643e-07 
set dist(35m) 1.56962e-07 
set dist(40m) 1.20174e-07 
Phy/WirelessPhy set CSThresh_ $dist(15m) 
Phy/WirelessPhy set RXThresh_ $dist(15m) 

# set up topography object 
set topo   [new Topography] 
$topo load_flatgrid $val(x) $val(y) 

# Create God 
set god_ [create-god $N_tot] 

set chan_1_ [new $val(chan)] 

# configure node 

$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) \ 
-topoInstance $topo \ 
-agentTrace ON \ 
-routerTrace OFF \ 
-macTrace ON \ 
-movementTrace OFF \ 
#-energyModel EnergyModel \ 
#-initialEnergy 1 \ 
#-rxPower 0.3 \ 
#-txPower 0.3 \ 
-channel $chan_1_ 

set u [new RandomVariable/Uniform] 
$u set min_ 0 
for {set i 0} {$i  $N_tot} {incr i} { 
set n($i) [$ns node] 

$n($i) random-motion 0   ;# disable random motion 
$u set max_ $val(x) 
$n($i) set X_ [$u value] 
$u set max_ $val(y) 
$n($i) set Y_ [$u value] 
} 


for {set i 0} {$i  $N_tot} {incr i} { 
set agent($i) [new Agent/MessagePassing/SimpleMSTP] 
if [expr ($i%(1+$val(L))) != 0] {$agent($i) set type_ Node} 

$agent($i) set successor_ [expr ($i+1)%$N_tot] 
if {$i != 0} { 
$agent($i) set predecessor_ [expr $i-1] 
} else { 
$agent($i) set predecessor_ [expr $N_tot-1] 
} 

$n($i) attach  $agent($i) $MESSAGE_PORT 
} 



$ns at 0.1 $agent(0) send-token 



$ns at 100 finish 


$ns run 



THANKS
_
Messenger e Hotmail in tasca. Provali sul tuo cellulare!
http://new.windowslivemobile.msn.com/it-it/Default.aspx