examples/mixed-global-routing.cc
changeset 2600 6c389d0c717d
parent 2592 3ebf97150166
child 2602 d9262bff6df2
equal deleted inserted replaced
2599:fcc1728eb669 2600:6c389d0c717d
   184   // Create the OnOff application to send UDP datagrams of size
   184   // Create the OnOff application to send UDP datagrams of size
   185   // 210 bytes at a rate of 448 Kb/s
   185   // 210 bytes at a rate of 448 Kb/s
   186   NS_LOG_INFO ("Create Applications.");
   186   NS_LOG_INFO ("Create Applications.");
   187   uint16_t port = 9;   // Discard port (RFC 863)
   187   uint16_t port = 9;   // Discard port (RFC 863)
   188   Ptr<OnOffApplication> ooff = 
   188   Ptr<OnOffApplication> ooff = 
   189     CreateObject<OnOffApplication> (
   189     CreateObject<OnOffApplication> ("Remote", Address (InetSocketAddress ("10.1.3.2", port)), 
   190                                         "Node", n0, 
   190                                     "Protocol", TypeId::LookupByName ("Udp"),
   191                                         "Remote", Address (InetSocketAddress ("10.1.3.2", port)), 
   191                                     "OnTime", ConstantVariable (1), 
   192                                         "Protocol", TypeId::LookupByName ("Udp"),
   192                                     "OffTime", ConstantVariable (0),
   193                                         "OnTime", ConstantVariable (1), 
   193                                     "DataRate", DataRate("300bps"),
   194                                         "OffTime", ConstantVariable (0),
   194                                     "PacketSize", Uinteger (50));
   195                                         "DataRate", DataRate("300bps"),
       
   196                                         "PacketSize", Uinteger (50));
       
   197   n0->AddApplication (ooff);
   195   n0->AddApplication (ooff);
   198   // Start the application
   196   // Start the application
   199   ooff->Start (Seconds (1.0));
   197   ooff->Start (Seconds (1.0));
   200   ooff->Stop (Seconds (10.0));
   198   ooff->Stop (Seconds (10.0));
   201 
   199