-   Linux - Software (
-   -   Install ns2.33 on fedora 17 (

torjemen 12-06-2012 04:55 AM

Install ns2.33 on fedora 17
Hi There,
I have try at several time to install ns 2.33 on Fedora 17 but I always get an error:

In file included from linkstate/
linkstate/ls.h:107:38: erreur: expected class-name before ‘{’ token
linkstate/ls.h:109:11: erreur: définition fournie pour une instanciation explicite
linkstate/ls.h: In member function ‘void A::del()’:
linkstate/ls.h:112:20: erreur: ‘template class std::vector’ used without template parameters
linkstate/ls.h:112:35: erreur: ‘erase’ was not declared in this scope
linkstate/ls.h: At global scope:
linkstate/ls.h:115:2: erreur: explicit instantiation of non-template type ‘A’
In file included from linkstate/
linkstate/ls.h:458:8: erreur: ISO C++ forbids declaration of ‘begin’ with no type [-fpermissive]
linkstate/ls.h:458:8: erreur: expected ‘;’ at end of member declaration
linkstate/ls.h:458:9: erreur: expected unqualified-id before ‘.’ token
linkstate/ls.h:460:2: erreur: ‘message_storage’ does not name a type
linkstate/ls.h:461:2: erreur: ‘message_storage’ does not name a type
linkstate/ls.h: In constructor ‘LsMessageCenter::LsMessageCenter()’:
linkstate/ls.h:425:16: erreur: class ‘LsMessageCenter’ does not have any field named ‘lsa_messages’
linkstate/ls.h:425:32: erreur: class ‘LsMessageCenter’ does not have any field named ‘other_messages’
linkstate/ls.h: In member function ‘LsMessage* LsMessageCenter::retrieveMessagePtr(u_int32_t)’:
linkstate/ls.h:443:11: erreur: ‘lsa_messages’ was not declared in this scope
linkstate/ls.h:445:11: erreur: ‘other_messages’ was not declared in this scope
linkstate/ In member function ‘LsMessage* LsMessageCenter::newMessage(int, ls_message_type_t)’:
linkstate/ erreur: ‘message_storage’ was not declared in this scope
linkstate/ erreur: ‘storagePtr’ was not declared in this scope
linkstate/ erreur: ‘lsa_messages’ was not declared in this scope
linkstate/ erreur: ‘other_messages’ was not declared in this scope
linkstate/ erreur: ‘message_storage’ is not a class or namespace
linkstate/ erreur: expected ‘;’ before ‘itr’
linkstate/ erreur: ‘itr’ was not declared in this scope
linkstate/ In member function ‘bool LsMessageCenter::deleteMessage(u_int32_t)’:
linkstate/ erreur: ‘message_storage’ has not been declared
linkstate/ erreur: expected ‘;’ before ‘itr’
linkstate/ erreur: ‘itr’ was not declared in this scope
linkstate/ erreur: ‘other_messages’ was not declared in this scope
linkstate/ erreur: ‘other_messages’ was not declared in this scope
linkstate/ erreur: ‘itr’ was not declared in this scope
linkstate/ In member function ‘int LsRetransmissionManager::ackIn(int, const LsMessage&)’:
linkstate/ attention : suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
In file included from linkstate/
linkstate/ls.h: In member function ‘LsMessage* LsMessageCenter::retrieveMessagePtr(u_int32_t)’:
linkstate/ls.h:447:2: attention : contrôle a atteint la fin non void de la fonction [-Wreturn-type]
make: *** [linkstate/ls.o] Erreur 1
Ns make failed!
See for problems
how can I fix it ?
best regards.

knudfl 12-06-2012 09:28 AM

Welcome to LQ.

# yum install compat-gcc-34-c++

The install command for ns-allinone-2.33 is :
$ cd ns-allinone-2.33/ && export CC=gcc34 CXX=g++34 && ./install

You will probably have to start from scratch with a new unpacked ns-allinone-2.33.tar.gz

Or : Do a 'make clean' in tcl8*/unix/, tk8*/unix/, otcl*/, tclcl*/, ns-2.33/,
and delete all 'Makefile', where 'make clean' didn't delete them.


torjemen 12-06-2012 12:27 PM

Thanks for your reply and I'm very grateful for you.
it seems that ns is intsalled now correctly.
However, when i type ns in the terminal it is not working but when i type ./ns it will show % symbol and it work.
by the way, how can I procede to install nam ?
Best regards.

knudfl 12-06-2012 01:36 PM

Installing ns : cd ns-allinone-2.33/ns-2.33/
make install
( 'make install' will copy ns to /usr/local/bin/ ).

You can do the same in ns-allinone-2.33/nam-1.14/
EDIT : ns-allinone-2.33/nam-1.13/
( If ./nam works.)

If not, you can use a binary nam ( -1.14 ) : post # 4 here ..

# cp nam /usr/local/bin/


torjemen 12-07-2012 02:18 AM

In ns-allinone-2.33 i find nam-1.13 folder and not nam-1.14.
when I see nam-1.13 folder i find many files but when i download the binary file i find only one file nam.
must i copy it into nam1.13 folder ?
best regards and thanks for your help.

knudfl 12-07-2012 04:08 AM

# 5

In ns-allinone-2.33 I find nam-1.13 folder and not nam-1.14.
Sorry, typo. "ns-allinone-2.33" is of course with nam-1.13 .

Nam is a separate application. Any nam can be used.
And : Nam 1.13, 1.14 are identical so far concerns Linux.

Using the binary package nam-1.14.i586.tar.gz :
tar xvf nam-1.14.i586.tar.gz
cp nam-1.14.i586/nam /usr/local/bin/


torjemen 12-07-2012 10:35 AM

Thanks. It is now working well.

torjemen 12-07-2012 12:32 PM

Now, i have try to patch ns2.33 with ns-2.33_hwmp_proact_rev282.patch and ns-2.33_hwmp_proact_rev282.patch file.
I have copy these two file in ns-allinone-2.33 folder and type patch -p1< ns-2.33_hwmp_rev282.patch in terminal.
the message below appear :
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
|Index: ns/
|--- ns/ (.../ns2_hwmp/trunk/ns) (revision 3)
|+++ ns/ (.../ns2_development/trunk/ns) (revision 282)
File to patch:

what is the porblem and how can i fix it
best regards.

knudfl 12-07-2012 04:25 PM

# 8

Now, i have try to patch ns2.33 with
Those two are the same.
But anyway, the patch ns-2.33_hwmp_proact_rev282.patch uses funny directory names :
Don't use it. The already patched package is the one to use.

1) cd ns-allinone-2.33/
2) mv ns-2.33/ ns-2.33_orig
3) tar xvf ns-2.33_hwmp_rev282.tar.bz2 >
4) mv ns-2.33_hwmp/ ns-2.33
5) export CC=gcc34 CXX=g++34 && ./install
... and your new binary ns ( "ns-hwmp" ) is created.

It's a good idea to have a copy of both 'ns' in /usr/local/bin/,
as they may behave different.
( The "ns-hwmp" may not work with non hwmp tcl files.)
Copy 1 : The original ns renamed to ns-orig.
Copy 2 : The new "ns hwmp" renamed to ns-hwmp.
If you ever need a plain "ns", it's easy to make a copy of either to ns.
(I would usually have about 20 different 'ns-<?>' in /usr/local/bin/).


torjemen 12-08-2012 01:29 PM

Dear Sir,
I really appreciate you support. Thanks.
By the way, i have already pacth the first version of ns to support multi interface :
and now i need to work on the same ns as i will run simulation supporting:
1- multi interface

So how can I do it to make the patch for Multi interface ,HWMP and EDCA on the same ns.
best regards.

knudfl 12-08-2012 04:14 PM


.. I need to work on the same ns as i will run simulation supporting 1 2 3
Why are they required on the same binary 'ns' ?

Do you want to mix all three in one tcl file for a combined simulation ?

How do you expect the patches to work together when they make
different changes in the same files ?
Please read the patches to know the different altered files.

The usual approach is to have a version of ns-allinone-2.xx
for each patching :
You can have as many versions of ns-allinone-2.xx as you want,
installed at the same time. But do not add any of them to a *PATH.
Example : 3 installs of ns-2.33, 2 installs of ns-2.28, etc. etc.


torjemen 12-09-2012 03:40 AM

Yes exactlty the tcl file need these 3 patch at the same time.
So what can I do ?
Best regards.

torjemen 12-11-2012 03:51 PM

No feedback knudfl ?
what do you think so ?
Best regards.

knudfl 12-12-2012 06:30 AM

# 12

Probable try out what works, and what isn't working.

Suggest : Use several installs of ns-allinone-2.33/ and see what happens,
when you apply the patches in different sequences :

1) Multi interface, HWMP, EDCA
2) EDCA, Multi interface, HWMP
3) HWMP, EDCA, Multi interface
4) HWMP, Multi interface, EDCA
5) EDCA, HWMP, Multi interface

One of the installs may then work with a "combined simulations tcl file" ?

Did you read the patches to learn which { aodv/* tcl/lib/* mac/* } files
are getting overwritten by the next patch ?


torjemen 12-17-2012 02:51 AM

Dear Sir,
I have follow this steps :Multi interface then try to install MAC 802.11e EDCA
For the Patch Multi interface, all thing is OK but when try to follow the steps included in the readme file below:

Installation of MAC 802.11e EDCA-Code:

1. please change into the directory ns-whatever/ns-x.y/mac/

2. copy the tgz file into this directory and extract it with:
tar -xvzf filename.tgz

3. changes to your in ns-whatever/ns-x.y/:
- add to INCLUDES:
- add to OBJ_CC:
mac/802_11e/mac-802_11e.o mac/802_11e/priq.o
mac/802_11e/d-tail.o mac/802_11e/mac-timers_802_11e.o
- exclude in NS_TCL_LIB:
tcl/lib/ns-mobilenode.tcl \
- add to NS_TCL_LIB:
mac/802_11e/ns-mobilenode_EDCA.tcl \
mac/802_11e/priority.tcl \

4. changes to your ns-whatever/ns-x.y/tcl/lib/ns-lib.tcl:
- exclude from the source list:
source ns-mobilenode.tcl
- add to the source list:
source ../../mac/802_11e/ns-mobilenode_EDCA.tcl
source ../../mac/802_11e/priority.tcl

5. changes to your ns-whatever/ns-x.y/tcl/lib/ns-default.tcl:
- add:
Queue/DTail set drop_front_ false
Queue/DTail set summarystats_ false
Queue/DTail set queue_in_bytes_ false
Queue/DTail set mean_pktsize_ 500
Queue/DTail/PriQ set Prefer_Routing_Protocols 1
Queue/DTail/PriQ set Max_Levels 4
Queue/DTail/PriQ set Levels 4

Mac/802_11e set SlotTime_ 0.000020 ;# 20us
Mac/802_11e set SIFS_ 0.000010 ;# 10us
Mac/802_11e set PreambleLength_ 144 ;# 144 bit
Mac/802_11e set PLCPHeaderLength_ 48 ;# 48 bits
Mac/802_11e set PLCPDataRate_ 1.0e6 ;# 1Mbps

Mac/802_11e set RTSThreshold_ 3000 ;# bytes
Mac/802_11e set ShortRetryLimit_ 7 ;# retransmittions
Mac/802_11e set LongRetryLimit_ 4 ;# retransmissions

6. add to tcl/lan/ns-mac.tcl:
if [TclObject is-class Mac/802_11e] {
copy settings of MAC/802.11
(which are contained in this file) into this section
and at an "e" at the end of the "Mac/802_11" terms
Mac/802_11e set cfb_ 0 ;# disables CFB

7. mac/wireless-phy.h:
enum ChannelStatus {IDLE, RECV, SEND};
enum ChannelStatus {IDLE, RECVING, SENDING};
replace all occurences of RECV and SEND (by RECVING and SENDING).

8. common/packet.h:
#define HDR_MAC802_11E(p) ((hdr_mac802_11e *)hdr_mac::access(p))

9. run ./configure; make clean; make depend; make in your ns directory

10. happy simulating :o) (e.g with the example script ../ns-x/mac/802.11e/multi_udpflows.tcl)
When using make as the last steps I get the following error:

[root@localhost ns-2.33]# make
make: Dépendance circulaire tcp/linux/tcp_naivereno.c <- tcp/linux/tcp_naivereno.c abandonnée.
make: Dépendance circulaire tcp/linux/src/tcp_cong.c <- tcp/linux/src/tcp_cong.c abandonnée.
make: Dépendance circulaire tcp/linux/src/tcp_highspeed.c <- tcp/linux/src/tcp_highspeed.c abandonnée.
make: Dépendance circulaire tcp/linux/src/tcp_bic.c <- tcp/linux/src/tcp_bic.c abandonnée.
make: Dépendance circulaire tcp/linux/src/tcp_htcp.c <- tcp/linux/src/tcp_htcp.c abandonnée.
make: Dépendance circulaire tcp/linux/src/tcp_scalable.c <- tcp/linux/src/tcp_scalable.c abandonnée.
make: Dépendance circulaire tcp/linux/src/tcp_cubic.c <- tcp/linux/src/tcp_cubic.c abandonnée.
make: Dépendance circulaire tcp/linux/src/tcp_westwood.c <- tcp/linux/src/tcp_westwood.c abandonnée.
make: Dépendance circulaire tcp/linux/src/tcp_vegas.c <- tcp/linux/src/tcp_vegas.c abandonnée.
make: Dépendance circulaire tcp/linux/src/tcp_hybla.c <- tcp/linux/src/tcp_hybla.c abandonnée.
make: Dépendance circulaire tcp/linux/src/tcp_illinois.c <- tcp/linux/src/tcp_illinois.c abandonnée.
make: Dépendance circulaire tcp/linux/src/tcp_yeah.c <- tcp/linux/src/tcp_yeah.c abandonnée.
make: Dépendance circulaire tcp/linux/src/tcp_veno.c <- tcp/linux/src/tcp_veno.c abandonnée.
make: Dépendance circulaire tcp/linux/src/tcp_compound.c <- tcp/linux/src/tcp_compound.c abandonnée.
make: Dépendance circulaire tcp/linux/src/tcp_lp.c <- tcp/linux/src/tcp_lp.c abandonnée.
make: Dépendance circulaire tcp/linux/ns-linux-c.c <- tcp/linux/ns-linux-c.c abandonnée.
make: Dépendance circulaire tcp/linux/ns-linux-param.c <- tcp/linux/ns-linux-param.c abandonnée.
make: *** Aucune règle pour fabriquer la cible « \tcl/lib/ns-compat.tcl », nécessaire pour « gen/ ». Arrêt.
How can I fix it ? what is the problem ?
Best regards.

All times are GMT -5. The time now is 05:16 PM.