//
archives

Network Simulators

Network Simulators has written 47 posts for Network Simulators

Fairness measure in wireless networks

Jain’s fairness index: rates the fairness of a set of values where there are n users and xi is the throughput for the i th connection. The result ranges from 1/n (worst case) to 1 (best case), and it is maximum when all users receive the same allocation. This index is k/n when k users … Continue reading

AWK Scripts to calculate throughput in NS2

Explanation of new trace format in NS2

The new trace format as seen above can be can be divided into the following fields : Event type In the traces above, the first field (as in the older trace format) describes the type of event taking place at the node and can be one of the four types: s send r receive d … Continue reading

CSS-OLSR – Code for simulations

CSS-OLSR is a Cooperative Security Scheme for the OLSR protocol. A basic version of this security scheme was published in the IST Mobile and Wireless Communications Summit 2006 (check here). In this page we provide the code (based on UM-OLSR) which was used to perform simulations of the proposed security scheme. We also present a … Continue reading

Packet-level Peer-to-Peer Simulation Framework and GnutellaSim

GnutellaSim is a scalable packet-level Gnutella simulator that enables the complete evaluation of the Gnutella system with a detailed network model. GnutellaSim is based on a framework we designed for packet-level peer-to-peer system simulation , which features functional isolation and a protocol- centric structure, among other characteristics. The framework is designed to be extensible to … Continue reading

Tools for Peer-to-Peer Network Simulation

IRTF P2PRG A. Brown Internet Draft Stirling Expires: July 26, 2006 M. Kolberg Stirling January 27, 2006 Tools for Peer-to-Peer Network Simulation draft-irtf-p2prg-core-simulators-00.txt Status of this Memo By submitting this Internet-Draft, each author represents that any applicable patent or other IPR claims of which he or she is aware have been or will be disclosed, … Continue reading

Source code for MANET IDS

Description: The source is available for use in the Public Domain under the General GPL (C) UMBC. Please refer to the license terms in the source code. The tarball contains the full source code and documentation for an intrusion detection system we have developed for Mobile ad hoc networks. The zipped tarball also contains libpcap … Continue reading

Analysis of 802.11 MAC code in NS-2

0. MAC in ns-2 LAN is within Berkeley Architecture, WLAN cannot create with “newLan” command Ethernet could be created as a LAN with common bandwidth and delay. 1. The general structure of MAC related sourcecode: mac.cc, mac.h MAC class is derived from Bi-Connector class. Local Variables: pktTx_ pktRx_ Macstate_ : index_ : mac address Basic … Continue reading

TCP over a 4 nodes ad-hoc network with TORA routing protocol

TCP over a 3 nodes ad-hoc network with TORA routing protocol

TCP over a 3 nodes ad-hoc network with DSR routing protocol

TCP over a 3 nodes ad-hoc network with DSDV routing protocol

TCP over a 3 nodes ad-hoc network with AODV routing protocol

NO Ad-Hoc Routing Agent (NOAH)

NOAH is a wireless routing agent that (in contrast to DSDV, DSR, …) only supports direct communication between wireless nodes or between base stations and mobile nodes in case Mobile IP is used. This allows to simulate scenarios where multi-hop wireless routing is undesired. NOAH does not send any routing related packets. It has been … Continue reading

Routing protocol in ns2: AODV, DSR, DSDV, DumbAgent

In 802.11 wireless LAN with ad hoc mode, there is no message routing. Any two nodes communicate directly –> You use DumbAgent (instead of AODV, DSR, DSDV,…) as the network layer protocol when no routing is required in your test scenario – this is when you need to calculate MAC layer performance:

Different transmission speeds and queue length in 802.11

Different transmission speeds in 802.11

Test hidden terminal in 802.11

Test transmission range in 802.11

Understand IEEE 802.11 MAC Standard

Undesrstanding Carrier Sense & Back Off: Consider the following two questions about IEEE 802.11 Standard: Carrier Sense is provided by the physical layer, thus, when MAC layer get a packet to transmit. It will initiate a carrier sense mechanism, and it took >= DIFS time to determine that the channel is free, thus, at least … Continue reading

Interfaces of Wireless MAC in ns-2

General Architecture of a mobile node in ns-2:   the relationship of MAC could be found in ns-mobilenode.tcl. The source code: Actually, from top to down path, the structure is  ll  —>  ifq —-> mac —> netif . for packets going up, it is netif —> mac —>ll. Thus, ifq is only used for down … Continue reading

Headers and Addresses in ns-2

Notice that by default, all packet headers are included. A diagram:   Common-header: Access method: What’s in common header (refer to ./common/packet.h) ch->ptype() : protocl type. e.g. PT_DSR shows this is a signaling message for DSR protocol, not a normal DATA packet ch->size(); ch->direction() : Up or Down ch->uid() ch->iface(): Interface ch->next_hop(): next hop for … Continue reading

Wireless Simulation Scenarios in ns-2

1. Node Movement and Topology Generation Instead of specifying and control each nodes’ position and movement pattern, we use a CMU tool “setdest” to generate large number of nodes and there movements. The tool use a random waypoint model. setdest Setdest tool is used to generate the positions of nodes and their moving speed and … Continue reading

Running Wireless Simulations in ns2

In this section, you are going to learn to use the mobile wireless simulation model available in ns. The section consists of two parts. In the first subsection, we discuss how to create and run a simple 2-node wireless network simulation. In second subsection, we will extend our example (in subsection 1) to create a … Continue reading

Simulating LANs with ns-2

Experiment Specific Instructions To analyze the given problem you have to write a Tcl script and simulate with ns2 Begin by specifying the trace files and the nam files to be created Define a finish procedure Determine and create the nodes that will be used to create the topology. Here in our experiment we are … Continue reading

Traffic generation in ns-2

Traffic generation is described in Chapter 32 of the ns Manual. Some extracts: Applications objects An application object may be of two types, a traffic generator or a simulated application. Traffic generator objects generate traffic and can be of four types, namely, exponential, pareto, CBR and traffic trace. Application/Traffic/Exponential objects Exponential traffic objects generate On/Off … Continue reading

Perl program for computing the throughput

Trace file format in ns2

The format of a trace file generated by the simulation follow the sequence below: The first field is the event type. It can have the values “r”, “+”, “-”, ”d” for “received”, “queue”, “dequeue”, and “dropped” and “r”, “s”, “f”, “D” for “received”, “sent”, “forward”, and “dropped” respectively; The second field gives the time at … Continue reading

How to analyze your trace file through a perl script

Let’s run the test tcl script and show how to analyze. The trace file “out.tr” is obtained by running ns2 with the script ns2/tcl/ex/wireless.tcl, and you can analyze it with this Perl script “analysis.pl“. out.tr:

Create both TCP and UDP traffic, use nam to show animation and TCP variable tracing, use nam graph to show TCP sequence plot

Apply RED queuing disciplines, plot queue statistics with xgraph

Create TCP connection on simple topology, use nam to show animation

Using xgraph to create bar and line graphs

(1) In an xgraph data file list some number of data sets (one per curve). A data set contains an ordered pair of X Y coordinates, each point on a separate line.  The name of the data set can be specified by a line beginning with a double quote.  Here is some sample data for … Continue reading

Creating Output Files for Xgraph

[Source: http://www.isi.edu/nsnam/ns/tutorial/nsscript4.html%5D One part of the ns-allinone package is ‘xgraph’, a plotting program which can be used to create graphic representations of simulation results. In this section, I will show you a simple way how you can create output files in your Tcl scripts which can be used as data sets for xgraph. On the … Continue reading

Trace Analysis Utilities

Here is a collection of trace analysis utilities that have been useful: Much parsing is easy if you can extract columns. Here is a helper-perl utility called “column” that breaks a text output into columns, separated by whitespace. It is used by many of the scripts below. Here is a simple perl called stats.pl script … Continue reading

Trace Analysis Example

This section shows a trace analysis example. Example 4 is the same OTcl script as the one in the “Simple Simulation Example” section with a few lines added to open a trace file and write traces to it. For the network topology it generates and the simulation scenario, refer to Figure 4 in the “Simple … Continue reading

Packet

A NS packet is composed of a stack of headers, and an optional data space (see Figure 12). As briefly mentioned in the “Simple Simulation Example” section, a packet header format is initialized when a Simulator object is created, where a stack of all registered (or possibly useable) headers, such as the common header that … Continue reading

Network Components

This section talks about the NS components, mostly compound network components. Figure 6 shows a partial OTcl class hierarchy of NS, which will help understanding the basic network components. For a complete NS class hierarchy, visit http://www-sop.inria.fr/rodeo/personnel/Antoine.Clerget/ns. Figure 6. Class Hierarchy (Partial) The root of the hierarchy is the TclObject class that is the superclass … Continue reading

Event Scheduler

This section talks about the discrete event schedulers of NS. As described in the Overview section, the main users of an event scheduler are network components that simulate packet-handling delay or that need timers. Figure 5 shows each network object using an event scheduler. Note that a network object that issues an event is the … Continue reading

Simple Simulation Example

This section shows a simple NS simulation script and explains what each line does. Example 3 is an OTcl script that creates the simple network configuration and runs the simulation scenario in Figure 4. To run this simulation, download “ns-simple.tcl” and type “ns ns-simple.tcl” at your shell prompt. Figure 4. A Simple Network Topology and … Continue reading

OTcl: The User Language

As mentioned in the overview section, NS is basically an OTcl interpreter with network simulation object libraries. It is very useful to know how to program in OTcl to use NS. This section shows an example Tcl and OTcl script, from which one can get the basic idea of programming in OTcl. These examples are … Continue reading

What is ns-2?

NS is an event driven network simulator developed at UC Berkeley that simulates variety of IP networks. It implements network protocols such as TCP and UPD, traffic source behavior such as FTP, Telnet, Web, CBR and VBR, router queue management mechanism such as Drop Tail, RED and CBQ, routing algorithms such as Dijkstra, and more. … Continue reading

Install some packages before installing ns-2

Attention: before you install ns-2 , be sure that you have installed following packages: tcl8.4 tk8.4 tcl8.4-dev tk8.4-dev I found that NS-2 all-in-one package is lack of the check to Xmu library when install NAM. The “configure” script of NAM doesn’t check Xmu library but can generate the “makefile”. Thus, you assume that everything is … Continue reading

Installing the Network Simulator NS2 on Ubuntu/Debian

Source: http://wiki.splitbrain.org/ns2 Note For the wget commands below get the correct download URLs from the sites linked at http://www.isi.edu/nsnam/ns/ns-build.html#pieces In the following I will download and unpack all needed sources to a directory named ns2install $> mkdir ns2install $> cd ns2install Debian Libraries Beside the usual stuff for compiling programs like gcc, g++ and make … Continue reading

Install ns2.26 in Ubuntu

Objective: install ns-allinone-2.26 in Ubuntu 5.10 Breezy Software needed: gcc-3.3, g++-3.3 (ns2.26 cannot be compiled with gcc >= 4.0), build-essential, autoconf, automaken, libxt-dev (tk need it), libxmu-dev (nam need it) To do: 1. apt-get install build-essential 2. apt-get install gcc-3.3 g++-3.3 autoconf automake-1.9 libxt-dev 3. go to /usr/bin, del softlink to gcc, g++ 4. ln … Continue reading

How to install ns-2 onto Ubuntu Linux

Get the allinone source. $ cd ~myname $ wget http://www.isi.edu/nsnam/dist/ns-allinone-2.28.tar.gz Modify build for GDB debugger. $ tar xzf ns-allinone-2.28.tar.gz $ cd ns-allinone-2.28 $ vim install Add the –enable-symbols option on line 408 so, ./configure –enable-gcc –disable-shared –prefix=$CUR_PATH || die “tcl8.3.2 configuration failed! Exiting …” becomes, ./configure –-enable-symbols –enable-gcc –disable-shared –prefix=$CUR_PATH || die “tcl8.3.2 configuration failed! … Continue reading

Download and install NS-2 on RedHat

Download ns-2.27 from: http://www.isi.edu/nsnam/dist/ns-allinone-2.27.tar.gz To install ns 2.27 in Red hat, there are following steps: 1. tar -xzf * 2. ./install change .bash_profile and add some environment variables. put /home/ns-allinone-2.27/bin:/home/ns-allinone-2.27/tcl8.4.5/unix:/home/ns-allinone-2.27/tk8.4.5/unix into your PATH environment; so that you’ll be able to run itm/tclsh/wish/xgraph. IMPORTANT NOTICES: You MUST put /home/ns-allinone-2.27/otcl-1.8, /home/ns-allinone-2.27/lib, into your LD_LIBRARY_PATH environment variable. If … Continue reading