My online Linux/NS faqs

 


This internet page had the goal to help me in my interaction with the linux world. It will log all the main discoveries that I found out, which helped me sometime in my Linux introduction, and work 

It will be majority talking about Linux (probably Fedora, Ubuntu), UNIX (probably FreeBSD), and the work performed in ns2 (Network Simulator). 

I hope you can also benefit of this simple FAQs… ENJOY 


1) A linux command guide that have my more-used commands

unix_commands.doc


2) Application installation in ubuntu

Please remember that when you want to have the latest up to date package list, you must do:

>apt-get update

To upgrade the entire system (to the newer packages that installed) you should write:

>apt-get dist-upgrade

To install something new, you should do:

>apt-get install <package name>...<package name> …

To find a package (and search by string) you should do:

>apt-cach search <some string you are looking for>

To see more information about a package you want to install:

>apt-cach show <package name>

And to see what is installed:

>dpkg -l | grep <package name>

 

PS: you can also use synaptic it's gui program to do the same.

If not installed do: apt-get install synaptic will do the trick :)

Thanks to Ido Kanner


3) My favorite NS2 pages....

The main NS2 page

A very useful and complete help page (Pedro Estrela)

Some opportunist FAQs

Example of TCL scripts and PERL measuring tools

 


4) Regarding Debugging…

I am using DDD for normal debugging

And Valgrind to memory allocation debug 1 - 2

 


5) Tips on Debugging NS

To see the last call functions after a "Segmentation Fault"... start gdb with ns

>gdb ns

Input the file as a parameter

>set args file_name.tcl

Run the program

>run

After the error enter

>bt

 


6) To get the energy level of a node, you can do:

 

>double energy;

>Node* node_;

>node_ = MobileNode::get_node_by_address(index); //index is the address of a node

 >if (node_) {

            >if (node_->energy_model())

                        energy = node_->energy_model()->energy();

Thanks to Hajer FERJANI


7) To have the current positions of a node you need to do:

> MobileNode* mnode_;

>double x = 0.0,y = 0.0,z = 0.0;

>mnode_->getLoc(&x, &y, &z);

Thanks to Hajer FERJANI


  Suggestions: tandre_at_dei.uc.pt                                                                                           Last modification: 29/12/2005