Thursday, February 16, 2012

[ns] Addressing to mpls nodes

Hello all,

I am trying to assign addresses to MPLS nodes in a network.. but
gettiing error.. Please help..

syntax error in expression "0.0.2 & 2147483647 << 0": extra tokens at
end of expression
while executing
"expr $addrstr & [AddrParams NodeMask 1] << [AddrParams NodeShift 1]"
invoked from within
"if [Simulator hier-addr?] {
set addressObj [[[Simulator instance] get-AllocAddrBits ""] get-Address]
return [$addressObj str2addr $addrstr]
} else {
..."
(procedure "AddrParams" line 2)
(AddrParams addr2id line 2)
invoked from within
"AddrParams addr2id $address_"
(procedure "_o16" line 5)
(Node attach line 5)
invoked from within
"[$self node] attach $ldp"
(procedure "_o19" line 5)
(RtModule/MPLS make-ldp line 5)
invoked from within
"[$src get-module "MPLS"] make-ldp"
(procedure "_o3" line 5)
(Simulator LDP-peer line 5)
invoked from within
"_o3 LDP-peer $LSR1 $LSR2"
("eval" body line 1)
invoked from within
"eval $ns LDP-peer $$a $$b"
("for" body line 5)
invoked from within
"for {set i 1} {$i < 7} {incr i} {
for {set j [expr $i+1]} {$j < 7} {incr j} {
set a LSR$i
set b LSR$j
eval $ns LDP-peer $$a $$b
}
}"
(file "try1.tcl" line 49)
<---------------------------------->

My tcl file is as


set ns [new Simulator]
set nf [open out1.nam w]
$ns namtrace-all $nf


Classifier/Addr/MPLS set control_driven_ 1
Classifier/Addr/MPLS enable-on-demand
Classifier/Addr/MPLS enable ordered control
# Turn on all traces to stdout
Agent/LDP set trace_ldp_ 1
Classifier/Addr/MPLS set trace_mpls_ 1

#$self openTrace 5.0
$ns set-address-format def

set Node0 [$ns node 0.0.1]
#set Node1 [$ns node]
$ns node-config -MPLS ON
set LSR1 [$ns node 0.0.2]
set LSR2 [$ns node 0.0.3]
set LSR3 [$ns node 0.0.4]
set LSR4 [$ns node 0.0.5]
set LSR5 [$ns node 0.0.6]
set LSR6 [$ns node 0.0.7]
#set LSR8 [$ns node]
$ns node-config -MPLS OFF
set Node7 [$ns node 0.0.8]
#set Node10 [$ns node]

$ns duplex-link $Node0 $LSR1 1Mb 10ms DropTail

$ns duplex-link $LSR1 $LSR2 1Mb 10ms DropTail
$ns duplex-link $LSR2 $LSR3 1Mb 10ms DropTail
$ns duplex-link $LSR3 $LSR4 1Mb 10ms DropTail
$ns duplex-link $LSR4 $LSR5 1Mb 10ms DropTail
$ns duplex-link $LSR5 $LSR6 1Mb 10ms DropTail
$ns duplex-link $LSR3 $LSR6 1Mb 10ms DropTail

$ns duplex-link $LSR5 $Node7 1Mb 10ms DropTail


#
# configure ldp agents on all mpls nodes
#
for {set i 1} {$i < 7} {incr i} {
for {set j [expr $i+1]} {$j < 7} {incr j} {
set a LSR$i
set b LSR$j
eval $ns LDP-peer $$a $$b
}
}


#
# 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 yellow



#
# make agent to send packets
#
set Src0 [new Application/Traffic/CBR]
set udp0 [new Agent/UDP]
$Src0 attach-agent $udp0
$ns attach-agent $Node0 $udp0
$Src0 set packetSize 500
$Src0 set interval 0.010

set Dst0 [new Agent/Null]
$ns attach-agent $Node7 $Dst0

$ns connect $udp0 $Dst0


$ns at 0.1 "$Src0 start"

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

$ns at 0.2 "$LSR5 ldp-trigger-by-withdraw 7 -1"

$ns at 0.5 "$LSR1 make-explicit-route 5 1_2_3_4_5 3000 -1"
$ns at 0.6 "$LSR1 flow-erlsp-install 7 -1 3000"

$ns at 2.0 "$Src0 stop"

$ns at 2.1 "$LSR1 pft-dump"
$ns at 2.1 "$LSR1 erb-dump"
$ns at 2.1 "$LSR1 lib-dump"

$ns at 2.1 "$LSR2 pft-dump"
$ns at 2.1 "$LSR2 erb-dump"
$ns at 2.1 "$LSR2 lib-dump"

$ns at 2.1 "$LSR3 pft-dump"
$ns at 2.1 "$LSR3 erb-dump"
$ns at 2.1 "$LSR3 lib-dump"

$ns at 2.1 "$LSR4 pft-dump"
$ns at 2.1 "$LSR4 erb-dump"
$ns at 2.1 "$LSR4 lib-dump"

$ns at 2.1 "$LSR5 pft-dump"
$ns at 2.1 "$LSR5 erb-dump"
$ns at 2.1 "$LSR5 lib-dump"

#define 'finish' procedure
proc finish {} {
global ns nf
$ns flush-trace
#close the trace files
close $nf

exec nam out1.nam &

exit 0
}


$ns at 14.0 "finish"
$ns run

No comments:

Post a Comment

Counter

blogger analytics