Вы находитесь на странице: 1из 4

Network Simulator - 2

Home Network Simulator v2 TCL script to demonstrate Message sending NAM Coding
Generating Patch for NS-2 Xgraph Installation ERROR - Solved Patching DYMO-UM in NS-2.34
Running two NS2 versions on single OS
Friday, September 7, 2012
NS-2.34 installation in Ubuntu 12.04
Follow the below given steps:
Download ns-allinnone-2.34 from nasam website
http://sourceforge.net/projects/nsnam/files/ns-2
Create a folder in home with name ns2
Extract the tar file in ns2
Open terminal and type cd ns2/ns-allinone-2.34
Install required libraries for ns2 using terminal
sudo apt-get install build-essential autoconf automake libxmu-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!
Ramakrishna M
Follow
View my complete
profile
About Me
2014 (1)
2013 (11)
2012 (5)
December (1)
November (1)
October (2)
September
(1)
NS-2.34
installatio
n in
Ubuntu
12.04
2011 (1)
Blog Archive
Join this site
with Google Friend
Connect
Members (45) More
Already a member? Sign in
Followers
Total Pageviews
Share 25 More Next Blog Create Blog Sign In
Network Simulator - 2: NS-2.34 installation in Ubuntu 12.04 http://ramakrishnamundugar.blogspot.in/2012/09/ns-234...
1 of 4 Monday 12 May 2014 01:47 PM
Posted by Ramakrishna M at 3:52 AM
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;
+ }
Path Setup:
In terminal sudo gedit ~/.bash_aliases
Then copy the following path and modify according to your system path
# LD_LIBRARY_PATH
OTCL_LIB=/home/ramakrishna/ns2/ns-allinone-2.34/otcl-1.13
NS2_LIB=/home/ramakrishna/ns2/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/ramakrishna/ns2/ns-allinone-2.34/tcl8.4.18/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB
# PATH
XGRAPH=/home/ramakrishna/ns2/ns-allinone-2.34/bin:/home/ramakrishna/ns2/ns-allinone-2.34/tcl8.4.18/unix:/home/ramakrishna/ns2/ns-allinone-
2.34/tk8.4.18/unix
NS=/home/ramakrishna/ns2/ns-allinone-2.34/ns-2.34/
NAM=/home/ramakrishna/ns2/ns-allinone-2.34/nam-1.14/
PATH=$PATH:$XGRAPH:$NS:$NAM
Save the file and type source ~/.bash_aliases
Now if you type ns in terminal it will show % symbol
+25 Recommend this on Google
75,083
Large Visitor Globe
Map
cluster map
Visitor Location
Search
Search This Blog
Network Simulator - 2: NS-2.34 installation in Ubuntu 12.04 http://ramakrishnamundugar.blogspot.in/2012/09/ns-234...
2 of 4 Monday 12 May 2014 01:47 PM
312 comments
Top comments
Saurabh Mittal 3 months ago - Shared publicly
Hi Ramakrishna after making path setting and all other steps I am getting the error given below:
galaxy@galaxy-HP-Compaq-4000-Pro-SFF-PC:~$ ns
The program 'ns' is currently not installed. You can install it by typing:
sudo apt-get install ns2
galaxy@galaxy-HP-Compaq-4000-Pro-SFF-PC:~$ source ~/.bashrc
Reply
jitendra kumar 2 months ago - Shared publicly
sir when i run the simulation of gpsr (ke lui) protocol i got error even when i run all the steps
according to ki lui file .i am using ns 2.34 on ubuntu 12.04
invalid command name "Agent/GPSR"
while executing
"Agent/GPSR set planar_type_ 1 "
Reply
komal bansal 7 months ago - Shared publicly
thank you sir..its working :)
+2 Reply
farhan akhter 1 month ago - Shared publicly
Hello sir,
I have already installed NS2.35. While "make" command I am getting the error given below can
you please elaborate ? What should I do?
make: CC@: Command not found make: * [tcp/linux/tcp_naivereno.o] Error 127
Reply
meenakshi yadav 3 months ago - Shared publicly
hello sir,
I have got following error while installing ns2.35 in ubuntu 13.04
tcl8.5.10 installation failed.
Tcl is not part of the ns project.
Reply
you may try install the packages
sudo apt-get update
sudo apt-get install build-essential libxmu-dev autoconf automake
after giving the above command, try to install ns2.
Pradeepkumar TS 3 months ago
ganesh kumar 2 months ago - Shared publicly
hello sir,
im trying to integrate a new routing protocol with ns2.34.....im getting error like this after
compiling make....pls help me to fix it sir
Add a comment as iqbal pasha
Network Simulator - 2: NS-2.34 installation in Ubuntu 12.04 http://ramakrishnamundugar.blogspot.in/2012/09/ns-234...
3 of 4 Monday 12 May 2014 01:47 PM
Newer Post Older Post Home
Subscribe to: Post Comments (Atom)
Awesome Inc. template. Powered by Blogger.
Network Simulator - 2: NS-2.34 installation in Ubuntu 12.04 http://ramakrishnamundugar.blogspot.in/2012/09/ns-234...
4 of 4 Monday 12 May 2014 01:47 PM

Вам также может понравиться