An Introduction to Network Simulator NS2 is a beginners’ guide for network simulator NS2, an open-source discrete event simulator designed mainly for networking research. NS2 has been widely accepted as a reliable simulation tool for computer communication networks both in academia and industry. This book will present two fundamental NS2 concepts:i) how objects (e.g., nodes, links, queues, etc.) are assembled to create a network and ii) how a packet flows from one object to another. Based on these concepts, this book will demonstrate through examples how new modules can be incorporated into NS2. The book will: -Give an overview on simulation and communication networks. -Provide general information (e.g., installation, key features, etc.) about NS2. -Demonstrate how to set up a simple network simulation scenario using Tcl scripting lanuage. -Explain how C and OTcl (Object oriented Tcl) are linked, and constitute NS2. -Show how Ns2 interprets a Tcl Script and executes it. -Suggest post simulation processing approaches and identify their pros and cons. -Present a number of NS2 extension examples. -Discuss how to incorporate MATLAB into NS2.