⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rsvp_conf.tcl

📁 rsvp and wfq patch for Netowrk Simulator 2
💻 TCL
字号:
## Copyright (c) 1998 The University of Bonn# All rights reserved.# # Permission to use and copy this software in source and binary forms# is hereby granted, provided that the above copyright notice, this# paragraph and the following disclaimer are retained in any copies# of any part of this software and that the University of Bonn is# acknowledged in all documentation pertaining to any such copy# or derivative work. The name of the University of Bonn may not# be used to endorse or promote products derived from this software# without specific prior written permission.## THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL # THE UNIVERSITY OF BONN BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF # OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE.## A simulation scenario which illustrates the possible problems # with confirmation messages. For a detailed description, see:# http://titan.cs.uni-bonn.de/~greis/rsvpns/rsvpns.psset ns [new Simulator -multicast on]$ns color 46 purple#Simulator set EnableMcast_ 1#Simulator set NumberInterfaces_ 1set n0 [$ns node]set n1 [$ns node]set n2 [$ns node]set n3 [$ns node]set nf [open out.nam w]$ns namtrace-all $nf$ns duplex-rsvp-link $n0 $n1 1Mb 1s 0.3 50 5000 Param Null$ns duplex-rsvp-link $n1 $n2 1Mb 1s 0.5 50 5000 Param Null$ns duplex-rsvp-link $n1 $n3 1Mb 1s 0.5 50 5000 Param NullDM set PruneTimeout 60.0set mproto DMset mrthandle [$ns mrtproto $mproto {}]Agent/RSVP set noisy_ 255set rsvp3 [$n3 add-rsvp-agent]set rsvp2 [$n2 add-rsvp-agent]set rsvp1 [$n1 add-rsvp-agent]set rsvp0 [$n0 add-rsvp-agent]# Enable all upcalls on node 3:#$rsvp3 set noisy_ 255# obtain a multicast addressset group [Node allocaddr]#puts "group = $group"set sid [$rsvp0 session $group 10]# Have node 2 and 3 join the multicast group$ns at 1.0 "$n2 join-group $rsvp2 $group"$ns at 1.0 "$n3 join-group $rsvp3 $group"# Send path messages from node 0# note that the sid only has local significance - this works because# only 1 session is defined and it has sid of 0 at all of the nodes.$ns at 2.0 "$rsvp0 sender 0 +500000 5000 32"# Send reservation messages first from node 2$ns at 5.0 "$rsvp2 reserve 0 FF +500000 5000 0"# Request a confirmation for the next reservation from node 3$ns at 5.5 "$rsvp3 confirm 0"# Send reservation messages from node 3$ns at 5.7 "$rsvp3 reserve 0 FF +500000 5000 0"#$ns at 1.0 "print-sessions"#$ns at 2.0 "print-sessions"#$ns at 3.0 "print-sessions"#$ns at 4.0 "print-sessions"#$ns at 5.0 "print-sessions"#$ns at 6.0 "print-sessions"#$ns at 7.0 "print-sessions"#$ns at 8.0 "print-sessions"#$ns at 9.0 "print-sessions"#$ns at 10.0 "print-sessions"#$ns at 11.0 "print-sessions"#$ns at 12.0 "print-sessions"#$ns at 13.0 "print-sessions"#$ns at 14.0 "print-sessions"#$ns at 15.0 "print-sessions"$ns at 15.0 "finish"proc print-sessions {} {    global rsvp0 ns    set sessions [$rsvp0 sessions]    set now [$ns now]    puts "time = $now: sessions - $sessions"}proc finish {} {	global nf ns        $ns flush-trace        close $nf	puts "Done."        exit 0}$ns run

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -