INSIGNIA NS-2 Source Code

 

1. Hardware and Software Requirements

The INSIGNIA simulation environment requires the ns-2 simulator and the CMU Monarch extensions (version 1.1.2). We gratefully acknowledge the use of the CMU code which allows users to run INSIGNIA with the DSR, AODV and TORA routing protocols included in the CMU extensions.

The ns-2 simulator is runs under Unix (e.g., FreeBSD, Linux, SunOS, Solaris) and Windows environments. Simple scenarios run on any reasonable machine, but very large scenarios benefit from large amounts of memory. 

To install the ns-2 simulator, you need a computer and a C++ compiler.

 

2. Installing INSIGNIA Simulation

1.       Download and Install the ns-2 simulator from http://www-mash.cs.berkeley.edu/ns/.

2.       Download and Install the CMU Monarch extensions (cmu-extendedns-1.1.2.tar.gz) to ns-2 simulator from http://www.monarch.cs.cmu.edu/cmu-ns.html.

3.       Download INSIGNIA insignia.tar.gz and unpack it in the ns-src/cmu/ directory. (ns-src represents the CMU Monarch ns source tree.) :

tar xvfz insignia.tar.gz

The following files should be visible:

                        ns-src/cmu/insignia/insignia.cc

                        ns-src/cmu/insignia/insignia.h

                        ns-src/cmu/insignia/insignia.tcl

                        ns-src/cmu/insignia/run.tcl

                        ns-src/cmu/insignia/mobile-node.tcl

                        ns-src/cmu/insignia/aodv.tcl

                        ns-src/cmu/insignia/dsr.tcl

                        ns-src/cmu/insignia/tora.tcl

                        ns-src/cmu/insignia/scen-60p

                        ns-src/cmu/insignia/cbr-20-512-0.1

                        ns-src/cmu/priqueue.cc  (replaces existing priqueue.cc)

                        ns-src/cmu/priqueue.h    (replaces exsiting priqueue.h)

 

4.       Modify the following files as instructed below

a)    The   ns-src/Makefile

 

Add insignia.o to the list of object files for CMU Monarch extensions as follows:

OBJ_CMU = \

                             cmu/channel.o cmu/ll.o cmu/mac.o cmu/modulation.o     \

                             cmu/ntr-workload.o cmu/adhockey-slaver.o     \

                                   cmu/insignia/insignia.o     \

 

b)      The ns-src/packet.h file

Add a new definition for PT_INSIGNIA as following:

 

#define PT_TCP                 0

#define PT_NTRWKLD      24

#define PT_INSIGNIA       25

#define PT_NTYPE             26

                  /* PT_NAMES must be same numerical order as above */

                  #define PT_NAMES tcp, telnet, ntrwkld, insignia

 

c)   The ns-src/tcl/lib/ns-packet.tcl file

Add an entry for the INSIGNIA header offset as following:

            Foreach pair {

                                     { Common off_cmn_ }

                                                ...

                                    { INSIGNIA off_insignia_ }

        }

d)   The ns-src/ip.h file

Add one of the IP header fields called tos_ (type of service) and define it's content as following:

 

#define   BE                     0

            #define   RES                   1

            #define   RPT                   2

 

            struct hdr_ip {

                        /*common to IPv{4, 6} */

                        nsaddr_t                    src_;

                        nsaddr_t                    dst_;

                        int                    ttl_;

                        int                    tos_;

}

 

5.     Build simulator.  Go to ns-src/ directory and compile:

 

$make depend

$make

 

3. Running INSIGNIA Simulation Environment

To run INSIGNIA simulator, go to ns-src/ directory and run simulation example described below:  

./ns cmu/insignia/run.tcl -rp cmu/insignia/dsr.tcl -sc cmu/insignia/scen-60p -x 1500 -y 300 -cp cmu/insignia/cbr-20-512-0.1  -stop 300 -tr result/out.tr  -ins cmu/insignia/insignia.tcl -ins_dir result/

This example script runs ns using the DSR routing protocol (-rp) for scenario: (-sc) 1500m (-x) by 300m (-y) simulation network size with communication pattern (-cp). This example simulation will runs for 300 seconds (-stop) and produces an output trace file out.tr (-tr).

The parameters -ins and -ins_dir represent the INSIGNIA simulation configuration. The script file insignia.tcl specifies INSIGNIA options such as bandwidth requirements, adaptation policy for INSIGNIA flows. The INSIGNIA trace files will be written to the directory result/ (-ins_dir). The insignia.tcl file represents an example configuration file which users can build other scenarios from by following the instructions provided in the file.

 

4. Simulator Description

4.1      Mobile Node

Figure 1 illustrates the basic schematic layout of a CMU mobile node with the INSIGNIA module added. The INSIGNIA module runs on all mobile nodes in the system. The INSIGNIA module is located between the entry point and the classifier (addr demux) as shown below.

 

Figure:  Schematic of the CMU mobile node with INSIGNIA

4.2        Source Code at a Glance  

File Name

Type

Description

insignia.cc

C++ code

INSIGNIA module for every mobile node

insignia.h

header file

header file for INSIGNIA module

run.tcl

tcl code

main configuration of the simulator

mobilenode.tcl

tcl code

configuration of mobile node

aodv.tcl

tcl code

configuration of aodv routing agent

dsr.tcl

tcl code

configuration of dsr routing agent

tora.tcl

tcl code

configuration of tora routing agent

 

        This page is maintained by   INSIGNIA Project Team.