📄 links.tex
字号:
is invoked, and the object will drop all packets in transit at the instant of link failure. We discuss the \href{specifics of this class in another chapter}{Chapter}{% chap:delays}.\\Queues & model the output buffers attached to a link in a ``real'' router in a network. In \ns, they are attached to, and are considered as part of the link. We discuss the \href{details of queues and different types of queues in \ns in another chapter}{Chapter}{chap:qmgmt}.\\TTLChecker & will decrement the ttl in each packet that it receives. If that ttl then has a positive value, the packet is forwarded to the next element on the link. In the simple links, TTLCheckers are automatically added, and are placed as the last element on the link, between the delay element, and the entry for the next node.\\\end{tabularx}\section{Object hierarchy}\label{sec:linkobjects}The base class used to represent links is called Link. Methods forthis class are listed in the next section. Other link objects derived fromthe base class are given as follows:\begin{itemize}\item SimpleLink ObjectA SimpleLink object is used to represent a simple unidirectional link.There are no state variables or configuration parameters associated withthis object. Methods for this class are:\code{$simplelink enable-mcast <src> <dst>}\\This turns on multicast for the link by creating an incoming networkinterface for the destination and adds an outgoing interface for thesource.\code{$simplelink trace <ns> <file> <optional:op>}\\Build trace objects for this link and update object linkage. If op isspecified as "nam" create nam trace files.\code{$simplelink nam-trace <ns> <file>}\\Sets up nam tracing in the link.\code{$simplelink trace-dynamics <ns> <file> <optional:op>}\\This sets up tracing specially for dynamic links. <op> allows setting upof nam tracing as well.\code{$simplelink init-monitor <ns> <qtrace> <sampleInterval>}\\Insert objects that allow us to monitor the queue size of this link.Return the name of the object that can be queried to determine the averagequeue size.\code{$simplelink attach-monitors <insnoop> <outsnoop> <dropsnoop> <qmon>}\\This is similar to init-monitor, but allows for specification of more ofthe items.\code{$simplelink dynamic}\\Sets up the dynamic flag for this link.\code{$simplelink errormodule <args>}\\Inserts an error module before the queue.\code{$simpleilnk insert-linkloss <args>}\\Inserts the error module after the queue.//Other link objects derived from class SimpleLink are FQLink,CBQLink and IntServLink.Configuration parameters for FQLink are:\begin{description}\item[queueManagement\_] The type of queue management used in the link. Default value is DropTail.\end{description}No configuration parameters are specified for CBQLink and IntServLinkobjects.\item DelayLink ObjectThe DelayLink Objects determine the amount of time required for a packetto traverse a link. This is defined to be size/bw + delay where size isthe packet size, bw is the link bandwidth and delay is the linkpropagation delay. There are no methods or state variables associated withthis object. Configuration Parameters are:\begin{description}\item[bandwidth\_] Link bandwidth in bits per second. \item[delay\_] Link propagation delay in seconds. \end{description}\end{itemize}\section{Commands at a glance}\label{sec:linkscommand}Following is a list of common link commands used in simulation scripts:\begin{flushleft}\code{$ns_ simplex-link <node1> <node2> <bw> <delay> <qtype> <args>}\\This command creates an unidirectional link between node1 and node2 withspecified bandwidth (BW) and delay characteristics. The link uses a queuetype of <qtype> and depending on the queue type different arguments arepassed through <args>.\code{$ns_ duplex-link <node1> <node2> <bw> <delay> <qtype> <args>}\\This creates a bi-directional link between node1 and node2. This procedureessentially creates a duplex-link from two simplex links, one from node1to node2 and the other from node2 to node1. The syntax for duplex-link issame as that of simplex-link described above.\code{$ns_ duplex-intserv-link <n1> <n2> <bw> <dly> <sched> <signal> <adc> <args>}\\This creates a duplex-link between n1 and n2 with queue type of intserv, withspecified BW and delay. This type of queue implements a scheduler with twolevel services priority. The type of intserv queue is given by <sched>, withadmission control unit type of <adc> and signal module of type <signal>.\code{$ns_ simplex-link-op <n1> <n2> <op> <args>}\\This is used to set attributes for a simplex link. The attributes may bethe orientation, color or queue-position.\code{$ns_ duplex-link-op <n1> <n2> <op> <args>}\\This command is used to set link attributes (like orientation of the links,color or queue-position) for duplex links.\code{$ns_ link-lossmodel <lossobj> <from> <to>}\\This function generates losses (using the loss model <lossobj> inserted inthe link between <from> node and <to> node) in the link that can bevisualized by nam.\code{$ns_ lossmodel <lossobj> <from> <to>}\\This is used to insert a loss module in regular links.Following is a list of internal link-related procedures:\code{$ns_ register-nam-linkconfig <link>}\\This is an internal procedure used by \code{"$link orient"} to register/update the order in which links should be created in nam.\code{$ns_ remove-nam-linkconfig <id1> <id2>}\\This procedure is used to remove any duplicate links (duplicate links may becreated by GT-ITM topology generator).\code{$link head}\\Returns the instance variable \code{head_} for the link. The \code{head_} isthe entry pont to the link and it points to the first object in the link.\code{$link add-to-head <connector>}\\This allows the <connector> object to be now pointed by the \code{head_}element in the link, i.e, <connector> now becomes the first object in thelink.\code{$link link}\\Returns the instance variable \code{link_}. The \code{link_} is the elementin the link that actually models the link in terms of delay and bandwidthcharacteristics of the link.\code{$link queue}\\Returns the instance variable \code{queue_}. \code{queue_} is queue elementin the link. There may be one or more queue elements in a particular link.\code{$link cost <c>}\\This sets a link cost of <c>.\code{$link cost?}\\Returns the cost value for the link. Default cost of link is set to 1.\code{$link if-label?}\\Returns the network interfaces associated with the link (for multicast routing).\code{$link up}\\This sets the link status to "up". This command is a part of networkdynamics support in \ns.\code{$link down}\\Similar to up, this command marks the link status as "down".\code{$link up?}\\Returns the link status. The status is always "up" as default, if linkdynamics is not enabled.\code{$link all-connectors op}\\ This command applies the specified operation <op> to all connectors in thelink. Like, \code{$link all-connectors reset} or\code{$link all-connectors isDynamic}. \code{$link install-error <errmodel>}\\This installs an error module after the \code{link_} element.In addition to the Link and link-related commands listed above, there areother procedures to support the specific requirements of different types oflinks derived from the base class "Link" like simple-link (SimpleLink),integrated service (IntServLink), class-based queue (CBQLink), fair queue(FQLink) and procedures to support multicast routing, sessionsim, nam etc.These and the above procedures may be found in \ns/tcl/lib(ns-lib.tcl,ns-link.tcl, ns-intserv.tcl, ns-namsupp.tcl, ns-queue.tcl),\ns/tcl/mcast/(McastMonitor.tcl, ns-mcast.tcl), \ns/tcl/session/session.tcl.\end{flushleft}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -