1 / 10

Including Your Modules into NS 2

Including Your Modules into NS 2. by Teerawat Issariyakul http://www.ns2ultimate.com March 2010. Assumptions and Objectives. You have developed NS2 modules in one or more of the following 3 file types: What you would like to do is to incorporate these files into NS2. Key step.

chaim
Télécharger la présentation

Including Your Modules into NS 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Including Your Modules into NS 2 by TeerawatIssariyakul http://www.ns2ultimate.com March 2010 http://www.ns2ultimate.com

  2. Assumptions and Objectives • You have developed NS2 modules in one or more of the following 3 file types: • What you would like to do is to incorporate these files into NS2 http://www.ns2ultimate.com

  3. Key step • Go to your ns home directory (e.g., nsallinone-2.35-RC3/ns-2.35). • Look for a file called “Makefile”. • Use your favorite editor to edit the file (I will explain the details in the next slides). • Run “make” at the command prompt under your ns home directory. • You’re done. You should be able to invoke your new modules defined in .cc, .h, and .tcl from the NS prompt. http://www.ns2ultimate.com

  4. Modifying Makefile • There are three places in Makefileyou will have to modify • OBJ_CC • NS_TCL_LIB • INCLUDE • Suppose your new module are • Stored in files myfile.h, myfile.cc, and myfile.tcl • Stored under directory nsallinone-2.35-RC3/ns-2.35/myDir http://www.ns2ultimate.com

  5. 1. C++ Modules • Add “myDir/myfile.o\” to any line following this line OBJ_CC = \ • Note: • The extension must be “.o”, not “.cc” nor “.h” • “.o” is an object file obtained by compiling “.cc” and “.h”

  6. 1. C++ Modules: Example http://www.ns2ultimate.com

  7. 2. Tcl Modules • Add “myDir/myfile.tcl\” to any line following this line NS_TCL_LIB = \

  8. 3. Including Directory (Optional) • Add “-I./myDir\” to any line following this line INCLUDES = \ • This will include myDir into the compiling path. So that you don’t need to type the full path every time.

  9. Final step • Just run “ make ” at the command prompt • Done!!

  10. For more information about NS 2 Please see chapter 2 in this book from Springer T. Issaraiyakul and E. Hossain, “Introduction to Network Simulator NS2”, Springer 2009 http://www.ns2ultimate.com

More Related