tag:blogger.com,1999:blog-87231151676187504322024-01-11T11:43:53.971-08:00Network Simulator - 2Ramakrishna Mhttp://www.blogger.com/profile/00604979190341937062noreply@blogger.comBlogger18125tag:blogger.com,1999:blog-8723115167618750432.post-25209669105509641732014-04-04T00:55:00.001-07:002014-04-04T00:55:34.405-07:00AntHocNet installation in Ubuntu 12.04<div dir="ltr" style="text-align: left;" trbidi="on">
The steps to be followed are:<br />
<ol style="text-align: left;">
<li>Download the AntHocNet patch for NS-2.34 from the following link
<a href="http://anthocnet.svn.sourceforge.net/viewvc/anthocnet/">http://anthocnet.svn.sourceforge.net/viewvc/anthocnet/</a> </li>
<li>Modify the <b>makefile</b> because the entries for anthocnet were missing
in the patch. </li>
<li>Compile the patch using:</li>
<ol>
<li>./configure</li>
<li>make clean</li>
<li>make</li>
<li>make install </li>
</ol>
<li>Now, you run example files with routing protocol as "<b>AntHocNet</b>"</li>
</ol>
<br />
The common errors:<br />
<ul style="text-align: left;">
<li><span style="color: red;">trace/cmu-trace.o: In function `AntBasicPacket::access(Packet const*)':cmu-trace.cc:(.text._ZN14AntBasicPacket6accessEPK6Packet[AntBasicPacket::access(Packetconst*)]+0x7): undefined reference to `AntBasicPacket::offset_'collect2: ld returned 1 exit status</span><span style="color: red;"> </span></li>
</ul>
<span style="color: red;"> make: *** [ns] Error 1</span><br /><div>
<span style="color: red;"> Ns make failed!</span><br /><span style="color: red;"> See http://www.isi.edu/nsnam/ns/ns-problems.html for problems</span><span style="color: red;"><span style="color: black;"> </span></span><br />
<span style="color: red;"><span style="color: black;"> Solution:</span></span><br />
<span style="color: red;"><span style="color: black;"> Update the makefile with proper path for object files.</span></span><br />
<span style="color: red;"><span style="color: black;"> </span> </span></div>
</div>
Ramakrishna Mhttp://www.blogger.com/profile/00604979190341937062noreply@blogger.com0tag:blogger.com,1999:blog-8723115167618750432.post-73751571756283616072013-10-22T19:44:00.002-07:002013-10-22T19:45:07.234-07:00NS-2.33 installation in Ubuntu 12.04<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
Follow the below given steps:<br />
<br />
Download ns-allinnone-2.33 from nasam website<br />
http://sourceforge.net/projects/nsnam/files/ns-2<br />
Create a folder in home with name ns2<br />
Extract the tar file in ns2<br />
Open terminal and type cd ns2/ns-allinone-2.33<br />
Install required libraries for ns2 using terminal<br />
sudo apt-get install build-essential autoconf automake libxmu-dev<br />
Then, sudo ./install<br />
<br />
For errors,<br />
<br />
<br />
1.<br />
ld: libotcl.so: hidden symbol `__stack_chk_fail_local' isn't defined<br />
ld: final link failed: Bad value<br />
make: *** [libotcl.so] Error 1<br />
otcl-1.13 make failed! Exiting ...<br />
Solution:<br />
In otcl-1.13/configure, line number 6304<br />
<br />
-SHLIB_LD="ld -shared"<br />
+SHLIB_LD="gcc -shared"<br />
<br />
2.<br />
tools/ranvar.cc: In member function ‘virtual double GammaRandomVariable::value()’:<br />
tools/ranvar.cc:219:70: error: cannot call constructor ‘GammaRandomVariable::GammaRandomVariable’ directly [-fpermissive]<br />
tools/ranvar.cc:219:70: error: for a function-style cast, remove the redundant ‘::GammaRandomVariable’ [-fpermissive]<br />
make: *** [tools/ranvar.o] Error 1<br />
<br />
Solution:<br />
In ns-2.33/tools/ranvar.cc, line 219<br />
<br />
-return GammaRandomVariable::GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);<br />
+return GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);<br />
<br />
3.<br />
In file included from mac/mac-802_11Ext.cc:66:0:<br />
mac/mac-802_11Ext.h: In member function ‘u_int32_t PHY_MIBExt::getHdrLen11()’:<br />
mac/mac-802_11Ext.h:175:19: error: expected primary-expression before ‘struct’<br />
mac/mac-802_11Ext.h:175:41: error: ‘dh_body’ was not declared in this scope<br />
mac/mac-802_11Ext.h:175:51: error: ‘offsetof’ was not declared in this scope<br />
mac/mac-802_11Ext.h:177:3: warning: control reaches end of non-void function [-Wreturn-type]<br />
make: *** [mac/mac-802_11Ext.o] Error 1<br />
Ns make failed!<br />
<br />
Solution:<br />
In mac/mac-802_Ext.h, line 65<br />
<br />
+#include<cstddef><br />
<br />
4.<br />
mobile/nakagami.cc: In member function ‘virtual double Nakagami::Pr(PacketStamp*, PacketStamp*, WirelessPhy*)’:<br />
mobile/nakagami.cc:183:73: error: cannot call constructor ‘ErlangRandomVariable::ErlangRandomVariable’ directly [-fpermissive]<br />
mobile/nakagami.cc:183:73: error: for a function-style cast, remove the redundant ‘::ErlangRandomVariable’ [-fpermissive]<br />
mobile/nakagami.cc:185:67: error: cannot call constructor ‘GammaRandomVariable::GammaRandomVariable’ directly [-fpermissive]<br />
mobile/nakagami.cc:185:67: error: for a function-style cast, remove the redundant ‘::GammaRandomVariable’ [-fpermissive]<br />
make: *** [mobile/nakagami.o] Error 1<br />
<br />
Solution:<br />
In ns-2.33/mobile/nakagami.cc, Line no.<br />
<br />
-if (int_m == m) {<br />
- resultPower = ErlangRandomVariable::ErlangRandomVariable(Pr/m, int_m).value();<br />
- } else {<br />
- resultPower = GammaRandomVariable::GammaRandomVariable(m, Pr/m).value();<br />
- }<br />
- return resultPower;<br />
- }<br />
<br />
+if (int_m == m) {<br />
+ resultPower = ErlangRandomVariable(Pr/m, int_m).value();<br />
+ } else {<br />
+ resultPower = GammaRandomVariable(m, Pr/m).value();<br />
+ }<br />
+ return resultPower;<br />
+ }<br />
<br />
Path Setup:<br />
In terminal sudo gedit ~/.bash_aliases<br />
Then update the environmrnt variable<br />
<br />
# LD_LIBRARY_PATH<br />
OTCL_LIB=/home/ramakrishna/ns2/ns-allinone-2.33/otcl-1.13<br />
NS2_LIB=/home/ramakrishna/ns2/ns-allinone-2.33/lib<br />
X11_LIB=/usr/X11R6/lib<br />
USR_LOCAL_LIB=/usr/local/lib<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB<br />
<br />
# TCL_LIBRARY<br />
TCL_LIB=/home/ramakrishna/ns2/ns-allinone-2.33/tcl8.4.18/library<br />
USR_LIB=/usr/lib<br />
export TCL_LIBRARY=$TCL_LIB:$USR_LIB<br />
<br />
# PATH<br />
XGRAPH=/home/ramakrishna/ns2/ns-allinone-2.33/bin:/home/ramakrishna/ns2/ns-allinone-2.33/tcl8.4.18/unix:/home/ramakrishna/ns2/ns-allinone-2.33/tk8.4.18/unix<br />
NS=/home/ramakrishna/ns2/ns-allinone-2.33/ns-2.33/<br />
NAM=/home/ramakrishna/ns2/ns-allinone-2.33/nam-1.13/<br />
PATH=$PATH:$XGRAPH:$NS:$NAM<br />
<br /></div>
Ramakrishna Mhttp://www.blogger.com/profile/00604979190341937062noreply@blogger.com0tag:blogger.com,1999:blog-8723115167618750432.post-48240002633067713442013-10-22T02:08:00.004-07:002013-10-22T02:08:54.331-07:00NS-2 Error<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="background-color: white; font-family: Ubuntubeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif; font-size: 13px; line-height: 15px; text-align: -webkit-auto;"><br /></span>
<span style="background-color: white; font-family: Ubuntubeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif; line-height: 15px; text-align: -webkit-auto;"><b>Application initialization failed: Can't find a usable init.tcl in the following </b></span><br />
<span style="background-color: white; font-family: Ubuntubeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif; line-height: 15px; text-align: -webkit-auto;"><b><br /></b></span>
<span style="background-color: white; font-family: Ubuntubeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif; line-height: 15px; text-align: -webkit-auto;"><b>directories:</b></span><br />
<span style="background-color: white;"><b><span style="font-family: Ubuntubeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif; line-height: 15px; text-align: -webkit-auto;"> </span><br style="font-family: Ubuntubeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif; line-height: 15px; text-align: -webkit-auto;" /><span style="font-family: Ubuntubeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif; line-height: 15px; text-align: -webkit-auto;">../../../linux/lib/tcltk/lib/tcl8.3 ../../../linux/lib/tcltk/lib/tcl8.3</span></b></span><br />
<span style="background-color: white; font-family: Ubuntubeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif; line-height: 15px; text-align: -webkit-auto;"><br /></span>
<span style="background-color: white; font-family: Ubuntubeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif; line-height: 15px; text-align: -webkit-auto;"><u><br /></u></span>
<span style="background-color: white; font-family: Ubuntubeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif; line-height: 15px; text-align: -webkit-auto;"><u>Solution:</u></span><br />
<span style="background-color: white; font-family: Ubuntubeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif; line-height: 15px; text-align: -webkit-auto;"><br /></span>
<span style="background-color: white; font-family: Ubuntubeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif; line-height: 15px; text-align: -webkit-auto;"><br /></span>
<span style="background-color: white; font-family: Ubuntubeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif; line-height: 15px; text-align: -webkit-auto;">1. Go to location root-usr-local-bin by giving following command in terminal</span><br />
<span style="background-color: white;"><br style="font-family: Ubuntubeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif; line-height: 15px; text-align: -webkit-auto;" /><span style="font-family: Ubuntubeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif; line-height: 15px; text-align: -webkit-auto;"><b>cd /usr/local/bin</b></span></span><br />
<span style="background-color: white;"><br style="font-family: Ubuntubeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif; line-height: 15px; text-align: -webkit-auto;" /><span style="font-family: Ubuntubeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif; line-height: 15px; text-align: -webkit-auto;">2. There you would find the ns file. We just need to remove it by giving following command</span></span><br />
<span style="background-color: white;"><br style="font-family: Ubuntubeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif; line-height: 15px; text-align: -webkit-auto;" /><span style="font-family: Ubuntubeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif; line-height: 15px; text-align: -webkit-auto;"><b>rm ns</b></span></span><br />
<span style="background-color: white;"><br style="font-family: Ubuntubeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif; line-height: 15px; text-align: -webkit-auto;" /><span style="font-family: Ubuntubeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif; line-height: 15px; text-align: -webkit-auto;">3. Thats it, you are done. Now your ns starts running successfully.</span></span></div>
Ramakrishna Mhttp://www.blogger.com/profile/00604979190341937062noreply@blogger.com0tag:blogger.com,1999:blog-8723115167618750432.post-44766840004400531402013-10-05T03:38:00.001-07:002013-10-05T03:38:24.416-07:00Error while including wireless-phy.h<div dir="ltr" style="text-align: left;" trbidi="on">
The below error is solved:<br />
<br />
<span style="font-size: x-small;">./mac/wireless-phy.h:129: error: expected identifier before 'r'
<br />./mac/wireless-phy.h:129: error: expected `}' before 'r'
<br />./mac/wireless-phy.h:129: error: expected unqualified-id before 'r'
<br />./mac/wireless-phy.h: In member function bool& WirelessPhy::Is_node_on():
<br />./mac/wireless-phy.h:97: error: node_on_ was not declared in this scope
<br />./mac/wireless-phy.h: In member function bool WirelessPhy::Is_sleeping():
<br />./mac/wireless-phy.h:98: error: status_ was not declared in this scope
<br />./mac/wireless-phy.h: At global scope:
<br />./mac/wireless-phy.h:131: error: no matching function for call to Sleep_Timer::Sleep_Timer()
<br />./mac/wireless-phy.h:58: note: candidates are: Sleep_Timer::Sleep_Timer(WirelessPhy*)
<br />./mac/wireless-phy.h:56: note: Sleep_Timer::Sleep_Timer(const Sleep_Timer&)
<br />./mac/wireless-phy.h:134: error: expected unqualified-id before private
<br />./mac/wireless-phy.h: In function EnergyModel* em():
<br />./mac/wireless-phy.h:142: error: node was not declared in this scope
<br />./mac/wireless-phy.h: At global scope:
<br />./mac/wireless-phy.h:144: error: friend can only be specified inside a class
<br />./mac/wireless-phy.h:146: error: expected declaration before } token </span><br />
<br />
<br />
The error is due to duplicate link to SEND and RECV, so we need to change one of the file as shown below:<br />
<br />
In cmu-trace.cc<br />
<br />
<span style="font-size: x-small;">- #define RECV 'r' <br />- #define SEND 's' </span><br />
<br />
Rename as follows: <br />
<br />
<span style="font-size: x-small;">+ #define RECVs 'r' <br />+ #define SENDs 's' </span><br />
<br />
</div>
Ramakrishna Mhttp://www.blogger.com/profile/00604979190341937062noreply@blogger.com0tag:blogger.com,1999:blog-8723115167618750432.post-59078311811148925602013-10-04T21:17:00.001-07:002013-10-04T21:17:18.539-07:00Installing LEACH in NS-2.34<div dir="ltr" style="text-align: left;" trbidi="on">
The home directory of NS-2.34 is “/home/ns2/ns-allinone-2.34″<br /><br /> 1. Download the package “<b>ns-234-leach.tar.gz</b>” into the directory “<b>/home/ns2/ns-allinone-2.34/ns-2.34</b>″.<br /> 2. Download the bash file “<b>leach-setup.sh</b>” into the directory “<b>/home/ns2/ns-allinone-2.34/ns-2.34</b>″.<br /> If the home directory of your “<b>NS-2.34</b>″ is other than “<b>/home/ns2/ns-allinone-2.34</b>″, then you need to find “<b>ns-allinone-2.34</b>″ and replace with “yourpath/ns-allinone-2.34″ for the file “<b>leach-setup.sh</b>”.<br /> 3. Move to the directory “/home/ns2/ns-allinone-2.34/ns-2.34″ and patch the file “leach-setup.sh” by run this command :<br /> <b>ns2@ubuntu-10.04:~$ cd /home/ns2/ns-allinone-2.34/ns-2.34/ </b><br /> <b> ns2@ubuntu-10.04:/home/ns2/ns-allinone-2.34/ns-2.34$ bash leach-setup.sh</b><br /> If the home directory of your “<b>ns-2.34</b>″ is other than “<b>/home/ns2/ns-allinone-2.34</b>″, then you need to find “<b>…/ns-allinone-2.34</b>″ and replace with “yourpath/ns-allinone-2.34″ for the following two files:<br /> ”<b>Makefile</b>” : found in the directory “/home/ns2/ns-allinone-2.34/ns-2.34″.<br /> “<b>Makefile.in</b>” : found in the directory “/home/ns2/ns-allinone-2.34/ns-2.34″.<br /> 4. Edit both “<b>Makefile</b>” & “<b>Makefile.in</b>” as following:<br /> <b> CC = gcc-4.3<br /> CPP = g++-4.3</b><br /> 5. Run the following commands<br /> <b>ns2@ubuntu-10.04:/home/ns2/ns-allinone-2.34/ns-2.34$ ./configure<br /> ns2@ubuntu-10.04:/home/ns2/ns-allinone-2.34/ns-2.34$ make clean<br /> ns2@ubuntu-10.04:/home/ns2/ns-allinone-2.34/ns-2.34$ make</b><br /> If you have a problem while ‘make’ and shown error message like this : “trace/cmu-trace.cc: In member function ‘void CMUTrace::format(Packet*, const char*)’: trace/cmu-trace.cc:1327: error: ‘format_rca’ was not declared in this scope trace/cmu-trace.cc: At global scope: trace/cmu-trace.cc:1523: error: no ‘void CMUTrace::format_rca(Packet*, int)’ member function declared in class ‘CMUTrace’ make: *** [trace/cmu-trace.o] Error 1″<br /><br />Then you need to add this lines into your cmu-trace.h:<br /> // start from line 165<br /> #ifdef MIT_uAMPS<br /> void format_rca(Packet *p, int offset);<br /> #define ADV_CHAR ‘A’<br /> #define REQ_CHAR ‘R’<br /> #define DATA_CHAR ‘D’<br /><br /> #endif<br /><br />and also add this line into ns-default.tcl (line 765):<br /><br /> # ——————————————————<br /> Phy/WirelessPhy set alive_ 1<br /> Phy/WirelessPhy set Efriss_amp_ 100e-12<br /> Phy/WirelessPhy set Etwo_ray_amp_ 0.013e-12<br /><br /> Phy/WirelessPhy set EXcvr_ 50e-9<br /> Phy/WirelessPhy set sleep_ 0<br /> Phy/WirelessPhy set ss_ 1<br /> Phy/WirelessPhy set dist_ 0<br /> # ——————————————————<br /><br />After that you need to re-make.<br /><br />If the previous commands passed successfully then you are ready to test your “Leach” by running ./test:<br /><b><br />ns2@ubuntu-10.04:/home/ns2/ns-allinone-2.34/ns-2.34$ ./test</b><br /><br />Check the file “leach.err”, if no error reported then go to “leach.out” for results.</div>
Ramakrishna Mhttp://www.blogger.com/profile/00604979190341937062noreply@blogger.com0tag:blogger.com,1999:blog-8723115167618750432.post-50849980284442232312013-08-11T23:39:00.002-07:002013-08-11T23:39:34.335-07:00TCL Error<div dir="ltr" style="text-align: left;" trbidi="on">
<u>TCL compilation error:</u><br />
<br />
/home/ramakrishna/ns2/ns-allinone-2.34/tcl8.4.18/library:/usr/lib /home/ramakrishna/ns2/ns-allinone-2.32/lib/tcl8.4 /home/ramakrishna/ns2/ns-allinone-2.34/tcl8.4.18/library:/usr/lib /home/ramakrishna/ns2/ns-allinone-2.34/tcl8.4.18/library:/usr/tcl8.4 /usr/local/lib/tcl8.4 /usr/lib/tcl8.4 /usr/local/library /usr/library /usr/tcl8.4.15/library /tcl8.4.15/library /home/ramakrishna/ns2/ns-allinone-2.32/lib/tcl8.4<br />
<br />
<br />
<br />
This probably means that Tcl wasn't installed properly.<br />
<br />
<br />
1) cd ns-allinone-2.34/tcl8.4.18/ && ln -s lib/ library<br />
2) Reinstall ns-allinone-2.34<br />
<br />
OR<br />
<br />
1. Go to location root-usr-local-bin by giving following command in terminal<br />
<b>cd /usr/local/bin</b><br />
2. There you would find the ns file. We just need to remove it by giving following command<br />
<b>rm ns</b><br />
3. Thats it, you are done. Now your ns starts running successfully.</div>
Ramakrishna Mhttp://www.blogger.com/profile/00604979190341937062noreply@blogger.com2tag:blogger.com,1999:blog-8723115167618750432.post-53192300921660876722013-05-31T01:41:00.001-07:002013-05-31T01:41:13.229-07:00'make depend' Error<div dir="ltr" style="text-align: left;" trbidi="on">
<br />/bin/sh: Syntax error: Bad fd number<br />make: *** [depend] Error 2<br /><br />This is because the default ubuntu 10.04 setting uses dash instead of bash for sh command. Thus, rename the old link of /bin/sh to dash and create new link of /bin/sh to bash.<br /><br />cd /bin<br />sudo mv sh sh_orig<br />sudo ln -s /bin/bash sh</div>
Ramakrishna Mhttp://www.blogger.com/profile/00604979190341937062noreply@blogger.com2tag:blogger.com,1999:blog-8723115167618750432.post-19390529219706088842013-04-29T21:15:00.002-07:002013-04-29T21:15:28.100-07:00NS-2 NAM Error <div dir="ltr" style="text-align: left;" trbidi="on">
If following is the error when you run<br />
<span style="background-color: white;"><br /></span>
<div style="border: 0px none; color: #333333; font-family: Tahoma,Arial,Helvetica,sans-serif; font-size: 13px; line-height: 18px; margin-bottom: 18px; padding: 0px; vertical-align: baseline;">
<span style="background-color: white;">
$nam sample.nam</span></div>
<div style="border: 0px none; color: #333333; font-family: Tahoma,Arial,Helvetica,sans-serif; font-size: 13px; line-height: 18px; margin-bottom: 18px; padding: 0px; vertical-align: baseline;">
<span style="background-color: white;">
node 0 is not defined… node 0 is not defined… node 1 is not defined…
node 1 is not defined… node 1 is not defined… node 0 is not defined…
node 0 is not defined… node 0 is not defined… node 1 is not defined…
node 1 is not defined… node 1 is not defined… node 0 is not defined…
node 0 is not defined… node 0 is not defined… node 1 is not defined…
node 1 is not defined… node 1 is not defined… node 0 is not defined…
node 0 is not defined… node 0 is not defined… node 1 is not defined</span></div>
<div style="border: 0px none; color: #333333; font-family: Tahoma,Arial,Helvetica,sans-serif; font-size: 13px; line-height: 18px; margin-bottom: 18px; padding: 0px; vertical-align: baseline;">
<span style="background-color: white;"> </span></div>
<div style="border: 0px none; color: #333333; line-height: 18px; margin-bottom: 18px; padding: 0px; vertical-align: baseline;">
<span style="font-size: large;"><span style="font-family: Georgia,"Times New Roman",serif;"><span style="background-color: white;">Solution:</span></span></span></div>
<div style="border: 0px none; color: #333333; font-family: Tahoma,Arial,Helvetica,sans-serif; font-size: 13px; line-height: 18px; margin-bottom: 18px; padding: 0px; vertical-align: baseline;">
<span style="background-color: white;"> $node_(0) set X_ 1236.434683198672<br />$node_(0) set Y_ 179.979610823970<br />$node_(0) set Z_ 0.000000000000<br />$node_(1) set X_ 1790.717030099859<br />$node_(1) set Y_ 83.776877593619<br />$node_(1) set Z_ 0.000000000000</span></div>
<div style="border: 0px none; color: #333333; font-family: Tahoma,Arial,Helvetica,sans-serif; font-size: 13px; line-height: 18px; margin-bottom: 18px; padding: 0px; vertical-align: baseline;">
<span style="background-color: white;"> $ns_ at 0.000000000000 "$node_(0) setdest 8.478589906252 340.108921691462 0.138306462152"<br />$ns_ at 0.000000000000 "$node_(1) setdest 758.184447675563 73.841187162084 0.696734621404" </span></div>
<div style="border: 0px none; color: #333333; font-family: Tahoma,Arial,Helvetica,sans-serif; font-size: 13px; line-height: 18px; margin-bottom: 18px; padding: 0px; vertical-align: baseline;">
<span style="background-color: white;">Add following two line at the after the mobility declaration.</span></div>
<div style="border: 0px none; color: #333333; font-family: Tahoma,Arial,Helvetica,sans-serif; font-size: 13px; line-height: 18px; margin-bottom: 18px; padding: 0px; vertical-align: baseline;">
<span style="background-color: white;"><b>$ns_ initial_node_pos $node_(1) 20<br />$ns_ initial_node_pos $node_(0) 20</b></span></div>
</div>
Ramakrishna Mhttp://www.blogger.com/profile/00604979190341937062noreply@blogger.com2tag:blogger.com,1999:blog-8723115167618750432.post-27439181575061841082013-04-16T10:35:00.002-07:002013-04-16T10:35:10.219-07:00Error while adding new protocol in NS2 - 3<div dir="ltr" style="text-align: left;" trbidi="on">
One more common error is as follows:<br /><br /><b>invalid command name "Agent/MyAgentOtcl"<br /> while executing<br />"Agent/MyAgentOtcl set seqNo_ $opt(seqNo)"</b><br /><br /><br />This is due to one of the below listed reason:<br /><br /><b>1.</b> The spelling mistake in "Agent/MyAgentOtcl" of TCL script and .cc file. In .cc file code will be as follows:<br /><br />MyAgentClass() : TclClass("Agent/MyAgentOtcl") {}<br />TclObject* create(int, const char*const*) {<br />return(new MyAgent());<br />}<br /><br /><br /><b>2. </b>Once protocol is added, then updating makefile is also important. In makefile give the path for creating object file. If path is not give, then TCL scripts cannot access the C++ codes.<br /><br /><b>3. </b>After modifying the makefile and ./configure, sometimes makefile will not be having the path information. You may get ./configure as successfully completed but TCL scripts fails to access. So updating is also important.<br /><br /></div>
Ramakrishna Mhttp://www.blogger.com/profile/00604979190341937062noreply@blogger.com25tag:blogger.com,1999:blog-8723115167618750432.post-29133748371496776022013-04-16T10:19:00.002-07:002013-04-16T10:19:58.636-07:00Error while adding new protocol in NS2 - 2<div dir="ltr" style="text-align: left;" trbidi="on">
Error:<br />
<br />
<b>make: *** No rule to make target `tcp/linux/tcp_naivereno.cc', needed by `depend'. Stop.</b><br />
<br />
Solution:<br />
<br />
edit file “ns-allinone-2.33/ns-2.33/Makefile.in”<br />
<br />
...<br />
<br />
<br />
OBJ_CC = \<br />
<br />
...<br />
<br />
tcp/scoreboard.o tcp/scoreboard-rq.o tcp/tcp-sack1.o tcp/tcp-fack.o \<br />
- tcp/linux/tcp_naivereno.o\<br />
- tcp/linux/src/tcp_cong.o\<br />
- tcp/linux/src/tcp_highspeed.o tcp/linux/src/tcp_bic.o tcp/linux /src/tcp_htcp.o tcp/linux/src/tcp_scalable.o src/tcp_cubic.o\<br />
- tcp/linux/src/tcp_westwood.o tcp/linux/src/tcp_vegas.o tcp/linux/src/tcp_hybla.o\<br />
- tcp/linux/src/tcp_illinois.o tcp/linux/src/tcp_yeah.o \<br />
- tcp/linux/src/tcp_veno.o tcp/linux/src/tcp_compound.o tcp/linux/src/tcp_lp.o\<br />
- tcp/scoreboard1.o tcp/tcp-linux.o tcp/linux/ns-linux-util.o tcp/linux/ns-linux-c.o tcp/linux/ns-linux-param.o\<br />
+ tcp/scoreboard1.o tcp/tcp-linux.o tcp/linux/ns-linux-util.o \<br />
tcp/tcp-asym.o tcp/tcp-asym-sink.o tcp/tcp-fs.o \<br />
<br />
...<br />
-OBJ_C =<br />
+OBJ_C = \<br />
+ tcp/linux/tcp_naivereno.o\<br />
+ tcp/linux/src/tcp_cong.o\<br />
+ tcp/linux/src/tcp_highspeed.o tcp/linux/src/tcp_bic.o tcp/linux/src/tcp_htcp.o tcp/linux/src/tcp_scalable.o tcp/linux/src/tcp_cubic.o\<br />
+ tcp/linux/src/tcp_westwood.o tcp/linux/src/tcp_vegas.o tcp/linux/src/tcp_hybla.o\<br />
+ tcp/linux/src/tcp_illinois.o tcp/linux/src/tcp_yeah.o \<br />
+ tcp/linux/src/tcp_veno.o tcp/linux/src/tcp_compound.o tcp/linux/src/tcp_lp.o\<br />
+ tcp/linux/ns-linux-c.o tcp/linux/ns-linux-param.o</div>
Ramakrishna Mhttp://www.blogger.com/profile/00604979190341937062noreply@blogger.com3tag:blogger.com,1999:blog-8723115167618750432.post-5503511430752435532013-04-16T10:13:00.003-07:002013-04-16T10:19:47.061-07:00Error while adding new protocol in NS2 - 1<div dir="ltr" style="text-align: left;" trbidi="on">
The most commonly found errors while adding new protocol are as follows:<br />
<br />
<b>invoked from within<br />"_o433 cmd addr"<br />invoked from within<br />"catch "$self cmd $args" ret"<br />invoked from within<br />"if [catch "$self cmd $args" ret] {<br />set cls [$self info class]<br />global errorInfo<br />set savedInfo $errorInfo<br />error "error when calling class $cls: $args" $..."<br />(procedure "_o433" line 2)<br />(SplitObject unknown line 2)<br />invoked from within<br />"_o433 addr"<br />("eval" body line 1)<br />invoked from within<br />"eval $node addr $args"<br />("default" arm line 2)<br />invoked from within<br />"switch -exact $routingAgent_ {<br />DSDV {<br />set ragent [$self create-dsdv-agent $node]<br />}<br />DSR {<br />$self at 0.0 "$node start-dsr"<br />}<br />AODV {<br />set ragent [$self cre..."<br />(procedure "_o3" line 14)<br />(Simulator create-wireless-node line 14)<br />invoked from within<br />"_o3 create-wireless-node"<br />("eval" body line 1)<br />invoked from within<br />"eval $self create-wireless-node $args"<br />(procedure "_o3" line 23)<br />(Simulator node line 23)<br />invoked from within<br />"$ns_ node"<br />("for" body line 2)<br />invoked from within<br />"for {set i $val(nnaodv)} {$i < $val(nn)} {incr i} {<br />set node_($i) [$ns_ node]<br />$node_($i) random-motion 0 ;#disable random motion<br />#..." </b><br />
<br />
<br />
The error is due to the TCL script you are trying to execute is not compilng to the library TCL scripts. This error can be solved using following commands:<br />
<br />
<ol>
<li><b>./configure</b></li>
<li><b>make clean</b></li>
<li><b>make</b></li>
<li><b>sudo make install</b></li>
</ol>
</div>
Ramakrishna Mhttp://www.blogger.com/profile/00604979190341937062noreply@blogger.com3tag:blogger.com,1999:blog-8723115167618750432.post-15007482632273102602013-01-04T02:04:00.001-08:002013-01-04T02:04:05.781-08:00Using added new routing protocol in NS2<div dir="ltr" style="text-align: left;" trbidi="on">
The steps to be followed in Fedora system are as follows:<br />
<br />
<ol style="text-align: left;">
<li>./configure</li>
<li>make clean</li>
<li>make</li>
<li>make install</li>
</ol>
<div>
After these only new protocol will be active and use.</div>
<div>
<br /></div>
<div>
<br /></div>
</div>
Ramakrishna Mhttp://www.blogger.com/profile/00604979190341937062noreply@blogger.com139tag:blogger.com,1999:blog-8723115167618750432.post-58637956807394081102012-12-14T20:24:00.000-08:002012-12-14T20:24:03.303-08:00NS-2.29 installation in Ubuntu 12.04<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: x-small;">The below given details are the errors and solutions, which I found while installing.<br /><br />1. <br />Build tcl8.4.11<br />============================================================<br />loading cache ./config.cache<br />checking whether to use symlinks for manpages... no<br />checking whether to compress the manpages... no<br />checking whether to add a package name suffix for the manpages... no<br />checking for gcc... gcc<br />checking whether the C compiler (gcc ) works... yes<br />checking whether the C compiler (gcc ) is a cross-compiler... no<br />checking whether we are using GNU C... yes<br />checking whether gcc accepts -g... yes<br />checking for building with threads... no (default)<br />checking if the compiler understands -pipe... yes<br />checking how to run the C preprocessor... gcc -pipe -E<br />checking for sin... no<br />checking for main in -lieee... yes<br />checking for main in -linet... no<br />checking for net/errno.h... no<br />checking for connect... yes<br />checking for gethostbyname... yes<br />checking how to build libraries... static<br />checking for ranlib... ranlib<br />checking if 64bit support is requested... no<br />checking if 64bit Sparc VIS support is requested... no<br />checking system version (for dynamic loading)... ./configure: 1: Syntax error: Unterminated quoted string<br />tcl8.3.2 configuration failed! Exiting ...<br />Tcl is not part of the ns project. Please see www.Scriptics.com<br />to see if they have a fix for your platform.<br /><br />Solution:<br /><span style="color: blue;">Basically, in some of the configure scripts the calls to awk are malformed.<br /><br /> Go to the ns-allinone folder and type<br /><br /> find . -name configure <br /><br />A list of the configure scripts should appear.<br /><br /> For each of these replace any line that looks like this:<br /><br /> system=MP-RAS-`awk ‘{print }’ /etc/.relid’` <br /><br /> with ...<br /><br /> system=MP-RAS-`awk ‘{print }’ /etc/.relid` <br /><br />Now rerun ./install in the ns-allinone folder.</span><br /><br /><br />2. <br />ld: libotcl.so: hidden symbol `__stack_chk_fail_local' isn't defined<br />ld: final link failed: Bad value<br />make: *** [libotcl.so] Error 1<br />otcl-1.13 make failed! Exiting ...<br />See http://www.isi.edu/nsnam/ns/ns-problems.html for problems <br /><br />Solution:<br /><span style="color: blue;">In otcl-1.13/configure, line number 5516<br /><br />- SHLIB_LD="ld -shared"</span></span><br />
<span style="font-size: x-small;"><span style="color: blue;">+SHLIB_LD="gcc -shared" </span><br /><br />3. <br />Tcl.cc: In member function ‘void Tcl::eval(char*)’:<br />Tcl.cc:182:8: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]<br />Tcl.cc: In member function ‘int TclObject::traceVar(const char*, TclObject*)’:<br />Tcl.cc:421:50: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]<br />Tcl.cc: In static member function ‘static int TclClass::create_shadow(ClientData, Tcl_Interp*, int, const char**)’:<br />Tcl.cc:509:57: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]<br />Tcl.cc:511:61: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]<br />Tcl.cc: In static member function ‘static int TclClass::dispatch_instvar(ClientData, Tcl_Interp*, int, const char**)’:<br />Tcl.cc:566:35: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]<br />Tcl.cc:571:72: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]<br />Tcl.cc: In member function ‘virtual void TclClass::bind()’:<br />Tcl.cc:603:60: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]<br />Tcl.cc:605:60: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]<br />make: *** [Tcl.o] Error 1<br />tclcl-1.17 make failed! Exiting ...<br />See http://www.isi.edu/nsnam/ns/ns-problems.html for problems<br /><br />Soultion:<br /><span style="color: blue;">Go to file tclcl-1.17/tcl.cc at line no. 564 replace the line following line<br /><br />- char *p =strchr(localName, '(');<br />+ char *p =const_cast<char*>( strchr(localName, '('));</span><br /><br />4.<br />./sctp/sctp.h:558:1: warning: ‘typedef’ was ignored in this declaration [enabled by default]<br />./sctp/sctp.h:564:1: warning: ‘typedef’ was ignored in this declaration [enabled by default]<br />./sctp/sctp.h:571:1: warning: ‘typedef’ was ignored in this declaration [enabled by default]<br />./sctp/sctp.h:577:1: warning: ‘typedef’ was ignored in this declaration [enabled by default]<br />./sctp/sctp.h:705:8: error: extra qualification ‘SctpAgent::’ on member ‘DumpSendBuffer’ [-fpermissive]<br />trace/trace.cc:185:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]<br />trace/trace.cc:185:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]<br />trace/trace.cc:185:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]<br />trace/trace.cc:185:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]<br />trace/trace.cc:185:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]<br />make: *** [trace/trace.o] Error 1<br />Ns make failed!<br />See http://www.isi.edu/nsnam/ns/ns-problems.html for problems<br /><br />Solution:<br /><span style="color: blue;">In file sctp/sctp.h in line 705, please change as follows:<br /><br />- void SctpAgent::DumpSendBuffer();<br />+void DumpSendBuffer();</span><br /><br />5.<br />In file included from ./trace/cmu-trace.h:43:0,<br /> from src_rtg/sragent.cc:53:<br />./mobile/god.h: At global scope:<br />./mobile/god.h:88:14: error: extra qualification ‘vector::’ on member ‘operator=’ [-fpermissive]<br />./mobile/god.h:93:14: error: extra qualification ‘vector::’ on member ‘operator+=’ [-fpermissive]<br />./mobile/god.h:98:13: error: extra qualification ‘vector::’ on member ‘operator==’ [-fpermissive]<br />./mobile/god.h:101:13: error: extra qualification ‘vector::’ on member ‘operator!=’ [-fpermissive]<br />make: *** [src_rtg/sragent.o] Error 1<br />Ns make failed!<br />See http://www.isi.edu/nsnam/ns/ns-problems.html for problems<br /><br />Solution:<br /><span style="color: blue;">The changes to be done to solve this problem is in the file mobile/god.h<br /><br />In line 88, 93, 98 and 101 <br />remove vector::</span><br /><br />6.<br />queue/red.cc: In member function ‘double REDQueue::estimator(int, int, double, double)’:<br />queue/red.cc:388:18: warning: variable ‘old_ave’ set but not used [-Wunused-but-set-variable]<br />queue/red.cc: In member function ‘virtual void REDQueue::trace(TracedVar*)’:<br />queue/red.cc:874:35: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]<br />queue/red.cc:875:36: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]<br />queue/red.cc:876:36: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]<br />queue/red.cc:877:41: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]<br />make: *** [queue/red.o] Error 1<br />Ns make failed!<br />See http://www.isi.edu/nsnam/ns/ns-problems.html for problems<br /><br />Solution: <br /><span style="color: blue;"> In file queue/red.cc at line 874,</span></span><br />
<span style="font-size: x-small;"><span style="color: blue;"><br /></span></span>
<span style="font-size: x-small;"><span style="color: blue;">-if (((p = strstr(v->name(), "ave")) == NULL) &&<br />- ((p = strstr(v->name(), "prob")) == NULL) &&<br />- ((p = strstr(v->name(), "curq")) == NULL) &&<br />- ((p = strstr(v->name(), "cur_max_p"))==NULL) ) {<br /><br />+if (((p = const_cast<char*>(strstr(v->name(), "ave"))) == NULL) &&<br />+ ((p = const_cast<char*>(strstr(v->name(), "prob"))) == NULL) &&<br />+ ((p = const_cast<char*>(strstr(v->name(), "curq"))) == NULL) &&<br />+ ((p = const_cast<char*>(strstr(v->name(), "cur_max_p")))==NULL) ) {</span><br /><br />7.<br />dsr/dsragent.cc:2737:18: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]<br />dsr/dsragent.cc:2756:28: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]<br />make: *** [dsr/dsragent.o] Error 1<br />Ns make failed!<br />See http://www.isi.edu/nsnam/ns/ns-problems.html for problems<br /><br />Solution:<br /><span style="color: blue;">In dsr/dsragent.cc at line 216 add following lines,<br /><br />void XmitFlowFailureCallback(Packet *pkt, void *data);<br />void XmitFailureCallback(Packet *pkt, void *data);</span><br /><br />8.<br />diffusion/diffusion.cc: In member function ‘void DiffusionAgent::MACprepare(Packet*, nsaddr_t, int, bool)’:<br />diffusion/diffusion.cc:427:26: error: ‘XmitFailedCallback’ was not declared in this scope<br />make: *** [diffusion/diffusion.o] Error 1<br />Ns make failed!<br />See http://www.isi.edu/nsnam/ns/ns-problems.html for problems<br /><br />Solution:<br /><span style="color: blue;">In diffusion/diffusion.cc at line 85 add following line,<br /><br />void XmitFailedCallback(Packet *pkt, void *data);</span><br />9.<br />diffusion/omni_mcast.cc: In member function ‘void OmniMcastAgent::ConsiderNew(Packet*)’:<br />diffusion/omni_mcast.cc:243:19: warning: variable ‘hashPtr’ set but not used [-Wunused-but-set-variable]<br />diffusion/omni_mcast.cc:246:27: warning: variable ‘forward_nodeID’ set but not used [-Wunused-but-set-variable]<br />diffusion/omni_mcast.cc: In member function ‘void OmniMcastAgent::MACprepare(Packet*, nsaddr_t, unsigned int, bool)’:<br />diffusion/omni_mcast.cc:388:26: error: ‘OmniMcastXmitFailedCallback’ was not declared in this scope<br />make: *** [diffusion/omni_mcast.o] Error 1<br />Ns make failed!<br />See http://www.isi.edu/nsnam/ns/ns-problems.html for problems<br /><br />Solution:<br /><span style="color: blue;">In diffusion/omni_mcast.cc at line 83 add followinf line<br /><br />void OmniMcastXmitFailedCallback(Packet *pkt, void *data);</span><br /><br />10.<br />queue/rio.cc: In member function ‘virtual void RIOQueue::enque(Packet*)’:<br />queue/rio.cc:481:56: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]<br />queue/rio.cc: In member function ‘virtual void RIOQueue::trace(TracedVar*)’:<br />queue/rio.cc:565:35: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]<br />queue/rio.cc:566:38: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]<br />queue/rio.cc:567:39: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]<br />queue/rio.cc:568:36: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]<br />queue/rio.cc:569:39: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]<br />queue/rio.cc:570:40: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]<br />queue/rio.cc:571:36: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]<br />make: *** [queue/rio.o] Error 1<br />Ns make failed!<br />See http://www.isi.edu/nsnam/ns/ns-problems.html for problems<br /><br />Solution:<br /><span style="color: blue;">Do the following changes in queue/rio.cc at line 565 onwards,<br /><br />- if (((p = strstr(v->name(), "ave")) == NULL) &&<br />- ((p = strstr(v->name(), "in_ave")) == NULL) &&<br />- ((p = strstr(v->name(), "out_ave")) == NULL) &&<br />- ((p = strstr(v->name(), "prob")) == NULL) &&<br />- ((p = strstr(v->name(), "in_prob")) == NULL) &&<br />- ((p = strstr(v->name(), "out_prob")) == NULL) &&<br />- ((p = strstr(v->name(), "curq")) == NULL)) {<br /> <br /><br />+ if (((p = const_cast<char*>(strstr(v->name(), "ave"))) == NULL) &&<br />+ ((p = const_cast<char*>(strstr(v->name(), "in_ave"))) == NULL) &&<br />+ ((p = const_cast<char*>(strstr(v->name(), "out_ave"))) == NULL) &&<br />+ ((p = const_cast<char*>(strstr(v->name(), "prob"))) == NULL) &&<br />+ ((p = const_cast<char*>(strstr(v->name(), "in_prob"))) == NULL) &&<br />+ ((p = const_cast<char*>(strstr(v->name(), "out_prob"))) == NULL) &&<br />+ ((p = const_cast<char*>(strstr(v->name(), "curq"))) == NULL)) {</span><br /><br />11.<br />tcp/tcp-sack-rh.cc: At global scope:<br />tcp/tcp-sack-rh.cc:68:15: error: extra qualification ‘SackRHTcpAgent::’ on member ‘newack’ [-fpermissive]<br />make: *** [tcp/tcp-sack-rh.o] Error 1<br />Ns make failed!<br />See http://www.isi.edu/nsnam/ns/ns-problems.html for problems<br /><br />Solution:<br /><span style="color: blue;">In tcp/tcp-sack-rh.cc at line 68,<br /><br />- virtual void SackRHTcpAgent::newack(Packet* pkt);<br />+ virtual void newack(Packet* pkt);</span><br />12.<br />queue/pi.cc: In member function ‘virtual void PIQueue::trace(TracedVar*)’:<br />queue/pi.cc:316:36: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]<br />queue/pi.cc:317:36: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]<br />make: *** [queue/pi.o] Error 1<br />Ns make failed!<br />See http://www.isi.edu/nsnam/ns/ns-problems.html for problems<br /><br />Solution:<br /><span style="color: blue;">In queue/pi.cc at line 316, do the following changes,<br /><br />- if (((p = strstr(v->name(), "prob")) == NULL) &&<br />- ((p = strstr(v->name(), "curq")) == NULL)) {<br /><br />+ if (((p = const_cast<char*>(strstr(v->name(), "prob"))) == NULL) &&<br />+ ((p = const_cast<char*>(strstr(v->name(), "curq"))) == NULL)) {</span><br /><br />13.<br />queue/vq.cc: In member function ‘virtual void Vq::trace(TracedVar*)’:<br />queue/vq.cc:333:35: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]<br />make: *** [queue/vq.o] Error 1<br />Ns make failed!<br />See http://www.isi.edu/nsnam/ns/ns-problems.html for problems<br /><br />Solution:<br /><span style="color: blue;">In file queue/vq.cc at line 333,<br /><br />- if ((p = strstr(v->name(), "curq")) == NULL) {<br />+ if ((p = const_cast<char*>(strstr(v->name(), "curq"))) == NULL) {</span><br /><br />14.<br />queue/rem.cc: In member function ‘virtual void REMQueue::trace(TracedVar*)’:<br />queue/rem.cc:335:35: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]<br />queue/rem.cc:336:36: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]<br />queue/rem.cc:337:36: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]<br />make: *** [queue/rem.o] Error 1<br />Ns make failed!<br />See http://www.isi.edu/nsnam/ns/ns-problems.html for problems<br /><br />Solution:<br /><span style="color: blue;">In file queue/rem.cc at line 335,<br /><br />- if (((p = strstr(v->name(), "ave")) == NULL) &&<br />- ((p = strstr(v->name(), "prob")) == NULL) &&<br />- ((p = strstr(v->name(), "curq")) == NULL)) {<br /><br />+ if (((p =const_cast<char*>(strstr(v->name(), "ave"))) == NULL) &&<br />+ ((p = const_cast<char*>(strstr(v->name(), "prob"))) == NULL) &&<br />+ ((p = const_cast<char*>(strstr(v->name(), "curq"))) == NULL)) {</span><br /><br />15.<br />queue/gk.cc: In member function ‘virtual void GK::trace(TracedVar*)’:<br />queue/gk.cc:207:35: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]<br />make: *** [queue/gk.o] Error 1<br />Ns make failed!<br />See http://www.isi.edu/nsnam/ns/ns-problems.html for problems<br /><br />Solution:<br /><span style="color: blue;">In file queue/gk.cc at line 207,<br /><br />- if ((p = strstr(v->name(), "curq")) == NULL) {<br />+ if ((p = const_cast<char*>(strstr(v->name(), "curq"))) == NULL) {</span><br /><br />16.<br />pgm/pgm-agent.cc: At global scope:<br />pgm/pgm-agent.cc:307:8: error: extra qualification ‘PgmAgent::’ on member ‘trace_event’ [-fpermissive]<br />pgm/pgm-agent.cc: In member function ‘void PgmAgent::handle_rdata(Packet*)’:<br />pgm/pgm-agent.cc:607:30: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]<br />pgm/pgm-agent.cc: In member function ‘void PgmAgent::handle_nak(Packet*)’:<br />pgm/pgm-agent.cc:756:43: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]<br />pgm/pgm-agent.cc: In member function ‘void PgmAgent::handle_ncf(Packet*)’:<br />pgm/pgm-agent.cc:853:28: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]<br />make: *** [pgm/pgm-agent.o] Error 1<br />Ns make failed!<br />See http://www.isi.edu/nsnam/ns/ns-problems.html for problem<br /><br />Solution<br /><span style="color: blue;">In pgm/pgm-agent.cc at line 307,<br /><br />- void PgmAgent::trace_event(char *evType, double evTime);<br />+ void trace_event(char *evType, double evTime);</span><br /><br />17.<br />pgm/pgm-sender.cc: At global scope:<br />pgm/pgm-sender.cc:189:8: error: extra qualification ‘PgmSender::’ on member ‘trace_event’ [-fpermissive]<br />pgm/pgm-sender.cc: In member function ‘virtual void PgmSender::handle_nak(Packet*)’:<br />pgm/pgm-sender.cc:501:67: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]<br />pgm/pgm-sender.cc: In member function ‘virtual void PgmSender::send_rdata(RdataItem*)’:<br />pgm/pgm-sender.cc:645:51: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]<br />make: *** [pgm/pgm-sender.o] Error 1<br />Ns make failed!<br />See http://www.isi.edu/nsnam/ns/ns-problems.html for problems<br /><br />Solution<br /><span style="color: blue;">In pgm/pgm-sender.cc at line 189,<br /><br />- void PgmSender::trace_event(char *evType, nsaddr_t daddr, double evTime); <br />+ void trace_event(char *evType, nsaddr_t daddr, double evTime); </span><br /><br />18.<br />pgm/pgm-receiver.cc: At global scope:<br />pgm/pgm-receiver.cc:186:8: error: extra qualification ‘PgmReceiver::’ on member ‘trace_event’ [-fpermissive]<br />pgm/pgm-receiver.cc: In member function ‘void PgmReceiver::generate_Nak(int)’:<br />pgm/pgm-receiver.cc:617:34: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]<br />make: *** [pgm/pgm-receiver.o] Error 1<br />Ns make failed!<br />See http://www.isi.edu/nsnam/ns/ns-problems.html for problems<br /><br />Solution<br /><span style="color: blue;">In pgm/pgm-sender.cc at line 186,<br /><br />- void PgmReceiver::trace_event(char *evType, double evTime);<br />+ void trace_event(char *evType, double evTime);</span></span></div>
Ramakrishna Mhttp://www.blogger.com/profile/00604979190341937062noreply@blogger.com63tag:blogger.com,1999:blog-8723115167618750432.post-36043788339426979552012-11-17T00:09:00.000-08:002012-11-17T00:09:04.851-08:00nrlsensorsim patching to ns-2.27<div dir="ltr" style="text-align: left;" trbidi="on">
Please find the details in the below given link:<br />
<br />
http://ppvbhat.blogspot.in/2012/07/ns-227-installation-on-fc8-with.html</div>
Ramakrishna Mhttp://www.blogger.com/profile/00604979190341937062noreply@blogger.com4tag:blogger.com,1999:blog-8723115167618750432.post-81856388526410352152012-10-23T21:44:00.003-07:002012-10-23T21:44:20.889-07:00GnuPlot installation in Ubuntu 12.04<div dir="ltr" style="text-align: left;" trbidi="on">
We need to make sure some packages are already installed before we try to compile gnuplot<br />
<br />
<ol style="text-align: left;">
<li><b><span style="font-family: Arial,Helvetica,sans-serif;"><span style="font-size: small;"><code>sudo apt-get install libwxgtk2.8-dev libpango1.0-dev libreadline5-dev libx11-dev libxt-dev texinfo libgd2-xpm-dev</code></span></span></b></li>
<li><b><span style="font-family: Arial,Helvetica,sans-serif;"><span style="font-size: small;"><code>wget http://sourceforge.net/projects/gnuplot/files/gnuplot/4.4.0/gnuplot-4.4.0.tar.gz/download</code></span></span></b></li>
<li><b><span style="font-family: Arial,Helvetica,sans-serif;"><span style="font-size: small;"><code>tar xzf gnuplot-4.4.0.tar.gz</code></span></span></b></li>
<li><b><span style="font-family: Arial,Helvetica,sans-serif;"><span style="font-size: small;"><code>cd <code>gnuplot-4.4.0</code></code></span></span></b></li>
<li><b><span style="font-family: Arial,Helvetica,sans-serif;"><span style="font-size: small;"><code><code>./configure</code></code></span></span></b></li>
<li><b><span style="font-family: Arial,Helvetica,sans-serif;"><span style="font-size: small;"><code><code>sudo make install </code></code></span></span></b> </li>
</ol>
</div>
Ramakrishna Mhttp://www.blogger.com/profile/00604979190341937062noreply@blogger.com2tag:blogger.com,1999:blog-8723115167618750432.post-66129565451104712122012-10-20T23:23:00.001-07:002013-03-15T04:27:03.994-07:00Installing NS-2.31 in Ubuntu 12.04<div dir="ltr" style="text-align: left;" trbidi="on">
Follow the below given steps:<br />
<br />
<br />
<ul style="text-align: left;">
<li>Download ns-allinnone-2.31 from nasam website</li>
</ul>
<a href="http://sourceforge.net/projects/nsnam/files/ns-2">http://sourceforge.net/projects/nsnam/files/ns-2</a><br />
<ul style="text-align: left;">
<li>Create a folder in /home with the name <span style="color: red;">ns2</span> </li>
</ul>
<ul style="text-align: left;">
<li> Extract the tar file in <span style="color: red;">ns2</span> </li>
</ul>
<ul style="text-align: left;">
<li>Open terminal and type <span style="color: red;">cd ns2/ns-allinone-2.31</span></li>
</ul>
<ul style="text-align: left;">
<li> Install required libraries for ns2 using terminal</li>
</ul>
<span style="color: red;">sudo apt-get install build-essential autoconf automake libxmu-dev</span><br />
<ul style="text-align: left;">
<li> Then, <span style="color: red;">sudo ./install </span></li>
</ul>
<span style="color: red;"> -----------------------------------------------------------------------------------------------------------------</span><br />
<span style="color: red;"> </span>For errors,<br />
<span style="color: red;"> </span><span style="color: red;"><span style="color: black;"> </span></span><br />
<br />
<span style="color: red;"><span style="color: black;">1. </span></span><br />
<br />
<span style="color: red;">ld: libotcl.so: hidden symbol `__stack_chk_fail_local' isn't defined<br />ld: final link failed: Bad value<br />make: *** [libotcl.so] Error 1<br />otcl-1.13 make failed! Exiting ...<br />See http://www.isi.edu/nsnam/ns/ns-problems.html for problems</span><br />
<br />
Solution:<br />
In <em>otcl-1.13/configure, </em>line number 5516<br />
<br />
<span style="color: lime;">-SHLIB_LD="ld -shared"</span><br />
<span style="color: lime;">+SHLIB_LD="gcc -shared"</span><span style="color: red;"><span style="color: black;"> </span></span><br />
<span style="color: red;"><span style="color: black;"><br /></span></span>
<span style="color: red;"><span style="color: black;"><br /></span></span></div>
Ramakrishna Mhttp://www.blogger.com/profile/00604979190341937062noreply@blogger.com93tag:blogger.com,1999:blog-8723115167618750432.post-25835453354227926212012-09-07T03:52:00.001-07:002012-09-07T03:52:32.800-07:00NS-2.34 installation in Ubuntu 12.04<div dir="ltr" style="text-align: left;" trbidi="on">
Follow the below given steps:<br />
<br />
<ul style="text-align: left;">
<li>Download ns-allinnone-2.34 from nasam website</li>
</ul>
<a href="http://sourceforge.net/projects/nsnam/files/ns-2">http://sourceforge.net/projects/nsnam/files/ns-2</a><br />
<ul style="text-align: left;">
<li>Create a folder in home with name <span style="color: red;">ns2</span> </li>
</ul>
<ul style="text-align: left;">
<li> Extract the tar file in <span style="color: red;">ns2</span> </li>
</ul>
<ul style="text-align: left;">
<li>Open terminal and type <span style="color: red;">cd ns2/ns-allinone-2.34</span></li>
</ul>
<ul style="text-align: left;">
<li> Install required libraries for ns2 using terminal</li>
</ul>
<span style="color: red;">sudo apt-get install build-essential autoconf automake libxmu-dev</span><br /><div>
<ul style="text-align: left;">
<li> Then, <span style="color: red;">sudo ./install</span></li>
</ul>
<br />
For errors,<br />
<br />
<br />
1. <br />
<div>
<span style="color: red;">ld: libotcl.so: hidden symbol `__stack_chk_fail_local' isn't defined<br />ld: final link failed: Bad value<br />make: *** [libotcl.so] Error 1<br />otcl-1.13 make failed! Exiting ...</span><ul style="text-align: left;"><ul></ul>
</ul>
Solution:<br />
In <em>otcl-1.13/configure, </em>line number 6304<br />
<br />
<span style="color: lime;">-SHLIB_LD="ld -shared"</span><br />
<span style="color: lime;">+SHLIB_LD="gcc -shared"</span><br />
<br />
2. <br />
<span style="color: red;">tools/ranvar.cc: In member function ‘virtual double GammaRandomVariable::value()’:<br />tools/ranvar.cc:219:70: error: cannot call constructor ‘GammaRandomVariable::GammaRandomVariable’ directly [-fpermissive]<br />tools/ranvar.cc:219:70: error: for a function-style cast, remove the redundant ‘::GammaRandomVariable’ [-fpermissive]<br />make: *** [tools/ranvar.o] Error 1</span><br />
<br />
Solution:<br />
In ns-2.34/tools/ranvar.cc, line 219<br />
<br />
<span style="color: lime;">-return GammaRandomVariable::GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);</span><br />
<span style="color: lime;">+return GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);</span><br />
<br />
3.<br />
<span style="color: red;">In file included from mac/mac-802_11Ext.cc:66:0:<br />mac/mac-802_11Ext.h: In member function ‘u_int32_t PHY_MIBExt::getHdrLen11()’:<br />mac/mac-802_11Ext.h:175:19: error: expected primary-expression before ‘struct’<br />mac/mac-802_11Ext.h:175:41: error: ‘dh_body’ was not declared in this scope<br />mac/mac-802_11Ext.h:175:51: error: ‘offsetof’ was not declared in this scope<br />mac/mac-802_11Ext.h:177:3: warning: control reaches end of non-void function [-Wreturn-type]<br />make: *** [mac/mac-802_11Ext.o] Error 1<br />Ns make failed!</span><br />
<br />
Solution:<br />
In mac/mac-802_Ext.h, line 65<br />
<br />
<span style="color: lime;">+#include<cstddef> </span><br />
<br />
4.<br />
<span style="color: red;">mobile/nakagami.cc: In member function ‘virtual double Nakagami::Pr(PacketStamp*, PacketStamp*, WirelessPhy*)’:<br />mobile/nakagami.cc:183:73: error: cannot call constructor ‘ErlangRandomVariable::ErlangRandomVariable’ directly [-fpermissive]<br />mobile/nakagami.cc:183:73: error: for a function-style cast, remove the redundant ‘::ErlangRandomVariable’ [-fpermissive]<br />mobile/nakagami.cc:185:67: error: cannot call constructor ‘GammaRandomVariable::GammaRandomVariable’ directly [-fpermissive]<br />mobile/nakagami.cc:185:67: error: for a function-style cast, remove the redundant ‘::GammaRandomVariable’ [-fpermissive]<br />make: *** [mobile/nakagami.o] Error 1</span><br />
<br />
Solution:<br />
In ns-2.34/mobile/nakagami.cc, Line no.<br />
<br />
<span style="color: lime;">-if (int_m == m) {<br />- resultPower = ErlangRandomVariable::ErlangRandomVariable(Pr/m, int_m).value();<br />- } else {<br />- resultPower = GammaRandomVariable::GammaRandomVariable(m, Pr/m).value();<br />- }<br />- return resultPower;<br />- }</span><br />
<span style="color: lime;"><br /></span>
<span style="color: lime;"> +if (int_m == m) {<br /> + resultPower = ErlangRandomVariable(Pr/m, int_m).value();<br /> + } else {<br /> + resultPower = GammaRandomVariable(m, Pr/m).value();<br /> + }<br /> + return resultPower;<br /> + }</span><br />
<br />
Path Setup:<br />
<ul style="text-align: left;">
<li>In terminal <span style="color: red;">sudo gedit ~/.bash_aliases</span> </li>
<li>Then copy the following path and modify according to your system path</li>
</ul>
<br />
<span style="font-size: x-small;"># LD_LIBRARY_PATH<br />OTCL_LIB=/home/ramakrishna/ns2/ns-allinone-2.34/otcl-1.13<br />NS2_LIB=/home/ramakrishna/ns2/ns-allinone-2.34/lib<br />X11_LIB=/usr/X11R6/lib<br />USR_LOCAL_LIB=/usr/local/lib<br />export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB<br /><br /># TCL_LIBRARY<br />TCL_LIB=/home/ramakrishna/ns2/ns-allinone-2.34/tcl8.4.18/library<br />USR_LIB=/usr/lib<br />export TCL_LIBRARY=$TCL_LIB:$USR_LIB<br /><br /># PATH<br />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<br />NS=/home/ramakrishna/ns2/ns-allinone-2.34/ns-2.34/<br />NAM=/home/ramakrishna/ns2/ns-allinone-2.34/nam-1.14/<br />PATH=$PATH:$XGRAPH:$NS:$NAM</span><br />
<br />
<ul style="text-align: left;">
<li>Save the file and type <span style="color: red;">source ~/.bash_aliases</span> </li>
</ul>
Now if you type ns in terminal it will show % symbol </div>
</div>
</div>
Ramakrishna Mhttp://www.blogger.com/profile/00604979190341937062noreply@blogger.com300tag:blogger.com,1999:blog-8723115167618750432.post-17301837458543078902011-11-22T07:31:00.001-08:002012-01-01T08:05:02.089-08:00Visit my blog for Photography<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: large;"><a href="http://ramakrishnaphotos.blogspot.com/" target="_blank">ramakrishnaphotos.blogspot.com </a></span></div>Ramakrishna Mhttp://www.blogger.com/profile/00604979190341937062noreply@blogger.com0