Contributed Code

From nsnam
(Redirected from Contributed code)
Jump to: navigation, search

Main Page - Roadmap - User Information - Developer Information - Projects - Contributing - Links

This wiki page contains pointers to ns code that is maintained by users and that has not been incorporated into the ns distributions. Please contact code authors for details about these modules; we don't maintain them and may not have tried them out.


  • "Implementing a New Manet Unicast Routing Protocol in NS2" gathers authors' own experience in implementing MANET routing protocols for NS2, in the hope it could be useful for those who want to write their own routing protocol. You can get a copy of this document or view it online at this page:
  • "Adding Multiple Interface Support in NS-2". In this document (in the format of a howto) the authors try to address all the changes that are needed on ns-2 (both TCL and C++) so as to be able to extend it to support multiple interfaces. A copy of that document can be obtained in the following page.
  • Mubashir Husain Rehmani has written "A Tutorial on the Implementation of Ad-Hoc On Demand Distance Vector Routing (AODV) in NS-2". This document presents the implementation of AODV Protocol in NS2 and it is targeted to novice users who wants to understand the implemenation of AODV Protocol in NS2. It can be obtained from [1] OR [2].
  • Zeeshan Ali Khan has written "A Tutorial on Broadcasting Packets over Multiple-Channels in a Multi-Inferface Network Setting in NS-2". This document explains the implementation of multi-channel multi-interface setting provided by CRCN patch in NS2 and it is targeted to novice users who wants to understand the implementation. It can be obtained from [3].


  • AODV+. AODV+ is an extension of the well-known AODV ad hoc routing protocol. It allows ns-2 users to simulate wired-cum-wireless scenarios, e.g., wireless Mobile Ad Hoc Networks (MANETs) connected to the wired Internet. The code has been developed by Ali Hamidian at Lund University (Sweden) and should work with all versions of ns-2.
  • nsclick. In short, nsclick is the Click Modular Router embedded inside of the ns-2 network simulator. With minor modifications, a Click routing graph may run both on an actual system as well as under ns-2.
  • AODV-UU is an AODV (Ad hoc On-demand Distance Vector) routing protocol implementation from Uppsala University. Key features are recent draft compliance, stability, and the ability to use it in both real-world (Linux) and ns-2 simulations.
  • AOMDV is an AOMDV (Ad hoc On-demand Multipath Distance Vector) routing protocol implementation from DIET @ University of Naples "Federico II". Contributed by Marcello Caleffi
  • An implementation of the IS-IS Routing Protocol for ns-2.1b8a. Contributed by [ Kristian Svensson]
  • Dynamic Linkstate Routing protocol package developed by Mingzhou Sun[Deprecated] can be downloaded from rtProtoLS page [Deprecated]. The Linkstate Routing protocol works in parallel with the DV routing protocol implemented in the ns-2 distribution. For more info on the implementation refer to the webpage above or email Mingzhou Sun.
  • An implementation of the DYMO routing protocol. The new 0.2 release is highly compliant with the latest spec (draft-03). This version includes support for the avoidance of unidirectional links when the S-bit of the DYMO header is set within the control messages. More info on DYMOUM website.
  • An OLSR implementation (UM-OLSR 0.8.8) has been released. It comes with a better default configuration and some improvements in the memory management. More info on UM-OLSR website
  • An implementation of the AntNet routing algorithm on ns-2.28. Contributed by Lavina Jain
  • Two variants of DSR, that try to increase the lifetime of a battery powered MANET, by choosing paths with more aggregate residual energy, and/or stop using nodes whose residual energy reaches a certain threshold, in order to let them "live", and transmit their own packets, for a longer time. Inside the .zip file there are graphs and a report showing the results of some simulations, comparing traditional DSR with the two new variants. Contributed by Salvo Danilo Giuffrida.

Wireless and Mobility

  1. New 802.11 support
    • Description: The existing 802.11 support in ns-2 is disapointing for a number of reasons. We have thus started a project to develop a new 802.11 module for ns-2 with support for:
      • ET/SNRT/BER-based PHY models
      • 802.11a multirate
      • 802.11e HCCA and EDCA
    • Distributed as: Full ns-2 snapshot.
    • Location:
  2. An IEEE 802.11e EDCA and CFB Simulation Model for ns-2
  3. NS-2 Emulation Extension (optimized for wireless networks)
    • Author: Daniel Mahrenholz, Svilen Ivanov
    • Description: This extension enables ns-2 to emulate wireless networks -- the emulation of wired networks is improved. External nodes can run inside a User-Mode-Linux environment or on external hosts. This extension includes several performace improvements and splits ns-2 into a real-time priority simulator core and a low-priority logging thread for in-memory trace file cacheing and compression. Example scripts and helper files can be found an the external project web site. More information can be found on the tutorial page.
    • Tested with: ns-2.27, ns-2.28, ns-2.29 (i386, amd64)
    • Distributed as: Patch
    • Location:
  4. An IEEE 802.11e HCCA module for ns-2
    • Author: Computer Networking Group at the University of Pisa, please contact us at
    • Description:: This extension allows for a flexible integration of different scheduling algorithms with the MAC. Specifically, the 802.11e sub-system consists of three modules: a classifier, which is used to tag incoming packets from transport agents with the appropriate Traffic stream Identifier (TID); a HCCA scheduler, which is used at both the QoS Access Point (QAP) and the QoS Stations (QSTAs) to manage downstream HCCA packets according to the QoS parameters of their traffic stream; a modified MAC module, which extends the legacy 802.11 MAC class. Currently, the only HCCA scheduler included is the 'Sample scheduler' described in the IEEE 802.11e (app. K).
    • Tested with: ns-2.27, ns-2.29
    • Distributed as: patch
    • Location:
  5. An IEEE 802.16 model for ns-2
    • Author: Seamless and Secure Mobility Project at NIST
    • Description:: Major features for this WiMax model include TDD and OFDM for the MAC and PHY layer respectively. Additional MAC layer functionality such as network entry, flow management, scheduling, mobility extension (IEEE 802.16e), and support for media independent handovers (IEEE 802.21) are also supported. Key configuration parameters for the module consist of frequency bandwidth, frame duration, burst modulation, channel, contention size, and scanning attributes. Performance statistics include packet loss, delay, jitter, and throughput.
    • Tested with: unspecified
    • Distributed as: download
    • Location: Project web page.
  6. An IEEE 802.16 model for ns-2 MIRACLE Framework
    • Author: Computer Science, Karlstad University DISCO group
    • Description:: The standard NS2 implementation does not provide a modular structure to create multihomed nodes. The NS-MIRACLE (Multi InteRfAce Cross Layer Extension for NS) library introduces this support. The goal of this project is to create a WiMAX module that can be plugged into the NS-MIRACLE framework to create multi-homed nodes supporting WiMax. With this NS2MiracleWimax module it is easily possible to create nodes with dual WiMax/WiFi or WiMax/UMTS stack. The WiMAX module which was used to be adapted to fit the Miracle framework was based on the NIST WiMax Module.
    • Tested with: unspecified
    • Distributed as: Patch, downloadable from SourceForge
    • Location: NS2MiracleWimax.
  7. An impulse-radio ultra-wide band (IR-UWB) model for ns-2
    • Description:: This code is a modification and extension of ns-2 to support impulse radio UWB wireless networking. The two main components that are added to the plain ns-2 is the DCC-MAC layer and a model of an impulse radio UWB physical layer assuming time-hopping, pulse position modulation and convolutional code for channel coding. As such, concurrent transmissions are possible thanks to the use of time-hopping. Our physical layer computes the packet error rate for each packet based on a bit error rate (BER) computation. The BER is calculated with lookup tables that map a signal to interference and noise ratio (SINR) to the BER. We also add a propagation model for UWB channels.
    • Tested with: ns-2.29, ns-2.26 (obsolete though)
    • Distributed as: full ns-2 snapshot
    • Location: NS-2 Ultra Wide-Band (UWB) MAC and PHY simulator.
  8. TDMA DAMA satellite support
    • Author: Raffaello Secchi
    • Description: MFTDMA-DAMA is a set of NS-2 modules for detailed simulation of DVB-RCS(2). The simulator is based on the existing NS-2 framework for geostationary transparent and regenerative satellite scenarios. The simulation framework aims to providing a good level of detail RCS(2) medium access control. The simulator supports ATM, Mpeg-2 and RLE encapsulation methods. Superframe configuration is also possible.The signalling, the capacity request format and TBTP format comply with the standard.
    • Tested with: ns-2.34
    • Distributed as: tarball
    • Location: h
  9. new IEEE802.11 PHY+MAC design and implementation
    • Author: Qi Chen, Felix Schmidt-Eisenrohl, Daniel Jiang
    • Description: A completely revised architecture and design for the WirelessPHY and MAC802_11 modules. The resulting PHY is a full featured generic module able to support any single channel frame-based communications (i.e. it is also able to support non-IEEE 802.11 based MAC). The key features include cumulative SINR computation, preamble and PLCP header processing and capture, and frame body capture. The MAC accurately models the basic IEEE 802.11 CSMA/CA mechanism, as required for credible simulation studies. The newly designed MAC models transmission and reception coordination, backoff management and channel state monitoring in a structured and modular manner. In turn, the contributions of this code make extending the MAC for protocol researches much easier and provide for a significantly higher level of simulation accuracy.
    • Tested with: ns-2.31
    • Distributed as: patch
    • Location: the source code will be downloadable in the following days.
    • Documentation:
  10. IEEE 802.16 Wireless Mesh Networks in ns-2
    • Author: Computer Networking Group at the University of Pisa and Broadband Wireless Networking Laboratory at the Georgia Tech. Please contact us at
    • Description: This extension allows the simulation of IEEE 802.16e Wireless Mesh Networks with ns-2. No support to the Point-to-Multipoint mode is included. The functions for enabling data transmission at the MAC layer are fully implemented. Access to the data sub-frame is negotiated by means of the three-way handshake specified by the standard, while scheduling is implemented according to the Fair End-to-end Bandwidth Access (FEBA) algorithm described in a technical paper presented at INFOCOM 2006. Access to the control sub-frame is implemented according to the standard distributed election procedure described in a tutorial manner here. Note that the MAC is not inter-operable with ns-2 routing algorithms and physical interference modules. Instead, base classes for routing and wireless channel modeling are provided, for which reference implementations are provided: Shortest-Path-First and Protocol-Model, respectively.
    • Tested with: ns-2.31, ns-2.33
    • Distributed as: patch to ns-2.31 and ns-2.33
    • Location:
  11. Extensions to 3G Communication networks
    • Author: Team of Research Unit 6, Computer Technology Institute and Press "Diophantus" (CTI) and University of Patras, Greece
    • Description: We have developed the following mechanisms: 1) A multicast packet forwarding mechanism for UMTS supporting join/leave requests as well as handover and relocation procedures 2) Two mechanisms (PGMCC and TFMCC) for adaptive multicast data transmission of MBMS services in UMTS. In all mechanisms, the Eurane UMTS extensions for ns-2 are needed.
    • Tested with: ns-2.28
    • Distributed as: source tarball
    • Location:
  12. ns-2 Wimax model
    • Author: Computer Networks Laboratory of the University of Campinas
    • Description: This project implements a WiMAX module based on the IEEE 802.16 standard for the ns-2 simulator, release 2.28. The focus of this implementation is the MAC layer and its mechanisms for bandwidth allocation and QoS support. The module implements the 802.16 five service flow types and their bandwidth request/grant mechanisms; moreover, it allows users to configure the QoS requirements of applications. Service flows are modeled by finite sate machines that capture how each service type react to different events. This module supports TDD mode and PMP topology. The wireless channel available in the ns-2 simulator is used. The module design was based on a module ( designed to simulate the DOCSIS standard. Although code reuse was possible, several modifications in the DOCSIS module code were necessary to make it compliant to the IEEE 802.16 standard.
    • Tested with: ns-allinone-2.28
    • Distributed as: source code
    • Location:
  13. ns-2 Cognitive Radio Network model
    • Author: Jing Zhong
    • Description: This cognitive radio cognitive network (CRCN) simulator is a software based network simulator for network-level simulations. It is based on open-source NS-2 (network simulator 2). CRCN simulator supports performance evaluations for the proposed dynamic spectrum resource allocation, power control algorithms, and the adaptive Cognitive Radio (CR) networking protocols including the CR MAC and the CR Routing protocols. This simulator uses NS-2 to generate realistic traffic and topology patterns. For each node in this simulator, a reconfigurable multi-radio multi-channel PHY layer is available by customizing the spectrum parameters such as transmission power, propagation and etc.
    • Tested with:
    • Distributed as: source code
    • Location:
  14. UCBT Bluetooth for ns-2
  15. SUNSET (underwater networking)
  • A wireless channel model for the simulation of Vehicle-to-Vehicle communication using channel models derived from real-time measurements at 5.9 GHz for different road environments (Rural, Urban, Suburban). Code and documentation can be found at Contact Gerges Dib for details.
  • IEEE 802.15.4 extensions to ns-2.26 and 2.27 are now available. The code works with ns 2.26 and 2.27 and has been tested on Linux/Solaris/FreeBSD. There are README, test/demo scripts. Code is at Contact Jianliang Zheng for details.
  • IEEE 802.15.4 extensions to ns-2.26 and 2.27 are now available. The code works with ns 2.26 and 2.27 and has been tested on Linux/Solaris/FreeBSD. There are README, test/demo scripts. Code is at Contact Jianliang Zheng for details.
  • CANU Mobility Simulation Environment is a mobility generator tool. It is based on the meta-mobility model integrating a model of spatial environment, user trip sequences, and user movement dynamics. The spatial environment can be initialized from geographic sources in various formats (Geographic Data Files, Nexus Augmented World Modeling Language, etc.). The tool provides implementations of corresponding parsers. To simulate movement dynamics, the tool includes implementations of several models from physics. Additionally, it contains several random mobility models, like Random Waypoint Model or Brownian motion. More information can be found here.
  • EURANE (Enhanced UMTS radio access network extensions for ns-2), developed within the European Commission 5th framework project SEACORN can be accessed at their webpage here . The page has a download for the software in the form of a patchfile against the ns-2.26 release version. It also has a manual, example scripts and input tracefiles available from the same page.
  • Fan Bai, Narayanan Sadagopan and Ahmed Helmy contributed a mobility generator tool that is used to generate random waypoint, reference point group mobility, freeway and manhattan mobility models. Go to their IMPORTANT project webpage and look for Mobility Generator under the "software" section for downloading the generator software. The trace outputs from the generator may be used in ns-2. You should also find links to a manual for the tool and some ready-to-use movement trace files in the same place.
  • Pablo Martin and Paula Ballester contributed modules to support UTRAN/UMTS simulations. The main contributions are the implementation of two new nodes: UE and NodeB to simulate mobile nodes and base stations, new layers handling UTRAN protocols and functionalities, WCDMA and a new routing module. It is worth mentioning that the new routing module uses flat addressing (without attaching mobile nodes to any base station at the beginning of the simulation) and enables the system to update routing tables dynamically, thus any mobile node can move all over the topology. Source code, examples, and documentations can be found here. The version of ns UTRAN/UMTS is developed is 2.1b9a-gcc32 (all-in-one package).
  • BonnMotion:Java mobility scenario generator & analyser "BonnMotion"is a mobility scenario generator and analysis tool developed by the University of Bonn. It is available under the terms of the GPL. The software is able to create scenarios according to several mobility models and to analyse characteristics like connectedness or node degrees. The scenarios can also be converted to a format such that they can be used for simulations with ns-2. For more information please refer to the above webpage or contact Christian de Waal
  • Kunal Shah contributed an extension patch to NS-2.1b9a (allinone package) to simulate the basic behavior of mobile agents. It's based on very simple performance models of mobile agents described on some papers. Source code and README can be found here.
  • GPRS - General Packet Radio Service has been implemented by Richa Jain at IITB, India. The source code gprs-072501-2.1b7a.tar.gz which also includes a patch (against ns-2.1b7a), detailed docs and example script is now available for download.
    In the GSM/GPRS implentation, MobileStation (MS) - BaseStation(BS) interactions are dealt with so far. The focus is on handling of the radio resources and on the network stack ie the Link Layer (LL), the Radio Link Control (RLC) and the Medium Access Control (MAC) (channels, TDMA slot structure, pkt tx and rx, call set-up and handling, slot handling, collisions, error model, handling ARPS) operating between the MS and the BS.
  • Thierry Ernst has announced the release of the NS-2.1b6 enhancements to simulate Mobile IPv6 in large Wide-Area networks. This code has been developed by MOTOROLA Labs Paris and INRIA Rhone-Alpes PLANETE team.For information, and to download the code, please check for ns-2.1b6, or for ns-2.26, the tar file comprises:
    - Mobile IPv6 and simple IPv6 extensions needed by Mobile IPv6
    - A library to create, configure, and manipulate large topologies in a very easy manner (TOPOMAN)
    - A new translator from GT-ITM to NS-2 which output TOPOMAN procedure calls.
    - Embedded extensions to allow the simultaneous use of wireless features, mobility, and multicast.Mobile IPv6 is available, in two modes:
    1. Local mobility (i.e. within an administrative domain, i.e. within a bounded area)
    2. Global mobility (crossing administrative domains, i.e. moving from one side of the topology to another).Hierarchical Mobile IPv6 will later be included in the distribution and will be used to demonstrate global mobility.This code comes without guaranties and may have bugs. If you find some, please tell me and also include the patch if you have one. If you cannot download the code, please email me and tell me why, I will try to be helpful whenever possible, but I might always have the time to be very responsive. Any feedback about the code is also very much appreciated.
  • A BlueTooth extension to NS (version ns-2.1b8), called BlueHoc has been contributed by Apurva. The documentation and instructions on installing and using BlueHoc were at An article on the simulator is available at
    The details on BlueHoc's features can be found on the above site. The key issues addressed by the simulator are:
    • Device Discovery performance of Bluetooth
    • Connection Establishment and QoS negotiation.
    • Medium access control scheduling schemes.
    • Radio characteristics of Bluetooth system.
    • Statistical modeling of the indoor wireless channel.
    • Performance of TCP/IP based applications over Bluetooth.
    The following Bluetooth layers have been simulated:
    • Bluetooth radio.
    • Bluetooth baseband.
    • Link Manager Protocol.
    • Logical Link Control and Adapatation Protocol (L2CAP).
    The distribution contains Bluetooth modules and patches for ns-2.1b6. An updated BlueHoc for ns-2.1b7 is also available from the download page. Please report any installation problems on the site or directly by writing to the author.
  • IEEE 802.11 PCF support for ns-2.1b8, contributed by Anders Lindgren. The patch, along with a example script and README files are available at here. This module implements the PCF mode of the IEEE 802.11 standard for wireless LANs for the ns-2 network simulator. It allows a station to become Point Coordinator (PC), and let that node send beacons, initiate Contention Free Periods (CFPs), and poll other stations during these CFPs in order to give higher priorities to such stations.
  • IEEE 802.11 PSM support for ns-2.1b8a, contributed by Ronny Krashinsky. The patch is available at here. This module is meant to represent the IEEE 802.11 wireless LAN protocol for infrastructure (not ad-hoc) networks. The model can be configured to simulate the standard 802.11 PSM protocol, or the Bounded Slowdown (BSD) protocol.
  • The Columbia IP Micro-Mobility Suite (CIMS) is available at The suite includes an ns 2 extension for the following IP micro-mobility protocols:
    • Cellular IP (draft-ietf-mobileip-cellularip-00.txt)
    • HAWAII (draft-ietf-mobileip-hawaii-00.txt)
    • Hierarchical Mobile IP (draft-ietf-mobileip-reg-tunnel-04.txt)
    The Cellular IP implementation supports hard and semi-soft handoff, and IP paging. The Hawaii implementation supports Unicast Non-Forwarding (UNF) and Multiple Stream Forwarding (MSF) schemes. Hawaii's IP paging capability is currently not supported. In addition, the CIMS implementation of Hierarchical Mobile IP currently does not support IP paging. These and other features will be added in due course - we would be happy to add any extensions worked on by other groups to the next release of CIMS.
  • Mobility support for NS-2 including implementation of mobile IP, a mobility generator and a wireless channel model developed by Charlie Perkins etal is available atMobins2 page.
  • The CMU Monarch group has also made extensions to NS-2 to support mobilty including ability to simulate multi-hop wireless ad-hoc networks. For downloading the source code and for detailed documentation see CMU Monarch project page.
  • A patch improving ns-2 802.11 wireless support is available at Marco Fiore's webage. The patch introduces realistic channel propagation, concurrent multiple data transmission rates among stations and ARF mechanisms, has been tested with ns-2.29, and features the following contributions:
    • realistic channel propagation by Wu Xiuchao
    • ricean propagation model by Ratish J. Punnoose
    • SNOOPy calendar scheduler by David X. Wei
    • 802.11 bug fixes by Felix Schmidt-Eisenlohr
    • multiple data transmission rates support by Marco Fiore
    • Adaptive Auto Rate Fallback (AARF) by Marco Fiore.
  • A patch file and a patched package for 802.11 wireless LAN power management functions are avalable at Wireless LAN Power Management Extension for ns-2.
    • Implemented PS-mode STA and AP, support legacy power save functions, such as DTIM/PVB in beacon, PS-Poll, and so on. It is based on WLAN infrastructure mode implementation of ns-2.33.
    • Added sample script.
    • Fixed mac header size bug.
    • Set next_hop value to improve NAM behavior.


  • Lloyd Wood has maintained Perl scripts for parsing satellite trace files and displaying LEO satellite constellation configurations and traced packet routes on unprojected maps of the Earth.
  • Case Western Reserve University has made available Shaun Endres's scripts for integrating STK with ns-2.

web caching in manets and imanets

a ns2 patch for extending support for web caching in manets and imanets

mail to

Topology and Traffic Generation

  • PackMime is an HTTP connection-based traffic generator, developed jointly by UNC and Bell Labs. This generator is based on data gathered by and models developed by Bell Labs. The current implementation supports both HTTP 1.0 and HTTP 1.1.
  • DelayBox is an ns node developed by UNC that can add per-flow delays and/or drop packets based on a probability distribution. DelayBox can be used with either TcpAgent or FullTcpAgent.
  • NSWEB is an extension to ns-2 and provides support for persistent and pipelined HTTP connection as specified in HTTP/1.1 (RFC 2616), static allocation of Web pages and embedded objects, dynamic page popularities and a SURGE-like load model implementation. It has been implemented by Jörg Wallerich who has also created a nice webpage describing NSWEB. Go to for downloading the code and getting a detailed description of how NSWEB is implemented and works.
  • Video traffic generator based on TES (Transform Expand Sample) model of MPEG4 trace files, contributed by Ashraf Matrawy and Ioannis Lambadaris. It generates traffic that has the same first and second order statistics as an original MPEG4 trace. The code can be found here.
  • Ulrich Fiedler contributed a simple script that implements persistency and pipelining for http. The code can be found here.
  • MPEG Trace can be found here.
  • Stanford Graph Base (SGB) Topology Generators, contributed by Graham Phillips. The basic idea was to widen the range of real and artificial topologies that might be constructed. There are programs to construct star topologies, string topologies and n-ary trees, as well as conversion programs to convert between various topology formats (such as SGB, Tiers, and an adjacency format). Also included is a collection of real topologies. More documentation can be found at
  • Web traffic generator from Tom Henderson. and Emile Sahouria. Summary notes. This module is useful for generating background "Web-like" traffic. A more comprehensive model that extends this basic traffic generator has been added to the ns simulator (in tcl/http directory), but it has not yet been documented. This module is no longer actively supported.
  • BonnTraffic is a simulator and scenario independent, highly flexible, stand-alone traffic generator for linux/unix-platforms. It is designed for flexibility regarding the utilized simulators, the focused scenarios as well as the traffic-type and its characteristics. BonnTraffic provides, analog to ns2, an embedded OTcl interpreter to realize its tasks. BonnTraffic is licensed under the GPL and currently equipped with a well evaluated HTTP-model as well as a rudimentary SIP-module (VoIP).
  • NSG2 ns-2 Java-based scenario generator written by Peng-Jung Wu.

Differentiated Services

  • An updated version of the Nortel Networks Diffserv Model is available from here. (Note: it has been incorporated into ns distribution)
  • Sergio Andreozzi developed several improvements to the diffserv module in ns (release 2.1b8a), including enhanced marking functions, new schedulers (WFQ, WF2Q+, SCFQ, SFQ, LLQ), new policy (possibility to define a DSCP based rate limiter), and new monitoring possibilities. You can download the patch from here. A new version for NS 2.29 is available here
  • Ulrich Fiedler contributed a WFQ Scheduler for Nortel DiffServ. The code can be found here.* Weighted Fair Queueing (WFQ) for DiffServ, contributed by Rafa/l Wielicki, is available at here. It works with ns-2.1b8.
  • Andreas Alexelis, as a part of ACR group at Advanced Telecommunications Research, Japan has developed a distributed QoS network resource allocation scheme that applies a hierarchy of agents to do resource negotiation, admission control and policy adaptation, locally at domain level, over a diffserv capable network. The sourcecode can be found here.
  • DiffServ and Bandwidth Brokers functionality
    • Author: Team of Research Unit 6, Computer Technology Institute and Press "Diophantus" (CTI) and University of Patras, Greece
    • Description: The implementation includes a DiffServ framework (packet classification via DSCP, MDRR scheduling, shaping, realistic background traffic), several alternative models of Bandwidth Brokers and admission control algorithms. Running the source code requires ns version 2.26.
    • Tested with: ns-2.26
    • Distributed as: source tarball
    • Location:

Integrated Services

Scheduling and Queue Management

  • JoBS is a queuing discipline that provides quality-of-service (QoS) to traffic aggregates (i.e., traffic classes). JoBS combines buffer management and scheduling in a single algorithm. There is no admission control or traffic shaping involved. The objective of JoBS is to provide a queuing scheme that can enforce the aforementioned service guarantees on a PER-HOP basis, without requiring any communication between the participating hops.
    Instructions for downloading and installing the patches for ns-2 are available at: This includes C++ code, validation tests, updated documentation, and oTcl example scripts.
  • Weighted Fair Queueing (WFQ), a patch to the ns-2 source, contributed by Paolo Losi, is available here. This patch is extracted from changes added upon ns-allinone-2.1b4a. To install this WFQ patch to a later version, you will need to mannually place/modify the corresponding files.
  • Core-Stateless Fair Queueing (CSFQ) that consists of ns-2 source codes for CSFQ and Flow Random Early Drop (FRED), a Java front end for ns-2, that allows to design simple networks and simulate the following buffer management and scheduling disciplines: FIFO, RED, FRED, DRR, and CSFQ. The CSFQ code contributed by Ion Stoica is available at Ion's homepage.
  • RIO code for ns-2.1b6, ported by James Scott from Yun Wang's RIO code. A modified version of this code has been added to the NS distribution by Sally Floyd and Ratul Mahajan on July 7, 2000. The validation test can be run with the command "./test-all-rio" in tcl/test.
  • BLUE: an active queue management algorithm, and Stochastic Fair BLUE (SFB: a BLUE extension for enforcing fairness among flows through Bloom filters) have been ported for ns2.1b8 by Sunil Thulasidasan
    Related papers:
    • W. Feng, D. Kandlur, D. Saha, K. Shin. "Blue: A New Class of Active Queue Management Algorithms". U. Michigan. pdf | ps.Z.
    • W. Feng, D. Kandlur, D. Saha, K. Shin. "Stochastic Fair Blue: A Queue Management Algorithm for Enforcing Fairness", in Proc. of INFOCOM 2001, April 2001. pdf.
  • CoDel patch for ns-2.35: Controlled Delay (CoDel) is a simple AQM mechanism developed by Kathleen Nichols and Van Jacobson. CoDel is parameterless and controls the delay, while insensitive to round-trip delays, link rates, and traffic loads. This patch is designed for ns-2.35. Instructions for downloading, installing the CoDel patch and trying the sample TCL codes are available at:
    Related paper/blog:
    • K. Nichols and V. Jacobson. "Controlling Queue Delay". ACM Queue, May 2012. pdf
    • Jim Gettys. "The Internet is Broken, and How to Fix It". June 2012. blog


  1. Codes
    • Author: Jon Crowcroft
    • Description: Codes used for simulation work in the following papers are available. The code is distributed under subdirectories called rlc, sot and multcp, each having {.cc,.h,.tcl} and README files.
      • [Differentiated End to End Internet Services using a Weighted Proportional Fair Sharing TCP]
      • [Network Adaptive Continuous-Media Applications Through Self Organised Transcoding ]
      • [TCP-like Congestion Control for Layered Multicast Data Transfer.]
      • An updated version of the rlc simulation code is now available.
    • Tested with: ns2.1b1 on HP-UX and Solaris.
    • Distributed as: tarball
    • Location:
  2. NORM
  3. PGM
  4. PGM
  5. PLM
  6. PUMA
    • Author: Sidney Doria
    • Description: PUMA is a multicast routing protocol for MANETs which outperforms MAODV and ODMRP. PUMA was designed by Ravindra Vaishampayan and J. J. Garcia-Luna-Aceves at UCSC.
    • Tested with: ns-2.33, and ns-2.34. Integrated to NS-2.35 source code.
    • Distributed as: Zip with instructions (2.33), Patch (2.34), or Integrated to NS (ns.2.35).
    • Location:
  7. SSM Extension
  8. IGMP Extension -- Beijing University of Posts and Telecommunications(BUPT), CHINA


  1. TCP Pacing
  2. DCCP
    • Author: Nils-Erik Mattsson, Sébastien Linck, Sidney Doria.
    • Description: DCCP for wired and wireless networks.
    • Tested with: NS-2.34; NS-2.35.
    • Distributed as: a patch to ns-2.34. Already integrated to NS-2.35.
    • Location:
  3. Linux TCP Congestion Control
    • Author: Xiaoliang (David) Wei
    • Description: The patch comes with 12 different congestion control algorithms from Linux-, including BIC, CUBIC, HighSpeed TCP, H-TCP, TCP-HYBLA, NewReno, Scalable TCP, Vegas, Westwood, TCP Veno, TCP Compound, TCP Low-Priority. It allows users to import new congestion control algorithms from source code of Linux congestion control modules.
    • Tested with: ns-2.29
    • Distributed as: patch
    • Location:
  4. Network Simulation Cradle
    • Author: Sam Jansen
    • Description: Allows TCP simulation using code from real network stacks such as Linux, FreeBSD and OpenBSD.
    • Tested with: ns-2.28, ns-2.29
    • Distributed as: patch and external build
    • Location:
  5. TCP Westwood
    • Author: Saverio Mascolo (
    • Description: TCP Westwood is a sender-side only modification of the TCP NewReno protocol based on end-to-end bandwidth estimation to set congestion window and slow start threshold after a congestion episode.
    • Tested with: ns2.1b9a
    • Distributed as: patch
    • Location:
  6. Extensions to NS-2 RTP code
    • Author: Team of Research Unit 6, Computer Technology Institute and Press "Diophantus" (CTI) and University of Patras, Greece
    • Description: In this work we extended the functionality of the RTP and RTCP code in NS2 to include: 1) Most of its feedback functions described in RFC 3550, and 2) TCP friendly behavior by the meaning that the transmitted flow consumes no more bandwidth than a TCP connection, which is traversing the same path with the transmitted flow.
    • Tested with: ns-2.30, ns-2.31
    • Distributed as: source tarball
    • Location:
  7. Freeze-TCP for ns-2
  8. Multipath TCP for ns-2
    • Author: Yoshifumi Nishida
    • Description: Implementation of new standard being developed in the IETF, to allow TCP to exploit multiple paths.
    • Tested with: ns-2.34
    • Distributed as: patch/module
    • Location:
  9. Data Center TCP (DCTCP) for ns-2
  10. TCP ex Machina for ns-2
  • The ns-2 patch and simulation scripts of SIMD (one instance of the stateful TCP congestion control algorithms proposed in the ICNP publication "TCP-friendly SIMD Congestion Control and Its Convergence Behavior". In Proceedings of ICNP'2001, Riverside, CA, November 2001.) are now available for downloading at
    Contributed by Liang Guo (
  • SCTP (Stream Control Transmission Protocol) has been contributed by a group at the University of Delaware. The first release of our SCTP module for ns-2 is now available for download. It currently supports the features in sections 6 and 7 of RFC2960 except:6.1 bi-directional data
    6.4 multi-homing
    6.8 checksum
    6.9 fragmentation
    7.3 path mtu discoveryWe are currently working on:
    - Full ns-2 Application Layer API support
    - Unreliable OptionFuture work includes support for:
    - Multihoming
    - Add/Delete IP OptionThe patch and readme are available from: Note: The SCTP code is now part of ns-2.29, and the old patch is out of date. Download ns-2.29 instead.
  • Poduri, K., and Nichols, K., Simulation Studies of Increased Initial TCP Window Size (Text, PDF), draft-tcpimpl-poduri-00.txt, February, 1998. These simulations model both long-lived TCP connections (file transfers) and short-lived web-browsing style connections. Simulation scripts: README file, tar file, compressed tar file. Additional files for modeling HTTP 1.1 (README file, tar file).
  • OTERS, a reliable multicast protocol that organizes receivers into a fusion tree that matches the multicast delivery tree of the source and uses this tree to fuse NAKs and subcast retransmissions from Stanford University. The source code, as well as a README, is available at here. An ICNP'98 paper discussing this protocol is also available from Stanford DSG group.
  • MFTP ("Multicast File Transfer Protocol") package, including documentation, installation instructions and an example script. Note: Link is not working anymore. Also, MFTP seems to dead since the demise of Starburst, the creator of MFTP.

Delay Tolerant Networking (DTN)

  • DTN Agent for ns-2
    • Author: Dimitris Vardalis <>
    • Description: a basic version of a DTN Agent implementing the Bundle Protocol. The agent sits on top of the TCP layer and for now it assumes a static network topology. It deals with issues such as bundle fragmentation, retransmission, custody reporting, and basic routing.
    • Tested with: No specific version of ns-2 is specified.
    • Download:

Application Layer

  • SIP
    • A SIP module for NS 2.27, developed by Rui Prior, is available for download here.
    • A port of an older SIP module from NIST to NS 2.27 may also be download from that page.
  • The U.S. Naval Research Laboratory's ns-2 contributed code
    • The ITD division of NRL has contributed a number of packages that facilitate the use of real-world application code in ns-2. Among these are Protolib, an abstraction library that allows applications to run in both ns-2 and user-space, and Agentj, which allows one to run Java applications in ns-2
  • NSIS - Communication Network Lab of SIE BUPT,CHINA
    • Author: Yu Ke <>
    • Description: NSIS (Next Steps In Signaling) is a modular framework developed at the IETF NSIS working group. It provides means to establish and manage network control state along a data path between two nodes communicating on the Internet.This NSIS module was developed for creating signaling state and implementing one of the NSLP applications - "gist ping".
    • Tested with: ns-2.29
    • Download:
    • Release updatesupport NAT/FW QoS Mobile IPv6
    • Download:
  • ns2voip - User-level Performance Evaluation of VoIP Using ns-2
    • Author: Computer Networking Group at the University of Pisa .
    • Description: An extension to carry out reliable performance evaluation studies with Voice over IP (VoIP) traffic in ns-2. For information/comments contact us.
    • Tested with: ns-2.31
    • Download: The website is located here, where the ns2voip can be download as a patch file to ns-2.31


  1. simd - Simulation Replication Management/Framework
    • Author: Sam Jansen
    • Description: Manages replicating simulation runs across multiple machines. Each machine performs one or more runs of a simulation with a set of parameters. Has been used with up to 100 machines to simulate a scenario with greater than 100,000 replications taking multiple weeks. A central server allows aggregation of results, controlling of client simulations, viewing data, etc. Client simulations automatically obtain the most up to date simulation script.
    • Tested with: ns-2.28, ns-2.29
    • Distributed as: Python program and PHP web frontend (optional)
    • Location:
  2. ns2measure - An integrated framework for enabling effective data collection and statistical analysis
    • Authors: Computer Networking Group at the University of Pisa, Italy
    • Description: The framework consists of two complementary contributions: a set of C++ modules, which allow a flexible and efficient data collection, and a software framework, fully integrated with ns2, which performs all the operations required to carry out simulation experiments in a statistically sound way. For information/comments contact ns2measure. NOTE: the framework has been recently enhanced, check the new features on the website.
    • Tested with: ns-2.28, ns-2.29, ns-2.30, ns-2.31
    • Distributed as: patch
    • Location:
  3. ns-2/akaroa-2 - MRIP simulation controller
    • Authors: The ns-2/akaroa-2 project
    • Description: Uses Akaroa2 simulation manager to provide credibility of results from quantitative stochastic simulation using automated sequential analysis to ns2, using multiple replications in parallel on a cluster of workstations.
    • Tested with: ns-2.27, ns-2.28, ns-2.29
    • Distributed as: patch
    • Location:
  4. Yavista - Yet Another Toolset to Visualize the Simulator Activity
    • Authors: The Yavista Team (Pole Phare/University of Paris 6/France & Cristal Laboratory/ENSI/Tunisia)
    • Description: YAVISTA is a visualization tool making the debugging and the understanding of the MANET simulators' 802.11 MAC layer easier thanks to a timeline representation. It works with NS-2 and Glomosim.
    • Tested with: ns-2.29, ns-2.30, Glomosim-2.03
    • Distributed as: patch & application
    • Location:
  5. ANSWER - Automated ns-2 Workflow Manager
    • Author: Matteo Andreozzi
    • Description: Framework for defining large simulation scenarios, controlling the execution of large numbers of runs, and managing output data analysis.
    • Distributed as: Two scripts
    • Location:
  • nam supports scenario generation with built-in Nam Editor(check the nam menu), but the object deletion action in Nam Editor will cause "Segmentation Fault". This article gives the solution. (a bug in nam1.13 and older versions)
  • Trace graph (NS trace file analyser) has been contributed by Jaroslaw Malek and is available for download from For any problems with trace graph please contact Jaroslaw.
  • Huginn, a visualizer for wireless ns2 traces, announced by Matthias Transier. Huginn is capable of reading native new/old trace format and visualizing it in 3D. It is highly adaptable to varying user demands. Huginn is available for various Linux distributions. For more information check
  • An improved implementation of multi-state error model by Jianping Pan (has been incorporated into ns distribution).
  • MultiState Error Model from Edison Hsu
    The contributed code is in the form of tarred diff files (diffs.tar). A README file for instructions on patching in the diffs and some examples using the model is to added here very soon.
  • Eric Weigle added support for 64 bit integers in the scheduler for compiliers that support it. (has been incorporated into ns distribution)
  • Evan Jones has compiled a number of tools for drawing and generating wireless networks, and for parsing simulation output.
  • David Harrison of RPI has contributed an ns-2 graphing and statistics package. The graph package provides a set of graph classes and statistics gathering functions. The graph package has been used by several RPI undergraduate networking courses, and includes a number of standard classes such as cwnd versus time, red queue versus time, etc.
  1. XAV - A Tracing Framework for Exploring Large Network Simulation Outputs
    • Authors: The Yavista Team (Pole Phare/University of Paris 6/France, Cristal Laboratory/ENSI/Tunisia & ESPRIT/Tunisia)
    • Description: XAV is a subproject of Yavista which allows real time exploration of the NS-2 trace files by optimizing database access.
    • Tested with: ns-2.30
    • Distributed as: patch
    • Location:


  1. Greencloud: The green cloud simulator
  2. GEA: A unified protocol development library
  3. Extensions to TFRC code for Power Management
    • Author: Team of Research Unit 6, Computer Technology Institute and Press "Diophantus" (CTI) and University of Patras, Greece
    • Description: The code implements modifications so that when the channel characteristics increase packet drop (which can result to important reduction of multimedia quality in the end user), the transmission power is adjusted, so that packets are received by the end user properly.
    • Tested with: ns-2.30
    • Distributed as: source tarball
    • Location:
  4. Extensions to TFRC code to use SNR
    • Author: Team of Research Unit 6, Computer Technology Institute and Press "Diophantus" (CTI) and University of Patras, Greece
    • Description: The code implements modifications to the existing TFRC and Evalvid Rate Adaptive implementations in ns-2.34, so that they can use SNR information from the physical layer. More specifically two major modifications were applied: a) TFRC feedback handling algorithm, and b) Packets' structure in order to be able to retrieve and store the SNR information that is provided by the physical and MAC layers of ns-2.
    • Tested with: ns-2.34
    • Distributed as: source tarball
    • Location:
  • The Pathchirp available bandwidth tool was developed at Rice university and can found here
  • Vincenzo Liberatore developed an agent (Agent/Plant) to simulate networked control systems, i.e., the interconnection of sensors, controllers, and actuators. For example, sensor data is sent to a controller, which can coordinate remote robots or other actuation units. The code was developed on ns2.1b9a.
  • Active network support for ns (developed on ns2.1b8a) is contributed by Prof. Rima Kilany at [ the Saint-Joseph University]. Please find the source files as well as the directions for installing and running here. Active network support for ns, where code is executed at the reception of capsules (a capsule is an active packet because it holds a reference to the code to be executed at the node). Code is downloaded from the previous node on demand, and is cached on the node for later use by other arriving capsules of the same type.It works much like the ANTS toolkit (MIT), with demand loading support and caching at the node. An active ANS-2 node is built in conformity to the DARPA model, where a node has its NodeOS, and can support many Execution environments and Active Applications.
  • Active Networking support for NS-2 including the creation of Active Agents with basic functionality (initialization and disabling). developed by the PANAMA project is available atPANAMA homepage .
  • An implementation of R. Ludwig's Eifel-Algorithm for Linux kernel 2.2.10 an d NS2. Please click here for details. More information can also be found here (seems to be removed, but it is achived here)

Windows support

Contributed Code to ns-1

  • BLUE: A New Class of Active Queue Management Algorithms, by W. Feng from U. Michigan. The ns-1.1 modifications for implementing Blue and Stochastic Fair Blue is available here. There is also a related paper ( .ps.Z and .pdf).