📄 1.the network simulator ns-2 building ns version 2.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0041)http://www.isi.edu/nsnam/ns/ns-build.html -->
<HTML><HEAD><TITLE>The Network Simulator ns-2: Building Ns version 2</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.2627" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<H1>The Network Simulator: Building Ns</H1>This page describes ns version 2. <!--Although as of 10 September 1997 is no longer considered beta software,some researchers may prefer<a href=ftp://ftp.ee.lbl.gov/ns.tar.gz>version 1</a>.-->
<H2><A name=start>Where to Start</A></H2><STRONG>What hardware is
needed?</STRONG> To build ns you need a computer and a C++ compiler. We develop
ns on several kinds of Unix (FreeBSD, Linux, SunOS, Solaris), so it installs
smoothest there, but it should run on an Posix-like computer, possibly with some
tweaking. Ns also builds and runs under Windows, see the dedicated <A
href="http://www.isi.edu/nsnam/ns/ns-cygwin.html">Windows / Cygwin page</A>.
Simple scenarios should run on any reasonable machine, but very large scenarios
benefit from large amounts of memory.
<P>Ns is fairly large. The allinone package requires about 320MB of disk space
to build. Building ns from pieces can save some disk space. (If multiple people
want to share files in the ns build tree to save space, you may download a <A
href="http://www.isi.edu/nsnam/dist/dup.tar.gz">simple perl script</A>, then
follow the instruction in its README. There is <A
href="http://netweb.usc.edu/cs599sp00/sharedns.html">detailed instruction</A>
from CS599b class of USC. You may also find discussions in the ns-users mailing
list archive useful.)
<P><STRONG>How do I get the software?</STRONG> There are two ways to build ns:
<A href="http://www.isi.edu/nsnam/ns/ns-build.html#pieces">from all the
pieces</A> or <A href="http://www.isi.edu/nsnam/ns/ns-build.html#allinone">all
at once</A>. If you just want to try it out quickly, you might try <A
href="http://www.isi.edu/nsnam/ns/ns-build.html#allinone">all at once</A>. If
you want to do C-level developement, or save download time or disk space, or
have trouble with all-in-one you should build it <A
href="http://www.isi.edu/nsnam/ns/ns-build.html#pieces">from the pieces.</A>
<P>ns is available both by HTTP (at the links below, all in <A
href="http://www.isi.edu/nsnam/dist/">http://www.isi.edu/nsnam/dist/</A>), by
anonymous FTP at <A href="ftp://ftp.isi.edu/nsnam">ftp://ftp.isi.edu/nsnam</A>.
and by anonymous CVS (as described on <A
href="http://www.isi.edu/nsnam/ns/ns-anoncvs.html">the anon-cvs page</A>). The
ftp part of ns is mirrored in Europe at <A
href="ftp://ftp.ee.surrey.ac.uk/pub/Mirrors/ftp.isi.edu/nsnam">ftp://ftp.ee.surrey.ac.uk/pub/Mirrors/ftp.isi.edu/nsnam</A>.
The <A href="http://www.isi.edu/nsnam/dist/binary">binary</A> subfolder contains
binaries for different platforms, including <A
href="http://www.isi.edu/nsnam/ns/ns-cygwin.html">Windows / Cygwin </A>.
<H2><A name=pieces>Getting the Pieces</A></H2>
<P><STRONG>Important:<EM>Please check the <!-- <A href=#bugfixes>bug fixes</A> --><A
href="http://www.isi.edu/nsnam/ns/ns-problems.html">bug fixes</A> after you
finish installation!</EM></STRONG>.
<P>Ns depends on several externally available components. Below is a summary of
where to get them and where they may already be (if you're a VINT developer).
Since the components depend on each other, you should build them in the listed
order. <!--<blockquote><hr><b>Note:</b> you should be using a reasonably up-to-date C compileror you may encounter problems during compilation(for example, use gcc version 2.7.2.1 or later).<hr></blockquote>-->
<DL>
<DT><STRONG>Tcl/Tk</STRONG>
<DD>Download source:
<UL>
<LI>A modestly up to date Tcl/Tk version <A
href="http://www.isi.edu/nsnam/dist/tcltk/tcl8.4.5-src.tar.gz">Tcl-8.4.5</A>
<A
href="http://www.isi.edu/nsnam/dist/tcltk/tk8.4.5-src.tar.gz">Tk-8.4.5</A>
<LI>web page: <A href="http://www.tcl.tk/software/">Tcl Developer Xchange
resources</A>. <BR>Note that while more up to date versions of Tcl/Tk are
available, we have not tested with them (although we expect them to work).
</LI></UL><BR>
<DT><STRONG>otcl</STRONG>
<DD>Download source:
<UL>
<LI><A
href="http://sourceforge.net/project/showfiles.php?group_id=30174">version
1.9 (released Jan 19, 2005)</A>
<LI><A
href="http://otcl-tclcl.sourceforge.net/tarballs/otcl-current.tar.gz">daily
snapshot</A>
<LI><A href="http://www.isi.edu/nsnam/ns/ns-anoncvs.html#packages">anonymous
CVS</A> (package "otcl")
<LI>web page: <A
href="http://otcl-tclcl.sourceforge.net/otcl/">http://otcl-tclcl.sourceforge.net/otcl/</A>.
</LI></UL><BR>
<DT><STRONG>TclCL</STRONG> (the package formerly known as
<STRONG>libTcl</STRONG>)
<DD>Download source:
<UL>
<LI>The latest version <A
href="http://sourceforge.net/project/showfiles.php?group_id=30174">tclcl-1.16
(released Jan 19, 2005)</A>
<LI><A
href="http://otcl-tclcl.sourceforge.net/tarballs/tclcl-src-current.tar.gz">daily
snapshot</A>
<LI><A href="http://www.isi.edu/nsnam/ns/ns-anoncvs.html#packages">anonymous
CVS</A> (package "tclcl")
<LI>web page: <A
href="http://otcl-tclcl.sourceforge.net/tclcl/">http://otcl-tclcl.sourceforge.net/tclcl/</A>.
</LI></UL><BR>
<DT><STRONG>ns-2</STRONG>
<DD>Download source:
<UL>
<LI><A href="http://www.isi.edu/nsnam/dist/ns-src-2.28.tar.gz">most recent
release</A> (ns-2.28 released Feb 3, 2005)
<LI><A href="http://www.isi.edu/nsnam/dist/ns-src-snapshot.tar.gz">daily
snapshot</A>,
<LI><A href="http://www.isi.edu/nsnam/ns/ns-anoncvs.html#packages">anonymous
cvs</A> (package "ns-2").
<LI>web page: <A
href="http://www.isi.edu/nsnam/ns/">http://www.isi.edu/nsnam/ns/</A>.
</LI></UL>There may be known problems with the current version of ns; please
check the <A href="http://www.isi.edu/nsnam/ns/ns-problems.html">ns
installation problems web page</A> for patches. <BR>
<DT><STRONG>nam-1</STRONG> (optional)
<DD>Download source:
<UL>
<LI><A href="http://www.isi.edu/nsnam/dist/nam-src-1.11.tar.gz">most recent
release</A> (nam-1.11 released Feb 3, 2005 )
<LI><A href="http://www.isi.edu/nsnam/dist/nam-src-snapshot.tar.gz">daily
snapshot</A>,
<LI><A href="http://www.isi.edu/nsnam/ns/ns-anoncvs.html#packages">anonymous
cvs</A> (package "nam-1").
<LI>web page: <A
href="http://www.isi.edu/nsnam/nam/">http://www.isi.edu/nsnam/nam/</A>
</LI></UL>
<P>You can find pre-built binary for Linux/freeBSD from the <A
href="http://www.isi.edu/nsnam/nam/index.html">nam page</A>.
<P></P>
<DT><STRONG>xgraph</STRONG> (optional, but needed for test suites)
<DD>Download source: <A
href="http://www.isi.edu/nsnam/dist/xgraph-12.1.tar.gz">version 12.1</A>, or
by <A href="http://www.isi.edu/nsnam/ns/ns-anoncvs.html#packages">anonymous
cvs</A> (package "xgraph"). web page: <A
href="http://www.isi.edu/nsnam/xgraph/">http://www.isi.edu/nsnam/xgraph/</A>.
<P>(This version is maintained by the ns maintainers and includes portability
fixes over the <A href="http://jean-luc.ncsa.uiuc.edu/Codes/xgraph/">older
12.0 release</A>.) <!-- This link also is dead. Should be removed. -- ehlert -->
<P></P>
<DT><STRONG>perl</STRONG> (optional, but needed for test suites)
<DD>Download source: <A
href="http://www.perl.com/CPAN/src/stable.tar.gz">latest stable release</A>;
web page: <A href="http://language.perl.com/">http://language.perl.com/</A>
<P>Note that version 5.003 or later is required.
<P></P>
<DT><STRONG>tcl-debug</STRONG> (optional, available for Tcl debugging help)
<DD>Download source: <A
href="http://expect.nist.gov/tcl-debug/tcl-debug.tar.gz">version 1.7</A>; web
page: <A
href="http://expect.nist.gov/tcl-debug/">http://expect.nist.gov/tcl-debug/</A>.
This version will work with Tcl/Tk 8.0 release.
<P></P>
<DT><STRONG>dmalloc</STRONG> (optional, available for memory debugging)
<DD>Download source: <!-- This link isn't valid anymore. Do newer versions also work? -- ehlert --><A
href="http://dmalloc.com/releases/dmalloc-4.8.0.tar.gz">version 4.8.0</A>. web
page: <A href="http://www.dmalloc.com/">http://www.dmalloc.com/</A>; specify
<TT>--with-dmalloc</TT> during configure to include.
<P></P>
<DT><STRONG>sgb2ns conversion program</STRONG> (optional, needed to convert
GT-ITM output to ns-2 format)
<DD>Download source: <A
href="http://www.isi.edu/nsnam/dist/sgb2ns.tar.gz">sgb2ns conversion
program</A>. For more info on GT-ITM topology generators see <A
href="http://www.isi.edu/nsnam/ns/ns-topogen.html#gt-itm">GT-ITM Topology
Generator</A>.
<P></P>
<DT><STRONG>tiers2ns conversion program</STRONG> (optional, needed to convert
Tiers output to ns-2 format) <!-- This link also is dead. Should be removed. -- ehlert -->
<DD>Download source: <A
href="http://www.isi.edu/~haldar/topogen/tiers2ns.awk">tiers2ns.awk</A>. For
more info on Tiers topology generators see <A
href="http://www.isi.edu/nsnam/ns/ns-topogen.html#tiers">Tiers Topology
Generator</A>.
<P></P>
<DT><STRONG>Cweb and sgb source code </STRONG>(optional, required to create
sgb-library that is used by gt-itm and sgb2ns programs)
<DD>Download cweb source from <A
href="ftp://labrea.stanford.edu/pub/cweb/cweb3.4g.tar.gz">cweb ftp page</A>
<DD>Download sgb source code from <A
href="ftp://labrea.stanford.edu/pub/sgb/sgb.tar.gz">sgb ftp page</A> </DD></DL>
<P>VINT developers at ISI can find all of these packages in
<TT>/nfs/filb2/public/pkgs</TT>.
<H2>Building it From Sources</H2><STRONG>These instructions are for Unix only.
For Windows, the <A
href="http://www.isi.edu/nsnam/ns/ns-build.html#allinone">allinone</A> is
recommended. Go <A href="http://www.isi.edu/nsnam/ns/ns-cygwin.html">here</A>
for Windows instructions.</STRONG>
<P>
<UL>
<LI>Fetch the source code as described above.
<P></P>
<LI>Unpack OTcl, TclCL and ns source into the same top level directory.
<P></P>
<LI>build OTcl, TclCL and ns
<DL>
<UL>
<LI>cd into the OTcl directory
<LI>run <CODE>./configure</CODE>
<LI>run <CODE>make</CODE>
<LI>cd into the TclCL directory
<LI>run <CODE>./configure</CODE>
<LI>run <CODE>make</CODE>
<LI>cd into the ns directory
<LI>run <CODE>./configure</CODE>
<LI>run <CODE>make</CODE> </LI></UL>
<P>For Unix, a simple <TT>./configure</TT> will try to auto-detect the
packages ns needs to build. Auto-detection searchs sensible places (like
/usr/local) and the directory above current direcory. If you have packages
installed elsewhere you can explicitly tell ns where something is with
options like <TT>--with-tcl=/your/path/to/tcl</TT>. Run <TT>./configure
--help</TT> for a complete list of options. code </P></DL>
<P></P>
<LI>Verify that it built correctly and runs:
<UL>
<LI><CODE>./validate</CODE>
<P></P></LI></UL></LI></UL><A name=allinone>
<H2>Getting everything at once</H2></A>Ns-allinone is a package which contains
equired components and some optional components used in running ns. The package
contains an "install" script to automatically configure, compile and install
these components. After downloading, run the install script. If you haven't
installed ns before and want to quickly try ns out, ns-allinone may be easier
than getting all the pieces by hand.
<P>Currently the package contains:
<P>
<UL>
<LI>Tcl release 8.4.5 (required component)
<LI>Tk release 8.4.5 (required component)
<LI>Otcl release 1.9 (required component)
<LI>TclCL release 1.16 (required component)
<LI>Ns release 2.28 (required component)
<LI>Nam release 1.11 (optional component)
<LI>Xgraph version 12 (optional component)
<LI>CWeb version 3.4g (optional component)
<LI>SGB version 1.0 (?) (optional component, builds sgblib for all UNIX type
platforms)
<LI>Gt-itm gt-itm and sgb2ns 1.1 (optional component)
<LI>Zlib version 1.1.4 (optional, but required should Nam be used) </LI></UL>
<P>Currently, ns-allinone works on Unix systems and under Cygwin for Windows
9x/2000/XP. If you have problems with allinone, we encourage you to build it <A
href="http://www.isi.edu/nsnam/ns/ns-build.html#pieces">from its pieces</A>.
<P>Download source:
<UL>
<LI><A href="http://www.isi.edu/nsnam/dist/ns-allinone-2.28.tar.gz">current
release 2.28</A> (released Feb 3, 2005) </LI></UL>
<P><STRONG>Important:<EM>Please check the <!-- <A href=#bugfixes>bug fixes</A> --><A
href="http://www.isi.edu/nsnam/ns/ns-problems.html">bug fixes</A> after you
finish installation! </EM></STRONG>.
<H2>Getting Older Versions of Ns</H2>
<P>Q: The current version of ns has too many features and fixed bugs... I want a
more challenging network simulator. (Or, more likely, I have someone elses code
that was built against an old ns release.)
<P>A: All available releases of ns-2 and nam are at our <A
href="http://www.isi.edu/nsnam/dist/">web</A> and <A
href="http://ftp.isi.edu/nsnam/">ftp</A> sites. Please note that many of these
versions have known bugs---we can only support the most recent ns release.
<H2>Where to go from here?</H2>
<P><A name=bugfixes>If</A> you have problems building ns, try reading the <A
href="http://www.isi.edu/nsnam/ns/ns-problems.html">Installation Problems and
Bug Fixes Web Page</A>.
<P>If you want to write new simulation scripts or modules, please check out the
documentation links on the <A href="http://www.isi.edu/nsnam/ns/index.html">main
ns page</A>.
<P>Now that ns runs, you might want to consider some tips about <A
href="http://www.isi.edu/nsnam/ns/ns-debugging.html">debugging your ns
scripts</A>.
<P>If you plan on modifing ns itself you should do a <TT>make depend</TT> to add
dependency information to configure's Makefile.
<P>To animate your simulations, you might want to examine <A
href="http://www.isi.edu/nsnam/nam/index.html">nam</A>, the network animator.
<HR>
<B><A href="http://www.isi.edu/nsnam/ns/">ns</A></B> <A
href="mailto:ns-users@isi.edu"><I>ns-users@isi.edu</I></A> </BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -