NS Network Simulator 3
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.

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()->
GetObject(UdpSocketFactory::GetTypeId());
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));