Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I was working on ns2.32 . But now i require ns2.34 also . I read some of threads and found it is possible to have two diffrent ns2 versions on the same machine.
Installed ns2.32 and ns2.34 in diffrent directories.
Installed successfully . when i type ns % sign appears . But i dont know which ns version it is running ?
so i delete the path varibale for ns2.32 from bashrc file .
and did the following
ns-2.32/ : $ cp ns ns-orig
cp ns-orig /usr/local/bin/
but it is giving me error : permission denied .
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
You can have as many ns-allinone-2.xx as you want, on the same OS.
( I have about 170 on one OS ! )
"$ cp ns-orig /usr/local/bin/" is wrong.
Right is : $ sudo cp ns-orig /usr/local/bin/
As all simulation files.tcl can be run with $ ns-any-name
.. you are supposed to save all the 'ns' executable`s as e.g. :
/usr/local/bin/{ ns, ns-orig, ns232, ns234, ns232-<protocol>, ns234-<protocol> }.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
Re #3.
Quote:
Is there a need to store ns path in bashrc file ?
No. The advice to do so, is an old text (~1999),
from a time when students used the 'University Computers',
and thus had no write access to /usr/.
Today we run 'make install', and get /usr/local/bin/ns ,
.. or we copy ns-<any-name> to usr/local/bin/.
The executable ns (and ns-new-name) is hard coded to know the library location:
ns-allinone-2.xx/{ bin/tcsh8* , lib/*/* }.
I want to make a new protocol in ns2. Could you please tell me "how a simulation tcl script would be executed internally in ns2". That is how aodv.cc would be called from a simulation script.
Although we define AODV as Val(rp) , but recv would be called or command function or anything else
In command function , we write argv[1] == "start" . is it same as "$cbr start" .
I would be very greatful if you provide me some link or give some insights under this.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
Re #5.
Quote:
"how a simulation tcl script would be executed internally in ns2"
There is no internal (ns-2.xx/), so far concerns a simulation.
Everything {c++, otcl, tcl/lib/*} is compiled into one file : The executable 'ns'.
For an 'ns' from an ns-allinone-2.xx/ to run, these tcl files are used :
ns-allinone-2.35/{ bin/tcsh8*, lib/*/* }.
(Some simulations will also use ns-2.xx/tcl//<tcl-"libraries">, //"scene-files".)
Quote:
.. define AODV as val(rp) ,
but recv would be called or command function or anything else .
In command function , we write argv[1] == "start" . is it same as "$cbr start".
I want to ask the following --
Suppose we have a simulation script "wireless.tcl " . In this file we create agents and invoking mobility file , traffic file cbr etc. ....... when we run this .tr and .nam file would be created.
We also have in ns2.32 or in any ns folder --> .cc files , .h files , packet files etc. How this functionality automatically would be called from a tcl script file.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
Re #7.
Quote:
ns-2.32/ { .cc files , .h files , packet files etc. }.
? How this functionality automatically would be called from a tcl script file.
See post #6 : Usually you will save the following :
1) /usr/local/bin/{ ns, ns-orig, ns232, ns-<any-name> }.
2) ns-allinone-2.32/{ bin/, lib/ }.
3) Examples, with the connected (tcl) files : Saved in a random location.
.... I.e. no files are called, it's all inside the executable "ns".
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.