📄 node51.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>5.4.4 Hash Classifier</TITLE><META NAME="description" CONTENT="5.4.4 Hash Classifier"><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="node52.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node52.html"><LINK REL="previous" HREF="node50.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node50.html"><LINK REL="up" HREF="node47.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node47.html"><LINK REL="next" HREF="node52.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node52.html"></HEAD><BODY ><!--Navigation Panel--><A NAME="tex2html2101" HREF="node52.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node52.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html2095" HREF="node47.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node47.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html2089" HREF="node50.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node50.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html2097" 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="tex2html2099" 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="tex2html2102" HREF="node52.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node52.html">5.4.5 Replicator</A><B> Up:</B> <A NAME="tex2html2096" HREF="node47.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node47.html">5.4 The Classifier</A><B> Previous:</B> <A NAME="tex2html2090" HREF="node50.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node50.html">5.4.3 MultiPath Classifier</A>   <B> <A NAME="tex2html2098" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html2100" 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="SECTION03244000000000000000"></A><A NAME="sec:node:hash-classifier"></A><BR>5.4.4 Hash Classifier</H2><P>This object is used to classify a packet as a member of aparticular <EM>flow</EM>.As their name indicates,hash classifiers use a hash table internally to assignpackets to flows.These objects are used where flow-level information isrequired (e.g. in flow-specific queuing disciplines and statisticscollection).Several ``flow granularities'' are available. In particular,packets may be assigned to flows based on flow ID, destination address,source/destination addresses, or the combination of source/destinationaddresses plus flow ID.The fields accessed by the hash classifier are limited tothe <TT>ip</TT> header: <TT>src(), dst(), flowid()</TT> (see <TT>ip.h</TT>).<P>The hash classifier is created with an integer argument specifyingthe initial size of its hash table. The current hash table size maybe subsequently altered with the <TT>resize</TT> method (see below).When created, the instance variables <TT>shift_</TT> and <TT>mask_</TT>are initialized with the simulator's current <I>NodeShift</I> and<I>NodeMask</I> values, respectively. These values are retrievedfrom the <TT>AddrParams</TT> object when the hash classifier isinstantiated. The hash classifier will fail to operate properly ifthe <TT>AddrParams</TT> structure is not initialized.The following constructors are used for the various hash classifiers:<PRE> Classifier/Hash/SrcDest Classifier/Hash/Dest Classifier/Hash/Fid Classifier/Hash/SrcDestFid</PRE><P>The hash classifier receives packets, classifies them accordingto their flow criteria, and retrieves the classifier <EM>slot</EM>indicating the next node that should receive the packet.In several circumstances with hash classifiers, most packets shouldbe associated with a single slot, while only a few flows shouldbe directed elsewhere. The hash classifier includes a <TT>default_</TT> instance variableindicating which slot is to be used for packets that do not matchany of the per-flow criteria.The <TT>default_</TT> may be set optionally.<P>The methods for a hash classifier are as follows:<PRE> $hashcl set-hash buck src dst fid slot $hashcl lookup buck src dst fid $hashcl del-hash src dst fid $hashcl resize nbuck</PRE><P>The []set-hash method inserts a new entry into the hashtable within the hash classifier.The <TT>buck</TT> argument specifies the hash table bucket numberto use for the insertion of this entry.When the bucket number is not known, <TT>buck</TT> may be specifiedas <TT>auto</TT>. The <TT>src, dst</TT> and <TT>fid</TT> arguments specify the IP source,destination, and flow IDs to be matched for flow classification.Fields not used by a particular classifier (e.g. specifying <TT>src</TT>for a flow-id classifier) is ignored.The <TT>slot</TT> argument indicates the index into the underlyingslot table in the base <TT>Classifier</TT> object from whichthe hash classifier is derived.The <TT>lookup</TT> function returns the name of the objectassociated with the given <TT>buck/src/dst/fid</TT> tuple.The <TT>buck</TT> argument may be <TT>auto</TT>, as for <TT>set-hash</TT>.The <TT>del-hash</TT> function removes the specified entry fromthe hash table.Currently, this is done by simply marking the entry as inactive,so it is possible to populate the hash table with unused entries.The <TT>resize</TT> function resizes the hash table to includethe number of buckets specified by the argument <TT>nbuck</TT>.<P>Provided no default is defined, a hash classifier willperform a call into OTcl when itreceives a packet which matches no flow criteria.The call takes the following form:<PRE> \$obj unknown-flow src dst flowid buck</PRE> Thus, when a packet matching no flow criteria is received,the method <TT>unknown-flow</TT> of the instantiated hash classifierobject is invoked with the source, destination, and flow idfields from the packet.In addition, the <TT>buck</TT> field indicates the hash bucketwhich should contain this flow if it were inserted using<TT>set-hash</TT>. This arrangement avoids another hashlookup when performing insertions into the classifier when thebucket is already known.<P><HR><!--Navigation Panel--><A NAME="tex2html2101" HREF="node52.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node52.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html2095" HREF="node47.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node47.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html2089" HREF="node50.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node50.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html2097" 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="tex2html2099" 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="tex2html2102" HREF="node52.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node52.html">5.4.5 Replicator</A><B> Up:</B> <A NAME="tex2html2096" HREF="node47.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node47.html">5.4 The Classifier</A><B> Previous:</B> <A NAME="tex2html2090" HREF="node50.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node50.html">5.4.3 MultiPath Classifier</A>   <B> <A NAME="tex2html2098" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html2100" 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 + -