In general, the research scholars have to know all the functions about the first .cc in network simulator 3. This article is the depiction about the significant processes of first .cc in ns3.
Firstly, we start with some sample codes based on first .cc in network simulator 3 along with the specification of its process.
- Create an OnOff application to send UDP datagrams
OnOffHelper onoff (“ns3::UdpSocketFactory”,
Address (InetSocketAddress (Ipv4Address (“10.1.1.3”), port)));
onoff.SetConstantRate (DataRate (“500kb/s”));
ApplicationContainer app = onoff.Install (n0);
app.Start (Seconds (1.0));
app.Stop (Seconds (10.0));
PacketSinkHelper sink (“ns3::UdpSocketFactory”,
Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
ApplicationContainer sink1 = sink.Install (n1);
sink1.Start (Seconds (1.0));
sink1.Stop (Seconds (10.0));
AddressValue (InetSocketAddress (Ipv4Address (“10.1.1.2”), port)));
ApplicationContainer app2 = onoff.Install (n3);
app2.Start (Seconds (1.1));
app2.Stop (Seconds (10.0));
- Bridge based node configuration
bridge.Install (bridge1, topBridgeDevices);
NodeContainer routerNodes (n0, n1, n2, n3, n4);
NodeContainer bottomLan (n2, n3, n4);
for (int i = 0; i < 3; i++)
NetDeviceContainer link = csma.Install (NodeContainer (bottomLan.Get (i), bridge2));
bottomLanDevices.Add (link.Get (0));
bottomBridgeDevices.Add (link.Get (1));
bridge.Install (bridge2, bottomBridgeDevices);
Now, let’s see the process of compiling the packages based on ns-3.28 through the implementation of the following commands.
sudo ./waf build
As the next process, we have to run the first .cc in ns-3.28 through the implementation of the following commands. Additionally, the acquired result is highlighted in following.
sudo ./waf –run first –vis
Ping us at any time and if you face some quarrels while implementing in real time.