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

📄 printout.ps

📁 obs网络试验平台
💻 PS
📖 第 1 页 / 共 3 页
字号:
(    set cl [new Classifier/BaseClassifier/CoreClassifier]) N(    $n set classifier_ $cl) N(    [$n set classifier_] set address_ $nodeid) N(    [$n set classifier_] set type_ 1) N() N(    # puts " create-core-node: node $nodeid created") N(    return $n) N(}) N() N(# construct a new edge node ) N(Simulator instproc create-edge-node { totedges } {) N(    set n [$self node]) N(    set nodeid [$n id]) N() N(    set cl [new Classifier/BaseClassifier/EdgeClassifier]) N(    $n set classifier_ $cl) N(    [$n set classifier_] set address_ $nodeid) N(    [$n set classifier_] set type_ 0) N() N(    set p0 [new Classifier/OBSPort]) N(    $p0 set address_ $nodeid) N(    set iagent0 [new Agent/IPKT]) N(    $iagent0 initiagent $totedges) N(    $p0 install-iagent $iagent0) N() N(    # dump the default burst-params ) N(    #$iagent0 dumpburstdefaults) N() N(    $n set dmux_ $p0) N(    [$n set classifier_] install $nodeid $p0) N(    $n attach $iagent0) N() N(    #puts " create-edge-node: node $nodeid created") N(    return $n ) N(}) N() N() N(Simulator instproc create-ftp-connection { src des } {) N(    set source [new Agent/TCP]) N(    set sink [new Agent/TCPSink]) N(    $self attach-agent $src $source) N(    $self attach-agent $des $sink) N(    $self connect $source $sink) N(    ) N(    set ftp [new Application/FTP]) N(    $ftp attach-agent $source) N() N(    return $ftp) N(}) N() N(# build the routing table) N(Simulator instproc build-routing-table { } {) N(    $self instvar Node_ link_) N() N(stdin) (Page 8/16) (Mar 01, 04 20:27) titlebordergrestore(Printed by U-GMGPC2\\Geoffrey M. Garner) rhead(stdin) (4/8) (Monday March 01, 2004) footerend % of iso1dictpagesave restoreshowpage%%Page: (9-10) 5%%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(ns-obs-lib.tcl) K(  Feb 26 21:04 2004                           Page:   5) p n() N(    set r [$self get-routelogic]) N() N(    $self compute-routes) N(    $self dump-routelogic-nh) N() N(    set n [Node set nn_]) N(    puts "The total number of nodes in this topology is $n") N(    set i 0) N(    ) N(    while { $i < $n } {) N() S 8 T (if ![info exists Node_\($i\)] {) N() S 8 T (    puts "Error node $i does not exist") N() S 8 T (    incr i ) N() S 8 T (    continue ) N() S 8 T (}) N() S 8 T (set n1 $Node_\($i\) ) N() S 8 T (set j 0) N() S 8 T (while { $j < $n } {) N(#) S 8 T (    if { $i == $j } {) N(#) S 8 T () S 16 T (set p0 [new Classifier/Port]) N(#) S 8 T () S 16 T ($n1 set dmux_ $p0) N(#) S 8 T () S 16 T ([$n1 set classifier_] install $j $p0) N(#) S 8 T (    }) N() S 8 T (    if { $i != $j } {) N() S 8 T () S 16 T (set nh [$r lookup $i $j]) N() S 8 T () S 16 T (if { $nh >=0 } {) N() S 8 T () S 16 T (    puts "setting up route between $i $j with $nh") N() S 8 T () S 16 T (    [$n1 set classifier_] install $j [$link_\($i:$nh\) head]) N() S 8 T () S 16 T (}) N() S 8 T (    }) N() S 8 T (    incr j) N() S 8 T (}) N() S 8 T (incr i) N(    }) N(}) N() N() N(# create a duplex) N(Simulator instproc createDuplexFiberLink { node1 node2 bwpc delay ncc ndc maxch ) N(} {) N(    $self instvar link_) N(   ) N(    $self obs_duplex-FiberLink $node1 $node2 $bwpc $delay Null $maxch) N() N(    set id1 [$node1 id]) N(    set id2 [$node2 id]) N(    if [info exists link_\($id1:$id2\)] {) N() S 8 T ([$node1 set classifier_] install-scheduler $id2 $ncc $ndc $maxch $bwpc) N() S 8 T (puts "Adding schedulers between $node1 and $node2") N(    }) N(    if [info exists link_\($id2:$id1\)] {) N() S 8 T ([$node2 set classifier_] install-scheduler $id1 $ncc $ndc $maxch $bwpc) N() S 8 T (puts "Adding schedulers between $node2 and $node1") N(    }) N(}) N() N(#Create a node trace object, for tracing application traffic at edge) N() N(stdin) (Page 9/16) (Mar 01, 04 20:27) 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(ns-obs-lib.tcl) K(  Feb 26 21:04 2004                           Page:   6) p n() N(#nodes) N() N(Simulator instproc nodetrace-all { file } {) N(     set ndtr [ new NodeTrace ]) N(     $ndtr set trace_on 1) N(     $ndtr attach $file) N(}) N() N(#Flush the node trace data) N(Simulator instproc flush-nodetrace {} {) N(     set ndtr [ new NodeTrace ]) N(     $ndtr flush) N(}) N() N(stdin) (Page 10/16) (Mar 01, 04 20:27) titlebordergrestore(Printed by U-GMGPC2\\Geoffrey M. Garner) rhead(stdin) (5/8) (Monday March 01, 2004) footerend % of iso1dictpagesave restoreshowpage%%Page: (11-12) 6%%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(ns-optic-link.tcl) K(  Feb 10 10:24 2004                        Page:   7) 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 ) N(under) N(#    grants from Cisco Systems Inc and the University of Maryland, Baltimore Cou) N(nty.) 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 modi) N(fied) N(#    at Washington State University, Pullman, WA  through research work which wa) N(s) 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 suc) N(h) 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(OBSFiberDelayLink set bandwidth_ 1.5Mb) N(OBSFiberDelayLink set delay_ 100ms) N(OBSFiberDelayLink set wvlen_num_ 8) N(OBSFiberDelayLink set debug_ 0) N() N(#GMG -- inserted these dummy functions - needed for tracing because the) N(# Connector object has replaced the queue object.) N(# Dummy function for all the queues that don't implement attach-traces) N(#) N(Connector instproc attach-traces {src dst file {op ""}} {) N() S 8 T (#Do nothing here) N(}) N() N(Connector instproc attach-nam-traces {src dst file {op ""}} {) N() S 8 T (#Do nothing here) N(}) N(stdin) (Page 11/16) (Mar 01, 04 20:27) 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() p n(stdin) (Page 12/16) (Mar 01, 04 20:27) titlebordergrestore(Printed by U-GMGPC2\\Geoffrey M. Garner) rhead(stdin) (6/8) (Monday March 01, 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(ns-optic-link.tcl) K(  Feb 10 10:24 2004                        Page:   8) p n() N() N(Simulator instproc duplex-link-of-interfaces { n1 n2 bw delay linktype args } {) N(        eval $self obs_duplex-FiberLink $n1 $n2 $bw $delay $linktype 8 $args) N(}) N() N(# create a duplex link with the provided nodes delay bw and linktype) N(Simulator instproc obs_duplex-FiberLink { n1 n2 bw delay linktype nlambda args }) N( {) N(        $self instvar link_) N(        set i1 [$n1 id]) N(        set i2 [$n2 id]) N() N(        if [info exists link_\($i1:$i2\)] {) N(                $self remove-nam-linkconfig $i1 $i2) N(        }) N() N(        eval $self obs_simplex-FiberLink $n1 $n2 $bw $delay $linktype $nlambda $) N(args) N(        eval $self obs_simplex-FiberLink $n2 $n1 $bw $delay $linktype $nlambda $) N(args) N(}) N() N(Simulator instproc obs_simplex-FiberLink { n1 n2 bw delay linktype nlambda args ) N(} {) N() S 8 T ($self instvar link_ ) N() N() S 8 T (#) N() S 8 T (# create the common simple-link between nodes) N() S 8 T (#) N(        #eval $self simplex-link $n1 $n2 $bw $delay $linktype $args) N() N(        set sid [$n1 id]) N(        set did [$n2 id]) N( ) N() S 8 T (# use connector to replace queue, in OWNS) N() S 8 T (if { $linktype == "ErrorModule" } {) N() S 8 T () S 16 T (if { [llength $args] > 0 } {) N(                ) S 24 T (set q [eval new $linktype $args]) N(                } else {) N(                        set q [new $linktype Fid]) N(                }                             ) N() S 8 T (} else {) N(        ) S 16 T (set q [new Connector]) N() S 8 T (}) N() N() N() S 8 T (# create fiber link) N(        set link_\($sid:$did\) [new obs_SimpleFiberLink $n1 $n2 $bw $delay $q]) N() N() S 8 T (# set fiber delay link's wvlen_num_) N() S 8 T ([$link_\($sid:$did\) set link_] set wvlen_num_ $nlambda) N() N(        $n1 add-neighbor $n2) N( ) N(#GMG - uncommented the tracing) N() S 8 T (# trace and nam trace) N(         set tracefile [$self get-ns-traceall]) N(         if {$tracefile != ""} {) N(                 $self trace-queue $n1 $n2 $tracefile) N(         }) N(stdin) (Page 13/16) (Mar 01, 04 20:27) 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() p n(stdin) (Page 14/16) (Mar 01, 04 20:27) titlebordergrestore(Printed by U-GMGPC2\\Geoffrey M. Garner) rhead(stdin) (7/8) (Monday March 01, 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(ns-optic-link.tcl) K(  Feb 10 10:24 2004                        Page:   9) p n() N(         set namtracefile [$self get-nam-traceall]) N(         if {$namtracefile != ""} {) N(                 $self namtrace-queue $n1 $n2 $namtracefile) N(         }) N( ) N(        # Register this simplex link in nam link list. Treat it as) N(        # a duplex link in nam                                                ) N() N(        $self register-nam-linkconfig $link_\($sid:$did\)              ) N() S 8 T () N() S 8 T (#) N() S 8 T (# Store wavelength information) N() S 8 T (#) N() S 8 T (set wbw [expr [$self bw_parse $bw] / $nlambda]) N() N() S 8 T (# call C++ to register wavelength information - not reqd for OBS) N() S 8 T (#[$self get-wassign-logic] register-wvlen $sid $did $nlambda $wbw) N() N(        #) N(        # set trace on lightpath classifier of nodes) N(        #) N(        # GMG commented out the lines below, as they are inserted above) N(        # set tracefile [$self get-ns-traceall]) N(        # set namtracefile [$self get-nam-traceall]) N() N() S 8 T (#) N() S 8 T (# direct dropped packets from classifiers to link queue's drophead) N() S 8 T (# drop-target is in C++ command) N() S 8 T (#) N() N( ) S 8 T (set classifier [$n1 set classifier_] ) N( ) S 8 T (set droptarget [$classifier drop-target] ) N() N() S 8 T (#) N() S 8 T (# Sigh, there might have more than one) N() S 8 T (# link queue which help drop packets,) N() S 8 T (# but we only select the first one.) N() S 8 T (#) N() S 8 T (# In nam, it does not make difference, ) N() S 8 T (# but in trace file, there might be confused with) N() S 8 T (# the normal dropped packets.) N() S 8 T (#) N( ) S 8 T (if { $droptarget == "" } {) N( ) S 8 T () S 16 T (set drophead [$link_\($sid:$did\) set drophead_]) N( ) S 8 T () S 16 T (eval $classifier drop-target $drophead) N( ) S 8 T (}) N(        ) N(}) N() N(Class obs_SimpleFiberLink -superclass SimpleLink) N( ) N(obs_SimpleFiberLink instproc init { src dst bw delay q {lltype "OBSFiberDelayLin) N(k"} } {      ) N() S 8 T ($self next $src $dst $bw $delay $q $lltype) N(}) N() N() N() N(stdin) (Page 15/16) (Mar 01, 04 20:27) 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(ns-optic-link.tcl) K(  Feb 10 10:24 2004                        Page:  10) p n() N() N() N() N(stdin) (Page 16/16) (Mar 01, 04 20:27) titlebordergrestore(Printed by U-GMGPC2\\Geoffrey M. Garner) rhead(stdin) (8/8) (Monday March 01, 2004) footerend % of iso1dictpagesave restoreshowpage%%Trailerend%%EOF

⌨️ 快捷键说明

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