src/virtual-net-device/examples/virtual-net-device.cc
changeset 8966 060dba23e9bb
parent 7256 b04ba6772f8c
child 8996 d0e0a162a990
equal deleted inserted replaced
8965:cfed4f87e003 8966:060dba23e9bb
   262   // 210 bytes at a rate of 448 Kb/s
   262   // 210 bytes at a rate of 448 Kb/s
   263   NS_LOG_INFO ("Create Applications.");
   263   NS_LOG_INFO ("Create Applications.");
   264   uint16_t port = 9;   // Discard port (RFC 863)
   264   uint16_t port = 9;   // Discard port (RFC 863)
   265   OnOffHelper onoff ("ns3::UdpSocketFactory", 
   265   OnOffHelper onoff ("ns3::UdpSocketFactory", 
   266                      Address (InetSocketAddress (Ipv4Address ("11.0.0.254"), port)));
   266                      Address (InetSocketAddress (Ipv4Address ("11.0.0.254"), port)));
   267   onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
   267   onoff.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1]"));
   268   onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
   268   onoff.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0]"));
   269   ApplicationContainer apps = onoff.Install (c.Get (0));
   269   ApplicationContainer apps = onoff.Install (c.Get (0));
   270   apps.Start (Seconds (1.0));
   270   apps.Start (Seconds (1.0));
   271   apps.Stop (Seconds (10.0));
   271   apps.Stop (Seconds (10.0));
   272 
   272 
   273   // Create a packet sink to receive these packets
   273   // Create a packet sink to receive these packets