Tuesday, February 10, 2015

Problem in loading the designer in Visual Studio 2013

The following figure shows the problem of loading the designer in visual studio 2013.


                                 


The solution for this is updating the graphics driver to the latest version.This worked for me and the application will run fine after the driver update.


                      



Sunday, February 8, 2015

Working with NS2

  • First of all, you need to create a simulator object. This is done with the command
                                      set ns [new Simulator]

  •  Now we open a file for writing that is going to be used for the nam trace data.

                                     set nf [open out.nam w]

                                     $ns namtrace-all $nf

 The first line opens the file 'out.nam' for writing and gives it the file handle 'nf'. In the second line we tell the simulator object that we created above to write all simulation data that is going to be relevant for nam into this file.

  • The next step is to add a 'finish' procedure that closes the trace file and starts nam.

                                         proc finish {} {

                                         global ns nf

                                         $ns flush-trace

                                         close $nf

                                         exec nam out.nam &

                                         exit 0 }

  • The next line tells the simulator object to execute the 'finish' procedure after 5.0 seconds of simulation time
                                          $ns at 5.0 "finish"

 We probably understand what this line does just by looking at it. NS provides us with a very simple way to schedule events with the 'at' command.

  • The last line finally starts the simulation
                                           $ns run

LINKS


For transmitting packets from one node to another node there should be a link between them.

SIMPLEX LINK

 Ns provides the instance procedure simplex-link to form a unidirectional link from one node to another. The link is in the class Simplex Link. The following describes the syntax of the Simplex link.

           $ns simplex-link <node0> <node1> <bandwidth> <delay> <queue type>

 The command creates a link from <node0> to <node1>, with specified <bandwidth> and <delay> characteristics.

Queue type : The type of queue used in the link. Default value is DropTail.

Bandwidth : Link bandwidth in bits per second.

Delay : Link propagation delay in seconds.

DUPLEX LINK


  The following is the syntax for duplex link between nodes.

              $ns_ duplex-link <node1> <node2> <bw> <delay> <q type> <args>

This creates a bi-directional link between node1 and node2. This procedure essentially creates a duplex-link from two simplex links, one from node1 to node2 and the other from node2 to node1.

bw : Link bandwidth in bits per second.

delay : Link propagation delay in seconds.

qtype : The link uses a queue type of <q type> and depending on the queue type different arguments are passed through <args>. Default qtype is value is DropTail.

AGENTS


Agents represent endpoints where network-layer packets are constructed or consumed, and are used in the implementation of protocols at various layers.

There are two major types of TCP agents: one-way agents and a two- way agent. One-way agents are further subdivided into a set of TCP senders (which obey different congestion and error control techniques) and receivers (“sinks”). The two-way agent is symmetric in the sense that it represents both a sender and receiver. It is still under development.

The one-way TCP sending agents currently supported are:

• Agent/TCP - a “tahoe” TCP sender

• Agent/TCP/Reno - a “Reno” TCP sender

• Agent/TCP/Newreno - Reno with a modification

• Agent/TCP/Sack1 - TCP with selective repeat (follows RFC2018)

• Agent/TCP/Vegas - TCP Vegas

• Agent/TCP/Fack - Reno TCP with “forward acknowledgment”

• Agent/TCP/Linux - a TCP sender with SACK support that runs TCP congestion control modules from Linux kernel

The one-way TCP receiving agents currently supported are:

• Agent/TCPSink - TCP sink with one ACK per packet

• Agent/TCPSink/DelAck - TCP sink with configurable delay per ACK

• Agent/TCPSink/Sack1 - selective ACK sink (follows RFC2018)

• Agent/TCPSink/Sack1/DelAck - Sack1 with DelAck


TWO NODES, ONE LINK


Two nodes 'n0' and 'n1'.The next line connects the two nodes. In this section we are going to define a very simple topology with two nodes that are connected by a link. The following two lines define the two nodes. (Note: We have to insert the code in this section before the line '$ns run', or even better, before the line '$ns at 5.0 "finish"').

                                          set n0 [$ns node]

                                          set n1 [$ns node]


 A new node object is created with the command '$ns node'. The above code creates two nodes and assigns them

                                 $ns duplex-link $n0 $n1 1Mb 10ms DropTail

This line tells the simulator object to connect the nodes n0 and n1 with a duplex link with the bandwidth 1Megabit, a delay of 10ms and a DropTail queue.



                                   

                                                        A simple link


 SENDING DATA


The next step is to send some data from node n0 to node n1. In ns, data is always being sent from one 'agent' to another. So the next step is to create an agent object that sends data from node n0, and another agent object that receives the data on node n1.

Create a UDP agent and attach it to node n0

                              set udp0 [new Agent/UDP]

                              $ns attach-agent $n0 $udp0

Create a CBR traffic source and attach it to udp0

                              set cbr0 [new Application/Traffic/CBR]

                              $cbr0 set packetSize_ 500

                              $cbr0 set interval_ 0.005

                              $cbr0 attach-agent $udp0

These lines create a UDP agent and attach it to the node n0, then attach a CBR traffic generator to the UDP agent. CBR stands for 'constant bit rate'. The packetSize is being set to 500 bytes and a packet will be sent every 0.005 seconds (i.e. 200 packets per second). The next lines create a Null agent which acts as traffic sink and attach it to node n1.

                              set null0 [new Agent/Null]

                              $ns attach-agent $n1 $null0

Now the two agents have to be connected with each other.

                              $ns connect $udp0 $null0

And now we have to tell the CBR agent when to send data and when to stop sending. Note: It's probably best to put the following lines just before the line

                              $ns at 5.0 "finish"'.

                              $ns at 0.5 "$cbr0 start"

                              $ns at 4.5 "$cbr0 stop"

Now we can save the file and start the simulation again. When we click on the 'play' button in the nam window, we will see that after 0.5 simulation seconds, node 0 starts sending data packets to node 1. We might want to slow nam down then with the 'Step' slider.


                     . 

                                       

                                     Data routing between nodes




Saturday, February 7, 2015

Introduction to NS2 (Network Simulator 2)


Network Simulator (Version 2), widely known as NS2, is simply an event driven simulation tool that has proved useful in studying the dynamic nature of communication networks. Simulation of wired as well as wireless network functions and protocols (e.g., routing algorithms, TCP, UDP) can be done usingNS2. In general, NS2 provides users with a way of specifying such network protocols and simulating their corresponding behaviors. Since its inception in 1989, NS2 has continuously gained tremendous interest from industry, academia, and government.

Having been under constant investigation enhancement and for years, NS2 now contains modules for numerous network components such as routing, transport layer protocol, application, etc. To investigate network performance, researchers can simply use an easy-to-use scripting language to configure a network, and observe results generated by NS2. Undoubtedly, NS2 has become the most widely used open source network simulator, and one of the most widely used network simulators.

Unfortunately, most research needs simulation modules which are beyond the scope of the built-in NS2 modules. Incorporating these modules into NS2 requires profound understanding of NS2 architecture.


Architecture of NS2

As shown in fig 1.8 NS2 architecture consists of Tcl, NS2 Shell Executable Command, NAM and Xgraph

                     

                                           Architecture of NS2

 TCL

Tcl (originally from Tool Command Language, but conventionally spelled “Tcl” rather than “TCL”, pronounced as “tickle” or “tee-see-ell”) is a scripting language created by John Ousterhout. Originally “born out of frustration”, according to the author, with programmers devising their own languages intended to be embedded into applications, Tcl gained acceptance on its own. It is commonly used for rapid prototyping, scripted applications, GUIs and testing.


Tcl is used on embedded systems platforms, both in its full form and in several other small-footprint versions. The combination of Tcl and the Tk GUI toolkit is referred to as Tcl/Tk.


NS2 shell executable command

We run Tcl script files in command prompt in NS2.The procedure is as follows.

To Run TCL files in NS2

1. Install NS2 and set the path.
2. After Installing NS2, go the $prompt and run ns filename for example, ns
tcp.tcl (if the file name is tcp.tcl)
3. After the previous statement automatically the .nam and .tr files will be created in the same (Nam means Network Animator and tr means Trace file).
4. To see the demo in GUI, run nam tcp.nam (a window will be opened and you can click the run button)
5. .tr file is actual file helpful to see the performance factors like (throughput, packet drop, etc.). You can parse the .tr file using software’s like tracegraph202 or Xgraph


Nam

Nam is a Tcl/TK based animation tool for viewing network simulation traces and real world packet trace data. The design theory behind nam was to create an animator that is able to read large animation data sets and be extensible enough so that it could be used in different network visualization situations. Under this constraint nam was designed to read simple animation event commands from a large trace file. In order to handle large animation data sets a minimum amount of information is kept in memory.

Event commands are kept in the file and reread from the file whenever necessary. The first step to use nam is to produce the trace file. The trace file contains topology information, e.g., nodes, links, as well as packet traces. Usually, the trace file is generated by NS. During an ns simulation, user can produce topology configurations, layout information, and packet traces using tracing events in NS.

However any application can generate a nam trace file. When the trace file is generated, it is ready to be animated by nam. Upon startup, nam will read the trace file, create topology, pop up a window, do layout if necessary, and then pause at time 0. Through its user interface, nam provides control over many aspects of animation. These functionalities will be described in detail in the USER INTERFACE section. After compiling tcl script file, nam console and nam window as shown in the figures will be automatically opened.


                         

                                                     NAM console



                      

                                                     NAM window



Xgraph


The Xgraph program draws a graph on an X display given data read from either data files or from standard input if no files are specified. It can display up to 64 independent data sets using different colors and/or line styles for each set. It annotates the graph with a title, axis labels, grid lines or tick marks, grid labels, and a legend.

There are options to control the appearance of most components of the graph. A data set consists of an ordered list of points for the “directive X Y”. For directive “draw”, a line will be drawn between the previous point and the current point. “Draw” is the default directive. The name of a data set can be specified by enclosing the name in double quotes. Overall graphing options for the graph can be specified in data files by writing lines of the form “<option> : <value>”. The interface used to specify the size and location of this window depends on the window manager currently in use once the window has been opened, all of the data sets will be displayed graphically with a legend in the upper right corner of the screen. Xgraph also presents three control buttons in the upper left corner of each window: Hardcopy, Close and About. Figure explains Xgraph.


                       

                                               A sample Xgraph


Main NS2 Simulation Steps



The followings show the three key step guideline in defining a simulation scenario in a NS2:

Step 1: Simulation Design

The first step in simulating a network is to design the simulation. In this step, the users should determine the simulation purposes, network configuration and assumptions, the performance measures, and the type of expected results.


Step 2: Configuring and Running Simulation

This step implements the design in the first step. It consists of two phases:

• Network configuration phase: In this phase network components (e.g., node, TCP and UDP) are created and configured according to the simulation design. Also, the events such as data transfer are scheduled to start at a certain time.

• Simulation Phase: This phase starts the simulation which was configured in the Network Configuration Phase. It maintains the simulation clock and executes events chronologically. This phase usually runs until the simulation clock reached a threshold value specified in the Network Configuration Phase.

In most cases, it is convenient to define a simulation scenario in a Tcl scripting file (e.g., <file>) and feed the file as an input argument of an NS2 invocation (e.g., executing “ns file>”). 

Step 3: Post Simulation Processing

The main tasks in these steps include verifying the integrity of the program and evaluating the performance of the simulated network. While the first task is referred to as debugging, the second one is achieved by properly collecting and compiling simulation results

Multiple Spanning Tree Construction For Dynamic Irregular Networks

Irregular network

In Irregular network each node hasn’t the same number of links. There is abnormal shape for this network as shown in figure. Routing is also more complex in irregular network



An irregular network

Up/Down routing in single spanning tree
                         
     Single spanning tree contains only root node. Up/down routing algorithm is proposed aiming to better utilize all the available channels in the network. First of all, root node is selected and the network is partitioned into two sub-networks: up sub-network and down sub-network. The up sub network consists of unidirectional channels directed towards the root node while the down sub network consists of unidirectional channels directed away from root node.  
 
     Most of the packets pass through this root node only. So congestion occurs at root node. As shown in figure, A is the root node. All up links are towards A and downlinks are away from A.


                                      
                                    Up / Down routing in a single spanning tree


Up/Down routing in multiple spanning trees

     Multiple spanning tree contains more than one root node. The root is not the destination of a packet, but only acts as an intermediate node for the packets in most cases based on the up*/down* routing scheme. 

      Packets, which belong to different pairs of source/destination, can be delivered across different roots in their own spanning trees. The benefit introduced by this scheme is that different trees hold their own roots, and the packets can be delivered across different roots in their own trees. This technique can equally distribute all packets in the irregular network and directly improve the congestion produced by the routing scheme with a single spanning tree.


EXISTING SYSTEM

The Existing system consists of multiple spanning tree construction for static irregular network. Here at first single spanning tree which contains single root is constructed. Up/Down routing algorithm is used in which all packets are routed via root node only from source to destination. All links are to and from root node. So congestion occurs at root node when the size of network increases. There may be loss of packets at root node.



                             

                               Spanning tree constructed for irregular network


The Figure is example for single spanning tree. If we start routing packets from node 5 to node 7 and from node 6 to node 2 at the same time, all packets pass via root node 1.So congestion occurs at node 1.

To overcome this, multiple spanning tree is constructed which contains more than one root. Packets that belong to different pairs of source/destination can be delivered across different roots in their own spanning trees.

                            
               



                                 Multiple spanning trees in an irregular network


In figure root nodes are 1 or 8.If we want to pass packets from node 5 to node 7 and node 6 to node 2,firstly it checks the availability of root node 1.If it is busy, it will pass through root node 8.It will take the shortest path from source to destination. In large networks we can calculate more than two root nodes.



Disadvantages of existing system:

  • Here topology is static. 
  • Once the root nodes are calculated, they are fixed. 
  • This will not work when topology becomes dynamic where the nodes are added or  removed. 

   

 PROPOSED SYSTEM

We propose a system that consists of construction of multiple spanning trees for dynamic irregular network. Here Up/Down routing is used. If nodes are added or removed, we have to construct multiple spanning tree where the root nodes will change. If any node is removed, then packets should take an alternate shortest path to reach the destination.


If root node is removed, then immediately another node should be taken as root node. If node is added, then automatically connections between nodes should be established.


PROJECT SCOPE

We present construction of multiple spanning tree for irregular networks. With this construction, performance of irregular network increases. We construct multiple spanning trees for Dynamic networks where nodes are added or removed. Packets are transmitted in a shortest path from source to destination. Up/Down routing algorithm is used in multiple spanning tree. This routing algorithm improves the adaptivity, and provides more load balancing routing. By constructing multiple spanning tree we can avoid congestion in the traffic when the size of network increases. Understanding of this network construction is also simple.