Skip to main content

Posts

Showing posts with the label revealing

TOUR DE NS2 REVEALING SECRETS BEHIND COMMAND MAKE AND MAKEFILE

TOUR DE NS2 REVEALING SECRETS BEHIND COMMAND MAKE AND MAKEFILE Friends, We are decided to introduce a new segment in our blog named as " ToUr De Ns2 " to get you more familiar with ns2 directories, folders and commands that we used in the ns2. We hope it gives you all a deep knowledge in ns2. We need all your supports and prayers. Comments and new ideas are welcomed. Now we are going to have a deep look in command make . We all know that ns2 is a research tool. So all of the researchers are tried to customize files or to add new C++ modules in ns2 directory. During this time, it is necessary to recompile all the files that related or depend with it. So we need an effective command for recompilation of all files because manual recompilation is not possible. For that we here use a UNIX utility tool called as " make ". This command has a significant role in development process. It keeps track of all the files created throughout the development process. By keeping track...

TOUR DE NS2 REVEALING PROGRAMMING STYLE

TOUR DE NS2 REVEALING PROGRAMMING STYLE Friends, Today we are going to have a look in why we run ns2 program as "ns program.tcl"? Before that we have to go through basic C++ programmings in ns2.Consider a basic C++ instruction only program i .e for example; we are considering a program to calculate time taken for a packet travel from uppermost node to lower most node with the time taken to travel packet between each nodes (t) are constant (say t=1ms) and the number of nodes as n. (say n=10). And we have to find out overall time taken to reach packet to lowermost node. The C++ program new.cc is given below and after compiling we get a executable file " new ". //new.cc main(){ float time = 0 , t = 1; int i, n = 10;  for(i = 1; i < n; i++) time = time+i ; printf("Overall time is  %f seconds. ",time); } Now we execute the program from terminal, we can see the following results; >> ./new Overall time is 10.0 seconds. But this programming style is not ...