📄 node57.html
字号:
<html><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><!--Converted with jLaTeX2HTML 2002 (1.62) JA patch-1.4patched version by: Kenshi Muto, Debian Project.LaTeX2HTML 2002 (1.62),original version by: Nikos Drakos, CBLU, University of Leeds* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan* with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --><HTML><HEAD><TITLE>6. Links: Simple Links</TITLE><META NAME="description" CONTENT="6. Links: Simple Links"><META NAME="keywords" CONTENT="everything"><META NAME="resource-type" CONTENT="document"><META NAME="distribution" CONTENT="global"><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"><META NAME="Generator" CONTENT="jLaTeX2HTML v2002 JA patch-1.4"><META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"><LINK REL="STYLESHEET" HREF="everything.css" tppabs="http://www.isi.edu/nsnam/ns/doc/everything.css"><LINK REL="next" HREF="node64.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node64.html"><LINK REL="previous" HREF="node39.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node39.html"><LINK REL="up" HREF="node29.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node29.html"><LINK REL="next" HREF="node58.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node58.html"></HEAD><BODY ><!--Navigation Panel--><A NAME="tex2html2181" HREF="node58.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node58.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html2175" HREF="node29.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node29.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html2169" HREF="node56.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node56.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html2177" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html"><IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="file:/usr/share/latex2html/icons/contents.png"></A> <A NAME="tex2html2179" HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html"><IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="file:/usr/share/latex2html/icons/index.png"></A> <BR><B> Next:</B> <A NAME="tex2html2182" HREF="node58.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node58.html">6.1 Instance Procedures for</A><B> Up:</B> <A NAME="tex2html2176" HREF="node29.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node29.html">2 Simulator Basics</A><B> Previous:</B> <A NAME="tex2html2170" HREF="node56.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node56.html">5.6 Commands at a</A>   <B> <A NAME="tex2html2178" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html2180" HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html">Index</A></B> <BR><BR><!--End of Navigation Panel--><H1><A NAME="SECTION03300000000000000000"></A><A NAME="chap:links"></A><BR>6. Links: Simple Links</H1><P>This is the second aspect of defining the topology.In the previous chapterChapterchap:nodes,we had described how to create the nodes in the topology in .We now describe how to create the links to connect the nodes and completethe topology.In this chapter, we restrict ourselves to describing the simplepoint to point links. supports a variety of other media, includingan emulation of a multi-access LAN using a mesh of simple links,and other true simulation of wireless and broadcast media.They will be described in a separate chapter.The CBQlink is derived from simple links and is a considerably morecomplex form of link that is also not described in this chapter.<P>We begin by describing the commands to create a link in this section.As with the node being composed of classifiers, a simple link is built up from a sequence of connectors.We also briefly describe some of the connectors in a simple link.We then describethe instance procedures that operate on the various components ofdefined by some of these connectorsSectionsec:links:components.We conclude the chapterwith a description the connector objectSectionsec:links:connectors,including briefdescriptions of the common link connectors.<P>The Link../ns-2/ns-link.tclis a standalone class in OTcl,that provides a few simple primitives.The SimpleLink../ns-2/ns-link.tclprovides the ability to connect two nodes with a point to point link. provides the instance procedure[]simplex-link../ns-2/ns-link.tclSimulator::simplex-linkto form a unidirectional link from one node to another.The link is in the class SimpleLink.The following describes the syntax of the simplex link:<PRE> set ns [new Simulator] $ns simplex-link \tup{node0} \tup{node1} \tup{bandwidth} \tup{delay} \tup{queue_type}</PRE>The command creates a link from <TT>node0</TT> to <TT>node1</TT>,with specified <TT>bandwidth</TT> and <TT>delay</TT> characteristics.The link uses a queue of type <TT>queue_type</TT>.The procedure also adds a TTL checker to the link.Five instance variables define the link:<P><DIV ALIGN="CENTER"><TABLE CELLPADDING=3><TR><TD ALIGN="RIGHT"><TT>head<BR>_</TT></TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=288>Entry point to the link, it points to the first object in the link.</TD></TR><TR><TD ALIGN="RIGHT"><TT>queue<BR>_</TT></TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=288>Reference to the main queue element of the link. Simple links usually have one queue per link. Other more complex types of links may have multiple queue elements in the link.</TD></TR><TR><TD ALIGN="RIGHT"><TT>link<BR>_</TT></TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=288>A reference to the element that actually models the link, in terms of the delay and bandwidth characteristics of the link.</TD></TR><TR><TD ALIGN="RIGHT"><TT>ttl<BR>_</TT></TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=288>Reference to the element that manipulates the ttl in every packet.</TD></TR><TR><TD ALIGN="RIGHT"><TT>drophead<BR>_</TT></TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=288>Reference to an object that is the head of a queue of elements that process link drops.</TD></TR></TABLE></DIV><P>In addition, if the simulator instance variable, <TT>$traceAllFile_</TT>, is defined, the procedure will add trace elements that track when a packet isenqueued and dequeued from <TT>queue_</TT>.Furthermore, tracing interposes a drop trace element after the<TT>drophead_</TT>.<DIV ALIGN="CENTER"><A NAME="fig:link"></A><A NAME="2640"></A><TABLE><CAPTION ALIGN="BOTTOM"><STRONG>Figure 6.1:</STRONG>Composite Construction of a Unidirectional Link</CAPTION><TR><TD><DIV ALIGN="CENTER">link</DIV></TD></TR></TABLE></DIV>The following instance variables track the trace elements:<P><DIV ALIGN="CENTER"><TABLE CELLPADDING=3><TR><TD ALIGN="RIGHT"><TT>enqT<BR>_</TT></TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=288>Reference to the element that traces packets entering <TT>queue<BR>_</TT>.</TD></TR><TR><TD ALIGN="RIGHT"><TT>deqT<BR>_</TT></TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=288>Reference to the element that traces packets leaving <TT>queue<BR>_</TT>.</TD></TR><TR><TD ALIGN="RIGHT"><TT>drpT<BR>_</TT></TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=288>Reference to the element that traces packets dropped from <TT>queue<BR>_</TT>.</TD></TR><TR><TD ALIGN="RIGHT"><TT>rcvT<BR>_</TT></TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=288>Reference to the element that traces packets received by the next node.</TD></TR></TABLE></DIV><P>Note however, that if the user enable tracing multiple times on the link,these instance variables will only store a reference to thelast elements inserted.<P>Other configuration mechanisms that add components to a simple linkare network interfaces (used in multicast routing), link dynamics models, and tracing and monitors.We give a brief overview of the related objects at the end of this chapterSectionsec:links:connectors,and discuss their functionality/implementation in other chapters.<P>The instance procedure[]duplex-link../ns-2/ns-link.tclSimulator::duplex-linkconstructs a bi-directional link from two simplex links.<P><BR><HR><!--Table of Child-Links--><A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A><UL><LI><A NAME="tex2html2183" HREF="node58.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node58.html">6.1 Instance Procedures for Links and SimpleLinks</A><UL><LI><A NAME="tex2html2184" HREF="node59.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node59.html">6.1.0.0.1 Link procedures</A><LI><A NAME="tex2html2185" HREF="node60.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node60.html">6.1.0.0.2 SimpleLink Procedures</A></UL><BR><LI><A NAME="tex2html2186" HREF="node61.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node61.html">6.2 Connectors</A><LI><A NAME="tex2html2187" HREF="node62.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node62.html">6.3 Object hierarchy</A><LI><A NAME="tex2html2188" HREF="node63.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node63.html">6.4 Commands at a glance</A></UL><!--End of Table of Child-Links--><HR><!--Navigation Panel--><A NAME="tex2html2181" HREF="node58.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node58.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html2175" HREF="node29.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node29.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html2169" HREF="node56.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node56.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html2177" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html"><IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="file:/usr/share/latex2html/icons/contents.png"></A> <A NAME="tex2html2179" HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html"><IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="file:/usr/share/latex2html/icons/index.png"></A> <BR><B> Next:</B> <A NAME="tex2html2182" HREF="node58.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node58.html">6.1 Instance Procedures for</A><B> Up:</B> <A NAME="tex2html2176" HREF="node29.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node29.html">2 Simulator Basics</A><B> Previous:</B> <A NAME="tex2html2170" HREF="node56.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node56.html">5.6 Commands at a</A>   <B> <A NAME="tex2html2178" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html2180" HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html">Index</A></B> <!--End of Navigation Panel--><ADDRESS>2003-09-23</ADDRESS></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -