Audience and Outline The 3rd NS (v2) Sim ulator W orkshop � Audience br ought to you by { net w ork researc hers { educators { dev elop ers Kevin F all � T opics for to da y La wrence Berk eley National Lab oratory { VINT pro ject goals and status (Kevin) kfal l@e e.lbl.gov arc hitecture plus some history (Kevin/Kannan) { http://www-nr g.e e.lbl.gov/kfal l { o v erview of ma jor comp onen ts (Kevin) { pro ject/co de status (Kevin) AND { details of ma jor comp onen ts (Kevin) { em ulation facilit y (Kevin) C++/OTcl link age and sim ulation debugging (Kannan) { Kannan V aradhan { scenario generation and session-lev el supp ort (Kannan) (formerly at USC/ISI) m ulticast and reliable m ulticast (Kannan) { kannan@c atarina.usc.e du { a complex link: CBQ (Kevin) http://www.isi.e du/~kannan p erformance issues (Kannan) { { discussion and futures (Ev ery one) August 7, 1998 3rd NSv2 W orkshop kfal l@e e.lbl.gov Slide 2 Dev elopmen t Status NSv2 Arc hitecture � Ob ject-orien ted structure � sim ulator co de basis for VINT Pro ject ev olution from NSv1 (C++ with regular Tcl) � 5ish p eople activ ely con tributing to the co de base { { ob jects implemen ted in C++ and \OTcl" � con tributions from: Xero x P AR C, USC/ISI, UCB, LBNL { OTcl: ob ject-orien ted extension to Tcl � Some appro ximate n um b ers: (from Da vid W etherall at MIT/LCS for V uSystem) { 44K lines of C++ co de (no w supp orted b y UCB Mash group) 14K lines of OTcl supp ort co de { � Con trol/\Data" separation { 40K lines of test suites, examples con trol op erations in OTcl { 10K lines of do cumen tation! { { data pass through C++ ob jects (for sp eed) � Users w e kno w ab out: � Mo dular approac h { 82 univ ersities, 39 companies, 4 US go v ernmen t sites { �ne-grain ob ject decomp osition � See main VINT and NS-2 w eb pages at: { p ositives : comp osible, re-usable http://netweb.usc.edu/vint negatives : m ust \plum b" in OTcl, { http://www-mash.cs.berkeley.edu/ns/ ns.htm l dev elop er m ust b e comfortable with b oth en vironmen ts, � Op en mailing lists: to ols (fairly steep learning curv e) { ns-users@mash.cs.b erk eley .edu ns-announce@mash.cs.b erk eley .edu { � T o subscrib e: { ma jordomo@mash.cs.b erk eley .edu 3rd NSv2 W orkshop kfal l@e e.lbl.gov Slide 3 3rd NSv2 W orkshop kfal l@e e.lbl.gov Slide 4
Class Hierarc h y Directory Structure � common directory shared b et w een MASH (UCB) and VINT pro jects � T op-lev el classes implemen t simple abstractions: Shared with MASH Project: TclObject WORK NsObject vint common Connector Classifier ... doc Queue ns-2 nam Tcl McastClassifier Agent Trace AddrClassifier www Delay conf Replicator Trace/Enq DropTail Trace/Deq tcl bin Agent/TCP Agent/Message ... ... Trace/Hop RED Trace/Drop lib test Reno Agent/Message/Prober ex NewReno 3rd NSv2 W orkshop kfal l@e e.lbl.gov Slide 5 3rd NSv2 W orkshop kfal l@e e.lbl.gov Slide 6 Example: a link Example: a no de � No de : a collection of agents and classi�ers � k eeps trac k of \from" and \to" No de ob jects � Agen ts: usually proto col endp oin ts and related ob jects � generally encapsulates a queue, dela y and p ossibly ttl c hec k er Link (OTcl class) � Classi�ers: pac k et dem ultiplexers Queue Node Delay Agent Port Classifier Agent Local Addr Node.entry Agent split classes Addr Classifier � Man y more complex ob jects built from this base Link Link � Note that the no de \routes" to itself or to do wnstream links 3rd NSv2 W orkshop kfal l@e e.lbl.gov Slide 7 3rd NSv2 W orkshop kfal l@e e.lbl.gov Slide 8
OTcl Basics Example: routers � routers (unicast and m ulticast) b y \plum bing" � See the page at ftp://ftp.tns.lcs.mit.edu/pub/otcl/ Node � ob ject orien ted extension to tcl Node Link � classes are ob jects with supp ort for inheritance Node.entry ... Link � Analogs to C++: ... Link { C++ has single class decl ) OTcl attac hes metho ds to ob ject or class � m ulticast router adds additional classi�ers and replicators C++ constructor/destructor ) OTcl init/destro y metho ds { � Replicators: dem uxers with m ultiple fanout { this ) $ self { OTcl metho ds alw a ys \virtual" MulticastNode Addr C++ shado w ed metho ds called explicitly with scop e op erator { Classifier ) OTcl metho ds com bined implicitly with $ self next Link { C++ static v ariables ) OTcl class v ariables unicast? Node.entry (m ultiple inheritance is supp orted) { Link Replicator multicast? Addr Classifier � F or use with tcl8.0, see http://www-mash.cs.berkeley.edu/dist (S1, G1) Replicator (S2, G2) Mcast Link Classifier (S3, G3) ... ... 3rd NSv2 W orkshop kfal l@e e.lbl.gov Slide 9 3rd NSv2 W orkshop kfal l@e e.lbl.gov Slide 10 C++/OTcl Split Ob jects OTcl Basics (con td) � use instvar and instpr o c to de�ne/access mem b er functions and � ob jects: implemen t metho ds in either language Split v ariables � new and delete � Example: set c [new Counter] $c val -> 0 $c bump Class Counter $c val -> 1 fg f Counter instproc init delete $c $self instvar cnt � De�ne instance v ariables in either C++ or OTcl: set cnt 0 g Counter::Counter() fg f Counter instproc bump f $self instvar cnt bind("cnt ", &value ); vs. $self set cnt 10 incr cnt value = 10; g ... Counter instproc val fg f g $self instvar cnt return $cnt bind() simply uses Tcl T r ac eV ar g Counter c c val ! 0 c bump ! c val 1 3rd NSv2 W orkshop kfal l@e e.lbl.gov Slide 11 3rd NSv2 W orkshop kfal l@e e.lbl.gov Slide 12
Recommend
More recommend