NS Network Simulator 3

Ns Network Simulator 3

Ns Network Simulator 3 is a open source software, which mainly target system needs to have a software development environment to build the libraries first, and then build the user program. Ns Network Simulator 3 tracing system is built on the concepts of independent tracing sources and tracing sinks, along with a uniform mechanism for connecting sources to sinks. Another emphasis of Ns Network Simulator 3 is on the reuse of real application and kernel code

Merits of Ns Network Simulator 3:

  • One of the fastest simulators around .
  • It’s a clean design.
  • It’s more flexible and scalable.
  • Most memory efficient simulation around.
  • No GUI to build topology.
  • Real-world integration.

Architecture of Ns Network Simulator 3:

This is the architecture of Ns Network Simulator 3modules.

Ns Network Simulator 3

Sample code for ns network simulator 3:

This is the code for how to open a socket in ns network simulator 3

InetSocketAddress addr(bcastAddr, m_bcastPort);
Ptr socketFactory = GetNode()->
m_socket = socketFactory->CreateSocket();
InetSocketAddress local = InetSocketAddress
(Ipv4Address::GetAny(), m_bcastPort);
m_socket->Bind(local); m_socket->Connect(addr);
m_socket->SetRecvCallback(MakeCallback(&Beacon::Receive, this));