📄 slides.tex
字号:
% $Id: slides.tex,v 1.2 1998/04/10 16:07:24 kannan Exp $% $Source: /nfs/jade/vint/CVSROOT/ns-2/doc/kannan/slides.tex,v $\documentclass[landscape]{foils}\usepackage{times}\usepackage[T1]{fontenc}\usepackage{color}\usepackage{nsfoils}\MyLogo{\raisebox{-2ex}{\includegraphics{isi_logo_small}}}\begin{document}\keyword{Introduction}\foilhead{\blue \ns~v2 Workshop}\begin{center} \renewcommand{\arraystretch}{2} \begin{tabular}{c} Kannan Varadhan\\ USC/Information Sciences Institute\\ \tup{kannan@catarina.usc.edu}\\[3ex] 18 September, 1997\\ \end{tabular}\end{center}\vspace*{4em}{\scriptsize The work of K.~Varadhan and the VINT project at USC/ISI is supported by the Defense Advanced Research Projects Agency (DARPA) under contract number ABT63-96-C-0054. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the DARPA.}\begin{comment}\item Intro\end{comment}\keyword{Outline}\foilhead[-2ex]{\blue Outline}\begin{enumerate} \item Topology Generation, the nodes and the links \item OTcl and C++: The Duality \item Routing \begin{sublist} \item Unicast \item Multicast \item Network Dynamics \end{sublist} \item Multicast Transport \item Issues of Scale \item Programming and Simulation Debugging\end{enumerate}\begin{comment}\item Have we done topologies yet?\end{comment}\foilhead{\blue Nodes}\placefig{node}\begin{comment}\item address and port classifiers, minimalistic configuration\item Address format\item restriction on number of nodes\item NxN split\end{comment}\keyword{Topology Definition}\foilhead{\violet Multicast Nodes}\placefig{mcastNode}\begin{comment}\item Multicast Classifier, <S,G> classification\item Replicators\end{comment}\foilhead{\indigo Classifiers}\begin{itemize}\item Table of $n$ slots\item Each slot can point to a TclObject\item When a packet is received --- \fcn[]{classify} identifies the slot to forward the packet to\item If slot is invalid, the classifier calls \proc[]{no-slot}\item Many different types of classifiers {\footnotesize \begin{tabularx}{\linewidth}{rX} Address Classifiers & parse address in packet \\ MultiPath Classifier & returns next slot number to use \\ Replicator & uses classifier as a table \\ \end{tabularx}}\end{itemize}\begin{comment}\item Note difference in replicator\end{comment}\foilhead{\violet Classifier methods}\begin{itemize}\item Install entries into classifier \begin{sublist} \item \proc[]{install} \item \proc[]{installNext} \end{sublist}\item Query entries in classifier \begin{sublist} \item \proc[]{elements} \hfil returns current list of elements inserted \item \proc[]{slot} \hfil returns handle of object in the specified slot \end{sublist} \item Delete entry in a particular slot \begin{sublist} \item \proc[]{clear} \end{sublist}\item \fcn[]{classify} internal method: receives a packet, and returns a slot number for that packet.\end{itemize}\begin{comment}\item The install procedures overload instproc-likes to return nicekey-value paris that can be loaded into Tcl arrays directly.\item The classify is internal nad different from the rest.\item classify is not used by Multipath or replicators\end{comment}\foilhead{\indigo Links}\placefig{link}\begin{comment} \item \end{comment}\foilhead{\violet Connectors}\begin{itemize}\item Connectors receive incoming packets, and (usually) transmit them to their \code{target_}\item Many different types of connectors: {\footnotesize \begin{tabularx}{\linewidth}{rX} Queue & holds a certain number of packets. Packets exceeding their queue-size are sent to the queue's drop-target.\\ LinkDelay & models delay/bandwidth of the link for detailed simulations.\\ TTLChecker & decrements TTLs on each packet, drops the packet if the TTL becomes zero.\\ DynaLink & transmit packets if the link is up, drop packet otherwise\\ & Other tracing related objects\\ \end{tabularx}}\end{itemize}\begin{comment} \item N way in, one way out. \item Multiple trace data, and hecne sleep overnight.\end{comment}\foilhead{\violet Connector methods}\begin{itemize}\item Add tracing or monitoring: \begin{sublist} \item \code{trace} \item \code{attach-monitors} \item \code{init-monitor} \end{sublist}\end{itemize}\begin{comment}\item trace adds enQ, deQ, drpT to trace packet activity\item attach-monitors adds specified snoop agents to link\item init-monitor adds queue length tracking code\end{comment}\foilhead{\indigo Topology Generation Resources}At \iurl{http://netweb.usc.edu/daniel/research/sims/}\begin{itemize}\item \code{ntg} by Steve Hotz \tup{hotz@isi.edu}\item \code{GT-ITM} by Ellen Zegura \tup{ewz@cc.gatech.edu}, \\ Ken Calvert \tup{calvert@cc.gatech.edu}\item \code{TIERS} by Matthew Doar \tup{mdoar@nexen.com}\item \code{rtg} by Liming Wei \tup{lwei@cisco.com}, \\ Lee Breslau \tup{breslau@parc.xerox.com}\end{itemize}\begin{comment}\item work done by Daniel Zappala\item looks at different types of topology generators and summarises them\item very brief look here\end{comment}\foilhead{\violet Topology Generation}\begin{tabularx}{\linewidth}{rX@{\hspace*{1.5em}}X} & \multicolumn1c{Type of Graph} & \multicolumn1c{Edge Models} \\[2ex]\code{ntg} & $n$-level hierarchy & user configurable probability distributions \\\code{GT-ITM} & flat random, $n$-level hierarchies, transit-stubnetworks & many different edge models \\\code{TIERS} & 3-level hierarchy & Minimum spanning tree + randomplacement\\\code{rtg} & flat random & waxman \\\end{tabularx}\begin{comment}\item ntg generates geographic placement\item GT-ITM transit stub appears to match Internet like networks in terms of degree of connectivity and other characteristics\item TIERS generates MST and then fills it in\item rtg place nodes, and then allocate edges accord to waxman dist.\item \ns\ tools availabel to convert some of these topologies to ns scripts\item some prebuilt topologies alread in distribution in tcl/ex\end{comment}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\foilhead{\blue OTcl and C++: The Duality}\placefig{duality}\begin{comment}\item \verb|\placefig{duality}|\item C++ code and OTcl scripts within ns\item Class hierarchy and protocol programming is often in C++\item OTcl helper scripts and built up primitives in OTcl\item not all hierarchy is in mirrored. will see examples\item User simulation is scripted (O)Tcl code\end{comment}\keyword{OTcl Linkage}\foilhead{\indigo OTcl Linkage}C++ $\iff$ OTcl \begin{tabularx}{\linewidth}{rX} class Tcl & C++ methods to access the OTcl interpreter \\ \scriptsize class TclCommand & \scriptsize Basic script to provide limited global commands to the interpreter \\ class EmbeddedTcl & Container for Tcl scripts that are pre-loaded at startup \\ class TclObject & Root of basic object hierarchy in \ns \\ class TclClass & C++ class to set up the TclObject hierarchy \\ \scriptsize class InstVar & \scriptsize internal class to bind C++ member variables to OTcl instance variables \\\end{tabularx}\begin{comment}\item outline slide\item Five classes\end{comment}\foilhead{\indigo C++ Methods to Access OTcl}The class Tcl\begin{list}{--~}{}\item Obtain a handle\item Invoke OTcl procedures\item Retrieve the result from the interpreter\item On invocation, pass a result string to the interpreter\item Return Success/Failure return codes\end{list}\begin{comment}\item Mention preamble, \item call to\item called from\end{comment}\foilhead[-2ex]{\violet class Tcl: C++ Methods to access OTcl}\begin{program} Tcl& tcl = {\bf{}Tcl::instance}(); \* obtain a handle to the interpreter */ if (argc == 2) \{ \* cmd: {\rm{}foo now} */ if (strcmp(argv[1], "now") == 0) \{ {\bf{}tcl.resultf}("%g", clock()); \* pass back the result */ return TCL_OK; \* return success code to interpreter */ \} {\bf{}tcl.result}("command not understood"); \* alternate way of passing result */ return TCL_ERROR; \} else if (argc == 3) \{ \* cmd: {\rm{}foo now \tup{callback}} */ if (strcmp(argv[1], "now") != 0) \{ {\bf{}tcl.error}("command not understood"); \* alternate way to return error */ \} char *callback = arv[2]; {\bf{}tcl.eval}(callback); \* invoke an OTcl procedure */ {\bf{}tcl.evalc("puts {hello, world}");} \* another variant */ char* timestr = {\bf{}tcl.result}(); \* callback result from the interpreter */ clock() = atof(timestr); \} else \{ Interp* ti = {\bf{}tcl.interp}(); \* access the interpreter directly */ \ldots \* \ldots to do whatever */\end{program}\begin{comment}\item obtain the reference\item invoke OTcl procedures, one shown, others...\item result handling, all three forms shown\item error handling, differences from returning TCL\_ERROR\item Direct access\end{comment}\foilhead{\red class TclCommand}Defines simple commands that execute in global interpreter contextFor example, \code{ns-version}\begin{comment}\item 1. define the class, derived from TclCommand.\item 2. constructor invokes parent constst. w. name of command as argument\item 3. command function and arguments to do the work\item 4. declare instance. default instance for ns-version and others are declared in init\_misc(), in misc.cc, and are called by tclAppInit().\end{comment}\foilhead{\indigo class EmbeddedTcl: Adding new OTcl code into \ns}\begin{itemize}\item container for scripts pre-loaded at startup \begin{sublist} \item \Tclf{tcl-object.tcl} \item \nsf{tcl/lib/ns-lib.tcl} \item scripts recursively sourced by \nsf{tcl/lib/ns-lib.tcl} \end{sublist}\item \Tclf{tcl-object.tcl} % $\Rightarrow$ \code{et_tclobject} \hfil activated by \fcn[]{Tcl::init} \nsf{tcl/lib/ns-lib.tcl} % $\Rightarrow$ \code{et_ns_lib} \hfil activated by \fcn[]{Tcl\_AppInit}\end{itemize}\begin{comment}\item Don't add your own scripts. But if you did,\item use tcl2c++ to create the object instance\item You'd a find a place/mechanism to load the object\end{comment}\foilhead{\indigo class TclObject}\begin{itemize}\item Basic object hierarchy in \ns\item Hierarchy mirrored in C++ and OTcl\item For example: \begin{program}\small set srm [new Agent/SRM/Adaptive] $srm set packetSize_ 1024 $srm traffic-source $s0 \end{program}\end{itemize}\begin{comment}\item creation/deletion\item binding variables\item instproc-likes\end{comment}\foilhead[-2ex]{\violet class TclObject: Hierarchy and Shadowing}\placefig{tclobject-hier}\begin{comment}\item \verb|\placefig{tclobject-hier}|\item object hierarchy\item handle\item relationship to shadow\end{comment}\foilhead[-1.5ex]{\violet class TclObject: Creation/Deletion Mechanisms}\begin{itemize}\item global procedure \proc[]{new} \placefig{tclobject-mech}\item global procedure \proc[]{delete}\end{itemize}\begin{comment}\item \verb|\placefig{tclobject-mech}|\item handle and handle equivalence\item constructor calling sequence: self next\item Base class constructr creates shadow...common mistake\item caveat regarding OTcl constructors\item create-shadow\item command method\end{comment}\foilhead[-3ex]{\violet class TclObject: Binding Variables}\begin{itemize}\item makes identical C++ member variables to OTcl instance variables\item Syntax \begin{program} ASRMAgent::ASRMAgent() \{ bind("pdistance_", &pdistance_); \* real variable */ \ldots \} \end{program}\item Initialisation through OTcl class variables \begin{program} Agent/SRM/Adaptive set pdistance_ 15.0 Agent/SRM set pdistance_ 10.0 \ldots \end{program}\item Other methods: \fcn[]{bind} (integers), \fcn[]{bind\_time} (time variables), \fcn[]{bind\_bw} (bandwidth variables), \fcn[]{bind\_bool} (boolean variables)\end{itemize}\begin{comment}\item Five different data types supported.\item Usage syntax supports obvious normal forms\item identicality of data\end{comment}\foilhead{\violet Examples of Specify Bound variables}\begin{program} $object set bwvar 1.5m $object set bwvar 1.5mb $object set bwvar 1500k $object set bwvar 1500kb $object set bwvar .1875MB $object set bwvar 187.5kB $object set bwvar 1.5e6 $object set timevar 1500m $object set timevar 1.5 $object set timevar 1.5e9n $object set timevar 1500e9p $object set boolvar t \; set to true; $object set boolvar true $object set boolvar 1 \; or any non-zero value;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -