⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 node232.html

📁 相关搜索: ns2仿真结果分析 all-awk ns2 ns2 无限网络中awk文件 ... [2.tcl.rar] - 在ns2平台上实现对AODV协议的模拟
💻 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>20.4.2 Tcl APIs for the ping application</TITLE><META NAME="description" CONTENT="20.4.2 Tcl APIs for the ping application"><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="node231.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node231.html"><LINK REL="up" HREF="node230.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node230.html"><LINK REL="next" HREF="node233.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node233.html"></HEAD><BODY ><!--Navigation Panel--><A NAME="tex2html4818"  HREF="node233.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node233.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html4812"  HREF="node230.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node230.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html4808"  HREF="node231.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node231.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html4814"  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="tex2html4816"  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="tex2html4819"  HREF="node233.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node233.html">20.5 Test-suites for diffusion</A><B> Up:</B> <A NAME="tex2html4813"  HREF="node230.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node230.html">20.4 Ping: an example</A><B> Previous:</B> <A NAME="tex2html4809"  HREF="node231.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node231.html">20.4.1 Ping Application as</A> &nbsp <B>  <A NAME="tex2html4815"  HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>  &nbsp <B>  <A NAME="tex2html4817"  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="SECTION031742000000000000000"></A><A NAME="sec:ping_tcl"></A><BR>20.4.2 Tcl APIs for the ping application</H2><P>An example script for the ping application is under tcl/ex/diffusion3/simple-diffusion.tcl. The example scenario consists of 3 nodes of which one is a ping-sender and another is a ping-receiver. The source and sink nodes are far away from one another and communicate only through a third node. The option adhocRouting is defined as Directed_Diffusion. This enables a core-diffusion agent to be created during the time of node creation. Also it creates a diffusionApplication agent if one is not present already. And a gradient filter is attached by default to each diffusion-enabled node. <P>The ping sender application is created in the following way:<PRE>set src_(0) [new Application/DiffApp/PingSender]$ns_ attach-diffapp $node_(0) $src_(0)$ns_ at 0.123 "$src_(0) publish"</PRE><P>The first line creates a ping-sender object. Simulator class method attach-diffapp basically attaches the application to the underlying diffusionApplication agent for that given node.The command <TT>publish</TT> essentially ``starts'' the sender application.<P>Similarly the ping sink is created as follows:<PRE>#Diffusion sink applicationset snk_(0) [new Application/DiffApp/PingReceiver]$ns_ attach-diffapp $node_(2) $snk_(0)$ns_ at 1.456 "$snk_(0) subscribe"</PRE><P>The command <TT>subscribe</TT> once again starts the ping-receiver application.<P>Thus in order to create your own application, you need to :<DL><DT><STRONG>1.</STRONG></DT><DD>define attribute-factories and attributes for application interest/data.</DD><DT><STRONG>2.</STRONG></DT><DD>create the application class (using dr-library APIs)</DD><DT><STRONG>3.</STRONG></DT><DD>add tcl commands to start the application</DD></DL><P>See tcl/lib/ns-lib.tcl, ns-diffusion.tcl for implementations of OTcl hooks for directed diffusion. Alo see chapter on Mobility in this manual for details on mobility model and wireless simulations in .<P><HR><!--Navigation Panel--><A NAME="tex2html4818"  HREF="node233.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node233.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html4812"  HREF="node230.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node230.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html4808"  HREF="node231.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node231.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html4814"  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="tex2html4816"  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="tex2html4819"  HREF="node233.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node233.html">20.5 Test-suites for diffusion</A><B> Up:</B> <A NAME="tex2html4813"  HREF="node230.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node230.html">20.4 Ping: an example</A><B> Previous:</B> <A NAME="tex2html4809"  HREF="node231.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node231.html">20.4.1 Ping Application as</A> &nbsp <B>  <A NAME="tex2html4815"  HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>  &nbsp <B>  <A NAME="tex2html4817"  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 + -