Saturday, 2 May 2015


 


INTRODUCTION

Network Simulator is software used to simulate a wide range of real world networks and study the behavior of the network without using physical network components. The program performs this by tracing the interactions between the different network entities (hosts/routers, data links, packets, etc) using mathematical formulas. The behavior of the network can be observed for the various user inputs. Various attributes of the environment can also be modified in a controlled manner to access these behaviors under different conditions.
Simulation processes are based on the actual behaviors of network devices and protocols. We have presented a practical use for the implementation of network design and analysis tools.

Problem statement
The SNiP Network Simulator helps in design, study and observe the behavior of various networks without using the actual networking components. It also plots required graphs to study the data transfers carried out, packets dropped and collisions occurred.

SYSTEM DESIGN

4.1 Architecture

2.1.1 Drawing the network topology
The network devices are drawn on the work panel by clicking on the appropriate network device in the toolbox provided at the top of the editor.
As we see in other editing software’s, the SNiP Network Simulator provides a toolbox containing the network devices such as node, router, switch etc to draw the network topology.
The network devices are drawn on a work panel by clicking on the appropriate device icon from the toolbox and on the work panel. The properties are set by selecting the properties option from the context menu, which can be invoked by right clicking the network device icon drawn on the work panel.

2.1.2 Setting up properties
The properties are the characteristics associated with the network devices. All the network devices are set to the default property when it is drawn. The properties of different types of network devices are maintained differently in structure and all the objects which represent the same network device are stored in the same array. The properties of a network device are displayed by just right clicking on the appropriate device and selecting properties option from the context menu. The properties then changed and saved. The saved properties overwrite the existing value and the array list is updated.

2.1.3 Compiler: To compile the topology
The compilation unit compiles the topology drawn. Two different branches are used for the compilation of algorithmic simulation and real world simulation. The compiler checks for the syntax error in the properties of all the network devices and connection errors if any mismatch occurred in connection.


The compilation unit further generates warnings and messages. Warnings are not errors but some cautions generated may be remembering the user to set some properties for network devices or remembering to connect the network device if any connection is left out. Once the topology becomes error free, then the compiler translates all the properties set to the network topology to commands for the simulation engine.

2.1.4 Command Prompt
The command prompt is used to enter commands to set the properties of network entities and replaces all GUI interfaces with commands. As shown in the above figure, the command prompt interacts with network topology and compiler.
Example “add node 1 stcp 127.0.0.1” adds the “stcp 127.0.0.1” to node 1.
The user can use to compile the simulation by the command “compile”. The connection establishment details can be entered directly into the command prompt. The sequence of connection establishment is dumped by the simulation engine to the command prompt.

2.1.5 Simulation engine
The simulation engine does data transfer as simulation. It establishes the connection, generates the packets, sends them to the router, and forwards to the other network devices and thus controls the data transfer. It also logs all the packets sent to the network.
The simulation engine is associated with the algorithms. It calculates the shortest path for the connection establishment, generates the packets in constant rate from a sender and sends through the link in link speed, stores in router buffer and does the data transfer as data transfer occurs in real network.

Elements of simulation engine are
• Packet generator
• Data transfer unit
• Timer.


2.1.6 Packet generator
The packet generator generates the packets. The packet size is pre defined in the properties of a node. The packet generator is associated with the timer. The packet generator generates the packets in a definite time intervals.
The packet generator generates TPDUs for the acknowledgements from a active sender or receiver.

2.1.7 Data transfer unit
The data transfer unit transfers the data packets in the network. Path for the packet transfer, speed of connection, and the packet itself is the input to the data transfer unit. The data transfer unit is synchronized with the timer. Depending on the bandwidth and time the data transfer unit transmits the packet as it occurs in real network.

2.1.8 Timer
The timer gives the timing signals to the simulation engine. When it updates the time, it gives the signal to the simulation engine. The simulation calls the packet generator and transmits the generated packets to the network.

2.1.9 Stack Trace: Packet details
The stack trace gives the details of all packets. It has the following fields
Time: Gives the exact time in which the packet is transmitted.
Size: Gives the size of the packet.
From: Gives the source host name from where the packet is transferred.
To: Gives the destination host number to where the packet is transferred.
Route: Gives the route for the packet transfer.
Status: Contains the status of the packet. If the packet is dropped it contains “dropped” else “transmitted”.

2.1.10 Graph Plotting: Selecting log details for graph plotting
Graph of transmitted and dropped packet can be plotted using graph plot tool. The graph plot tool takes the stack trace as input. Depending on the status in stack trace, the graph plot tool divides the entire packet history into transmitted and dropped packets and thus plots the graph.

2.1.11 Play back of the data transfer
After the simulation is finished, the simulation server will send back the simulation result files to the GUI program. A log file is created and the file will be the input for playback. The playback gives the packet transfer information in GUI.

The packet animation trace file can be replayed later by the packet animation player. The performance curve of these log files can be plotted by the performance monitor.

2.2 Features
The SNiP Network Simulator has many useful features listed as follows:

• Its simulation speed is high and its simulation results are repeatable.
• The SNiP Simulator runs on windows platform.
• There is no need for kernel up-gradation and manual invocation of external processes.
• It provides a highly integrated and professional GUI environment. This GUI can help a user

 Draw network topologies.
 Configure the protocol modules used inside a node.
 Specify the moving paths of nodes.
 Plot network performance graphs.
 Playing back the animation of a logged packet transfer trace, etc. All these operations can be easily and intuitively done with the GUI.

SNiP uses a simple but effective syntax to describe the settings and configurations of a simulation job. These descriptions' are generated by the GUI and stored in a file. Normally the GUI will automatically transfer the file to the simulation engine for execution. However, if a researcher wants to try his (her) novel device or network configurations that the current GUI does not support, he (she) can totally bypass the GUI and generate the suite of description file by himself (herself) using the command prompt . The commands entered in the command prompt are directly transferred to the simulation engine for execution.



Chapter 3
DETAILED DESIGN

3.1 Front end design
The front end is designed using .NET and visual C#. The front end includes a network editor and GUI design. The network editor contains toolbox and menus.
The SNiP Simulator model contains 32 windows forms and 7 separate code files. The starting Windows form is SimCont.cs which is a Multiple Document Interface (MDI) parent. The SimCont form holds the instance of WorkPanel form as MDI child. The SimCont form contains a toolbox, which contains different icons for network devices. SimCont also contains a menu strip. The menu strip holds File, Edit, Tools, Simulate and Help menus and submenus.
The first form which loads into the memory is loadingfrm.cs. It calls SimCont.cs and further AObj.cs. The AObj.cs allocates objects and memory for those objects.
Network devices are drawn by clicking on the toolbar and then Work Panel. Every network device is associated with a form and some procedures inside the form for construction of new devices, to set the properties. When the new devices are created default properties are set. All the network devices including link are associated with different structure and an array list. The structure maintains the behavior of the device whereas the array list contains instances of those structures.
Every Network device is linked with a context menu strip. Right-clicking the device invokes the menu. The menu contains items such as Cut, Copy, Delete, Properties etc. Clicking on the properties invoke the form associated with the network device which contains the characteristics of the device. Lines can be drawn from one network device to other. Line drawing procedure is written in LineFrm.cs. The line drawing is done by calling DrawALine function inside the LineFrm.cs. The DrawALine function calls midpoint line algorithm written inside Midline.cs code module, to find out all points of the line for packet transfer animation.
The CompPro.cs windows form contains the definition for errors and warnings. It contains definition for 7 errors and 3 warnings. All the errors and warnings are associated with an ID.
ConnectionFrm.cs establishes the connection. It establishes a path from an active sender to receiver. It finds a shortest path among them and establishes the connection and makes the sender and receiver ready for packet transfer.
It contains a structure STCP which contains three fields. The first field represents the active sender of the connection. Second field gives the active receiver. The last field gives the path for data transfer.
LineFrm.cs, RouterFrm.cs, NodeFrm.cs, HubFrm.cs, SwitchFrm.cs are the Windows forms for the represents the characteristics of Network Connector, Router, Node, Hub and Switch respectively. Selecting properties of the respective device by right clicking on it invokes particular Windows form associated with it.
Other windows forms
Windows Forms Description
SettingsFrm.cs This is designed for the customization of the simulator. The form contains options to set the colors in playback, data and time limit for simulation etc
StackTrace.cs is designed to display a stack trace window after the simulation. The form contains a listbox which contains ID, Size, Source, Destination and for status of the packet.

GraphControl.cs Draws a graph. The input for the control is the x co-ordinate and y co-ordinate points and scale for drawing.
GraphFrm.cs This provides a Windows form for GraphControl.cs. Along with this it also mines the data form the simulation to draw the graph and adds GraphControl.cs.

ImgList.cs Contains a list of icons for toolbox.
TransactionLdFrm.cs Displays a loading form signifying the completion of transaction.
GraphSelectFrm.cs Displays all nodes in a combo box and provides options to select the graph type such as transfer graph of drop graph
CmdPromptFrm Invokes the command prompt. The command prompt can be used to interact with all the network devices and used to run the simulation.

3.2 Algorithms
Algorithm/Function Description
MidLine Algorithm Mid Point line algorithm.
Upon drawing every link, this algorithm is called.
Saves all X and Y points of a line in an Arraylist.
FileWrite FileRead Functions Writes and reads the entire network drawn in the WorkPanel. All network devices are written into the file in a format and the same format is used for reading the file.
CompileAll Compiles the simulation. If any syntax error exists in the topology then it displays the error else the simulation is ready to run. The run button is enabled.
TransferData Animation for transfer of data in real time. The procedure takes bandwidth and data size to be transferred and calculates the time required for data transfer.
DrawGraph This function draws the graph. The input is X co-ordinate points and Y co-ordinate points and scale.
StackTrace This function displays the status of every packet transferred from a source to a destination.
CnctNetDFrm Contains information about the network links. The bandwidth and type of the links can be changed here.
GetAIp This function gets a random IP address. The IP address returned from this function contains 4 fields, and all fields within the range 0-255
SimulateAll Simulates the entire network from the connection establishment phase until the end of the data transfer. This procedure creates log files, which gives the details of data transfer.
FlushAll Flushes all the buffer arrays associated with the actual buffer of routers, switches hubs. Also clears all the file transfers.
TCPpiar Finds out shortest path form a source to a destination and stores for shortest path for TCP connection.
FwdRouterToRouter Forwards packets from router to router.
FwdRouterToSwitch Forwards packets from router to switch.
FwdRouterToHub Forwards packets from router to hub.
FwdSwitchToRouter Forwards packets from switch to router.
FwdSwitchToSwitch Forwards packets from switch to switch.
FwdSwitchToHub Forwards packets from switch to hub.
FwdHubToRouter Forwards packets from hub to router.
FwdHubToSwitch Forwards packets from hub to switch.
FwdHubToHub Forwards packets from hub to hub.

STRUCTURES Description

SNODE
To hold the properties of a node. A Node has the following properties.
Node Number: All the nodes are numbered to identify the node.
IP Address: This field holds the IP address of the node
X and Y hold the position of the node icon.
Pb holds the picture box which contains icon of the node.
DCmd holds the command entered into a node.


SROUTER To hold the properties of a router. A router has the following properties.
Router Name: Holds the name of the router.
Router Number: All the routers are numbered to identify the router.
Pb holds the picture box which contains icon of the router.
X and Y hold the position of the node icon.
ConD : Holds the connection information
maxBuf : Holds the buffer size of the router

fillBuf : Holds the filled buffer information
pckTs: Arraylist that holds the packets as a queue.

SLINE Holds the link information. The line link information includes the bandwidth of the link and description about the link.

SHUB Holds the properties of hub. This includes the buffer size of the hub, unique number assigned to the hub for identification.

SPACKET
Holds packet information. Packet information includes size of the packet, source and destination of the packet.

SSTACK Holds a stack entry. The stack entry includes a SPACKET, source and destination of the packet and status of the packet which gives the information about whether the packet is sent successfully or not.

STCP Holds the source, destination and path for TCP connection.

SNODECMD Holds the command entered at the node.
The command includes the command string start time to start the data transfer.
3.1 Introduction
A simulation is an imitation of some real thing, state of affairs, or process. The act of simulating something generally entails representing certain key characteristics or behaviors of a selected physical or abstract system.
A computer simulation is an attempt to model a real-life situation on a computer so that it can be studied to see how the system works. By changing variables, predictions may be made about the behavior of the system.

3.2 Network simulator
A network simulator is a piece of software that simulates a network, without an actual network being present. Network simulators serve a variety of needs. Compared to the cost and time involved in setting up an entire test bed containing multiple networked computers, routers and infrastructure, network simulators are relatively fast and inexpensive. They allow engineers to test scenarios that might be particularly difficult or expensive to simulate using real hardware- for instance, simulating the effects of a sudden burst in traffic on a network service. Networking simulators are particularly useful in allowing designers to test new networking protocols or changes to existing protocols in a controlled and reproducible environment.
Network Simulators, as the name suggests are used by researchers to design various kinds of networks, simulate and then analyze the effect of various parameters on the network performance. A typical network simulator like NS2, encompasses a wide range of networking technologies and help the users to build complex networks from basic building blocks like variety of nodes and links. With the help of simulators one can design hierarchical networks using various types of nodes like computers, hubs, bridges, routers, optical cross connects, multicast routers, mobile units, etc. Various types of Wide Area Network (WAN) technologies like packet, circuit, burst switching etc and Local Area Network (LAN) technologies like Ethernet, token rings etc can all be simulated with a typical simulator and the user can test, analyze various standard results apart from devising some novel protocol or strategy for routing etc.
There are a wide variety of network simulators, ranging from the very simple to the very complex. Minimally, a network simulator must enable a user to represent a graph of a network, specifying the nodes on the network and the links between those nodes. More complicated systems may allow the user to specify everything about the protocols used to handle network traffic. Graphical applications allow users to easily visualize the workings of their simulated environment. Text-based applications may provide a less intuitive interface, but may permit more advanced forms of customization. Others, such as GTNets, are programming-oriented, providing a programming framework that the user then customizes to create an application that simulates the networking environment that he or she wishes to test.

3.3 Introduction to TCP Protocol
Introduction to TCP (Transmission Control Protocol)
TCP was specially designed to provide a reliable end-to-end byte stream over an unreliable inter network. An inter-network differs from a single network because different parts may have widely different topologies, bandwidths, delays, packet sizes, and other parameters. TCP was designed to dynamically adapt to properties of the inter network and to be robust in the face of many kinds of failures.
Each machine supporting TCP has a TCP transport entity, either a library procedure, a user process, or part of the kernel. In all cases, it manages TCP streams and interfaces to the IP layer. A TCP entity accepts user data streams from local processes breaks them up into pieces not exceeding 64KB and sends each piece as a separate IP datagram. When datagrams containing TCP data arrive at a machine, they are given to the TCP entity, which reconstructs the original byte streams.
The IP layer gives no guarantee that datagrams will be delivered properly, so it is up to TCP to time out and retransmit them as needed. Datagrams that do arrive may well do so in the wrong order; it is also up to TCP to reassemble them into messages in the proper sequence. In short, TCP must furnish the reliability that most users want and that IP does not provide.

TCP 7000
FTP 21 file transfer
Tenet 23 remote login

3.4 The SNiP Network Simulator
SNiP Network simulator attempts to provide real world network simulation. Real world network simulation is associated with the protocols used in real world. It includes TCP/IP, UDP, FTP, etc. SNiP provides a user friendly interface to draw and simulate the topology, playback to view the data transfers, stack trace to view the data transfer of each and every packet transferred. Along with this it also provides graph drawing tool, which can be used to plot the graph giving details about in-throughput, out-throughput, collisions occurred at all the network devices.
The real time network simulation tool provides the user exact time required for data transfer for a specified bandwidth and datum under various conditions.
The SNiP Network simulator can be used by professionals for studying real world networks, problems encountered, and for educational purposes.

3.5 System Requirement Specification
Once the analysis is complete, the requirements must be written or specified. The final output is the Software Requirements Specification document (SRS).The SRS captures the complete software requirements for the project Network Simulator. This SRS will describe the different functionalities of GUI Network Simulator. This SRS outlines the product requirements on functional basis. The SRS will define how our team envision the final product and the characteristics or functionalities it must have

--> The system should have a work panel or work window to design the network topology.
--> The system should have a toolbox with different tools to draw network devices.
--> The system should contain a compiler for compilation and running of network drawn.
-->The system should have facilities like editing the network topology, setting up properties for network devices and playback.
--> The system should provide some tools such as graph plotting tool, stack trace, command prompt which helps to study the behavior of the simulation.
--> The system should provide printing tool to print the network topology.
--> The system should implement some algorithm such as Prims algorithm to find out the shortest path spanning tree with in the topology.

Work Panel: To design the network topology
The work panel is a tool to draw the network. The network devices are drawn on work panel by selecting appropriate network device on the toolbox provided at the top of the editor and drawing on the work panel.

Tool box: To draw network devices
The SNiP Network Simulator provides a toolbox which contains standard tools for standard operation such as “open” to open a file or “save” to save the file and Network toolbox containing network devices such as node, router, switch etc to draw the network topology.

Properties: Setting up properties
The properties are the network characteristics of particular network device. The properties are set by right-clicking on the network devices and selecting “Properties” option. Different types of network devices have different properties.
Example: Node has the properties like IP address, transmission mode, commands required for establishment of connections.
Router contains properties like buffer size, router name, router ID and routing table.

Compiler: compiles the simulation
The SNiP Simulator contains a compiler which compiles the topology before the simulation. The compiler detects the errors and warnings and displays if any. If no errors found, then it converts properties of all network devices to commands.

Command Prompt
The command prompt is used to control the topology and properties of network devices. The connection establishment details can be entered directly to the command prompt. The command prompt replaces all GUI interfaces with commands. The sequence of connection establishment is dumped by the system to the command prompt.

Stack Trace: Packet details
Stack trace gives the information about all the packets transmitted in the network form one network device to other.

Graph Plotting: Selecting log details for graph plotting
Graph of transmitted and dropped packets can be plotted using graph plot tool. The graph plot tool takes the log file of the simulation.

Algorithmic simulation: Simulation of standard algorithms
The algorithmic simulation is used to simulate the algorithm. Algorithmic simulation uses only nodes and network links. Distances are assigned to the links directly from the link properties.


3.6 Configuration
3.6.1 Hardware Configuration
No special hardware configuration is required. Hardware configuration which is sufficient to run Windows XP is sufficient.

3.6.2 Software Configuration
A software package is created from software package building provided by visual studio. The software package should be installed. Before installing the software the existing system should be upgraded to Windows XP Service Pack 2.0 and .NET framework should be installed. After the installation of framework the package is ready to run. The package creates a desktop icon and start menu icon.

FEASIBILITY STUDY

2.1 Introduction
In the feasibility study we check whether the SNiP simulator project can be developed within the available software and hardware technologies. We also check whether the system to be developed is cost effective and whether it satisfies all the proposed requirements.
During feasibility study various constraints such as time constraints, budgetary constraints, resource constraints etc are studied.
The network simulator accounts for great amount of feasibility since the actual behavior of the system is simulated in a stand alone system which allows us to test the characteristics of the network by giving various inputs and analyzing the respective outputs in a short time and less amount of people involved
The project is developed in Visual C# under .NET framework using Visual Studio 2005. The Visual Studio 2005 facilitates the development of Graphical User Interface (GUI) comprising various forms for different purposes using languages like Visual C#, Visual J#, Visual C++, VB .NET. The software developed in Visual Studio is compatible to run in any newer version of Windows.

2.2 Existing System
Whenever a new system is developed it is either a new product or is a further development of some existing product. There can be some drawback in the existing product. Most of the simulators do not have good user interfaces. Often being command oriented, they demand trained users. Some simulators require a Kernel up gradation which requires reinstallation of the operating systems. It acts as an over head and thus making it less user friendly.


2.3 Proposed System
The SNiP Network Simulator has a good Graphical User Interface. It can be installed and run on windows without any kernel upgradation. SNiP Network simulator attempts to provide real world network simulation. Real world network simulation is associated with the protocols used in real world. It includes TCP/IP, UDP, FTP, etc. SNiP provides a user friendly interface to draw and simulate the topology, playback to view the data transfers, stack trace to view the data transfer of each and every packet transferred. Along with this it also provides graph drawing tool, which can be used to plot the graph giving details about in-throughput, out-throughput, collisions occurred at all the network devices. The real time network simulation tool provides the user exact time required for data transfer for a specified bandwidth and datum under various conditions. The SNiP Network simulator can be used by professionals for studying real world networks, problems encountered, and for educational purposes.

2.4 System Feasibility
This study checks whether the proposed system satisfies all the requirements that are specified in the proposal. The SNiP Network simulator can simulate a variety of networks accurately.

2.4.1 Operational Feasibility
What are the users’ needs and how does a developer system meets them? A user interactive system is provided and the user can build the topology, specify the working environment and put constraints according to the needs.

2.4.2 Technical Feasibility
Technical feasibility is concerned with determining whether it is possible to code the project using the language selected. Visual C# is used and the developer software is Visual Studio 2005.
Visual studio is a toolkit to develop windows based applications. It supports a variety of languages for the software development.
The .NET framework is a completely new model for building systems on the windows family of operating systems.

Features of .NET and Visual Studio
• Full interoperability with existing win32 code: .NET allows invoking raw C based functions from managed code.
• Complete and total language interaction: Unlike classic COM, .NET supports cross language inheritance, cross-language exception handling and cross language debugging. A common runtime engine shared by all .NET aware languages.
• Multithreading: .NET provides multithreading. This allows the software to run modules in parallel.
• Direct access to Windows APIs: .NET provides a direct access to windows APIs. The APIs including the DLL (Dynamic Link Library) functions.
• Visual studio provides GUI design tools for designing the software. It simplifies the overhead of coding to an extent, and helps to reduce the software development time and provides a better user friendly system.

2.4.3 Economical Feasibility
Economical feasibility is used for evaluating the effectiveness of a system. The project does not involve any special hardware other than standard specifications.

TESTING

6.1 Introduction
Software Testing is the process used to help identify the correctness, completeness, security, and quality of developed computer software. Testing is a process of technical investigation, performed on behalf of stakeholders, that is intended to reveal quality-related information about the product with respect to the context in which it is intended to operate. This includes, but is not limited to, the process of executing a program or application with the intent of finding errors. Quality is not an absolute; it is value to some person. With that in mind, testing can never completely establish the correctness of arbitrary computer software; testing furnishes a 'criticism' or comparison that compares the state and behavior of the product against a specification. An important point is that software testing should be distinguished from the separate discipline of Software Quality Assurance (SQA), which encompasses all business process areas, not just testing.

6.2 White box and black box testing
White box and black box testing are terms used to describe the point of view a test engineer takes when designing test cases. Black box being an external view of the test object and white box being an internal view. Software Testing is the process of executing software in a controlled manner; in order to answer the question “Does this software behave as specified?” Software testing is used in association with verification and validation. Verification is the checking of or testing of items, including software, for conformance and consistency with an associated specification. Software testing is just one kind of verification, which also uses techniques such as reviews, inspections, and walk-throughs. Validation is the process of checking what has been specified is what the user actually wanted.
Validation: Are we doing the right job?
Verification: Are we doing the job right?

6.3 Unit Testing
In unit testing each unit (basic component) of the software is tested to verify that the detailed design for the unit has been correctly implemented.
The basic components such as command prompt, packet generator, timer, simulation engine are checked and verified to ensure that the detailed design is implemented.

6.4 Integration testing
In integration testing progressively larger groups of tested software components corresponding to elements of the architectural design are integrated and tested until the software works as a whole.
After testing all the basic software components, the components are integrated to work as a single system and tested until the software works as whole.

6.5 System testing
In system testing the software is integrated to the overall product and tested to show that all requirements are met.
In this step the software is tested to weather it meets the requirements to work as a network simulator.

6.6 Regression Testing
Changes made in order to fix bugs or develop further functionality may cause previously successful tests to fail, so regression testing is used to repeat the earlier successful tests to ensure that changes made in the software have not introduced new bugs/side effects.


6.7 Test the front-end actions
It has been checked whether the front end is responding properly for different user actions.

No comments:

Post a Comment