Skip to content

Wiflin/pfabric_ns2

Repository files navigation

1. Introduction
----------------

Ns-allinone is a package which contains required components and some of
optional components used in running ns. The package contains an
"install" script to automatically configure, compile and install these
components. 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.
 
Currently the package contains:
  
- Tcl       Tcl release 8.4.18    (required component)
- Tk        Tk release 8.4.18     (required component)
- Otcl      otcl release 1.13    (required component)
- TclCL     tclcl release 1.19  (required component)
- Ns        ns release 2.33    (required component)
- Nam       Nam release 1.13       (optional component)
- Xgraph    xgraph version 12     (optional component)
- GT-ITM    Georgia Tech Internetwork
            Topology Modeler      (optional component)
- SGB       Stanford GraphBase
            package               (optional component)
- CWEB      CWeb version 1.0 (?)  (optional component)
- ZLib      zlib version 1.2.3    (optional component) 

2. FEATURES IN ns-allinone-2.32
-------------------------------

Features in this version include:
 
- Self-containing: All installation will be kept in a directory to help
		   the user manange and use the package. The execution of ns
		   ns or nam does not need any ther support outside
		   this directory

- Bugs fixed:      All components inside the package, are the most recent 
                   versions;

- Easy to use :    Only one-line command is needed to build all ns
		   components

3. Installing the package
--------------------------

All you need to do is type "./install" under this directory. The install
script will compile and install the whole package for you. The script also
will tell you the final installation result.


4. More information
--------------------

Ns-allinone is available from
<http:https://sourceforge.net/projects/nsnam>
or
<http:https://www.isi.edu/nsnam/ns/ns-build.html>

-----------------------------
The nsnam Project
http:https://www.nsnam.org



################################################################################
installation of ns-2.34 on Debian Jessie:
################################################################################



Install required libraries for ns2 using terminal
            sudo apt-get install build-essential autoconf automake libxmu-dev  gcc g++ make libxt-dev 
 Then, sudo ./install

################################################################################
For errors,
################################################################################

1.
ld: libotcl.so: hidden symbol `__stack_chk_fail_local' isn't defined
ld: final link failed: Bad value
make: *** [libotcl.so] Error 1
otcl-1.13 make failed! Exiting ...
Solution:
In otcl-1.13/configure, line number 6304

-SHLIB_LD="ld -shared"
+SHLIB_LD="gcc -shared"

2.
tools/ranvar.cc: In member function ‘virtual double GammaRandomVariable::value()’:
tools/ranvar.cc:219:70: error: cannot call constructor ‘GammaRandomVariable::GammaRandomVariable’ directly [-fpermissive]
tools/ranvar.cc:219:70: error:   for a function-style cast, remove the redundant ‘::GammaRandomVariable’ [-fpermissive]
make: *** [tools/ranvar.o] Error 1

Solution:
In ns-2.34/tools/ranvar.cc, line 219

-return GammaRandomVariable::GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);
+return GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);

3.
In file included from mac/mac-802_11Ext.cc:66:0:
mac/mac-802_11Ext.h: In member function ‘u_int32_t PHY_MIBExt::getHdrLen11()’:
mac/mac-802_11Ext.h:175:19: error: expected primary-expression before ‘struct’
mac/mac-802_11Ext.h:175:41: error: ‘dh_body’ was not declared in this scope
mac/mac-802_11Ext.h:175:51: error: ‘offsetof’ was not declared in this scope
mac/mac-802_11Ext.h:177:3: warning: control reaches end of non-void function [-Wreturn-type]
make: *** [mac/mac-802_11Ext.o] Error 1
Ns make failed!

Solution:
In mac/mac-802_Ext.h, line 65

+#include<cstddef>

4.
mobile/nakagami.cc: In member function ‘virtual double Nakagami::Pr(PacketStamp*, PacketStamp*, WirelessPhy*)’:
mobile/nakagami.cc:183:73: error: cannot call constructor ‘ErlangRandomVariable::ErlangRandomVariable’ directly [-fpermissive]
mobile/nakagami.cc:183:73: error:   for a function-style cast, remove the redundant ‘::ErlangRandomVariable’ [-fpermissive]
mobile/nakagami.cc:185:67: error: cannot call constructor ‘GammaRandomVariable::GammaRandomVariable’ directly [-fpermissive]
mobile/nakagami.cc:185:67: error:   for a function-style cast, remove the redundant ‘::GammaRandomVariable’ [-fpermissive]
make: *** [mobile/nakagami.o] Error 1

Solution:
In ns-2.34/mobile/nakagami.cc, Line no.

-if (int_m == m) {
-             resultPower = ErlangRandomVariable::ErlangRandomVariable(Pr/m, int_m).value();
-         } else {
-             resultPower = GammaRandomVariable::GammaRandomVariable(m, Pr/m).value();
-         }
-         return resultPower;
-    }

 +if (int_m == m) {
 +           resultPower = ErlangRandomVariable(Pr/m, int_m).value();
 +        } else {
 +            resultPower = GammaRandomVariable(m, Pr/m).value();
 +        }
 +       return resultPower;
 +   }

5.
linkstate/ls.h: In instantiation of ‘void LsMap<Key, T>::eraseAll() [with Key = int; T = LsIdSeq]’:
linkstate/ls.cc:396:28:   required from here
linkstate/ls.h:137:58: error: ‘erase’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
  void eraseAll() { erase(baseMap::begin(), baseMap::end()); }
                                                          ^
linkstate/ls.h:137:58: note: declarations in dependent base ‘std::map<int, LsIdSeq, std::less<int>, std::allocator<std::pair<const int, LsIdSeq> > >’ are not found by unqualified lookup

Solution:
edit the line number 137 of ns-2.35/linkstate/ls.h from

void eraseAll() { erase(baseMap::begin(), baseMap::end()); }

to

void eraseAll() { this->erase(baseMap::begin(), baseMap::end()); }


################################################################################
Path Setup:
################################################################################

In terminal vim ~/.bashrc
Then update the environmrnt variable

# LD_LIBRARY_PATH
OTCL_LIB=/home/neverhood/Research/pFabric_ns2.34Simulation/ns-allinone-2.34/otcl-1.13
NS2_LIB=/home/neverhood/Research/pFabric_ns2.34Simulation/ns-allinone-2.34/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB

# TCL_LIBRARY
TCL_LIB=/home/neverhood/Research/pFabric_ns2.34Simulation/ns-allinone-2.34/tcl8.4.18/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH
XGRAPH=/home/neverhood/Research/pFabric_ns2.34Simulation/ns-allinone-2.34/bin:/home/neverhood/Research/pFabric_ns2.34Simulation/ns-allinone-2.34/tcl8.4.18/unix:/home/neverhood/Research/pFabric_ns2.34Simulation/ns-allinone-2.34/tk8.4.18/unix
NS=/home/neverhood/Research/pFabric_ns2.34Simulation/ns-allinone-2.34/ns-2.34/
NAM=/home/neverhood/Research/pFabric_ns2.34Simulation/ns-allinone-2.34/nam-1.14/
PATH=$PATH:$XGRAPH:$NS:$NAM






About

reproduction of pfabric ns2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published