---------- Forwarded message ---------- From: Wim Vrijens <[EMAIL PROTECTED]> Date: 27 aug. 2007 13:06 Subject: Lan and multicast (again) To: ns-users@isi.edu
Hi all, As the title suggests I'm trying to get multicast working over a LAN. I have NS-2.31 installed, updated to the latest snapshot on a Kubuntu Feisty system. Never had any problems with the installation or validation of my build. The main goal of my simulation: Within a power substation breakers and transformers communicate on a LAN. In my implementation about 10 nodes (the breakers etc) report to the substation automation computer (node(0)) every 0.02 secondes. When an important event occurs, the substation automation computer multicasts a message to all breakers on the LAN. Notice that in my case timing constraints are important, not the protocol itself. And I'm a power system engineer not a telecommunications engineer ;-) Implementation: The reporting services is implemented as 10 nodes sending out CBR messages to node(0) over the LAN. This works fine and I've written a awk-file to extract useful data from the tracefile. Then I implement the multicast session from node(0) to all nodes in the LAN. I'm using DM, just like the manual says it should work fine with a LAN. Although it doesn't when I coded it. For debugging purpose I added a duplex link from node(0) to a new node and started multicasting from this new node. This sheds a new light at the problem. By looking at the trace file you can see that, when the message wants to enter the LAN it doesn't find any downstream receivers. Hence the prune message going upstream. Because the prune timer still stands on 0.5 (default) nothing happens anymore. The first line from my trace file are: v 0.1 eval {set sim_annotation {0.10000000000000001 1 join-group -2147483648}} + 1.5 0 12 cbr 50 ------- 2 0.1 -2147483648.1 0 0 - 1.5 0 12 cbr 50 ------- 2 0.1 -2147483648.1 0 0 h 1.5 0 11 cbr 50 ------- 2 0.1 -2147483648.1 0 0 r 1.5 0 12 cbr 50 ------- 2 0.1 -2147483648.1 0 0 + 1.5 12 0 prune 80 ------- 30 12.0 0.0 -1 1 - 1.5 12 0 prune 80 ------- 30 12.0 0.0 -1 1 r 1.5 12 0 prune 80 ------- 30 12.0 0.0 -1 1 + 1.5001 0 11 cbr 50 ------- 2 0.1 -2147483648.1 0 0 - 1.5001 0 11 cbr 50 ------- 2 0.1 -2147483648.1 0 0 h 1.500893 0 11 cbr 50 ------- 2 0.1 -2147483648.1 1 2 + 1.500993 0 11 cbr 50 ------- 2 0.1 -2147483648.1 1 2 - 1.500993 0 11 cbr 50 ------- 2 0.1 -2147483648.1 1 2 h 1.501786 0 11 cbr 50 ------- 2 0.1 -2147483648.1 2 3 + 1.501886 0 11 cbr 50 ------- 2 0.1 -2147483648.1 2 3 - 1.501886 0 11 cbr 50 ------- 2 0.1 -2147483648.1 2 3 So can anybody shed some light on the problem why there are no downstream receivers, even though I still add the nodes on the LAN to the destination group? My apologies for the long post, but I want to be as clear as possible so a easy solution can be found. With kind regards Wim PS My tcl-script looks like this (some lines have been commented out, because there not needed to get multicast working and only clog up my trace file). # Lan-configuratie voor een Substation Automation System (IEC 61850) ###### Variabelen ###### set val(tr) "trace.tr" set val(ntr) "namout.nam" set val(resf) "resf.txt" set val(stop) 3.0 set val(IED) 11 set val(LanBW) 10Mb set val(LanDelay) 0.1ms set val(CBRPacket) 80 set val(CBRInterval) 0.02 set val(CBRPackMulti) 50 set val(CBRCountMulti) 10 ###### Methodes ####### proc finish {} { global ns val trf ntrf resf $ns flush-trace close $trf close $ntrf close $resf #exec nam -a namout.nam & #exec awk -f awktrace.awk trace.tr & exit 0 } proc create-trace {} { global ns val set trf [open $val(tr) w] $ns trace-all $trf return $trf } proc create-namtrace {} { global ns val set ntrf [open $val(ntr) w] $ns namtrace-all $ntrf return $ntrf } proc create-resultfile {} { global ns val set resf [open $val(resf) w] puts $resf "Resultaten voor de simulatie:" puts $resf "-----------------------------" puts $resf "" puts $resf "Aantal IEDs: [expr $val(IED)-1]" puts $resf "Aantal SACs: 1" puts $resf "" return $resf } proc create-topology {} { global ns val global node nodex lan resf for {set i 0} {$i < $val(IED)} {incr i} { set node($i) [$ns node] lappend nodelist $node($i) } set lan [$ns make-lan $nodelist $val(LanBW) $val(LanDelay) LL Queue/DropTail Mac/802_3 Channel] puts "LAN aangemaakt $lan" puts $resf "LAN-topology aangemaakt met een bandbreedte van $val(LanBW)/s en een delay: $val(LanDelay)" puts $resf "" set nodex [$ns node] $ns duplex-link $nodex $node(0) 100Gb 0ms DropTail } proc create-reportSource {} { global ns val global node nodex lan reportCBR reportSink resf set reportSink [new Agent/LossMonitor] $ns attach-agent $nodex $reportSink for {set i 1} {$i < $val(IED)} {incr i} { set reportUDP($i) [new Agent/UDP] $ns attach-agent $node($i) $reportUDP($i) $reportUDP($i) set class_ 1 set reportCBR($i) [new Application/Traffic/CBR] $reportCBR($i) set packetSize_ $val(CBRPacket) $reportCBR($i) set interval_ $val(CBRInterval) $reportCBR($i) attach-agent $reportUDP($i) $ns connect $reportUDP($i) $reportSink } puts "UDP-sources aangemaakt" puts $resf "Real-time sources aangemaakt met $val(CBRPacket) byte datapackets en een zendinterval van $val(CBRInterval)s" puts $resf "" } ###### Main ###### set ns [new Simulator] $ns multicast $ns color 1 Blue $ns color 2 Red set trf [create-trace] set ntrf [create-namtrace] set resf [create-resultfile] create-topology #create-reportSource # Multicast set mproto DM set mrthandle [$ns mrtproto $mproto {}] set group [Node allocaddr] puts "Group adress $group" set udp [new Agent/UDP] $ns attach-agent $node(0) $udp $udp set class_ 2 set src [new Application/Traffic/CBR] $src attach-agent $udp $src set packetSize_ $val(CBRPackMulti) $src set maxpkts_ $val(CBRCountMulti) for {set i 1} {$i < $val(IED)} {incr i} { set rcvr($i) [new Agent/LossMonitor] $ns attach-agent $node($i) $rcvr($i) } $ns at 0.1 "$node(1) join-group $rcvr(1) $group" $udp set dst_addr_ $group $udp set dst_port_ 1 puts "Received is [$rcvr(1) set bytes_]" ###### Events ###### $ns at 1.5 "$src start" for {set i 1} {$i < $val(IED)} {incr i} { #$ns at 1.0 "$reportCBR($i) start" #$ns at 2.0 "$reportCBR($i) stop" } $ns at $val(stop) "finish" $ns run