Simulation Network
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);