[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ns] MPLS rerouting not work
Hi,
I made a simple mpls rerouting script file but the rerouting does not
work. The topology is like below:
---------8-------------
| |
| |
7---------------------9
| |
| |
0-----1----2----4-----5-----6-----10
\ /
\ /
3
The working path is 1--2--3--4--5--6. At time 0.6 the link between 4 and 5
is down. The reroute path is 4--3--2--1--7--8--9--6. But rerouting does
not work. I don't know why.
The script file is below. If you know the reason please let me know.
Thanks a lot!
Sincerely,
--Jie
set ns [new Simulator]
set nf [open m.nam w]
$ns namtrace-all $nf
set f0 [open m.tr w]
$ns trace-all $f0
proc finish {} {
global ns nf f0
$ns flush-trace
close $nf
close $f0
exec nam m.nam &
exit 0
}
proc attach-expoo-traffic { node sink size burst idle rate } {
global ns
set udp [new Agent/UDP]
$ns attach-agent $node $udp
set traffic [new Application/Traffic/Exponential]
$traffic set packetSize_ $size
$traffic set burst_time_ $burst
$traffic set idle_time_ $idle
$traffic set rate_ $rate
$traffic attach-agent $udp
$ns connect $udp $sink
return $traffic
}
Agent/LDP set trace_ldp_ 1
Classifier/Addr/MPLS set trace_mpls_ 1
$ns use-scheduler List
$ns rtproto DV
set node0 [$ns node]
$ns node-config -MPLS ON
set LSR1 [$ns node]
set LSR2 [$ns node]
set LSR3 [$ns node]
set LSR4 [$ns node]
set LSR5 [$ns node]
set LSR6 [$ns node]
set LSR7 [$ns node]
set LSR8 [$ns node]
set LSR9 [$ns node]
$ns node-config -MPLS OFF
set node10 [$ns node]
$ns duplex-link $node0 $LSR1 1Mb 10ms DropTail
$ns duplex-link $LSR1 $LSR7 1Mb 10ms DropTail
$ns duplex-link $LSR1 $LSR2 1Mb 10ms DropTail
$ns duplex-link $LSR2 $LSR3 1Mb 10ms DropTail
$ns duplex-link $LSR2 $LSR4 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 $LSR7 $LSR8 1Mb 10ms DropTail
$ns duplex-link $LSR7 $LSR9 1Mb 10ms DropTail
$ns duplex-link $LSR8 $LSR9 1Mb 10ms DropTail
$ns duplex-link $LSR9 $LSR6 1Mb 10ms DropTail
$ns duplex-link $LSR6 $node10 1Mb 10ms DropTail
for {set i 1} {$i < 10} {incr i} {
set a LSR$i
for {set j [expr $i+1]} {$j < 10} {incr j} {
set b LSR$j
eval $ns LDP-peer $$a $$b
}
set m [eval $$a get-module "MPLS"]
$m enable-reroute "new"
}
$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
Classifier/Addr/MPLS enable-on-demand
Classifier/Addr/MPLS enable-ordered-control
[$LSR1 get-module "MPLS"] enable-data-driven
set sink0 [new Agent/LossMonitor]
$ns attach-agent $node10 $sink0
set src0 [attach-expoo-traffic $node0 $sink0 200 0 0 400k]
$ns at 0.0 "$src0 start"
# for reroute
$ns at 0.0 "[$LSR1 get-module MPLS] make-explicit-route 6 7_8_9_6 1000
-1"
$ns at 0.1 "[$LSR6 get-module MPLS] make-explicit-route 6 5_4_3_2_1_1000
1005 -1"
#for working path
$ns at 0.0 "[$LSR1 get-module MPLS] make-explicit-route 6 1_2_3_4_5_6
2000 -1"
$ns at 0.2 "[$LSR1 get-module MPLS] flow-erlsp-install 10 -1 2000"
#routing binding
$ns at 0.3 "[$LSR1 get-module MPLS] reroute-binding 10 -1 1005"
$ns at 0.3 "[$LSR2 get-module MPLS] reroute-binding 10 -1 1005"
$ns at 0.3 "[$LSR3 get-module MPLS] reroute-binding 10 -1 1005"
$ns at 0.3 "[$LSR4 get-module MPLS] reroute-binding 10 -1 1005"
$ns at 0.3 "[$LSR5 get-module MPLS] reroute-binding 10 -1 1005"
$ns rtmodel-at 0.6 down $LSR4 $LSR5
$ns rtmodel-at 0.7 up $LSR4 $LSR5
$ns at 0.8 "$src0 stop"
$ns at 0.9 "[$LSR1 get-module MPLS] erb-dump"
$ns at 0.9 "[$LSR1 get-module MPLS] lib-dump"
$ns at 0.9 "[$LSR1 get-module MPLS] pft-dump"
$ns at 1.0 "finish"
$ns run