📄 node193.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>16.3 Lists of changes for merging code developed in older version of ns (2.1b5 or later) into the current version (2.1b8) </TITLE><META NAME="description" CONTENT="16.3 Lists of changes for merging code developed in older version of ns (2.1b5 or later) into the current version (2.1b8) "><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="node194.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node194.html"><LINK REL="previous" HREF="node190.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node190.html"><LINK REL="up" HREF="node171.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node171.html"><LINK REL="next" HREF="node194.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node194.html"></HEAD><BODY ><!--Navigation Panel--><A NAME="tex2html4237" HREF="node194.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node194.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html4231" HREF="node171.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node171.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html4225" HREF="node192.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node192.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html4233" 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="tex2html4235" 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="tex2html4238" HREF="node194.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node194.html">16.4 Commands at a</A><B> Up:</B> <A NAME="tex2html4232" HREF="node171.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node171.html">16. Mobile Networking in</A><B> Previous:</B> <A NAME="tex2html4226" HREF="node192.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node192.html">16.2.2 MobileIP</A>   <B> <A NAME="tex2html4234" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html4236" 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="SECTION031330000000000000000"></A><A NAME="old-merge"></A><BR>16.3 Lists of changes for merging code developed in older version of ns (2.1b5 or later) into the current version (2.1b8) </H1><P>The CMU-wireless model developed by David Johnhson's Monarch project was merged into ns around 1998-99 in what was then the ns-2.1b5 version. Since then the ns versions used by Monarch and by us here at ISI have forked quite a bit. Recently we ported a newer version of DSR developed by the Monarch group back into ns and in the process have created a list of changes that were required to be made for the merge. Hopefully this list will be helpful for those who have been working on older versions of ns from around that time or or later, to have their stuff merged in to the current version of ns-2.1b8. <P>The following lists of changes are required for merging the cmu version of ns (2.1b5) in to current version of 2.1b8. Each change is followed by a brief explanation for why the change was made.<P><DIV ALIGN="LEFT"></DIV><P><DIV ALIGN="LEFT">Methods for accessing pkt hdrs have changed from <BR><TT>(hdr_sr *)p-access(off_sr) </TT> <BR>to a static access method defined for each hdr, as <BR><TT>hdr_sr::access(p)</TT> <BR>where for class hdr_sr a static method <TT>access()</TT> is defined as</DIV><PRE> inline static hdr\_sr* access(const Packet* p) { return (hdr\_sr*)p-\>access(offset\_); }</PRE><DIV ALIGN="LEFT"><TT>why:</TT> This change avoids using casts everywhere.</DIV><P><DIV ALIGN="LEFT">As the method for accessing hdrs have changed, there is no need to explicitly bind the hdr offset values. This is now done while establishing tcl linkage for the individual hdr classes.so lines like <BR><TT>bind("off_SR_", &off_sr_);</TT><BR> <TT>bind("off_ll_", &off_ll_);</TT><BR> <TT>bind("off_mac_", &off_mac_);</TT><BR> <TT>bind("off_ip_", &off_ip_); </TT><BR>should be removed.</DIV><P><DIV ALIGN="LEFT">AF_ enumerations replaced by NS_AF_ as in <BR><TT>enum ns_af_enum NS_AF_NONE, NS_AF_ILINK, NS_AF_INET ;</TT><BR><TT>why:</TT> This avoids header clashes between ns and the OS.</DIV><P><DIV ALIGN="LEFT">The ip hdr (dst/src) address fields that used be integers are now defined as structures called ns_addr_t. ns_addr_t has 2 members address_ and port_ that are both defined as int. Hence lines like <BR><TT>iph-src()</TT> should change to<BR><TT>iph-saddr() & iph-sport();</TT> <BR>Also lines like <BR><TT>dst_ = (IP_BROADCAST 8) | RT_PORT </TT> <BR>should be replaced by <BR><TT>dst_.addr_ = IP_BROADCAST;</TT> <BR><TT>dst_.port_ = RT_PORT;</TT> <BR><TT>Why:</TT> This extension supports 32bit addressing.</DIV><P><DIV ALIGN="LEFT">The addrs_ member for hdr_sr class has a separate function for returning its value . Thus need to call <TT>hsr.addrs()</TT> instead of hsr.addrs.<BR><TT>why:</TT> addrs_ is now a private variable which is accessed by public function <TT>addrs()</TT>.</DIV><P><DIV ALIGN="LEFT">All includes that had absolute paths by using were replaced by <TT>""</TT>. Thus<BR><TT>cmu/dsr/dsragent.h</TT><BR>was changed to<BR><TT>"cmu/dsr/dsragent.h"</TT></DIV><P><DIV ALIGN="LEFT">The tcl command "ip-addr" was changed to "addr".<BR>Other new tcl commands like "node", "port-dmux" and "trace-target" were added.<BR><TT>why:</TT> Part of support for mobileIP and wired-cum-wireless simulations.</DIV><P><DIV ALIGN="LEFT">Need to convert address in string format into int format; so use<BR><TT>Address::instance().str2addr(argv[2]) </TT><BR>instead of <BR><TT>atoi(argv[2])</TT><BR><TT>why:</TT> This is required for supporting hier-addressing/routing.</DIV><P><DIV ALIGN="LEFT">The array <TT>packet_names[]</TT> has changed to <TT>packet_info.name()</TT><BR><TT>why:</TT> In order to remove a bunch of <TT>#</TT>defines for pkt types, an enumeration called packet_t now describes all packet types in ns. class p_info was created that now describes an array name_ that has replaced packet_names array used previously.</DIV><P><DIV ALIGN="LEFT">Have to explicitly set direction of new pkts to DOWN before sending them down to the LL.<BR><TT>why:</TT> A variable direction_ in hdr_cmn is now used. This is used in the lower layers like LL, mac, phy etc to determine the direction of the pkt flow. All incoming pkts are marked as UP by channel, which should be remarked as DOWN by agents before sending them out into the network again.</DIV><P><DIV ALIGN="LEFT">Instead of <TT>logtarget-buffer</TT>, should now call <TT>logtarget-pt_-buffer</TT>.<BR><TT>why:</TT> This change reflects support for eventtracing. Tracing has evolved into two types, packet tracing and event tracing.Class Trace essentially supports packet tracing. However in addition to the basic tracing properties that it derives from a BaseTrace class, pkt-tracing also requires to inherit some of the Connector class properties as well. Hence pt_, a basetrace object represents the pure tracing functionalities required for a trace object.</DIV><P><DIV ALIGN="LEFT">The parameter used to describe the reason a pkt was dropped used to be an integer. This was changed to <TT>char*</TT>. Hence needed to define different pkt-drop reasons in string formats. <BR><TT>Why:</TT> Allows greater expandibility and flexibility.</DIV><P><DIV ALIGN="LEFT">linkHead changed to dsrLinkHead.<BR><TT>why:</TT> name clashed with linkHead used elsewhere in ns.</DIV><P><DIV ALIGN="LEFT">The older cmu model used an incoming_ flag added in all pkts to figure out direction of pkt flow in the lower layers like ll, mac etc. Later this was replaced by a variable called direction_ added in cmn_hdr. direction value can be set to UP, DOWN or NONE. all pkts created with a DOWN dir by default. <BR><TT>why:</TT> Both these flags were being used which is not really reqd. so incoming_ flag has been replaced with direction_.</DIV><P><DIV ALIGN="LEFT"></DIV><P><HR><!--Navigation Panel--><A NAME="tex2html4237" HREF="node194.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node194.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html4231" HREF="node171.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node171.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html4225" HREF="node192.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node192.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html4233" 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="tex2html4235" 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="tex2html4238" HREF="node194.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node194.html">16.4 Commands at a</A><B> Up:</B> <A NAME="tex2html4232" HREF="node171.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node171.html">16. Mobile Networking in</A><B> Previous:</B> <A NAME="tex2html4226" HREF="node192.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node192.html">16.2.2 MobileIP</A>   <B> <A NAME="tex2html4234" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html4236" 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 + -