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

Re: Problem with LAN and Multicast..



The patch only quells and stops the tcl breakdown,
but another problem still persists: there's no packet
activity in the LAN.  In the configuration below, my 
simulation showed that multicast members m1 and p1 receive 
no packets..   Do you experience the same problem in your 
ns build ? 

Thanks,
Apinun.

-- CUT HERE --
;#
;#          n0  Sender
;#           |
;#          n1  Router
;#          / \
;#         /   \
;#       m0    p0
;#   m1  |      |
;#   +---+      +---+
;#   m2             p1
;#   LAN0       LAN1
;#
;#  LAN0: m0, m1, m2
;#  LAN1: p0, p1
;#  Multicast Receivers:  m0, m1, p0, p1  (m2 is not)
;#

set ns [new Simulator -multicast on]
set f [open out.nam w]
$ns namtrace-all $f

set n0 [$ns node]; puts "n0 is $n0"
set n1 [$ns node]; puts "n1 is $n1"

set m0 [$ns node]; puts "m0 is $m0"
set m1 [$ns node]; puts "m1 is $m1"
set m2 [$ns node]; puts "m2 is $m2"

set p0 [$ns node]; puts "p0 is $p0"
set p1 [$ns node]; puts "p1 is $p1"

set group [expr [Node allocaddr]]; puts "Group is $group"

set lan0 [$ns make-lan "$m0 $m1 $m2" 10Mb 10ms LL Queue/DropTail Mac/802_3 Channel]
set lan1 [$ns make-lan "$p0 $p1"     10Mb 10ms LL Queue/DropTail Mac/802_3 Channel]

puts "lan0 is $lan0"
puts "lan1 is $lan1"

$ns duplex-link $n0 $n1 10Mb 10ms DropTail
$ns duplex-link $n1 $m0 10Mb 10ms DropTail
$ns duplex-link $n1 $p0 5Mb  10ms DropTail

$ns duplex-link-op $n1 $m0 orient down
$ns duplex-link-op $n1 $p0 orient down

set mproto CtrMcast
set mrthandle [$ns mrtproto $mproto {}]

$mrthandle set_c_rp $n0
$mrthandle compute-mroutes

;# Sender
set sag  [new Agent/UDP]
set sapp [new Application/Traffic/CBR]
$ns   attach-agent $n0 $sag
$sapp attach-agent $sag
$sag set dst_ $group

;# Receivers
set m0ag [new Agent/LossMonitor]; puts "m0agent is $m0ag"
set m1ag [new Agent/LossMonitor]; puts "m1agent is $m1ag"
set p0ag [new Agent/LossMonitor]; puts "p0agent is $p0ag"
set p1ag [new Agent/LossMonitor]; puts "p1agent is $p1ag"

$ns attach-agent $m0 $m0ag
$ns attach-agent $m1 $m1ag
$ns attach-agent $p0 $p0ag
$ns attach-agent $p1 $p1ag

$ns at 0.1  "$m0 join-group $m0ag $group"
$ns at 0.1  "$m1 join-group $m1ag $group"
$ns at 0.1  "$p0 join-group $p0ag $group"
$ns at 0.1  "$p1 join-group $p1ag $group"

$ns at 0.2  "$n0 join-group $sag  $group" 
$ns at 0.25 "$mrthandle compute-mroutes"
$ns at 0.25  "puts beginning..."
$ns at 0.3  "$sapp start"

$ns at 20.0 "$ns halt"
$ns run

$ns flush-trace
close $f
---- CUT HERE ----


To see packet activities, you may add a few lines to 
loss-monitor.cc in method LossMonitor::recv()
as shown below, or use nam to view 'out.nam'. 


--- CUT HERE --- 
void LossMonitor::recv(Packet* pkt, Handler*)
{
        hdr_rtp* p = (hdr_rtp*)pkt->access(off_rtp_);
        seqno_ = p->seqno();
        bytes_ += ((hdr_cmn*)pkt->access(off_cmn_))->size();
        ++npkts_;
+        printf( " LossMonitor %s: receives packet seqno %d\n", name(),
+                  seqno_ );
        /*
         * Check for lost packets
         */
        if (expected_ >= 0) {
                int loss = seqno_ - expected_;
                if (loss > 0) {
                        nlost_ += loss;
                        Tcl::instance().evalf("%s log-loss", name());
                }
        }
        last_packet_time_ = Scheduler::instance().clock();
        expected_ = seqno_ + 1;
        Packet::free(pkt);
}

-- CUT HERE ---


On Thu, 17 Jun 1999, Nader Salehi wrote:

> Apinun,
> 
> Please apply the following patch to tcl/ctr-mcast/CtrMcastComp.tcl and
> let me know if it works or not.  This should help you finish your
> task.
> 
> Nader
> 
> 
> Index: CtrMcastComp.tcl
> ===================================================================
> RCS file: /usr/src/mash/repository/vint/ns-2/tcl/ctr-mcast/CtrMcastComp.tcl,v
> retrieving revision 1.17
> diff -r1.17 CtrMcastComp.tcl
> 118a119,121
> >                   if {[$rpfl info class] == "Vlink"} {
> >                       set tmp [[$tmp rpf-nbr $target] rpf-nbr $target]
> >                   }
> 141a145,147
> >                       if [$rpfnbr is-lan?] {
> >                               set rpfnbr [$rpfnbr rpf-nbr $target]
> >                       }
> 386a393,397
> > }
> > 
> > Vlink instproc if-label? {} {
> >       $self instvar iif_
> >       $iif_ label