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

Multicast Packet Counter



Hi,

I'm trying to use McastMonitor and having trouble. I set it up like this:
set mcastmonitor [$ns McastMonitor]
$mcastmonitor set period_ 0.01
$mcastmonitor trace-tree $n0 $group

but it doesn't print out counts of packets for the fields (data, prune,
join, etc.).  Instead, everything is 0, incorrectly.  (even the nam
simulator shows packets flying, plus the trace-all shows packets as well.)

You wrote to the ns2 newsgroup about the McastMonitor.  I have tried to
use it, using 'trace-tree' mode, and it does indeed print out a trace for
every time period as the simulation runs... however, the counts of packets
are 0 for each and every field (data, prune, etc.).  Even though true
counts are above 0.

Here's part of what I get:
1.2200000000000009 0 0 0 0 _o10 0x8000
1.2300000000000009 0 0 0 0 _o10 0x8000
1.2400000000000009 0 0 0 0 _o10 0x8000

The _o10 is not what I would expect the source to be (I have defined the
source as $n0, which is a UDP CBR sender, if that makes a difference).
I have attached my code (which is *very* short) in case you have any
questions about it.


Thanks for any advice!
Lori


---------- Forwarded message ----------
Date: Thu, 20 May 1999 02:18:40 -0700
From: Joumdane Abdelhamid <[email protected]>
To: [email protected]
Subject: Multicast Packet Counter

Hi ns-users,

I'm trying to evaluatre losses due to Core migration in a Core Based Forwarding Protocol. What I'd like to know is : 
1- There is a way to count how many multicast packets a node had received from the group ?

2- I also found that McastMonitor provides a way to know many packets were sent to a specific group. But are join, prune packets included in this count ?


Thanks in advance,
Abdelhamid JOUMDANE


#m2.tcl by Lori Flynn   
#A simple CBR multicast

 # 
 #
## Using Multicast in ns
##
## joining & pruning test(s) 
#           |0|
#           /
#          |1|
#         /   \ 
#        |2|  |3|
#        /     /
#       |4|---|5|

set ns [new Simulator -multicast on]
Simulator set NumberInterfaces_ 1

set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
set n4 [$ns node]
set n5 [$ns node]
set group [Node allocaddr]

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

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

$ns duplex-link $n0 $n1 1.5Mb 10ms DropTail
$ns duplex-link $n1 $n2 1.5Mb 10ms DropTail
$ns duplex-link $n1 $n3 1.5Mb 10ms DropTail
$ns duplex-link $n2 $n4 1.5Mb 10ms DropTail
$ns duplex-link $n3 $n5 1.5Mb 10ms DropTail
$ns duplex-link $n4 $n5 1.5Mb 10ms DropTail

$ns duplex-link-op $n0 $n1 orient left-down
$ns duplex-link-op $n1 $n2 orient left-down
$ns duplex-link-op $n1 $n3 orient right-down
$ns duplex-link-op $n2 $n4 orient right-down
$ns duplex-link-op $n3 $n5 orient left-down
$ns duplex-link-op $n4 $n5 orient right

$ns duplex-link-op $n0 $n1 queuePos 0.5
$ns duplex-link-op $n1 $n2 queuePos 0.5
$ns duplex-link-op $n1 $n3 queuePos 0.5
$ns duplex-link-op $n2 $n4 queuePos 0.5
$ns duplex-link-op $n3 $n5 queuePos 0.5
$ns duplex-link-op $n4 $n5 queuePos 0.5


### Start multicast configuration: 5 mproto options
### CtrMcast   : centralized multicast
### DM         : static DVMRP (can't adapt to link up/down or node up/down)
### detailedDM : dense mode protocol that adapts to dynamics (recommended)
### dynamicDM  : dynamic DVMRP 
### pimDM      : PIM dense mode

### Uncomment following lines to change default
#DM set PruneTimeout 0.3               ;# default 0.5 (sec)
#dynamicDM set ReportRouteTimeout 0.5  ;# default 1 (sec)

set mproto pimDM
set mrthandle [$ns mrtproto $mproto  {}]
if {$mrthandle != ""} {
    $mrthandle set_c_rp [list $n0]
}
### End of multicast configuration

set cbr1 [new Agent/CBR]
$ns attach-agent $n0 $cbr1
$cbr1 set dst_ $group

set mcastmonitor [$ns McastMonitor]
$mcastmonitor set period_ 0.01
$mcastmonitor trace-tree $n0 $group

set rcvr0 [new Agent/Null]
$ns attach-agent $n0 $rcvr0
set rcvr1 [new Agent/Null]
$ns attach-agent $n1 $rcvr1
set rcvr2  [new Agent/Null]
$ns attach-agent $n2 $rcvr2
set rcvr3 [new Agent/Null]
$ns attach-agent $n3 $rcvr3
set rcvr4 [new Agent/Null]
$ns attach-agent $n4 $rcvr4
set rcvr5 [new Agent/Null]
$ns attach-agent $n5 $rcvr5

$ns at 0.2 "$cbr1 start"
$ns at 0.4 "$n1 join-group  $rcvr1 $group"
$ns at 0.7 "$n1 leave-group $rcvr1 $group"
$ns at 0.9 "$n4 join-group $rcvr4 $group"
$ns at 1.5 "finish"


proc finish {} {
        global ns
        $ns flush-trace

        #exec awk -f ../../nam-demo/nstonam.awk out-cmcast.tr > cmcast-nam.tr
        #XXX
        puts "running nam..."
        exec nam out-m2 &
        exit 0
}

$ns run