#include "ns3/core-module.h" #include "ns3/config-store.h" #include "ns3/network-module.h" #include "ns3/internet-module.h" #include "ns3/point-to-point-module.h" #include "ns3/applications-module.h" using namespace ns3; NS_LOG_COMPONENT_DEFINE ("ConfigTest"); int main(int argc, char *argv[]) { LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_ALL); Config::SetDefault ("ns3::ConfigStore::Mode", StringValue ("Load")); Config::SetDefault ("ns3::ConfigStore::FileFormat", StringValue ("RawText")); Config::SetDefault ("ns3::ConfigStore::Filename", StringValue ("scratch/input-defaults.txt")); CommandLine cmd; cmd.Parse (argc, argv); ConfigStore inputConfig; inputConfig.ConfigureDefaults (); NodeContainer nodes; nodes.Create (2); PointToPointHelper pointToPoint; NetDeviceContainer devices; devices = pointToPoint.Install (nodes); InternetStackHelper stack; stack.Install (nodes); Ipv4AddressHelper address; address.SetBase ("10.1.1.0", "255.255.255.0"); Ipv4InterfaceContainer interfaces = address.Assign (devices); UdpEchoServerHelper echoServer (9); echoServer.Install (nodes.Get (1)); UdpEchoClientHelper echoClient (interfaces.GetAddress (1), 9); echoClient.Install (nodes.Get (0)); inputConfig.ConfigureAttributes (); Simulator::Stop (Seconds (3.0)); Simulator::Run (); Simulator::Destroy (); return 0; }