ns Modifications

This page contains information on building the ns network simulator for use on Mac OS X and SuSE Linux (using the Intel
C++ Compiler for Linux
). In particular, this information applies
to ns as distributed by the Monarch Project, which
includes several modifications designed to support wireless and
mobility research.

Building ns on Mac OS X

These instructions are current as of Mac OS X version
10.3.2 and Xcode
1.1
. You must install Fink, and ensure that the Fink
tcltk source (not binary) packages are
installed. (This is most easily performed by installing the tcltk package from fink
instead of dselect.) Fink installation is
beyond the scope of this document.

In order to use ad-hockey, you must
install Perl/Tk. Jaguar
users may follow this
procedure
, and must also install Perl 5.8.0 (Panther ships
with Perl 5.8.1), which may have side effects on your system. One
symptom in particular involves Perl warning messages such as
“Setting local failed” and “Please check that your
locale settings… are supported and installed on your system.”

To fix this particular problem, set the environment variables
LC_ALL=”C” and LANG=”en_US” before
invoking perl. This release is current as of
Perl/Tk version 804.025b5.

Note that the build scripts for OTcl and
ns include optimizations for the G4 (PowerPC
7450) processor. If you are using a G3 (PowerPC 750) or G5 (PowerPC
970), you should modify the Makefiles to omit the -fast
-mcpu=7450
compiler options. (On the G5, -fast appears
to cause addressing-related crashes.)

To build ns, you must first build OTcl and TclCL. The
build process for each of these three components is illustrated in the
following shell scripts:

otcl-darwin.sh
2 kilobytes – released: 16 November, 2003
Automated script for downloading, patching,
configuring, and building OTcl on Mac OS X (Darwin). (Example run.)
tclcl-darwin.sh
2 kilobytes – released: 16 November, 2003
Automated script for downloading, patching,
configuring, and building TclCL on Mac OS X (Darwin).
Requires OTcl. (Example
run
.)
ns-darwin.sh
2 kilobytes – released: 16 November, 2003
Automated script for downloading, patching,
configuring, and building ns on Mac OS X (Darwin). Requires
OTcl and TclCL. (Example
run
.)

Building ns on SuSE Linux with icc

These instructions are current as of SuSE Linux version 8.1 and
the Intel
C++ Compiler version 7.0
. You must install the tcl RPM and SRPM (if not already
installed). Intel compiler installation is beyond the scope of this
document.

In order to use ad-hockey, you must
install Perl/Tk. Perl/Tk
installation is beyond the scope of this document; this release is
current as of Perl/Tk version 800.024.

To build ns, you must first build OTcl and TclCL. The
build process for each of these three components is illustrated in the
following shell scripts:

otcl-linux.sh
2 kilobytes – released: 24 November, 2003
Automated script for downloading, patching,
configuring, and building OTcl on SuSE Linux with the Intel C++
Compiler. (Example
run
.)
tclcl-linux.sh
2 kilobyts – released: 24 November, 2003
Automated script for downloading, patching,
configuring, and building TclCL on SuSE Linux with the Intel C++
Compiler. Requires OTcl. (Example run.)
ns-linux.sh
1 kilobyte – released: 24 November, 2003
Automated script for downloading, patching,
configuring, and building ns on SuSE Linux with the Intel C++
Compiler. Requires OTcl and TclCL. (Example run.)

Performance

Some informal simulation performance data have been collected,
using the example 900-second scenario given in The
CMU Monarch Project’s Wireless and Mobility Extensions to
ns
:


./ns cmu/scripts/run.tcl -rp cmu/dsr/dsr.tcl -x 1500 -y 300
-cp scen/cbr-50-20-4-512 -sc scen/scen-1500x300-50-0-20-1
-stop 900 -tr out.tr

Platform Compiler User Sys Elap
Intel Pentium II 400MHz, Red Hat Linux 7.2 icc 6.0.1 20020822Z 1746 1657 56:44
PowerBook
G3 500MHz
, Mac OS X 10.2.1
gcc 3.1 20020420 1935 283 51:34
PowerBook
G3 500MHz
, Mac OS X 10.2.3
gcc 3.1 20020420 1791 247 35:19
Intel Pentium II 400MHz, Red Hat Linux 7.2 icc 5.0.1 010730D0 1853 114 32:48
Intel Pentium II 400MHz, Red Hat Linux 7.2 gcc 2.96-98 20000731 1647 105 29:13
Intel Pentium II 400MHz, SuSE Linux 8.1 icc 8.0 20031016Z 1109 96 20:16
PowerBook G4
17-inch 1GHz
, Mac OS X 10.2.4
December 2002 Mac OS X Developer Tools 900 116 18:15
PowerBook
G3 500MHz
, Mac OS X 10.3.2
Xcode 1.1 889 105 17:08
AMD Athlon MP 1900+, Red Hat Linux 7.3 icc 6.0.1 20020822Z 477 34 8:31
PowerBook G4
17-inch 1GHz
, Mac OS X 10.3.1
Xcode 1.0.1 with Xcode Update 2003-11-03 417 42 8:03
AMD Athlon MP 1900+, Red Hat Linux 7.3 gcc 2.96-110 20000731 428 35 7:43
AMD Athlon MP 1900+, SuSE Linux 8.1 icc 7.0 20021021Z 306 27 5:37
Power Mac G5
2GHz
, Mac OS X 10.3.2
Xcode 1.1 209 25 3:55

Patches

This section describes the patches used in the above scripts to
enable Darwin and icc compatibility. If you
are using the automated scripts, there is no need to download the
patches separately.

Patches against ns are generated using:


diff -urNX excludes original/ modified/

otcl-1.0a7-jd4.patch.gz
1 kilobyte – released: 16 November, 2003
Build script updates for Panther.
tclcl-1.0b11-jd6.patch.gz
3 kilobytes – released: 16 November, 2003
Build script updates for Panther, corrected
a newline bug in tcl2c++ which causes problems with gcc 3.3.
cmu-extendedns-1.1.2-jd8.patch.gz
22 kilobytes – released: 16 November, 2003
Build script updates for Panther, corrected
-borderwidth usage and 802.11 Control/Management frame handling in
ad-hockey.

Archive

Older patches are preserved here for historical interest only.
Please use the current patches for any new work.

otcl-1.0a7-jd3.patch.gz
1 kilobyte – released: 2 April, 2003
Fixed some compiler warnings related to Tcl
header definitions.
otcl-1.0a7-jd2.patch.gz
1 kilobyte – released: 16 October, 2002
Add support for Mach-O shared library names
and provide necessary tools/flags for build process. Also, re-run
ranlib(1) after installing libotcl.a (needed for Darwin ld(1)
behavior: must regenerate table of contents after copying
library).
tclcl-1.0b11-jd5.patch.gz
3 kilobytes – released: 14 April, 2003
Updates for SuSE 8.1.
tclcl-1.0b11-jd4.patch.gz
3 kilobytes – released: 2 April, 2003
Fixed some compiler warnings related to Tcl
header definitions.
tclcl-1.0b11-jd3.patch.gz
1 kilobyte – released: 17 October, 2002
Add support for Mach-O shared library names
and provide necessary tools/flags for build process. Also, re-run
ranlib(1) after installing libtclcl.a (needed for Darwin ld(1)
behavior: must regenerate table of contents after copying
library). Rename TclObject::abort(), and supply a strtoq() prototype
needed when using glibc with a non-GNU compiler. Don’t pass
-I/usr/include to icc (breaks sys/types.h substitution, which is
needed on RH7.2).
cmu-extendedns-1.1.2-jd7.patch.gz
22 kilobytes – released: 14 April, 2003
Fix broken Perl/Tk API usage in ad-hockey,
miscellaneous updates for SuSE 8.1 and Fink 0.5.1.
cmu-extendedns-1.1.2-jd6.patch.gz
20 kilobytes – released: 3 January, 2003
Clean up the last few compiler warnings on
Red Hat Linux (icc). Fix `make depend’ rule.
cmu-extendedns-1.1.2-jd5.patch.gz
11 kilobytes – released: 21 December, 2002
Clean up the last few compiler warnings on
Darwin (gcc3).
cmu-extendedns-1.1.2-jd4.patch.gz
10 kilobytes – released: 16 October, 2002
Fix a handful of showstopper bugs as well as
a larger number of warnings during compilation.

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *