Re: Problem with resource release in MNS/QOSPF...
Brought to you by:
iamamardeep,
shreeraman
From: Tarek N. <na...@in...> - 2002-06-13 17:02:01
|
Hi all, The problem I have been talking about recently has been solved. The cause of this problem is that the "collect-resource" function does not call "bw-changed" after modification of "usable-bw_". After making changes to the source files of ns MNS/OSPF fine. The changes are as followed (I attached the necessary file also). Rgds.. Tarek. file : ~ns/tcl/mns_v2.0/ns-mpls-cbq.tcl SimpleLink instproc collect-resource {flowid cbq_qtype} { $self instvar usable_bw_ set cbqclass [$self get-class-in-cbq-pool $flowid] if { $cbqclass == -1 } { return } set link_bw [$self get-link-bw] set extra_bw [$self set usable_bw_] set cbqclass_bw [$cbqclass allot] self set usable_bw_ [expr $extra_bw + $cbqclass_bw * $link_bw] # Modified by Tarek Nadour set QOSPFenable [RtModule/MPLS set enableQOSPF] if {$QOSPFenable != 0} { set rtqospf [ [$self src] get-module "QOSPF"] $rtqospf bw-changed } # option: cbqclass bw okborrow maxidle prio xdelay $cbqclass CBQ-set-papameter 0.0 ignore ignore ignore ignore set oldqueue [$self get-queue-in-cbq-pool $cbqclass] $oldqueue reset $self CBQ-change-flowid $cbqclass -1 $self update-flowid-in-cbq-pool $cbqclass -1 } Le Jeudi 13 Juin 2002 14:55, Tarek NADOUR a écrit : > Hi All, > > I'm trying this example to see if MNS/QOSPF take account the resource > release (with contraint-based-routing), BUT I saw that the explicite route > selected first is not the same as the second ( despite ther is release > message to release the established LSP which the LSPID is 1100). This > choice (of the explicite route) is due to the fact which it does not take > account the resource release. > > Any response will be appreciated. > > Regards.. > > Tarek. > > > RtModule/MPLS set enableQOSPF 1 > > set ns [new Simulator] > $ns use-scheduler Heap > > set na [open test-constraint-routing.tr w] > set nf [open test-constraint-routing.nam w] > $ns trace-all $na > $ns namtrace-all $nf > set f0 [open src0.tr w] > set f1 [open src1.tr w] > set f2 [open src2.tr w] > proc finish {} { > global ns na nf f0 f1 f2 fs > $ns flush-trace > close $na > close $nf > close $f0 > close $f1 > close $f2 > exec ../nam-1.0a10/nam test-constraint-routing.nam & > #exec xgraph -m src0.tr src1.tr src2.tr -geometry 800x400 & > exit 0 > } > > > proc attach-expoo-traffic { node sink size burst idle rate } { > global ns > > set source [new Agent/CBR/UDP] > $ns attach-agent $node $source > > set traffic [new Traffic/Expoo] > $traffic set packet-size $size > $traffic set burst-time $burst > $traffic set idle-time $idle > $traffic set rate $rate > > $source attach-traffic $traffic > > $ns connect $source $sink > return $source > } > > > #Define a procedure which periodically records the bandwidth received by > the #traffic sink sink0 and writes it to the file f0. > > proc record {} { > global sink0 sink1 sink2 f0 f1 f2 > > set ns [Simulator instance] > > #Set the time after which the procedure should be called again > set time 0.065 > > #How many bytes have been received by the traffic sink? > set bw0 [$sink0 set bytes_] > set bw1 [$sink1 set bytes_] > set bw2 [$sink2 set bytes_] > > #Get the current time > set now [$ns now] > > #Calculate the bandwidth (in MBit/s) and write it to the file > puts $f0 "$now [expr $bw0/$time*8/1000000]" > puts $f1 "$now [expr $bw1/$time*8/1000000]" > puts $f2 "$now [expr $bw2/$time*8/1000000]" > > #Reset the bytes_ values on the traffic sink > $sink0 set bytes_ 0 > $sink1 set bytes_ 0 > $sink2 set bytes_ 0 > > #Re-schedule the procedure > $ns at [expr $now+$time] "record" > } > > > # routing protocol > $ns rtproto DV > > Node enable-module "QOSPF" > > # > # make nodes & MPLSnodes > # > set node0 [$ns node] > set LSR1 [$ns mpls-node] > set LSR2 [$ns mpls-node] > set LSR3 [$ns mpls-node] > set LSR4 [$ns mpls-node] > set LSR5 [$ns mpls-node] > set LSR6 [$ns mpls-node] > set LSR7 [$ns mpls-node] > set LSR8 [$ns mpls-node] > set LSR9 [$ns mpls-node] > set node10 [$ns node] > > # > # make links > # > $ns duplex-link $node0 $LSR1 3Mb 10ms DropTail > $ns duplex-link $LSR1 $LSR3 2Mb 10ms CBQ > $ns duplex-link $LSR3 $LSR5 1Mb 10ms CBQ > $ns duplex-link $LSR5 $LSR7 2Mb 10ms CBQ > $ns duplex-link $LSR7 $LSR9 1Mb 10ms CBQ > > $ns duplex-link $LSR1 $LSR2 1Mb 10ms CBQ > $ns duplex-link $LSR2 $LSR4 1Mb 10ms CBQ > $ns duplex-link $LSR4 $LSR6 2Mb 10ms CBQ > $ns duplex-link $LSR6 $LSR8 1Mb 10ms CBQ > $ns duplex-link $LSR8 $LSR9 2Mb 10ms CBQ > > $ns duplex-link $LSR1 $LSR2 1Mb 10ms CBQ > $ns duplex-link $LSR3 $LSR4 1Mb 10ms CBQ > $ns duplex-link $LSR5 $LSR6 1Mb 10ms CBQ > $ns duplex-link $LSR7 $LSR8 1Mb 10ms CBQ > > $ns duplex-link $LSR9 $node10 3Mb 10ms DropTail > > # > # configure ldp agents on all mpls nodes > # > $ns configure-ldp-on-all-mpls-nodes > > > # configure-cbq-for-SBTS {qlim cbq_qtype okborrow bw maxidle extradelay} > $ns cfg-cbq-for-SBTS 10 DropTail 1 0.1 auto 0 > $ns cfg-cbq-for-HBTS 10 DropTail 1 0.05 auto 0 > $ns cfg-cbq-for-RTS 10 DropTail 0 0.8 auto 0 > $ns cfg-cbq-for-STS 10 DropTail 1 0.05 auto 0 > > > $ns color 0 blue > $ns color 1010 purple > #$ns color 1020 yellow > #$ns color 1030 blue > > $ns bind-flowid-to-SBTS 0 > $ns bind-flowid-to-SBTS 100 > $ns bind-flowid-to-SBTS 200 > $ns bind-flowid-to-SBTS 300 > $ns bind-flowid-to-SBTS 400 > > $ns bind-ldp-to-STS > > $ns configure-qospf-nodes > > # > # set ldp-message clolr > # > $ns ldp-request-color blue > $ns ldp-mapping-color red > $ns ldp-withdraw-color magenta > $ns ldp-release-color orange > $ns ldp-notification-color green > > # > $ns collect-resource-info 4 > > #Create a traffic sink and attach it to the node node10 > set sink0 [new Agent/LossMonitor] > $ns attach-agent $node10 $sink0 > $sink0 clear > > #Create a traffic source > set src0 [attach-expoo-traffic $node0 $sink0 200 0 0 700k] > $src0 set fid_ 100 > $ns color 100 orange > > #Create a traffic sink and attach it to the node node10 > set sink1 [new Agent/LossMonitor] > $ns attach-agent $node10 $sink1 > $sink1 clear > > #Create a traffic source > set src1 [attach-expoo-traffic $node0 $sink1 200 0 0 700k] > $src1 set fid_ 200 > $ns color 200 magenta > > #Create a traffic sink and attach it to the node node10 > set sink2 [new Agent/LossMonitor] > $ns attach-agent $node10 $sink2 > $sink2 clear > > #Create a traffic source > set src2 [attach-expoo-traffic $node0 $sink2 200 0 0 700k] > $src2 set fid_ 300 > $ns color 300 blue > > proc notify-erlsp-setup {node lspid} { > global src0 src1 src2 st > > set module [$node get-module "MPLS"] > > set ns [Simulator instance] > if {[$node id] == 1} { > puts " o The CR-LSP of lspid $lspid has been just > established at [$ns now]" > > switch $lspid { > 1100 { $module bind-flow-erlsp 10 100 $lspid > #$src0 start > #puts "[$module get-flowid-for-lspid 1100]" > } > 1200 { $module bind-flow-erlsp 10 200 $lspid > #$src1 start > } > 1300 { $module bind-flow-erlsp 10 300 $lspid > $src2 start > } > default { > #puts "error" > #exit 1 > } > } > } > > } > > proc notify-erlsp-fail {node status lspid tr} { > > puts "nodeid=[$node id] : status=$status lspid=$lspid tr=$tr" > > } > > > proc constraint-based-routing { lspid sLSR dLSRid bw } { > global ns > set sLSRmodule [$sLSR get-module "MPLS"] > set er [$sLSRmodule constraint-based-routing $dLSRid $bw] > if {$er != -1} { > puts "--> The result of constraint-based routing for lspid $lspid : > Explicit Route=$er" > $sLSRmodule setup-crlsp $dLSRid $er $lspid $bw 400B 200B 7 3 > } else { > puts "--> The result of constraint-based routing for lspid $lspid : > Explicit Route= No path" > } > } > > for {set i 1} {$i < 7} {incr i} { > set a LSR$i > set m [eval $$a get-module "MPLS"] > eval set LSRmpls$i $m > } > > $ns at 1.0 "record" > > $ns at 1.0 "constraint-based-routing 1100 $LSR1 9 700kb" > $ns at 1.2 "$LSRmpls1 send-crldp-release-msg 1100" > > $ns at 1.5 "constraint-based-routing 1100 $LSR1 9 700kb" > > $ns at 4.1 "record" > $ns at 4.1 "finish" > > $ns run |