224 // Create the OnOff applications to send |
224 // Create the OnOff applications to send |
225 if (systemId == 0) |
225 if (systemId == 0) |
226 { |
226 { |
227 OnOffHelper clientHelper ("ns3::UdpSocketFactory", Address ()); |
227 OnOffHelper clientHelper ("ns3::UdpSocketFactory", Address ()); |
228 clientHelper.SetAttribute |
228 clientHelper.SetAttribute |
229 ("OnTime", RandomVariableValue (ConstantVariable (1))); |
229 ("OnTime", RandomVariableValue (ConstantVariable (1))); |
230 clientHelper.SetAttribute |
230 clientHelper.SetAttribute |
231 ("OffTime", RandomVariableValue (ConstantVariable (0))); |
231 ("OffTime", RandomVariableValue (ConstantVariable (0))); |
232 |
232 |
233 ApplicationContainer clientApps; |
233 ApplicationContainer clientApps; |
234 for (uint32_t i = 0; i < 4; ++i) |
234 for (uint32_t i = 0; i < 4; ++i) |
235 { |
235 { |
236 AddressValue remoteAddress |
236 AddressValue remoteAddress |
237 (InetSocketAddress (rightLeafInterfaces.GetAddress (i), port)); |
237 (InetSocketAddress (rightLeafInterfaces.GetAddress (i), port)); |
238 clientHelper.SetAttribute ("Remote", remoteAddress); |
238 clientHelper.SetAttribute ("Remote", remoteAddress); |
239 clientApps.Add (clientHelper.Install (leftLeafNodes.Get (i))); |
239 clientApps.Add (clientHelper.Install (leftLeafNodes.Get (i))); |
240 } |
240 } |
241 clientApps.Start (Seconds (1.0)); |
241 clientApps.Start (Seconds (1.0)); |
242 clientApps.Stop (Seconds (5)); |
242 clientApps.Stop (Seconds (5)); |