📄 node228.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.2 The diffusion model in ns</TITLE><META NAME="description" CONTENT="20.2 The diffusion model in ns"><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="node229.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node229.html"><LINK REL="previous" HREF="node227.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node227.html"><LINK REL="up" HREF="node226.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node226.html"><LINK REL="next" HREF="node229.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node229.html"></HEAD><BODY ><!--Navigation Panel--><A NAME="tex2html4762" HREF="node229.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node229.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html4756" HREF="node226.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node226.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html4750" HREF="node227.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node227.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html4758" 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="tex2html4760" 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="tex2html4763" HREF="node229.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node229.html">20.3 Some mac issues</A><B> Up:</B> <A NAME="tex2html4757" HREF="node226.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node226.html">20. Directed Diffusion</A><B> Previous:</B> <A NAME="tex2html4751" HREF="node227.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node227.html">20.1 What is Directed</A>   <B> <A NAME="tex2html4759" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html4761" 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="SECTION031720000000000000000"></A><A NAME="sec:diff_model"></A><BR>20.2 The diffusion model in ns</H1><P>The directed diffusion model consists of a core diffusion layer, a diffusion library provides an application programming interface for overlying diffusion applications and finally the application layer which includes both diffusion applications and filters. The core diffusion layer is used to receive/send out packets from/into the network. The library provides a interface for the overlying application classes for publishing/subscribing etc. These APIs have been described in details in a document called Network Routing API 8.0 and can be found at <TT><A NAME="tex2html49" HREF="javascript:if(confirm('http://www.isi.edu/scadds/publications.html \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.isi.edu/scadds/publications.html'" tppabs="http://www.isi.edu/scadds/publications.html">http://www.isi.edu/scadds/publications.html</A></TT> under APIs section. In the following paragraphs we are going to describe how the diffusion model looks like in .<P>First we start with a brief description of the diffusion3 directory structure.If the reader wishes to examine the C++ code related to NS Diffusionthat underpins the OTcl script commands, it may be found inns/diffustion3. Here is a summary by subdirectory:<DL><DT><STRONG>apps</STRONG></DT><DD>contains sample source and sink apps; as well as gradient filter.</DD><DT><STRONG>lib</STRONG></DT><DD>DiffusionRouting class definitions. Derived from NR, it is the ISI API to diffusion. </DD><DT><STRONG>main</STRONG></DT><DD>DiffusionCoreAgent class definitions. Core diffusion code and other misc/utility code. </DD><DT><STRONG>ns</STRONG></DT><DD>contains ns wrappers for diffusion code. These wrapper classes allow the core diffusion code and the diffusion API to be seamlessly incorporated into the NS class hierarchy. The DiffRoutingAgent is a wrapper for the Core Diffusion code, and DiffAppAgent is a wrapper for the DiffusionRouting (API) code.</DD><DT><STRONG>nr</STRONG></DT><DD>attribute definition and the class NR which is an abstract factory for the API (so that either ISI or MIT implementations may derive from it. </DD></DL><P><DIV ALIGN="CENTER"><A NAME="fig:filter"></A><A NAME="9330"></A><TABLE><CAPTION ALIGN="BOTTOM"><STRONG>Figure 20.1:</STRONG>Message flow in directed diffusion</CAPTION><TR><TD><DIV ALIGN="CENTER">filter</DIV></TD></TR></TABLE></DIV><P>The above Figure <A HREF="node228.html#fig:filter" tppabs="http://www.isi.edu/nsnam/ns/doc/node228.html#fig:filter">20.1</A> is from SCADDS' network routing API document available from their homepage (URL given earlier). The document describes attribute factories, matching rules for attributes, how applications interface with the core diffusion layer, and filter/timer APIs. All messages coming from/going out in the network is received at/sent out from the core diffusion layer. Messages can also come to core-diffusion layer from local applications and/or filters that might be connected to the node. The applications use the publish/subscribe/send interface to send interest and data messages to the network.<P>The core diffusion agent and diffusion application agent are attached to two well-known ports defined in /tcl/lib/ns-default.tcl. Diffusion applications attached to the node call the underlying diffusion application agent for publishing/subscribing/sending data.<P><HR><!--Navigation Panel--><A NAME="tex2html4762" HREF="node229.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node229.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html4756" HREF="node226.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node226.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html4750" HREF="node227.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node227.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html4758" 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="tex2html4760" 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="tex2html4763" HREF="node229.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node229.html">20.3 Some mac issues</A><B> Up:</B> <A NAME="tex2html4757" HREF="node226.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node226.html">20. Directed Diffusion</A><B> Previous:</B> <A NAME="tex2html4751" HREF="node227.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node227.html">20.1 What is Directed</A>   <B> <A NAME="tex2html4759" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html4761" 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 + -