Hi All, Our website moved to a new URL. Please bookmark the new link: https://ns2bloggers.blogspot.com/

NETWORK ANIMATOR [NAM]

NAM is a Tcl/TK based animation tool for viewing network simulation traces and real world packet traces. It supports topology layout, packet level animation, and various data inspection tools.It has a graphical interface, which can provide information such as number of packets drops at each link.The network animator "NAM'' began in 1990 as a simple tool for animating packet trace data.Nam began at LBL. It has evolved substantially over the past few years. The NAM development effort was an ongoing collaboration with the VINT project. Currently, it is being developed as an open source project hosted at Sourceforge.

This trace data is typically derived as output from a network simulator like ns or from real network measurements, e.g., using tcpdump.

We can either start NAM with the command 
                                                       
                                                            'nam <nam-file>'

where '<nam-file>' is the name of a NAM trace file that was generated by NS or one can execute it directly out of the Tcl simulation script for visualization of node movement.

NAM window is showed on the following figure;



We can use NAM in network simulation by creating nam trace file and after that executing the nam trace file on TCL script.

SYNTAX:

To create a nam trace file
  
                                set nf [open trace.nam w]
                                $ns namtrace-all $nf

which means we are opening a new nam trace file named as "trace" and also telling that data must be stored in nam format.

"nf" is the file handler that we are used here to handle the trace file.

"w" means write i.e the file trace.nam is opened for writing.

The second line tells the simulator to trace each packet on every link in the topology and for that we give file handler nf for the simulator ns.


To execute a nam file

                                proc finish {} {
                                global ns nf
                                $ns flush-trace
                                close $nf
                                exec nam trace.nam &
                                exit 0
                                }

In here the trace data is flushed into the file by using command $ns flush-trace and then file is closed.Then,execution of nam file is done by using following command.

Animated Network in NAM

program to launch NAM window:


#at start of the programn
set x 500
set y 500
set n 30
set ns [new Simulator]
set f0 [open wir7.tr w]
$ns trace-all $f0
$ns use-newtrace
set namtracefd [open wir7.nam w]
$ns namtrace-all-wireless $namtracefd $x $y

#at end of the program
$ns at 10.0 "stop"
proc stop {} {
    global ns f0 namtracefd
    $ns flush-trace
    close $f0
    close $namtracefd
exec nam wir7.nam &
exit 0
}
#Run the simulation
$ns run


EXTENDED NETWORK ANIMATOR

The Extended Nam Editor is an editor that allows the graphical creation of ns2 scripts. It extends the basic Nam Editor with the following features:

  • Integration with existing topology generators
  • Localization and visualization of set of nodes on large network topologies according to different selection criteria;
  • Instantiation of agents of any types on all the nodes of a given node set;
  • Definition of new node types;
  • Support for simulations of web cache systems.

The Extended Nam Editor work under Linux operating system; it is available for download in links given on the bottom of page.

TOPOLOGY GENERATOR INTERFACE

The manual generation of complex Network Topology is a tedious and error prone activity. In order to simulate networks with realistic topologies, it is a common practice to use ad-hoc topology generators, whose output is usually not compatible with the ns2 syntax. Hence, several tools have been developed to translate topology descriptions generated by topology generators in ns-scripts that can be used in the definition of a simulation scenario. Unfortunately, scripts produced in this way are not compatible with the Nam Editor, hence networks created by common topology generators cannot be modified interactively. Such a limitation is sometimes annoying, in particular when the automatically generated topology needs to be further adapted, e.g. by instantiating agents on particular network nodes.

Our extended Nam-Editor provides a graphical interface to:

  1. GT-ITM topology generator;
  2. INET topology generator;

It is now possible to create, visualize and modify topologies created according to the following topology models:

  1. flat-itm;
  2. hierarchical-itm;
  3. transit-stub-itm;
  4. INET;

In order to integrate the above mentioned topology generators in Nam-Editor, our tool not only provides the generators with the required input parameters, but it also translates the generated topology description in the Nam-Editor internal representation of a network. To create a new network topology the user must:
                                                                Fig. 1: Topology Generation

  1. select a generation method from the generator list(Fig.1). 
  2. click the "Topology Generation" button(Fig.1).
  3. fill in a generator-specific input masks, in order to provide the selected generator with the required parameters (see fig. 2).
  4. click the "Create Topology" button (see fig.2).

                                                              Fig. 2: Parameter mask

Node Set Tool

Localization of a network agent in a simulation scenario is a two steps process, which requires:

  • the localization of the node in which the agent must be instantiated;
  • the instantiation of the agent.

To support agent instantiation in large topologies we have included in the extended Nam-Editor the concept of Node Set.
A Node Set is a set of nodes selected according to one of the following criteria:

  • leaf node;
  • mutual distance;
  • randomly.

When a network topology is created with one of the supported topology generators, a few Node Sets are automatically created, reflecting the topology model. For instance, in the case of a transit-stub topology, a Node Set is associated to each transit domain and to each stub domain. With the Node Set Tool it is possible to (see fig. 3):

  1. visualize all the nodes included in a given set;
  2. associate a color to all the nodes included in a given set;
  3. instantiate an agent on all the nodes of a given set;
  4. instantiate a Web Server on all the nodes of a given set (See Web Tool);
  5. instantiate a Web Client on all the node of a given set (See Web Tool);
  6. instantiate a Web Cache on all the node of a given set (See Web Tool);

                                                                Fig. 3: Node Set Tool

Editor Configuration

The ns2 is an extensible network simulator.
New protocols can be simulated through the definition of a new Agent type.
Likewise, particular network scenarios may require the definition of new Node types.
The GUI of our Extended Nam Editor can be customized to:

  • add an user-defined agent to the agent list;
  • customize the parameters of a user-defined agent;
  • define new node type and its parameters;
  • associate a particular node type to any node.

To create a new agent type (or a new node type) the user must:

  • select the "Configure Editor" entry from the Edit menu;
  • click the "Define New Agent" button (see fig. 4);
  • fill in the new agent mask and click the "Continue" button (see fig. 4);

                                                               Fig. 4: New Agent mask


  • define the Name and the Default value for any agent parameter (see fig. 5);
  • click the "Continue" button (see fig. 5).

                                                       Fig 5: New Agent Parameter mask

Once the previous steps have been completed, the new agent type is permanently included in the agent list.

Web Tool

A special support as been provided in our Extended Nam Editor for simulating web cache systems. A proper tool (see fig. 6) can be used to create web-page pools and to deploy system of caches, servers and clients onto a previously generated topology.

                                                                  Fig. 6: Web Tool

The configuration of any web element is made through a configuration window (see fig. 7); for the meaning of the parameters included in this window please refer to the ns Manual.
                                               Fig. 7: Configuration window for web client

Install instructions

If you start from the source distribution:

  1. cd to your ns-allinone
  2. remove the nam-1.0a11 directory (rm -rf nam-1.0a11)
  3. expand the ext-nam-1.0a11.tar.gz archive (tar xzvf ext-nam-1.0a11.tar.gz)
  4. cd nam-1.0a11
  5. build the extended nam editor (./configure; make clean; make)

If you start from the binary distribution:

  1. expand the ext-nam-1.0a11.gz file (gunzip ext-nam-1.0a11.gz);
  2. put the nam binary in your path.
For DOWNLOAD,click:
                                        1. For binary distribution
                                        2. For source distribution             
freshersvoice

5 comments :

  1. What is source distribution and binary distribution? Do i need to use extended NAM for design of new routing protocol?

    ReplyDelete
  2. Replies
    1. https://drive.google.com/file/d/0B6aQ8IUEyp5NNlg4ajEwT2g3elk/edit?resourcekey=0-gg65cMtoRFvikVIyJcecJA

      Delete
    2. https://drive.google.com/file/d/0B6aQ8IUEyp5NcVRiR0RJc211ZkU/edit?resourcekey=0-G73mDMu4qoanNdn_g94BLw

      Delete