Introduction to Network Simulations
In this post
Introduction to Network Simulator 2 and its architecture
Installation of Network Simulator 2 in various Operating Systems
How to simulate a given network with the available libraries of NS2
A simulator is of extensive use to engineers and researchers as it provides them a simple and inexpensive way to test real-world scenarios without facing the problems of actual implementation, while getting the same results. Similarly, a network simulator is a software that models the behaviour of the network given to it as an input, under real network characteristics,s without the actual network being present. To generalise, we can say that a simple network simulator must provide the user the capability to create nodes, the links between them and the traffic between the nodes. Additionally, an advanced network simulator may provide options for specifying every detail about the protocol used in handling network traffic.
Simulation is the modelling of an environment that is exactly similar to the underlying state of the target. The main goal of building a simulator is that the internal state transitions and responsiveness of the system must exactly match the actual target environment it’s trying to mimic. Simulators are often used in order to give the user an initial experience of the real environment, since it may not be feasible for the user or the corporation to let the trainee use the actual environment due to monetary or safety reasons. The best example of a simulator is the flight simulator. The pilot trainee is never allowed to board the actual cockpit until he is able to get through the flight simulator environment. The flight simulator has the exact controls which is present in the cockpit and create a virtual environment similar to that of the actual cockpit. It is capable of taking into consideration a number of factors like G-forces, turbulence etc. It’s mandatory that these effects are very accurate so that the pilot doesn’t make any errors during the actual flight. Likewise, network simulators are useful in analysing, testing and designing various methods of computer networks. The emergence of wireless networks forced network simulations to be more accurate and appropriate due to its dynamic nature while deploying such networks.
Need for Simulation
Most of the pilot projects are using simulators rather than the real network deployments because of various factors like cost, implementation difficulties, customisation, new technology adaptation, etc.
However, there are situations where the real network deployment is at an upper hand for accurate results, and it is the actual thing happening. Here is a simple comparison between the real model and the simulated model.
So once the network project is decided, it is advisable to look for a simulator rather than an option for a real network deployment as the initial cost should in any case be minimal.
List of Network Simulators
There are various simulators available for simulations, each with its own purpose. However, there are limited simulators that support a wide range of protocols, routing metrics, etc. Here is the list of simulators that support a huge number of protocols and network entities.
Network Simulator 2 [NS2]
Network Simulator 2[3] is one of the oldest simulators available for the simulation of wired, wireless, satellite networks, etc. For more than a decade, it has satisfied most of the researchers/students across the globe in simulating the networks. It has a strong community that helps developers, researchers across the internet. NS2 was criticised because of the complex architecture it has (OTcl and C++), but it supports the oldest to the latest protocols that were available for the wired or wireless networks. NS2 is completely open source and free.
Network Simulator 3 [NS3]
NS3 [14] is another simulator available for less than a decade and it supports network components of recent developments, unlike NS2, the architecture of ns3 is simpler and one can simulate a network using either C++ or python scripts. NS3 is evolving these days to a greater extent and will come with new protocols, new networks, etc in each of their releases. NS3 is completely open source and free.
OMNeT++
OMNeT++[15] is another tool that supports many protocols, network entities using the framework INET, which comes as a third-party interface. OMNeT++ is built on the Eclipse framework and the development and deployment is very easy as it as a richer GUI that supports the developers to form a network very easily. It is built over C++, and most of the developmental modules are developed in C++, and there is a configuration file (omnetpp.ini) which serves the purpose of forming a network either in a text mode or in a graphical mode. All these things are available at a free cost. OMNEST is the commercial version.
OPNET
This is expensive commercial software available for network simulation and is available with source code for unrestricted protocols. The trial version is available on request. It contains an excellent manual. It has a full-fledged GUI with XML-based support for scenario generation. Because of its heavy weight components, this is a slow simulator.
There are various other simulators too in the market that serve the purpose of narrow network research. So, the developers once identified a network, there are choices available for them to select the perfect simulator for their research. The following table will list some of the key comparisons between the simulators
1.3 Time driven and Event Driven Simulations
Usually, network simulations are carried out either in time driven or event driven. Each of them has its own pros and cons. This topic will show you the difference between these simulations.
Time driven Simulation
Time driven simulation is also called as discrete time simulation. The simulation is carried out on a fixed time interval. The time interval in which a task is running is assumed to be running before the end of the interval, though the task would have arrived at the beginning of the interval.
For example:
Assume ∆t is the interval in which the task is running (Assuming a packet arrives in ∆t)
∆t = t2- t1.
Suppose if the packet arrives t1+0.001, and it may be running before the time t2. So sometimes, the packet may have to wait for a shorter duration of time because of this kind of simulation.
A simple pseudo code shows
For t = 1 to time
{
If (packet arrival)
Buffer ++;
Else (packet departure)
Buffer—
Print (Buffer);
}
This shows the time-driven simulation has some limitations in networks.
Event-driven Simulation
Event-driven simulation, as the name suggests, handles a set of events using a scheduler or a handler. Here are some of the key features of event-driven simulation
A discrete set of events can be handled by a scheduler
One event, upon completion, triggers the next event
The events are fired at random intervals and are scheduled by the handler
The simulation may be stopped once all the events are executed or at a predefined time (where we want to end the simulation). In short, the stopping occurs when the system reaches a particular state or particular time.
Here is the pseudo-code for event-driven simulation
Initialise the system
Initialise the events
While (true)
Collect information from the current event.
Remove the first event from the list and handle it.
Set the time for the event
When compared event driven simulation has the upper hand over the time-driven simulation, as in the latter case, the time is wasted in the difference of timing. But selecting a small ∆t does not solve the purpose as the computational complexity of handling the network dynamics may not suit.
This book demonstrates the Network Simulator 2 (NS2), which is a discrete event simulator that handles the network dynamics using a discrete number of events that are handled by a scheduler. Also, ns2 supports four different types of schedulers, namely calendar (Default), heap, simple linked list and real-time scheduler.
1.4 Modelling for Network Simulation
The most difficult part in simulating a network is selecting a Model. Selecting a model needs a thorough knowledge of network elements, problem specification and a deep knowledge of the system under study. So, to analyse a given network under study, here are the steps that can be used for performance analysis [16]
Problem formulation and system model definition
Performance Metrics definitions
Various levels under study
Data collection
Selection of the simulation environment
Verification and validation
Experimentation and analysis
1.5 Conclusion
This chapter deals with the elements of network simulation that compare time-driven and event-driven simulation. Also, this chapter lists the list of network simulators that are available for research and development. This chapter compares various simulators based on their usage and features.
Comments
Post a Comment