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

[Q] General Question on Multicast and its simulation



Dear Seniors

After the general multicast simulation result of ns-2, 
I became curious the general mechanism of dynamic join/leave 
and multicast routing/forwarding.

1. In NS-2, when I start the multicast sender, it distributes its packets 
throughout the whole topology even though none of potential receivers
have not joined yet. What I guess is that the simulation result as correct solution,
should show no multicast packet transmission even though the sender start
, until  at the moment when one receiver joins that multicast session.

2. Therefore, my question is this: In the real world, how the multicast works ?
I guess the sender(server) should inform the multicast routers of the fact that
a multicast session has started with SIP. But it shoudn't send video stream packets
before a receiver really joins that session. When a receiver joins the session,
the server is finally able to send video stream.  Is this correct guess ?

3. Therefore again, I guess, if multicast routers (a intermediate node in NS-2)
work in order, the router should stop forwarding multicast packets as soon as
it receives leave message from an edge receiver. (Assume there is no other 
receivers.) 

4. But NS-2 simulation doesn't show the expectation of 3. When the edge receiver
leaves the session, the edge router(which is located nearest to that receiver) just
passes the leave message to upper routers, while it does forward multicast packets.
When the "server" receives the leave message, it finally 'begins to generate' the
multicast packets which doesnot reach the edge receiver. 


I don't have much knowledge about the real world. Am I wrong ?
Below I attached my test code. It's simple!

Dull Question: What version of IGMP is implemented in NS-2 ?


Thank you sincerely

Jiwoong Lee
KAIST, Korea

===============================
# Simple modification of ~/tcl/ex/newmcast/mcast3.tcl

set ns [new Simulator -multicast on]
$ns color 1 Blue
$ns color 2 Red
$ns color 3 Yellow

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 n6 [$ns node]
set n7 [$ns node]
set n8 [$ns node]

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

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

### Generating Topology
#   [0]---[1]---[2]
#           \
#           [3]---[4]
#             \
#             [5]  [6]
#              |    |
#              ------
#              |    |
#             [7]  [8]

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

$ns make-lan "$n5 $n6 $n7 $n8" 10Mbps 5ms LL Queue/DropTail Mac/802_3 Channel

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

$ns duplex-link-op $n0 $n1 queuePos 0.5
$ns duplex-link-op $n1 $n0 queuePos 0.5
$ns duplex-link-op $n3 $n1 queuePos 0.5

### Start multicast configuration: 4 mproto options
### CtrMcast : centralized multicast
### DM       : static DVMRP (can't adapt to link up/down or node up/down)
### dynamicDM: dynamic DVMRP 
### pimDM    : PIM dense mode

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

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

if {$mproto == "CtrMcast"} {
    $mrthandle set_c_rp [list $n2 $n3]
}
### End of multicast configuration

set cbr1 [new Agent/RTP]
set cbr2 [new Agent/RTP]
set source3 [new Agent/TCP]
$ns attach-agent $n0 $cbr1
$ns attach-agent $n0 $cbr2
$ns attach-agent $n3 $source3
$cbr1 set dst_ 0x8000
$cbr2 set dst_ 0x8003

set dest2 [new Agent/TCPSink]
$ns attach-agent $n2 $dest2

set rcvr0 [new Agent/LossMonitor]
set rcvr1 [new Agent/LossMonitor]
set rcvr2 [new Agent/LossMonitor]
set rcvr3 [new Agent/LossMonitor]
set rcvr4 [new Agent/LossMonitor]
set rcvr5 [new Agent/LossMonitor]
set rcvr6 [new Agent/LossMonitor]
set rcvr7 [new Agent/LossMonitor]
set rcvr8 [new Agent/LossMonitor]

$ns attach-agent $n0 $rcvr0
$ns attach-agent $n1 $rcvr1
$ns attach-agent $n2 $rcvr2
$ns attach-agent $n3 $rcvr3
$ns attach-agent $n4 $rcvr4
$ns attach-agent $n5 $rcvr5
$ns attach-agent $n6 $rcvr6
$ns attach-agent $n7 $rcvr7
$ns attach-agent $n8 $rcvr8

set traffic3 [new Application/Traffic/Pareto]
$ns connect $source3 $dest2
$traffic3 attach-agent $source3

$cbr1 set fid_ 1
$cbr2 set fid_ 2
$source3 set fid_ 3
$ns at 0.2 "$cbr1 start"
$ns at 0.3 "$cbr2 start"
$ns at 0.3 "$traffic3 start"
$ns at 0.3 "$n4 join-group  $rcvr4 0x8000"
$ns at 0.4 "$n7 join-group  $rcvr7 0x8003"

if {$mproto == "CtrMcast"} {
    $ns at 0.45 "$mrthandle switch-treetype 0x8000"
}


$ns at 0.7 "$n4 leave-group $rcvr4 0x8000"

$ns at 1.1 "finish"

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

 puts "Received is [$rcvr2 set bytes_]"
 puts "The Number of Lost packet is [$rcvr2 set nlost_]"

#        puts "running nam..."
#        exec nam mcast3.nam &
        exit 0
}

$ns run


---
 Jiwoong Lee @ KAIST EE