LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-10-2011, 05:28 PM   #1
kanirip
LQ Newbie
 
Registered: Jan 2011
Posts: 17

Rep: Reputation: 0
Unhappy Installing old version of NS2 for ATM Simulation


Hello,

My first thread here. I am currently trying to implement an ATM simulation using ns2 ( network simulator 2) using information provided in this link here

Now my problem:
I am currently using Cent OS 5.4 and I was able to successfully install ns 2.34 on the machine and run a few test FTP simulations.

The problem stems from the fact that the ns 2 installation used in the ATM simulation , in the link provided, uses ns2.1b7 or ns2.1b9.

I have tried to see if I could cheat and implement the patch for my ns2.34 installation but that failed flat out ( make failed with an incorrect parameter error)

I then tried to download the older versions of ns that were used in the ATM Simulation, ns 2.1b9 and that failed too ( otcl make failed with g++ error) which i figured failed because I am using g++ version 4.1 . ( From the docuemntation, this particular version of the software had trouble with any g++ version > 3.2)

So my question:

a) Is anyone aware of any ATM Simulation patch for the current version of ns i.e. ns 2.34?
b) Is there anyway I can confgure the patch for the ns2.1b9/7 version to work smoothly with the ns2.34 version I have installed?
c) What are the recommendations for me to install the ATM Simulation provided on the URL above.

Thanks for any assistance provided.
 
Old 01-10-2011, 06:20 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Welcome to LQ. .. .. ..

Installing ns-allinone-2.1b9a-gcc32(.tar.gz) to CentOS 5, 32bits
is the same as Fedora 8, mentioned here, post # 4 :
http://www.linuxquestions.org/questi...-5-a-849259/#4
ns-allinone-2.1b9a-gcc32.tar.gz + ns21b9a.patch

You can have two or more versions of ns-allinone-2.x installed
in /home/<name>/<directory>/ with no problems at all.

..
 
1 members found this post helpful.
Old 01-10-2011, 06:58 PM   #3
kanirip
LQ Newbie
 
Registered: Jan 2011
Posts: 17

Original Poster
Rep: Reputation: 0
@knudfl: I was hoping I'd meet you here. You are a legend of B. Laudrup proportions

I would like to ask a question though, do you think that the patch in the page I provided above will also work on the ns2.1b9a version ( as opposed to the ns2.1b9 used in the actual simulation)? Or do I just go safety-first and try and install ns2.1b9? My first guess is that there would be no difference but I know you have more experience across different versions of ns so I would like an expert opinion.

According to the blog that showed the instructions for the installation, we apply a patch prior to the installation. But I also need to apply a patch for the ATM Simulation. IS there any particular order in which I should apply the different patches?

Also, you mention I can have multiple ns versions on the same systems ( provided they are located at different directories) but wouldn't my installation of a separate gcc's affect this?

Thanks for all the help. I might not be able to give an update at the moment ( its 2 AM where I live) but will do so as soon as I can get some work done. Thanks a lot again.
 
Old 01-10-2011, 08:42 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Well, it says : ns-2.1b9-atm.patch

Never tried to include that, but will attempt to do so.
When I have the time. The file README : 2) .. simple ..
Hopefully it is simple to do !

P.S. : And thank you for the kind words.

..

Last edited by knudfl; 01-10-2011 at 08:44 PM.
 
Old 01-12-2011, 03:10 PM   #5
kanirip
LQ Newbie
 
Registered: Jan 2011
Posts: 17

Original Poster
Rep: Reputation: 0
Unhappy

Hi,

I am still having HUGE problems trying to get the patch working.

I successfully installed the ns2.1b9a verson (using the instructions knudfl provided) but after installation I could not get the ATM Simulation patch to work with it.
I then tried to install the ns2.1b9 version but currently I have not been able to get that to install. I have been getting all sorts of errors with individual source files , which I have had to download from the CVS Repo just to get rid of the Compilation errors, but right now I am stuck with some problems in the utils.c linking process. Undefined references and all that ( If the precise error message would be of assistance I can provide that as well)

Could anyone please provide any sort of instructions for installing ns2.1b9 on CentOS 5 ( or even looking at the ATM patch to see how it can be applied to a slightly different version of ns) , I would be very grateful.

Thanks.
 
Old 01-12-2011, 04:50 PM   #6
kanirip
LQ Newbie
 
Registered: Jan 2011
Posts: 17

Original Poster
Rep: Reputation: 0
And finally I have been able to successfully install ns2.1b9.

But my celebrations didnt last long!

I was able to impelement the ATM patch on the new ns installaton and succesfully run ./configure.

The trouble started when I ran ´make´.

I got the following error:
Quote:
g++-3.3.6 -c -DTCP_DELAY_BIND_ALL -DNO_TK -DNIXVECTOR -DTCLCL_CLASSINSTVAR -DNDEBUG -DLINUX_TCP_HEADER -DUSE_SHM -DHAVE_LIBTCLCL -DHAVE_TCLCL_H -DHAVE_LIBOTCL1_0A8 -DHAVE_OTCL_H -DHAVE_LIBTK8_3 -DHAVE_TK_H -DHAVE_LIBTCL8_3 -DHAVE_TCL_H -DHAVE_CONFIG_H -DPGM -DPGM_DEBUG -DNS_DIFFUSION -I. -I/home/ktofa/ns_atm/ns2.1b9/ns-allinone-2.1b9/tclcl-1.0b12 -I/home/ktofa/ns_atm/ns2.1b9/ns-allinone-2.1b9/otcl-1.0a8 -I/home/ktofa/ns_atm/ns2.1b9/ns-allinone-2.1b9/include -I/home/ktofa/ns_atm/ns2.1b9/ns-allinone-2.1b9/include -I/usr/include/pcap -I./tcp -I./common -I./link -I./queue -I./adc -I./apps -I./mac -I./mobile -I./trace -I./routing -I./tools -I./classifier -I./mcast -I./diffusion3/main -I./diffusion3/lib -I./diffusion3/nr -I./diffusion3/ns -I./asim/ -o trace/trace.o trace/trace.cc
In file included from trace/trace.cc:55:
atm/atm.h:66: error: syntax error before `*' token
make: *** [trace/trace.o] Error 1
Now from my initial research I figure that this may be a compiler/library issue so I looked into the source code of the atm. source file and found the below snippet.
Code:
#ifndef __atm_h__
#define __atm_h__

#include <string>
#include "config.h"
#include "packet.h"
#include "general.h"


...
struct hdr_atm {
        int gfc;
        int vpi;
        int vci;
        int type;
        bool clp;
        int hec;
        string *payload;

        static int offset_;
        inline static int &offset() { return offset_; }
        inline static hdr_atm* access(Packet *p) {
                return (hdr_atm*) p->access(offset_);
        }
I believe I need to change the
Code:
string* payload;
or the <string> import line but I am not sure to what.


Any help on this will be appreciated.

I will try and provide a more detailed process for installing ns2.1b9 on CentOS at a later time.
 
Old 01-12-2011, 04:57 PM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Post # 5

1) # yum install libX11-devel libXext-devel libXau-devel libXmu-devel \
gcc-c++ libtool autoconf automake

2) # rpm -Uvh --force gcc3.3-cpp-3.3.6* ; # rpm -Uvh gcc3.3-3.3.6*
EDIT # rpm -Uvh --force libstdc++5-3.3.6-1pclos2007.i586.rpm
# rpm -Uvh libstdc++5-devel-3.3.6 ; # rpm -Uvh --force gcc3.3-c++-3.3.6
2a) exit

3) tar xvf ns-allinone-2.1b9a-gcc32.tar.gz
4) patch -p0 < ns21b9a.patch
5) EDIT : cd ns-allinone-2.1b9a/ns-2.1b9a/
6) patch -p1 < ns-2.1b9-atm.patch
EDIT : 6a) cd ..
7) export CC=gcc-3.3.6 CXX=g++-3.3.6
8) ./install

Did you go that far ? Or did something, that looks like errors appear
before or after the "8) ./install" ?
..

Last edited by knudfl; 01-14-2011 at 07:32 AM.
 
Old 01-12-2011, 05:03 PM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Post # 6.

If you apply the patch 'ns-2.1b9-atm.patch' later in the build sequence,
You will have to : cd ns-allinone-2.1b9a/ns-2.1b9a/ and do : make clean.

And the redo ./install.

Or you can start from scratch with a new unpacked ns-allinone-2.1b9a-gcc32.tar.gz
in a new directory.

..
 
Old 01-12-2011, 06:12 PM   #9
kanirip
LQ Newbie
 
Registered: Jan 2011
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by knudfl View Post
Post # 6.

If you apply the patch 'ns-2.1b9-atm.patch' later in the build sequence,
You will have to : cd ns-allinone-2.1b9a/ns-2.1b9a/ and do : make clean.

And the redo ./install.

Or you can start from scratch with a new unpacked ns-allinone-2.1b9a-gcc32.tar.gz
in a new directory.

..
Will try this and will get back to you with results.

Regarding your earlier post, the problem was that the patch was not completely applied with ns2.1b9a ( it gave me some errors while patching some files e.g packet.h which then threw errors during compilation regarding some missing variable) so I had to run back to ns2.1b9 which I have recently been able to install. Can you confirm that you were able to apply the patch using those instructions on ns 2.1b9a?

------UPDATE-------
While following your recent instructions ( the ´make clean´ and install), I am still receiving the same error.

Any more ideas? Thanks

--EDIT--
I have replaced the ´string´ in the problematic code with ´char´ and that file seem to compile OK ( with some more errors listed in a seperate file later in the build process). One of the later errors it is given me, is that the Vector was used as a type but not defined as a type. Could this be that some libraries are incompatible with the ATM Patch I have?

I have attached the problematic files , make you can look into the source and proffer any solutions.
Attached Files
File Type: txt atm.h.txt (2.8 KB, 14 views)
File Type: txt atmconditioner.h.txt (3.6 KB, 19 views)

Last edited by kanirip; 01-12-2011 at 06:35 PM.
 
Old 01-13-2011, 07:21 PM   #10
kanirip
LQ Newbie
 
Registered: Jan 2011
Posts: 17

Original Poster
Rep: Reputation: 0
NO suggestions?

I am really desperate, will try anything!

I just need some pointers... What does one do when some code uses a library that is incompatible with he currently installed GCC compiler.

Thanks
 
Old 01-14-2011, 08:43 AM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Quote:
What does one do when some code uses a library that is incompatible with
the currently installed GCC compiler ?
Fix the code to use the system compiler.

Or use another compiler, like gcc / g++ version 3.3.6.
You can have several compiler installed at the same time :

1) Compilers, that come with CentOS 5.5 :
The system compiler gcc / gcc-c++ : version 4.1.3
compat-gcc-34 / compat-gcc-34-c++ : version 3.4.6
gcc44 / gcc44-c++ : version 4.4.0

2) Extra compilers like gcc/gcc-c++ -3.3.6
and / or gcc/gcc-c++ -3.3.3 ( Used for ns-2.26 ).

..

Last edited by knudfl; 01-14-2011 at 08:46 AM.
 
Old 01-14-2011, 09:23 AM   #12
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
The result, I got yesterday with no errors :
I do not seem to be able to reproduce it.

I patched with 'ns-2.1b9-atm.patch' using both the p1 and p0 options.
And did so outside ns-allinone-2.1b9a/ and in ns-allinone-2.1b9a/.
And also in ns-allinone-2.1b9a/ns-2.1b9a/ .

But the patch is for 2.1b9 and may not work properly in 2.1b9a.

So actually, I am not sure, that the patch was applied properly.

My hopefully lucky result is available here
https://docs.google.com/uc?id=0B7S25...download&hl=en
> > ns-allinone-2.1b9a-atm-gcc336+patch.tar.gz

Suggest : Try it out, to discover if it will function with your 'atm assignment'.

You can just rerun ./install and see, that it at least does that OK.

..
 
1 members found this post helpful.
Old 01-14-2011, 07:21 PM   #13
kanirip
LQ Newbie
 
Registered: Jan 2011
Posts: 17

Original Poster
Rep: Reputation: 0
@Knudfl: You are a legend!! REALLY!!

I am having some problems downloading the file from Google but once I do , I will test and get back to you with the results.

I really can't thank you enough.

EDIT:
Please Knudfl could you please re-upload the file to a different location because every time I try to download the file, my download does not even start and when I try to sign up to Google Docs I get re-directed to some special domain of Google( called Orange Web Trust) which I can not log into. I could provide you with FTP locations if that is more preferable. Thanks for all the help.

Last edited by kanirip; 01-19-2011 at 12:33 PM. Reason: Request for different file download location
 
Old 01-22-2011, 05:49 PM   #14
kanirip
LQ Newbie
 
Registered: Jan 2011
Posts: 17

Original Poster
Rep: Reputation: 0
@Knudfl: Helloooooo...

I am still waiting for the re-upload of the patched NS2 installation, I can download from the Google docs site.

I really need your help on this.


Thanks
 
Old 01-22-2011, 06:14 PM   #15
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Sorry, but I get no information, when you edit a post. ( Post #13.)

And I have no problems downloading the file :
https://docs.google.com/uc?export=do...ZlYTJkOGNiNmQy

The link is a little different : Confirms that no virus scan will be made.
( Because of size.)
..

Last edited by knudfl; 01-22-2011 at 06:15 PM.
 
  


Reply

Tags
ns-allinone-2.1b9a-gcc32, ns2.1b9a



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
tora simulation does not come to an end in ns2.34 mq15 Linux - Software 3 10-01-2012 12:19 PM
ns2 Wireless simulation Help md_imranullah Programming 1 06-13-2012 02:19 AM
Error on example simulation on ns2 using add-on for directional antenna Vixxx Linux - Software 5 02-03-2012 10:37 AM
NS2 network simulation problem:Change queue parameters dynamically during simulation raeisy Linux - Networking 1 11-21-2010 11:30 AM
Plz.. help me. Network Simulation(NS2)'s problems everfree General 0 06-16-2008 01:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration