Simulation Network

Quick Intro to Simulation network (ns3):

Simulation Network ns-3 software infrastructure encourages the development of simulation network models which are sufficiently realistic to allow ns-3 to be used as a real-time network emulator, interconnected with the real world and which allows many existing real-world protocol implementations to be reused within ns-3. Ns-3 also supports a real-time scheduler that facilitates a number of “simulation-in-the-loop” use cases for interacting with real systems.

Distributed Simulation Network in ns3:

In ns3 the distributed simulation done by using MPI (Message Passing Interface).

  • Nodes on different machines may communicate using point-to-point links only.
  • Nodes in the simulation assigned different System Ids.
  • Nodes with different system ids run on different cluster machines.

Sample code for simulation network:
This is the sample code for ns3 callback object functions.
– Ns3 callbacks implements function objects.
– Used for example in sockets and tracing

double MyFunc (int x, float y){
return double (x+y)/2;
}[..] Callback<double, int, float>cb1;
cb1=MakeCallback(MyFunc);
double result = cb1(3,5);[….] class MyClass{
public: double MyMethod (int x, float y){
return double (x+y)/2;
};[….] Callback<double, int, float> cb1;
MyClass myobj;
cb1= MakeCallback (&MyClass :: MyMethod, &myobj);
double result = cb1 (3,5);