[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] Multicast and Hierarchical Addressing



Hello everyone,

Sorry if you receive this message twice, but I can not find it in the
archives.

I am working on ns-2.b6 and I am trying to work on multicast with
hierarchical topologies.    There seems to be a problem when the
multicast source has a hierarchial address of the kind x.y.z where x and
y are different than zero but it works fine for multicast source with
address 0.0.z.

The following script is a good example.   If the CBR source is node
n(1), it works fine ; but if you try n(10) there is no output in the
trace.

Could the ns people have a look on that and explain me what is it like
this and how to fix it ? 

>From what I have seen, the function Node instproc rpf-nbr gets an index
in array Node_ which is too high when the source is a hierarchical
address of the kind 1.0.0. 

Here is the script ; attached is the complete tar file with the output
traces.

Thank you for your help,
Thierry Ernst.



proc set-nodes { } {
  global ns n

  AddrParams set domain_num_ 2
  lappend cluster_num 2 2
  AddrParams set cluster_num_ $cluster_num
  lappend eilastlevel 7 3 2 3
  AddrParams set nodes_num_ $eilastlevel

  set naddr {0.0.0 0.0.1 0.0.2 0.0.3 0.0.4 0.0.5 0.0.6 0.1.0 0.1.1 0.1.2
1.0.0 1.0.1 1.1.0 1.1.1 1.1.2}

  for {set i 0} {$i < 15} {incr i} {
     set n($i) [$ns node [lindex $naddr $i]]
  }
}

proc set-links-2 {} {
  global ns n

$ns duplex-link $n(0) $n(1) 5Mb 2ms DropTail
$ns duplex-link $n(0) $n(2) 5Mb 2ms DropTail
$ns duplex-link $n(0) $n(3) 5Mb 2ms DropTail
$ns duplex-link $n(0) $n(4) 5Mb 2ms DropTail
$ns duplex-link $n(0) $n(5) 5Mb 2ms DropTail
$ns duplex-link $n(0) $n(6) 5Mb 2ms DropTail
$ns duplex-link $n(1) $n(7) 5Mb 2ms DropTail
$ns duplex-link $n(7) $n(8) 5Mb 2ms DropTail
$ns duplex-link $n(7) $n(9) 5Mb 2ms DropTail
$ns duplex-link $n(13) $n(10) 5Mb 2ms DropTail
$ns duplex-link $n(0) $n(11) 5Mb 2ms DropTail
$ns duplex-link $n(11) $n(12) 5Mb 2ms DropTail
$ns duplex-link $n(12) $n(13) 5Mb 2ms DropTail
$ns duplex-link $n(13) $n(14) 5Mb 2ms DropTail
$ns duplex-link $n(7) $n(14) 5Mb 2ms DropTail

}

proc main {} {
   global ns n
   global rcvr0 rcvr1

   set ns [new Simulator -multicast on]

   set f [open out.tr w]
   $ns trace-all $f
   set nf [open out.nam w]
   $ns namtrace-all $nf

   $ns color 2 black
   $ns color 1 blue
   $ns color 0 red
   $ns color 30 purple
   $ns color 31 green

   $ns node-config -addressType hierarchical
   set-nodes
   set-links-2

   set-multicast
   $ns at 1.0 "finish"
   $ns run
}

proc set-multicast {} {
   global ns n

   set mproto CtrMcast
   set mrthandle [$ns mrtproto $mproto  {}]
   if {$mrthandle != ""} {
        $mrthandle set_c_rp [list $n(0)]
   }
   set group [Node allocaddr]

   set udp [new Agent/UDP]
   $udp set dst_addr_ $group
   $udp set dst_port_ 0
   $ns attach-agent $n(1) $udp
   set cbr1 [new  Application/Traffic/CBR]
   $cbr1 attach-agent $udp

   set rcvr0 [new Agent/LossMonitor]
   $ns attach-agent $n(5) $rcvr0
   set rcvr1 [new Agent/LossMonitor]
   $ns attach-agent $n(6) $rcvr1

   $ns at 0.1 "$cbr1 start"
   $ns at 0.3 "$n(5) join-group  $rcvr1 $group"
   $ns at 0.4 "$n(12) join-group  $rcvr0 $group"
}


proc finish {} {
    global ns

    $ns flush-trace
    exec nam out.nam &
    exit 0
}
main


--
* mailto:[email protected]  Tel +33 (0) 4 76 61 52 69 
* INRIA Rhone-Alpes Projet PLANETE       (fax 52 52) 
* http://www.inrialpes.fr/planete/people/ernst/Welcome.html

pb-mcast.tar.gz