The MPLS-OPS Archive

Cell Relay Retreat>MPLS-OPS Archive>month:2003-Jan> msg00093



[Date Prev][Date Next][Thread Prev][Thread Next]  
  [Date Index][Thread Index][Author Index][Subject Index]

problem in executing MPLS program.

  • From: "ursbabu79" <ursbabu79@indiatimes.com>
  • Date: Thu, 23 Jan 2003 18:36:36 +0530
  • Resent-Date: Thu, 23 Jan 2003 09:42:52 -0500
  • To: <mpls-ops@mplsrc.com>
  • X-URL: http://indiatimes.com

hello friends,

i am getting an error in executing the following program.the Packets are not transmitted with the same color as they are generated when they enter a LSP.
i am using 4 types of traffic types SBT,HBT,RT1,RT2
and i am establishing 2 ER-LSP for SBT and HBT.
i am establishing 2 CR-lsp for RT1 and RT2.
but when these packets enter the LSP their color is changing for Black.and all packets in the Queue are also displayed in Black only.
so, please tell me how to solve this problem..

thanks in advance..

the program is............

####### Resource pre-emption in CR-LSP ###########

set ns [new Simulator]

set na [open crlsp-pmt.tr w]
set nf [open crlsp-pmt.nam w]
set fSBT [open SBT w]
set fHBT [open HBT w]
set fRT1 [open RT1 w]
set fRT2 [open RT2 w]

set TpktSBT 0
set TpktHBT 0
set TpktRT1 0
set TpktRT2 0
proc record {} {
        global fSBT fHBT fRT1 fRT2 SBTsink HBTsink RT1sink RT2sink TpktSBT TpktHBT TpktRT1 TpktRT2

	set ns [Simulator instance]
	
	#Set the time after which the procedure should be called again
        set time 1.0
	#set time 0.045
	
	#How many bytes have been received by the traffic sink?
        set bwSBT [$SBTsink set bytes_]
        set bwHBT [$HBTsink set bytes_]
        set bwRT1 [$RT1sink set bytes_]
        set bwRT2 [$RT2sink set bytes_]
	
	#Get the current time
        set now [$ns now]

	#Calculate the bandwidth (in MBit/s) and write it to the file
        puts $fSBT "$now [expr $bwSBT/$time*8/1000000]"
        puts $fHBT "$now [expr $bwHBT/$time*8/1000000]"
        puts $fRT1 "$now [expr $bwRT1/$time*8/1000000]"
        puts $fRT2 "$now [expr $bwRT2/$time*8/1000000]"
        

	#Reset the bytes_ values on the traffic sink
        $SBTsink set bytes_ 0
        $HBTsink set bytes_ 0
        $RT1sink set bytes_ 0
        $RT2sink set bytes_ 0
        
        set pktSBT  [expr $bwSBT / 200]
        set TpktSBT [expr $TpktSBT + $pktSBT]
        set pktHBT  [expr $bwHBT / 200]
        set TpktHBT [expr $TpktHBT + $pktHBT]
        set pktRT1  [expr $bwRT1 / 200]
        set TpktRT1 [expr $TpktRT1 + $pktRT1]
        set pktRT2  [expr $bwRT2 / 200]
        set TpktRT2 [expr $TpktRT2 + $pktRT2]

	#Re-schedule the procedure
        $ns at [expr $now+$time] "record"
}

proc recv-pkts {} {
     global TpktSBT TpktHBT TpktRT1 TpktRT2

     puts "The packet number of SBT : $TpktSBT"
     puts "The packet number of HBT : $TpktHBT"
     puts "The packet number of RT1 : $TpktRT1"
     puts "The packet number of RT2 : $TpktRT2"
}


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
}


$ns trace-all $na
$ns namtrace-all $nf
proc finish {} {
	global ns na nf fSBT fHBT fRT1 fRT2
	$ns flush-trace
        close $na
	close $nf
	close $fSBT
	close $fHBT
	close $fRT1
	close $fRT2
	
	recv-pkts
        exec nam  crlsp-pmt.nam &
#        exec xgraph -m SBT HBT RT1 RT2  -geometry 800x400 &
	exit 0
}

#
# make nodes & MPLSnodes
#
set Node0 [$ns node]
set LSR1  [$ns mpls-node]
set LSR2  [$ns mpls-node]
set LSR3  [$ns mpls-node]
set Node4 [$ns node]


#
# make links
#
$ns duplex-link $Node0  $LSR1  2Mb  10ms DropTail
$ns duplex-link $LSR1   $LSR2  1Mb  10ms CBQ
$ns duplex-link $LSR2   $LSR3  1Mb  10ms CBQ
$ns duplex-link $LSR3   $Node4 1Mb  10ms DropTail


$ns duplex-link-op $LSR1 $LSR2 queuePos 0.8

#
# 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.14  auto       0
$ns cfg-cbq-for-HBTS      10  DropTail    1     0.01  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 bind-flowid-to-SBTS 100
$ns bind-flowid-to-SBTS 200 200
$ns bind-flowid-to-SBTS 300 300 
$ns bind-flowid-to-SBTS 400 400

$ns bind-ldp-to-STS


$ns ldp-request-color       blue
$ns ldp-mapping-color       red
$ns ldp-withdraw-color      magenta
$ns ldp-release-color       orange
$ns ldp-notification-color  yellow

#$LSR2 trace-mpls

# set ldp events
#
#
# $ns enable-control-driven
#

#$ns enable-data-driven
#$ns enable-on-demand
#$ns enable-ordered-control

#
#Create a traffic sink and attach it to the node Node4
#

set SBTsink [new Agent/LossMonitor]
$ns attach-agent $Node4  $SBTsink
$SBTsink clear

set HBTsink [new Agent/LossMonitor]
$ns attach-agent $Node4  $HBTsink
$HBTsink clear

set RT1sink [new Agent/LossMonitor]
$ns attach-agent $Node4  $RT1sink
$RT1sink clear

set RT2sink [new Agent/LossMonitor]
$ns attach-agent $Node4  $RT2sink
$RT2sink clear

#
#Create a traffic source
#

set SBT [attach-expoo-traffic $Node0  $SBTsink 200 0 0  250k]
$SBT set fid_ 100
$ns color 100 red

set HBT [attach-expoo-traffic $Node0  $HBTsink 200 0 0  250k]
$HBT set fid_ 200
$ns color 200 blue

set RT1 [attach-expoo-traffic $Node0  $RT1sink 200 0 0  600k]
$RT1 set fid_ 300
$ns color 300 yellow

set RT2 [attach-expoo-traffic $Node0  $RT2sink 200 0 0  700k]
$RT2 set fid_ 400
$ns color 400 black


proc notify-erlsp-setup {node lspid} {
        
        set ns [Simulator instance]
        puts "[$ns now] nodeid=[$node id] : lspid=$lspid"
        
        set module [$node get-module "MPLS"]
	
        if {[$node id] == 1} {
           
               switch $lspid {
                      1000 {  $module bind-flow-erlsp   4  100  $lspid
                           }
                      1100 {  $module bind-flow-erlsp   4  200  $lspid 
                              $module set-flow-prio     4  200  1
                           }
                      1200 { $module bind-flow-erlsp   4  300  $lspid }
                      1300 { $module bind-flow-erlsp   4  400  $lspid }
                 default { 
                           puts "error" 
                           exit 1
                         }
               }
        }
        
}

proc notify-erlsp-fail {node status lspid tr} {

   puts "nodeid=[$node id] : status=$status  lspid=$lspid  tr=$tr"

}

#
# set MPLS modules
#
for {set i 1} {$i < 4} {incr i} {
	set a LSR$i
	set m [eval $$a get-module "MPLS"]
	eval set LSRmpls$i $m
}

$ns at 0.0  "record"

$ns at 0.1 "$LSRmpls1 setup-erlsp  3  1_2_3  1000"
$ns at 0.1 "$LSRmpls1 setup-erlsp  3  1_2_3  1100"

############################################################################
# MplsNode instproc setup-crlsp {fec er lspid TRate BSize PSize SPrio HPrio}
#
$ns at 0.1  "$LSRmpls1 setup-crlsp  3  1_2_3  1200  600K  400B 200B 7 4"
############################################################################

$ns at 1.0  "$SBT start"
$ns at 1.0  "$HBT start"
$ns at 1.0  "$RT1 start"


############################################################################
# MplsNode instproc setup-crlsp {fec er lspid TRate BSize PSize SPrio HPrio}
#
$ns at 10.0  "$LSRmpls1 setup-crlsp  3  1_2_3  1300  700K  400B 200B 3 2"
############################################################################

$ns at 11.0  "$RT2 start"

$ns at 30.0  "$RT2 stop"
$ns at 31.0  "$LSRmpls1 send-crldp-release-msg  1300"

$ns at 40.0  "$SBT stop"
$ns at 40.0  "$HBT stop"
$ns at 40.0  "$RT1 stop"

$ns at 43.0 "finish"

$ns at 0.0 "$ns trace-annotate Red------------SBT"
$ns at 0.0 "$ns trace-annotate Blue-----------HBT"
$ns at 0.0 "$ns trace-annotate Yellow---------RT1"
$ns at 0.0 "$ns trace-annotate Black----------RT2"

$ns run






Get Your Private, Free E-mail from Indiatimes at http://email.indiatimes.com

 Buy the best in Movies at http://www.videos.indiatimes.com

Bid for for Air Tickets @ Re.1 on Air Sahara Flights. Just log on to http://airsahara.indiatimes.com and Bid Now !

-------
The MPLS-OPS Mailing List
Subscribe/Unsubscribe:  http://www.mplsrc.com/mplsops.shtml
Archive: http://www.mplsrc.com/mpls-ops_archive.shtml