An insight into the architecture of NS2
NS2 is primarily designed on two languages: C++ and Objectoriented Tool Command Language (OTCL). C++ is used for GefiQLQg the LQteUQDOV RI 1S2 whLOe 2TC/ LV XVeG tR FRQtURO the simulation as well as to schedule discrete events. C++ and OTCL are linked together using TCLCL. After the linking of C++ member variables to OTCL object variables by using the bLQG PePbeU IXQFtLRQ, C++ vDULDbOeV FDQ be PRGLfieG thURXgh OTCL directly. The main drawbacks of this approach are that the user has to know C++ as well as OTCL, and the debugging RI VLPXODtLRQV beFRPeV PRUe GLIfiFXOt.
After simulation, NS2 outputs either text-based or animation-based simulation results. To interpret these results graphically and interactively, tools such as NAM and Xdraph are used, which are explained in the next section. To analyse some particular behaviour of the network, extract a relevant subset of the text-based data and transform it into a more understandable presentation. The basic architecture is shown in Figure 1, pictorially.