examples/csma-one-subnet.cc
changeset 3716 458bc4845806
parent 3714 249ec8d21b24
child 4218 debf1a8a96d3
equal deleted inserted replaced
3715:594e2052e5b2 3716:458bc4845806
   101   app.Stop (Seconds (10.0));
   101   app.Stop (Seconds (10.0));
   102 
   102 
   103   // Create an optional packet sink to receive these packets
   103   // Create an optional packet sink to receive these packets
   104   PacketSinkHelper sink ("ns3::UdpSocketFactory",
   104   PacketSinkHelper sink ("ns3::UdpSocketFactory",
   105     Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
   105     Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
   106   sink.Install (nodes.Get (1));
   106   app = sink.Install (nodes.Get (1));
       
   107   app.Start (Seconds (0.0));
   107 
   108 
   108 // 
   109 // 
   109 // Create a similar flow from n3 to n0, starting at time 1.1 seconds
   110 // Create a similar flow from n3 to n0, starting at time 1.1 seconds
   110 //
   111 //
   111   onoff.SetAttribute ("Remote", 
   112   onoff.SetAttribute ("Remote", 
   112                       AddressValue (InetSocketAddress (interfaces.GetAddress (0), port)));
   113                       AddressValue (InetSocketAddress (interfaces.GetAddress (0), port)));
   113   ApplicationContainer app2 = onoff.Install (nodes.Get (3));
   114   app = onoff.Install (nodes.Get (3));
       
   115   app.Start(Seconds (1.1));
       
   116   app.Stop (Seconds (10.0));
   114 
   117 
   115   sink.Install (nodes.Get (0));
   118   app = sink.Install (nodes.Get (0));
       
   119   app.Start (Seconds (0.0));
   116 
   120 
   117   app2.Start(Seconds (1.1));
       
   118   app2.Stop (Seconds (10.0));
       
   119 //
   121 //
   120 // Configure tracing of all enqueue, dequeue, and NetDevice receive events.
   122 // Configure tracing of all enqueue, dequeue, and NetDevice receive events.
   121 // Trace output will be sent to the file "csma-one-subnet.tr"
   123 // Trace output will be sent to the file "csma-one-subnet.tr"
   122 //
   124 //
   123   NS_LOG_INFO ("Configure Tracing.");
   125   NS_LOG_INFO ("Configure Tracing.");