📄 node363.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>30.2 Commands at a glance</TITLE><META NAME="description" CONTENT="30.2 Commands at a glance"><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="previous" HREF="node362.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node362.html"><LINK REL="up" HREF="node361.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node361.html"><LINK REL="next" HREF="node364.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node364.html"></HEAD><BODY ><!--Navigation Panel--><A NAME="tex2html6945" HREF="node364.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node364.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html6939" HREF="node361.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node361.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html6935" HREF="node362.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node362.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html6941" 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="tex2html6943" 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="tex2html6946" HREF="node364.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node364.html">31. TCP Agents</A><B> Up:</B> <A NAME="tex2html6940" HREF="node361.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node361.html">30. UDP Agents</A><B> Previous:</B> <A NAME="tex2html6936" HREF="node362.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node362.html">30.1 UDP Agents</A>   <B> <A NAME="tex2html6942" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html6944" 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="SECTION06120000000000000000"></A><A NAME="sec:udpcommand"></A><BR>30.2 Commands at a glance</H1><P>The following commands are used to setup UDP agents in simulation scripts:<DIV ALIGN="LEFT"><TT>set udp0 [new Agent/UDP]</TT><BR>This creates an instance of the UDP agent.</DIV><P><DIV ALIGN="LEFT"><TT>$ns_ attach-agent node agent</TT><BR>This is a common command used to attach any <agent> to a given <node>.</DIV><P><DIV ALIGN="LEFT"><TT>$traffic-gen attach-agent agent</TT><BR>This a class Application/Traffic/<traffictype> method which connects thetraffic generator to the given <agent>. For example, if we want to setupa CBR traffic flow for the udp agent, udp1, we given the following commands<BR></DIV><PRE>set cbr1 [new Application/Traffic/CBR]\$cbr1 attach-agent \$udp1</PRE><DIV ALIGN="LEFT"></DIV><P><DIV ALIGN="LEFT"><TT>$ns_ connect src-agent dst-agent</TT><BR>This command sets up an end-to-end connection between two agents (at thetransport layer).</DIV><P><DIV ALIGN="LEFT"></DIV><PRE>\$udp set packetSize\_ \<pktsize\>\$udp set dst\_addr\_ \<address\>\$udp set dst\_port\_ \<portnum\>\$udp set class\_ \<class-type\>\$udp set ttl\_ \<time-to-live\>..... etc</PRE><DIV ALIGN="LEFT"></DIV><P><DIV ALIGN="LEFT">The above are different parameter values that may be set as shown abovefor udp agents. The default values can be found in /tcl/lib/ns-default.tcl.</DIV><P><DIV ALIGN="LEFT">For a typical example of setting up an UDP agent used in a simulation, seethe above section <A HREF="node362.html#sec:udpagent" tppabs="http://www.isi.edu/nsnam/ns/doc/node362.html#sec:udpagent">30.1</A>.</DIV><P><DIV ALIGN="LEFT"></DIV><HR><!--Navigation Panel--><A NAME="tex2html6945" HREF="node364.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node364.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html6939" HREF="node361.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node361.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html6935" HREF="node362.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node362.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html6941" 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="tex2html6943" 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="tex2html6946" HREF="node364.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node364.html">31. TCP Agents</A><B> Up:</B> <A NAME="tex2html6940" HREF="node361.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node361.html">30. UDP Agents</A><B> Previous:</B> <A NAME="tex2html6936" HREF="node362.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node362.html">30.1 UDP Agents</A>   <B> <A NAME="tex2html6942" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html6944" 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 + -