[ns] Multicast in wired-cum-wireless scenario
Micheal Murray
mickmur at gmail.com
Tue Aug 12 03:33:05 PDT 2008
Hi all,
I realise there have been many threads posted on this or similar topics.
Through working with those and the example test-suite scripts in tcl/test I
have been making progress.
I came across a similar error to the one posted in the thread:
First try in wireless multicast
http://mailman.isi.edu/pipermail/ns-users/2006-September/057345.html
The test-suite-hier-routing.tcl in tcl/test suggests that
$ns node-config addressType_ hierarchical
must be declared before implementing the multicast command
$ns multicast_ on
Using this in a basic script I now can execute ns on my script with no
segfaults or errors.
However on analysis of the output traces no traffic seems to arrive at my
mobile node.
The base-station node instantly returns a prune message to the source under
DM multicast operation.
It could be that the mobile node's association with its basestation node is
problematic.
Or the join-group procedure isn't entirely effective.
Has anyone reached the same stage/problem as me?
I'll paste some of the script incase anyone is interested or maybe it might
come in useful to somebody.
Thanks for your time,
Micheal
#=============================================
set ns [new Simulator]
#Define hierarchical address type for all nodes
$ns node-config -addressType hierarchical
#Enable Multicast routing facilities on all nodes
$ns multicast on
set group [Node allocaddr]
# Setup address parameters for hierarchical routing
AddrParams set domain_num_ 3 ;# number of domains
lappend cluster_num 2 1 1 ;# number of clusters in each domain
AddrParams set cluster_num_ $cluster_num
lappend eilastlevel 1 1 2 2 ;# number of nodes in each cluster
AddrParams set nodes_num_ $eilastlevel ;# of each domain
#
# 2 4
# /
# /
# 0 - - - 1
# \
# \
# 3 5
#
.......
# Store wire-less domain addresses
set temp {1.0.0 1.0.1 2.0.0 2.0.1}
#debug 1
# Create Base-station Nodes
set node_(b2) [$ns node [lindex $temp 0]]
$node_(b2) set X_ 500.0
$node_(b2) set Y_ 450.0
$node_(b2) set Z_ 0.0
.......
#===========================================================
# Configure nodes for Wireless node creation
$ns node-config -wiredRouting OFF
# Create wireless nodes
set node_(m4) [$ns node [lindex $temp 1]]
#new MashInspector
#debug 1
$node_(m4) base-station [AddrParams addr2id [$node_(b2) node-addr]]
# Initial Co-ordinates
$node_(m4) set X_ 510.0 ;# initially 10m away from basestation
$node_(m4) set Y_ 450.0
#$node_(m4) set Y_ 600.0
$node_(m4) set Z_ 0.0
......
set mproto DM
set mrthandle [$ns mrtproto $mproto {}]
....
#Setup a UDP source
set udp_s [new Agent/UDP]
$ns attach-agent $node_(s0) $udp_s
$udp_s set dst_addr_ $group
$udp_s set dst_port_ 0
$udp_s set packetSize_ 1500
$udp_s set fid_ 1
#Setup a CBR Application
set sendr [new Application/Traffic/CBR]
$sendr attach-agent $udp_s
$sendr set rate_ 300Kb
$sendr set packetSize_ 1500
$sendr set random_ false
#Setup Receivers
set recvr1 [new Agent/LossMonitor]
$ns attach-agent $node_(m4) $recvr1
.....
$ns at 0.1 "$sendr start"
$ns at 0.4 "$node_(m4) join-group $recvr1 $group"
$ns at 2.0 "$node_(m4) leave-group $recvr1 $group"
$ns at 2.5 "$node_(m4) join-group $recvr1 $group"
....
More information about the Ns-users
mailing list