How to reflect changes done in Network simulator 2 Source codes

Many of you have tried to change the source codes in NS-2 but researchers find it difficult to reflect these changes. This article will guide you to the steps which are necessary for it.

However all these steps are not always necessary. All the steps should only be done when some changes in have been made. If no changes done in but some changes are made in any header file then Step 2, 3 and 4 are required. If only .cc files are modified then it will require only Step 3 and 4.

Always performing all the steps will not cause any harm but after step 2, step 3 takes much longer time to execute since all the object files are removed by step 2.

There are four steps to reflect changes that have been done in the source codes of NS-2.

  1. Open terminal, go to ns-allinone-2.35/ns-2.35 folder by issuing cd command. Type sudo ./configure. It will ask for your computer password. Type it and press Enter.
  2. Now issue the following command: sudo make clean This command will remove all the existing object files from C++ source code.
  3. Now type: sudo make It will take around 2 minutes to process this command. It may vary depending upon your computer speed.
  4. Now issue the following command: sudo make install 

If these 4 steps are successfully completed then your changes done in the source codes will be reflected. If you are doubtful whether changes have been reflected or not. I advise you to put one printf(“changes have been reflected”); command in somewhere in the code that you have been modifying. When you will run any Tcl file, this statement will be printed on terminal. It will verify that changes have been reflected.


Raghavendra Pal

I have completed in Electronics and communication Engineering from Tezpur University, Assam in 2014. M.Tech in Communication systems from Motilal Nehru National Institute of Technology Allahabad in 2016. Currently pursuing Ph.D. in the domain of Wireless communication.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Close Menu


Close Panel
Skip to toolbar