If you run the script, it will not generate any interesting outputs in the terminal because I just removed all the lines which actually shows some “LogComponent” outputs to make you understand how we can use the Log Components in a typical simulation. Even though there will not be any mobility in this wired network scenario, a mobility model should be attached to the nodes to display the nodes at the appropriate locations. We just added two lines at the top and few lines at the bottom to create XML file output for visualizing on the NetAnim tool. Mobility.SetMobilityModel (“ns3::ConstantPositionMobilityModel”) ĪnimationInterface anim (“SimpleNS3Simulation_NetAnimationOutput.xml”) Īnim.SetConstantPosition (nodes.Get(0), 0, 5) Īnim.SetConstantPosition (nodes.Get(1), 10, 5) “GridWidth”, UintegerValue (5), “LayoutType”, StringValue (“RowFirst”)) Mobility.SetPositionAllocator (“ns3::GridPositionAllocator”, UdpEchoClientHelper udpEchoClient (ipinterfaces.GetAddress (1), 9) ĪpplicationContainer clientApps = udpEchoClient.Install (nodes.Get (0)) Ipv4InterfaceContainer ipinterfaces = ipAddresses.Assign (netDevices) ĪpplicationContainer serverApps = udpEchoServer.Install (nodes.Get (1)) Channel.SetDeviceAttribute (“DataRate”, StringValue (“5Mbps”)) Ĭhannel.SetChannelAttribute (“Delay”, StringValue (“2ms”))
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |