📄 node474.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>35.2.1 Attaching transport agents to nodes</TITLE><META NAME="description" CONTENT="35.2.1 Attaching transport agents to nodes"><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="node475.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node475.html"><LINK REL="previous" HREF="node473.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node473.html"><LINK REL="up" HREF="node473.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node473.html"><LINK REL="next" HREF="node475.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node475.html"></HEAD><BODY ><!--Navigation Panel--><A NAME="tex2html8708" HREF="node475.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node475.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html8702" HREF="node473.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node473.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html8696" HREF="node473.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node473.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html8704" 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="tex2html8706" 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="tex2html8709" HREF="node475.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node475.html">35.2.2 Attaching applications to</A><B> Up:</B> <A NAME="tex2html8703" HREF="node473.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node473.html">35.2 The transport agent</A><B> Previous:</B> <A NAME="tex2html8697" HREF="node473.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node473.html">35.2 The transport agent</A>   <B> <A NAME="tex2html8705" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html8707" HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html">Index</A></B> <BR><BR><!--End of Navigation Panel--><H2><A NAME="SECTION07121000000000000000"></A><A NAME="sec:attachagentnode"></A><BR>35.2.1 Attaching transport agents to nodes</H2>This step is typically done at OTcl level. Agent management was also brieflydiscussed in Section <A HREF="node41.html#sec:node:node" tppabs="http://www.isi.edu/nsnam/ns/doc/node41.html#sec:node:node">5.2</A>. <P><PRE> set src [new Agent/TCP/FullTcp] set sink [new Agent/TCP/FullTcp] $ns_ attach-agent $node_(s1) $src $ns_ attach-agent $node_(k1) $sink $ns_ connect $src $sink</PRE><P>The above code illustrates that in , agents are first attached to a nodevia <TT>attach-agent</TT>. Next, the <TT>connect</TT> instproc sets each agent'sdestination target to the other. Note that, in , <TT>connect()</TT> hasdifferent semantics than in regular sockets. In , <TT>connect()</TT> simplyestablishes the destination address for an agent, but does not set up theconnection. As a result, the overlying application does not need to knowits peer's address. For TCPs that exchange SYN segments, the first call to <TT>send()</TT> will trigger the SYN exchange. <P>To detach an agent from a node, the instproc <TT>detach-agent</TT> can be used; this resets the target for the agent to a null agent.<P><BR><HR><ADDRESS>2003-09-23</ADDRESS></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -