LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Extending NS-2.34 to include RCP - [code omitted because of length] : invalid command (https://www.linuxquestions.org/questions/linux-networking-3/extending-ns-2-34-to-include-rcp-%5Bcode-omitted-because-of-length%5D-invalid-command-916594/)

jnhun6 12-01-2011 12:37 PM

Extending NS-2.34 to include RCP - [code omitted because of length] : invalid command
 
Dear All,

I am working on Ubuntu 11.04 and trying to extend NS-2.34 to include Rate Control Protocol (RCP). I have done the steps in readMe of RCP to install it, namely the following steps:

__________________________________________________
To install RCP:
***************

1. Put the 'rcp' directory under ns-allinone-2.30/ns-2.30. The rcp directory has: rcp.cc, rcp-host.cc and rcp-host.h. These are the only newly created files.

The following are existing ns-2 files modified for RCP:

2. ns-packet.tcl at ns-allinone-2.30/ns-2.30/tcl/lib

3. ns-default.tcl at ns-allinone-2.30/ns-2.30/tcl/lib

4. packet.h at ns-allinone-2.30/ns-2.30/common

5. trace.cc at ns-allinone-2.30/ns-2.30/trace

6. Add the following line in Makefile to compile rcp:
rcp/rcp.o rcp/rcp-host.o

7. You can find some sample .tcl files to run RCP in example-tcl-files
__________________________________________________

I have made these changes to the corresponding files in NS-2.34.

Before adding RCP, I was able to run tcl files using NS. Now after adding RCP and recompiling NS, when I try to run any tcl file, I get the following error:
___________________________________________________
ns:
[code omitted because of length]
: invalid command name "Queue/DropTailVariant"
while executing
"Queue/DropTailVariant set drop_front_ false"
___________________________________________________

Any immediate helps on resolving this issue would be very much appreciated.

Btw, the incremental code of RCP is here [in case more detailed info is needed]:

<http://yuba.stanford.edu/rcp/rcp-ns2.30.tar.gz>

knudfl 12-01-2011 01:05 PM

Welcome to LQ.
Quote:

1. Put the 'rcp' directory under ns-allinone-2.30/ns-2.30
1) Do not expect an ns-2.30 modification to work in ns-2.34 .
Patches / modifications are always meant for a specific version.

2) You can have as many versions of ns2 installed at the same time.
Just do not any of those to your PATH, LD_LIBRARY_PATH.

jnhun6 12-01-2011 04:12 PM

Thanks knudfl.

That's completely true. For steps 2-6 I have changed the particular lines in the files and not just simply replacing the files. For step 1, I directly copied the rcp directory. However, since the compilation was successful, I am expecting that for a tcl file which does not use anything from RCP, the execution should be successful. That's why I am thinking there might be some other problem.

I have also been trying to install NS-2.30 on Ubuntu 11.04, but not successful yet. I installed it based on the steps here <http://erl1.wordpress.com/?s=ns-2.30> (although it's for Ubuntu 10.04 Lucid Lynx). It got installed, however when I run a tcl file I get a buffer overflow error. According to <http://erl1.wordpress.com/2011/05/12/installing-ns-2-34-on-ubuntu-11-04/> which suggests to mention an (older) compiler version directly in "Makefile.in" of tcl for buffer overflow error and then re-install it, I did so, but I mentioned version at the beginning of the command, i.e.,
"-V 4.4 CC = @CC@", as otherwise it gets aborted in the middle complaining that,
"gcc: '-V' must come at the start of the command line".

It got installed, but when I run tcl files, it still gives a buffer overflow error along with map of the memory.

Do you have any ideas as how to get NS-2.30 successfully installed and have it working?

Thank you so much in advance.

knudfl 12-01-2011 05:35 PM

Ubuntu 11.04 is not really fit for any ns2.
( Ubuntu 11.10 is even worse.)

If it must be Ubuntu, then Ubuntu 10.04 should be preferred.
( All ns2 was created on CentOS / RHEL.
The perfect choice is CentOS 5.7 ).


About Ubuntu 10.04 : No need to use any "Erlend's modifications".
I.e.: 'export CC=gcc-4.1 CXX=g++-4.1 && ./install' will usually do.

..

jnhun6 12-01-2011 07:04 PM

'export CC=gcc-4.1 CXX=g++-4.1 && ./install' does not work; it gets aborted with the errors which need "Erlend's modifications" (I am assuming that you meant 4.4, since version 4.1 is not available to be installed).

With "Erlend's modifications" NS-2.30 can be installed, but when running tcl files, it generates buffer overflow error.

Any suggestions as how to install NS-2.30 on Ubuntu 11.04 successfully?

knudfl 12-02-2011 01:28 AM

Quote:

With "Erlend's modifications" NS-2.30 can be installed,
but when running tcl files, it generates buffer overflow error.
"buffer overflow error" : Nothing to do.

"Erlend's modifications" may have worked the day they were written.
But Ubuntu updates after that time will prevent ns2 from working :
"Buffer overflow" will be the result. We have seen the issue before
here at LQ.

If you insist in using 11.04, the "gcc41-compat" for 11.04 can used.
( Not tested specificly with ns-2.30 )
> > > Start from scratch with a new unpacked ns-allinone-2.30 .

Please install the 2 packages 1) gcc41-compat-4.1.2_i386.deb
https://docs.google.com/open?id=0B7S...RjNjJhOTZjNjI2

2) g++41-compat-4.1.2_i386.deb
https://docs.google.com/open?id=0B7S...hjMjljN2M2MGU4
Then reboot, and the binaries gcc41, g++41 are ready for use.


Generally : Do not use Ubuntu 11.04 or later for ns2.

P.S. : Please see the EDIT in post #4 : Line 6 is about 10.04 .
(The export command will work in 11.04 too, with gcc41/g++41 -compat:
'export CC=gcc41 CXX=g++41 && ./install' ).

..

jnhun6 12-02-2011 08:26 AM

Thanks.

Quote:

Please install the 2 packages 1) gcc41-compat-4.1.2_i386.deb
https://docs.google.com/open?id=0B7S...RjNjJhOTZjNjI2

2) g++41-compat-4.1.2_i386.deb
https://docs.google.com/open?id=0B7S...hjMjljN2M2MGU4
Then reboot, and the binaries gcc41, g++41 are ready for use.
These two links don't show.
When I try to install the two packages, they cannot be located.
If there are specific things to install these, could you please let me know (I guess that should be in the links you have provided--but those don't show)?


And another question: what version of Ubuntu works well for NS-2.30? Is there a "safe" way to downgrade or it should be installed from scratch?

knudfl 12-02-2011 02:06 PM

Quote:

What version of Ubuntu works well for NS-2.30
Ubuntu 10.04 will work with ns-2.30 (And all other ns2 from version 2.27 up.)

A downgrade is not possible, but you can install 10.04 on a spare partition.


By the way, the links in post #6 seem to work OK :
Packages are downloaded to the default "Downloads" folder.
And can be installed with :
'sudo dpkg -i gcc41-compat-4.1.2_i386.deb g++41-compat-4.1.2_i386.deb'

..

jnhun6 12-02-2011 04:39 PM

Quote:

By the way, the links in post #6 seem to work OK :
I still cannot access it, it gives me this error: Not Found - Error 404.
Maybe read permissions are not set for public.



Quote:

Packages are downloaded to the default "Downloads" folder.
And can be installed with :
'sudo dpkg -i gcc41-compat-4.1.2_i386.deb g++41-compat-4.1.2_i386.deb'
generates error, not accessible:
_______________________________________________________________
dpkg: error processing gcc41-compat-4.1.2_i386.deb (--install):
cannot access archive: No such file or directory
dpkg: error processing g++41-compat-4.1.2_i386.deb (--install):
cannot access archive: No such file or directory
Errors were encountered while processing:
gcc41-compat-4.1.2_i386.deb
g++41-compat-4.1.2_i386.deb
_______________________________________________________________

knudfl 12-03-2011 05:55 AM

The link options for the 2 packages on 'Google Docs' are :

Shared, "Public on the Internet", "Anybody can access and view".


Optional method http://www.linuxquestions.org/questi...ember&u=386037
= Send email to knudfl.
( Then I will attach the 2 files to a return mail.)

..

bhargavigoswami 08-08-2012 06:58 AM

Quote:

Originally Posted by jnhun6 (Post 4539356)
Dear All,

I am working on Ubuntu 11.04 and trying to extend NS-2.34 to include Rate Control Protocol (RCP). I have done the steps in readMe of RCP to install it, namely the following steps:

__________________________________________________
To install RCP:
***************

1. Put the 'rcp' directory under ns-allinone-2.30/ns-2.30. The rcp directory has: rcp.cc, rcp-host.cc and rcp-host.h. These are the only newly created files.

The following are existing ns-2 files modified for RCP:

2. ns-packet.tcl at ns-allinone-2.30/ns-2.30/tcl/lib

3. ns-default.tcl at ns-allinone-2.30/ns-2.30/tcl/lib

4. packet.h at ns-allinone-2.30/ns-2.30/common

5. trace.cc at ns-allinone-2.30/ns-2.30/trace

6. Add the following line in Makefile to compile rcp:
rcp/rcp.o rcp/rcp-host.o

7. You can find some sample .tcl files to run RCP in example-tcl-files
__________________________________________________

I have made these changes to the corresponding files in NS-2.34.

Before adding RCP, I was able to run tcl files using NS. Now after adding RCP and recompiling NS, when I try to run any tcl file, I get the following error:
___________________________________________________
ns:
[code omitted because of length]
: invalid command name "Queue/DropTailVariant"
while executing
"Queue/DropTailVariant set drop_front_ false"
___________________________________________________

Any immediate helps on resolving this issue would be very much appreciated.

Btw, the incremental code of RCP is here [in case more detailed info is needed]:

<http://yuba.stanford.edu/rcp/rcp-ns2.30.tar.gz>


-------------------------------------------------------------
I tried alot to install RCP over ns2.30. But I was unsuccessful.
First I installed ns2.30. I could successfully do that over Fedora.
Second I downloaded RCP for ns2.30 from following link

http://yuba.stanford.edu/rcp/

But, I could not implement it successfully.

During RCP implementation over ns2.30, it does not give me any error.
But when I run ns command, I get following error:

[amg@localhost ~]$ ns
ns:
[code omitted because of length]
: invalid command name "Queue/DropTailVariant"
while executing
"Queue/DropTailVariant set drop_front_ false"


I m stuck now. Can't move forward my research.
Need your help. Please help me.

bhargavigoswami 11-01-2012 06:55 AM

Quote:

Originally Posted by bhargavigoswami (Post 4748870)
-------------------------------------------------------------
I tried alot to install RCP over ns2.30. But I was unsuccessful.
First I installed ns2.30. I could successfully do that over Fedora.
Second I downloaded RCP for ns2.30 from following link

http://yuba.stanford.edu/rcp/

But, I could not implement it successfully.

During RCP implementation over ns2.30, it does not give me any error.
But when I run ns command, I get following error:

[amg@localhost ~]$ ns
ns:
[code omitted because of length]
: invalid command name "Queue/DropTailVariant"
while executing
"Queue/DropTailVariant set drop_front_ false"


I m stuck now. Can't move forward my research.
Need your help. Please help me.

The problem is solved.
Need change in ns-default.tcl. Just replace rcp related agents with Queue/DropTail/RCP
for more details please mail me at bhargavigoswami@gmail.com
Hope it helps you in yr research.


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