Wednesday 8 February 2012

Network Designing and simulation using OPNET 14.5.

Hello,

So we are back on our discussion on OPNET 14.5 , how to design network and then simulate it...:)
I already  talked about how to set the environment of OPNET to work on it in last post.
So, today we will be designing a small network and then we will move on to complex networks in later discussions.
Lets consider a simple office network of 10 workstations (clients) and 1 server connected through a hub.

First we have to design this network. Don't worry...... designing means we have to select respective objects and connect then...That's it and our network will be ready to work ... haha... :) Okay back to point and lets see how easy it is... :):)

Designing Network

Select  'New Project' and create a new project. In this project it will ask for a scenario create scenario_1 as example. So what is scenario???
Scenario is part of our complete network we want to simulate. Because we cant build and simulate whole network in one go, we divide network in areas, parts, domains, sub-nets, etc. called as scenarios.
So in scenario_1we will be designing the simple network.
1. Click on 'Open Object Palette'. We are creating a office network which is Ethernet based network so select 'ethernet'  in 'Shared Object Palettes'.
2. We need 10 workstations . So select 'ethernet_wkstn' from 'Node Models', drag it in scenario workspace. Left click ten times (replicate the same object) and then do right click to stop duplicating objects. So we added 10 workstations to network.
3. Select 'ethernet_server' from same 'Object palette', drag it to workspace and right click as we don't need more than 1 server. Similarly drag 'ethernet16_hub' to workspace.
4. Now we need to connect all nodes. So, select '10baseT' links from 'Object Palette'. First click on hub and then click on node. Do same for all nodes to connect every node with hub and then right click to stop connecting.
5. To set configuration of network traffic we need two more objects 'Profile Config' and 'Application Config' so drag them in workspace.
So I think the network you designed may look like this:






















6. Now we need to set network traffic. So right click on Profile Config object and select 'Edit attributes'  and then
 a) Select Number of Rows as 2.
 b) Set the attributes as shown in pic (node_8 attributes).
7. Click 'OK'.
8. Select 'Application Config' Object and right click on it. Set Application Attributes to Default.

Till this point from configuration point of view we have set the network traffic but didn't set which node will generate what traffic.
9. So, Select all workstations, right click and select 'Edit Attributes'. 
 a) Select Application Supported Profiles.
 b) Select 'Number of rows' as 2.
 c) Set the parameters as shown in below:


d) After doing all this Check on 'Apply To Selected Objects'.  Here I have set all clients as same traffic generator you can experiment with different traffic also.

10. Now you have to configure server so select server, right click, select 'Application Supported Services'  and set it to 'ALL'.


11. Now everything is ready i.e. we have designed the network, defined all attributes of all objects.

Happy and ready to simulate it. Okay lets do simulation..

Ohhoohhooo!!!!....we have defined everything but we din't set, after simulation what we want to analyse...???? :) :)
Okay, lets quickly set the parameters we want to analyse and then ready set and go..............

Setting Analysis Parameters

1. Right click on workspace and select 'Choose Individual DES Statistics'.
2. In 'Global Statistics'  select 'Ethernet->Delay(sec)'.
3. Similarly in Node Statistics Ethernet select parameters like Load, Utilization, Collision Count, etc whatever you want to analyse.

Oookaay so all set ....

Save the Project and then  click on 'Configure/Run Discrete Event Simulation (DES)'. Set Simulation time to 20 minutes and click Run.
After simulation is over you can view results of all statistics you set. Statistics in form of graph I got look like this:

Hmmm......so finally designed and simulated a small office network using OPNET 14.5.
So for today, I think it is enough.
This was just an introduction of how to work on OPNET. In later discussions we will work on some big and complex networks and will try to figure out how different network fails, which equipment of which vendor are best for which network??? So lot of questions yet to answer....
Okay .Hope you enjoyed it..
Bbyyee..

Tuesday 7 February 2012

OPNET 14.5 Configuration

Hello,
This is my first blog post. Hope it will be interesting to you. I am going to start with network simulator tool OPNET14.5.
So, What is OPNET14.5 ????
OPNET is a network modeler through which one can design any kind of network model and then can simulate it. 14.5 is the version of OPNET and it is freeware.
Here simulation means OPNET will generate the traffic as defined in attributes set by user and will generate results like utilization, collision, load, etc (these analysis parameters are again set defined by user. We will discuss later on how to define each attribute).

Now, first we will discuss about how to install and major part is how to configure the OPNET on MS VS2008.

INSTALLATION
OPNET 14.5 modeler have three packages. So install them in sequence as:
1. First install OPNET Modeler.
2. Second Install OPNET documentation.
3. Then last install OPNET library.
Also,  note that every package is installed in same directory.

CONFIGURATION
Now, after installing one have to set environment variables. So, I think first question will be why we need to set environment variables?? If we don't do what will happen???

Well, I will answer you at the end of this discussion. :) :)

I am considering that MS VS2008 is installed in default directory i.e.( C:\Program Files\Microsoft Visual Studio 9.0\ ). First right click on 'My Computer' choose 'Advanced" tab and the click on 'Environment Variables'. Then in system variables add following variables:
a) PATH
     C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE;
     C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN;
     C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools;
     C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\bin;
     C:\WINDOWS\Microsoft.NET\Framework\v3.5;
     C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;
     C:\Program Files\Microsoft Visual Studio 9.0\VC\VCPackages;
     C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin;
b) LIB
    C:\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\LIB;
    C:\Program Files\Microsoft Visual Studio 9.0\VC\LIB;
    C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib;
c) LIBPATH
    C:\WINDOWS\Microsoft.NET\Framework\v3.5;
    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;
    C:\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\LIB;
    C:\Program Files\Microsoft Visual Studio 9.0\VC\LIB;
d) INCLUDE
    C:\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\INCLUDE;
    C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE;
    C:\Program Files\Microsoft Visual Studio 9.0\SDK\v3.5\include;   
e) NetSamplePath
    C:\Program Files\Microsoft Visual Studio 9.0\SDK\v3.5;
f) DevEnvDir
    C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE;
g) FrameworkDir
    C:\Windows\Microsoft.NET\Framework;
h) FrameworkSDKDir
    C:\Program Files\Microsoft Visual Studio 9.0\SDK\v3.5;
i) FrameworkVersion
    v2.0.500727;
j) VCBUILD_DEFAULT_CFG
    Debug^|Win32;
k) VCBUILD_DEFAULT_OPTIONS
    /useenv;
l) VCINSTALLDIR
    C:\Program Files\Microsoft Visual Studio 9.0\VC;
m) VSINSTALLDIR
    C:\Program Files\Microsoft Visual Studio 9.0;

Oops!!!!! lot of variables...:) :)
Now I will answer the question raised at the starting of discussion Why it is required??
So we can design a network in two ways a) Using the Object Pallete and  b) Through coding... Obviously no one wants to do it though coding when everything is graphically done by just setting attributes and code will be generated for same. So whatever you are designing graphically , for same a code  will be generated in C that needed to be compiled before we do simulation so all these variable we defined above will set the path for all header files required for compilation and execution of the network. That's why OPNET requires VS2008 because it uses VS2008 for code compilation and execution. That's why we need to set these environment variables. I think now you got answer of first question that why we did that. Now if we don't do it then we can design the network but cant simulate it.
I think if you go to manual of OPNET you will find the same variable but if it is for VS2005 the directory names will be different for example .Net framework used in VS2005 is v2.0 while in VS2008 it is v3.5 so you need to make changes at all respective places.
Also if you get error during compilation that

gna_email_mgr.pr.tmp.c

c:\opnet\14.5.a\sys\include\vos.h(105) : fatal error C1083: Cannot open include file: 'WinDef.h': No such file or directory.


Then search the Windef.h in my computer. You will get lot of results but you have to select the path as:
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include;
Copy the address and append it to 'INCLUDE' environment variable value.

I think now we are done with configuration.
uuuhhhhh!!!!!! It seems that we have done a kind of project :) :) but exactly speaking we have just set the environment for our projects :) :).
Hope it gives you enough information to set OPNET 14.5 network modeler. In further discussions of OPNET we will discuss how to design a network and how to simulate and analyse it.
:) :)
Bye!!