grafovi

download grafovi

of 248

  • date post

    04-Oct-2014
  • Category

    Documents

  • view

    134
  • download

    0

Embed Size (px)

Transcript of grafovi

The Protocol Developer Manual for the NCTUns 6.0 Network Simulator and Emulator

Authors:Prof. Shie-Yuan Wang Chih-Liang Chou, Chih-Che Lin, and Chih-Hua Huang

Last update date: January 15, 2010Produced and maintained by Network and System Laboratory, Department of Computer Science, National Chiao Tung University, Taiwan

Table of ContentsChapter 1 Overview ..................................................................... 11. Development History ............................................................................................. 1 1.1 Introduction .......................................................................................................... 2 1.2 Overview of the Components of NCTUns........................................................... 3 1.3 Simulation Network Description File (.tcl) ......................................................... 4

Chapter 2 Adding a New Module .............................................. 242.1 Register a New Module with the Simulation Engine......................................... 24 2.2 Register a New Module with the GUI Node Editor ........................................... 26 2.3 An Example of Adding a New Module .............................................................. 34 2.4 Run a Simulation Case without the Use of the GUI .......................................... 39 2.5 Formats and Usages of Simulation Description Files ........................................ 54

Chapter 3 High-level Architecture of NCTUns ......................... 703.1 Simulation Methodology ................................................................................... 71 3.2 Job Dispatcher and Coordinator......................................................................... 73 3.3 Simulation Engine Design ................................................................................. 74 3.4 Kernel Modifications ......................................................................................... 78 3.5 Discrete Event Simulation ................................................................................. 80

Chapter 4 Simulation Engine S.E ........................................... 814.1 Architecture of the Simulation Engine ............................................................... 81 4.2 Event .................................................................................................................. 82 4.3 Scheduler............................................................................................................ 94 4.4 Dispatcher .......................................................................................................... 97 4.5 Module Manager ................................................................................................ 98 4.6 Script Interpreter .............................................................................................. 101 4.7 The NCTUns APIs ........................................................................................... 104

Chapter 5 Module-Based Platform .......................................... 1055.1 Introduction ...................................................................................................... 105 5.2 Module Framework .......................................................................................... 107 5.3 Module Communication (M.C) ....................................................................... 116

Chapter 6 NCTUns Simulation Engine APIs .......................... 1202

6.1 Timer APIs ....................................................................................................... 120 6.2 Packet APIs ...................................................................................................... 123 6.3 NCTUns APIs .................................................................................................. 136 6.4 Packet Transmission/Reception Log Mechanism ............................................ 155

Chapter 7 Tactical and Active Mobile Ad hoc Networks ........ 1577.1 Introduction ...................................................................................................... 157 7.2 Tactical MANET Simulation ........................................................................... 158 7.3 Design Principles ............................................................................................. 162 7.4 Design and Implementation ............................................................................. 163 7.5 Writing a Tactical Agent .................................................................................. 167 7.6 Tactical MANET API Functions ...................................................................... 169 7.7 Five Examples .................................................................................................. 189

Chapter 8 IEEE 802.16(d) WiMAX Networks........................ 2268.1 Introduction ...................................................................................................... 226 8.2 Protocol Stacks of IEEE 802.16 Network Nodes ............................................ 227 8.3 Simulation Description File for IEEE 802.16 Networks ................................. 232

Chapter 9 Multi-interface Mobile Node .................................. 2369.1 Introduction ...................................................................................................... 236 9.2 The Design of the Multi-interface Network Node ........................................... 237 9.3 Exploiting Multiple Heterogeneous Network Interfaces ................................. 240 9.4 Simulation Description File for the Multi-Interface Network Node ............... 241

Reference ................................................................................. 244

3

Chapter 1 Overview1. Development HistoryThe NCTUns network simulator and emulator (NCTUns) is a high-fidelity and extensible network simulator capable of simulating various devices and protocols used in both wired and wireless networks. Its core technology is based on the kernel-reentering simulation methodology invented by Prof. S.Y. Wang at Harvard University in 1999 when Wang was pursuing his Ph.D. degree. Due to this novel methodology, NCTUns provides many unique advantages that cannot be easily achieved by traditional network simulator such as OPNET Modeler and ns-2. The predecessor of NCTUns is the Harvard network simulator, which Wang authored in 1999. As feedback about the Harvard network simulator came back, it was found that the Harvard network simulator had several limitations and drawbacks that need to be overcome and solved, and some important features and functions need to be implemented and added to it. For these reasons, after joining National Chiao Tung University (NCTU), Taiwan in February 2000, Prof. S.Y. Wang has been leading his students to develop NCTUns since then. NCTUns removes many limitations and drawbacks in the Harvard network simulator. It uses a distributed architecture to support remote simulations and concurrent simulations. It uses an open-system architecture to enable protocol modules to be easily added to the simulator. In addition, it has a highly-integrated GUI environment for editing a network topology, specifying network traffic, plotting performance curves, configuring the protocol stack used inside a network node, and playing back animations of logged packet transfers. To make NCTUns run simulations quickly, Prof. S.Y. Wang invented an approach to combine the discrete event simulation methodology and the kernel-reentering simulation methodology. The Harvard network simulator used a time-stepped method to implement its simulation engine. As a result, its simulation speed is low. In contrast, using this approach, NCTUns can generate high-fidelity simulation results at high speeds when the network traffic load is not heavy. NCTUns was first released to the networking community on November 1, 2002. Its web site is set up at http://NSL.csie.nctu.edu.tw/nctuns.html. As of January 12, 2010, according to the download user database, 16,246 people from 137 countries1

have registered at the web site and downloaded it, and these numbers are still growing. Initially, NCTUns was developed for the FreeBSD operating system. As the Linux operating system is getting popular, NCTUns now only supports the Linux operating system. Specifically, the version of Linux distribution that NCTUns 6.0 currently supports is Red Hats Fedora 12 with kernel version 2.6.31.6. Although officially NCTUns only supports Fedora distribution, it is possible to port it to other Linux distributions such as Debian or Ubuntu. This is because all Linux distributions use the same Linux kernel and they differ only in system configurations and settings. Some advanced Linux users have successfully ported NCTUns to other Linux distributions and show people how to do it on their web sites.

1.1 IntroductionNCTUns is a software tool that integrates user-level processes, operating system kernel, and the user-level simulation engine into a cooperative network simulation system. This manual aims to provide knowledge about NCTUns to help researchers develop their own protocol modules on top of NCTUns. The formats of various simulation-related files are explained in this document. These simulation-related files are used to specify and describe a complete simulation case. Normally, these files are automatically generated by the GUI program of NCTUns without bothering the user to manually creating them. However, sometimes it may be needed (or useful) for a developer to create or modify these files manually. The rest of this document is organized as follows. In Chapter 1 and Chapter 2, we explain and show the detailed procedures for developing a protocol module, registering it wit