📄 printout.ps
字号:
x0 y0 moveto(basic8a-nam.tcl) K( Feb 11 10:01 2004 Page: 10) p n() N(source ../lib/ns-obs-defaults.tcl) N(source ../lib/ns-optic-link.tcl ) N() N(set ns [new Simulator]) N(set nf [open basic8a.nam w]) N(set sc [new StatCollector]) N(set tf [open trace8a.tr w]) N(set ndf [open ndtrace8a.tr w]) N() N($ns color 1 Blue) N($ns color 2 Red) N() N(# dump all the traces out to the nam file) N($ns namtrace-all $nf) N() N($ns trace-all $tf) N($ns nodetrace-all $ndf) N() N() N(#====================================================================#) N(# constant definitions) N(# set the offset time To to 20 microseconds) N(#BurstManager offsettime 0.00002) N(BurstManager offsettime 0.002) N(BurstManager maxburstsize 1250) N(BurstManager bursttimeout 0.1) N(# set the bhp processing time 1 microsecond) N(Classifier/BaseClassifier/CoreClassifier set bhpProcTime 0.000006) N(Classifier/BaseClassifier/EdgeClassifier set bhpProcTime 0.000006) N(Classifier/BaseClassifier set proc_time 0.0) N(OBSFiberDelayLink set FDLdelay 0.000005) N() N(# total number of edge nodes) N(set edge_count 2) N(# total number of core routers) N(set core_count 1) N() N(# total bandwidth/channel \(1mb = 1000000\)) N(set bwpc 1000000) N(#set bwpc ) N(# delay in milliseconds) N(set delay 1ms) N() N(# total number of channels per link) N(set maxch 14) N(# number of control channels per link) N(set ncc 4) N(# number of data-channels) N(set ndc 10) N() N(# set the variables too.) N($ns set bwpc_ $bwpc) N($ns set maxch_ $maxch) N($ns set ncc_ $ncc) N($ns set ndc_ $ndc) N() N() N(stdin) (Page 12/26) (Feb 11, 04 16:20) titlebordergrestore(Printed by U-GMGPC2\\Geoffrey M. Garner) rhead(stdin) (6/13) (Wednesday February 11, 2004) footerend % of iso1dictpagesave restoreshowpage%%Page: (13-14) 7%%BeginPageSetup/pagesave save defsh 0 translate 90 rotate%%EndPageSetupiso1dict begingsavellx lly 12 add translate/v 0 store/x0 x v get 3.362408 add sx cw mul add store/y0 y v get bfs th add sub storex0 y0 moveto(basic8a-nam.tcl) K( Feb 11 10:01 2004 Page: 11) p n() N(#====================================================================#) N(# support procedures) N() N(# finish procedure) N(proc finish {} {) N( global ns nf sc tf) N( $ns flush-trace) N( close $nf) N( close $tf) N( ) N( $sc display-sim-list) N() N( #Execute NAM on the trace file) N( exec nam basic8a.nam &) N() N( puts "Simulation complete";) N( exit 0) N(}) N() N() N() N() N(#create a edge-core-edge topology) N(Simulator instproc create_topology { } {) N( $self instvar Node_) N( global E C ns) N( global edge_count core_count) N( global bwpc maxch ncc ndc delay) N() N( set i 0) N( # set up the edge nodes) N( while { $i < $edge_count } {) N() S 8 T (set E\($i\) [$self create-edge-node $edge_count]) N( set nid [$E\($i\) id]) N( set string1 "E\($i\) node id: $nid") N( puts $string1) N() S 8 T (incr i) N( }) N( ) N( set i 0) N( # set up the core nodes) N( while { $i < $core_count } {) N() S 8 T (set C\($i\) [$self create-core-node $core_count]) N( set nid [$C\($i\) id]) N( set string1 "C\($i\) node id: $nid") N( puts $string1) N() S 8 T (incr i) N( }) N( ) N( $self createDuplexFiberLink $E\(0\) $C\(0\) $bwpc $delay $ncc $ndc $maxch) N( $self createDuplexFiberLink $C\(0\) $E\(1\) $bwpc $delay $ncc $ndc $maxch) N() N( #$ns duplex-link-op $E\(0\) $C\(0\) orient right) N( #$ns duplex-link-op $C\(0\) $E\(1\) orient right) N() N( $self build-routing-table) N() N(stdin) (Page 13/26) (Feb 11, 04 16:20) titleborder/v 1 store/x0 x v get 3.362408 add sx cw mul add store/y0 y v get bfs th add sub storex0 y0 moveto(basic8a-nam.tcl) K( Feb 11 10:01 2004 Page: 12) p n() N( ) N(}) N() N() N() N() N($ns create_topology) N(#set ftp0 [$ns create-ftp-connection $E\(0\) $E\(1\)]) N() N(#puts "constructed a ftp connection between Edge node 0 and 1 ") N(#$ns at 1.0 "$ftp0 start") N(#$ns at 1000.0 "$ftp0 stop") N() N(Agent/UDP set packetSize_ 1250) N() N(set udp0 [new Agent/UDP]) N($ns attach-agent $E\(0\) $udp0) N() N(set cbr0 [new Application/Traffic/CBR]) N($cbr0 set packetSize_ 1250) N($cbr0 set interval_ 0.0005) N($cbr0 attach-agent $udp0) N() N(set null0 [new Agent/Null]) N($ns attach-agent $E\(1\) $null0) N() N($ns connect $udp0 $null0) N() N($ns at 1.0 "$cbr0 start") N($ns at 6.0 "$cbr0 stop") N() N($ns at 7.0 "finish") N($ns run) N() N() N() N() N() N() N(stdin) (Page 14/26) (Feb 11, 04 16:20) titlebordergrestore(Printed by U-GMGPC2\\Geoffrey M. Garner) rhead(stdin) (7/13) (Wednesday February 11, 2004) footerend % of iso1dictpagesave restoreshowpage%%Page: (15-16) 8%%BeginPageSetup/pagesave save defsh 0 translate 90 rotate%%EndPageSetupiso1dict begingsavellx lly 12 add translate/v 0 store/x0 x v get 3.362408 add sx cw mul add store/y0 y v get bfs th add sub storex0 y0 moveto(basic8a.tcl) K( Feb 11 10:00 2004 Page: 13) p n() N(# Copyright \(c\) University of Maryland, Baltimore County, 2003.) N(# Original Authors: Ramakrishna Shenai, Sunil Gowda and Krishna Sivalingam.) N() N(# This software is developed at the University of Maryland, Baltimore County u) N(nder) N(# grants from Cisco Systems Inc and the University of Maryland, Baltimore Coun) N(ty.) N() N(# Permission to use, copy, modify, and distribute this software and its) N(# documentation in source and binary forms for non-commercial purposes) N(# and without fee is hereby granted, provided that the above copyright) N(# notice appear in all copies and that both the copyright notice and) N(# this permission notice appear in supporting documentation. and that) N(# any documentation, advertising materials, and other materials related) N(# to such distribution and use acknowledge that the software was) N(# developed by the University of Maryland, Baltimore County. The name of) N(# the University may not be used to endorse or promote products derived from) N(# this software without specific prior written permission.) N() N(# Copyright \(C\) 2000-2003 Washington State University. All rights reserved.) N(# This software was originally developed at Alcatel USA and subsequently modif) N(ied) N(# at Washington State University, Pullman, WA through research work which was) N(# supported by Alcatel USA, Inc and Cisco Systems Inc.) N() N(# The following notice is in adherence to the Washington State University) N(# copyright policy follows.) N() N(# License is granted to copy, to use, and to make and to use derivative) N(# works for research and evaluation purposes, provided that Washington) N(# State University is acknowledged in all documentation pertaining to any such) N(# copy or derivative work. Washington State University grants no other) N(# licenses expressed or implied. The Washington State University name) N(# should not be used in any advertising without its written permission.) N() N(# WASHINGTON STATE UNIVERSITY MAKES NO REPRESENTATIONS CONCERNING EITHER) N(# THE MERCHANTABILITY OF THIS SOFTWARE OR THE SUITABILITY OF THIS SOFTWARE) N(# FOR ANY PARTICULAR PURPOSE. The software is provided "as is") N(# without express or implied warranty of any kind. These notices must) N(# be retained in any copies of any part of this software.) N() N() N() N() N(# Example demo topology as shown below :) N(#) N(# ___________ ___________ ___________) N(# | | | | | |) N(# | Edge node |========| Core node |========| Edge node |) N(# |___________| |___________| |___________|) N(#) N(#) N() N(StatCollector set debug_ 0) N(Classifier/BaseClassifier/EdgeClassifier set type_ 0) N(Classifier/BaseClassifier/CoreClassifier set type_ 1) N(# Per node bhp processing time is 1 micro-second) N(source ../lib/ns-obs-lib.tcl) N() N(stdin) (Page 15/26) (Feb 11, 04 16:20) titleborder/v 1 store/x0 x v get 3.362408 add sx cw mul add store/y0 y v get bfs th add sub storex0 y0 moveto(basic8a.tcl) K( Feb 11 10:00 2004 Page: 14) p n() N(source ../lib/ns-obs-defaults.tcl) N(source ../lib/ns-optic-link.tcl ) N() N(set ns [new Simulator]) N(set nf [open basic8a.nam w]) N(set sc [new StatCollector]) N(set tf [open trace8a.tr w]) N(set ndf [open ndtrace8a.tr w]) N() N(# dump all the traces out to the nam file) N($ns namtrace-all $nf) N() N($ns trace-all $tf) N($ns nodetrace-all $ndf) N() N() N(#====================================================================#) N(# constant definitions) N(# set the offset time To to 20 microseconds) N(#BurstManager offsettime 0.00002) N(BurstManager offsettime 0.002) N(BurstManager maxburstsize 1250) N(BurstManager bursttimeout 0.1) N(# set the bhp processing time 1 microsecond) N(Classifier/BaseClassifier/CoreClassifier set bhpProcTime 0.000006) N(Classifier/BaseClassifier/EdgeClassifier set bhpProcTime 0.000006) N(Classifier/BaseClassifier set proc_time 0.0) N(OBSFiberDelayLink set FDLdelay 0.000005) N() N(# total number of edge nodes) N(set edge_count 2) N(# total number of core routers) N(set core_count 1) N() N(# total bandwidth/channel \(1mb = 1000000\)) N(set bwpc 1000000) N(#set bwpc ) N(# delay in milliseconds) N(set delay 1ms) N() N(# total number of channels per link) N(set maxch 14) N(# number of control channels per link) N(set ncc 4) N(# number of data-channels) N(set ndc 10) N() N(# set the variables too.) N($ns set bwpc_ $bwpc) N($ns set maxch_ $maxch) N($ns set ncc_ $ncc) N($ns set ndc_ $ndc) N() N(#====================================================================#) N(# support procedures) N() N() N(stdin) (Page 16/26) (Feb 11, 04 16:20) titlebordergrestore(Printed by U-GMGPC2\\Geoffrey M. Garner) rhead(stdin) (8/13) (Wednesday February 11, 2004) footerend % of iso1dictpagesave restoreshowpage%%Page: (17-18) 9%%BeginPageSetup/pagesave save defsh 0 translate 90 rotate%%EndPageSetupiso1dict begingsavellx lly 12 add translate/v 0 store/x0 x v get 3.362408 add sx cw mul add store/y0 y v get bfs th add sub storex0 y0 moveto(basic8a.tcl) K( Feb 11 10:00 2004 Page: 15) p n() N(# finish procedure) N(proc finish {} {) N( global ns nf sc tf) N( $ns flush-trace) N( close $nf) N( close $tf) N( ) N( $sc display-sim-list) N() N( #Execute NAM on the trace file) N( #exec nam p2p.nam &) N() N( puts "Simulation complete";) N( exit 0) N(}) N() N() N() N() N(#create a edge-core-edge topology) N(Simulator instproc create_topology { } {) N( $self instvar Node_) N( global E C ) N( global edge_count core_count) N( global bwpc maxch ncc ndc delay) N() N( set i 0) N( # set up the edge nodes) N( while { $i < $edge_count } {) N() S 8 T (set E\($i\) [$self create-edge-node $edge_count]) N( set nid [$E\($i\) id]) N( set string1 "E\($i\) node id: $nid") N( puts $string1) N() S 8 T (incr i) N( }) N( ) N( set i 0) N( # set up the core nodes) N( while { $i < $core_count } {) N() S 8 T (set C\($i\) [$self create-core-node $core_count]) N( set nid [$C\($i\) id]) N( set string1 "C\($i\) node id: $nid") N( puts $string1) N() S 8 T (incr i) N( }) N( ) N( $self createDuplexFiberLink $E\(0\) $C\(0\) $bwpc $delay $ncc $ndc $maxch) N( $self createDuplexFiberLink $C\(0\) $E\(1\) $bwpc $delay $ncc $ndc $maxch) N() N( $self build-routing-table) N( ) N(}) N() N() N() N() N() N(stdin) (Page 17/26) (Feb 11, 04 16:20) titleborder/v 1 store/x0 x v get 3.362408 add sx cw mul add store/y0 y v get bfs th add sub storex0 y0 moveto(basic8a.tcl) K( Feb 11 10:00 2004 Page: 16) p n() N
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -