examples/simple-p2p.cc
changeset 1171 335886fe4ddd
parent 1165 618104cbd20d
equal deleted inserted replaced
1170:39ca41540e00 1171:335886fe4ddd
    55 #include "ns3/pcap-trace.h"
    55 #include "ns3/pcap-trace.h"
    56 #include "ns3/internet-node.h"
    56 #include "ns3/internet-node.h"
    57 #include "ns3/p2p-channel.h"
    57 #include "ns3/p2p-channel.h"
    58 #include "ns3/p2p-net-device.h"
    58 #include "ns3/p2p-net-device.h"
    59 #include "ns3/ipv4-address.h"
    59 #include "ns3/ipv4-address.h"
    60 #include "ns3/inet-address.h"
    60 #include "ns3/inet-socket-address.h"
    61 #include "ns3/ipv4.h"
    61 #include "ns3/ipv4.h"
    62 #include "ns3/socket.h"
    62 #include "ns3/socket.h"
    63 #include "ns3/ipv4-route.h"
    63 #include "ns3/ipv4-route.h"
    64 #include "ns3/p2p-topology.h"
    64 #include "ns3/p2p-topology.h"
    65 #include "ns3/onoff-application.h"
    65 #include "ns3/onoff-application.h"
   141 
   141 
   142   // Create the OnOff application to send UDP datagrams of size
   142   // Create the OnOff application to send UDP datagrams of size
   143   // 210 bytes at a rate of 448 Kb/s
   143   // 210 bytes at a rate of 448 Kb/s
   144   Ptr<OnOffApplication> ooff = Create<OnOffApplication> (
   144   Ptr<OnOffApplication> ooff = Create<OnOffApplication> (
   145     n0, 
   145     n0, 
   146     InetAddress("10.1.3.2", 80).ConvertTo (), 
   146     InetSocketAddress("10.1.3.2", 80).ConvertTo (), 
   147     "Udp",
   147     "Udp",
   148     ConstantVariable(1), 
   148     ConstantVariable(1), 
   149     ConstantVariable(0));
   149     ConstantVariable(0));
   150   // Start the application
   150   // Start the application
   151   ooff->Start(Seconds(1.0));
   151   ooff->Start(Seconds(1.0));
   152   ooff->Stop (Seconds(10.0));
   152   ooff->Stop (Seconds(10.0));
   153 
   153 
   154   // Create a similar flow from n3 to n1, starting at time 1.1 seconds
   154   // Create a similar flow from n3 to n1, starting at time 1.1 seconds
   155   ooff = Create<OnOffApplication> (
   155   ooff = Create<OnOffApplication> (
   156     n3, 
   156     n3, 
   157     InetAddress("10.1.2.1", 80).ConvertTo (),
   157     InetSocketAddress("10.1.2.1", 80).ConvertTo (),
   158     "Udp",
   158     "Udp",
   159     ConstantVariable(1), 
   159     ConstantVariable(1), 
   160     ConstantVariable(0));
   160     ConstantVariable(0));
   161   // Start the application
   161   // Start the application
   162   ooff->Start(Seconds(1.1));
   162   ooff->Start(Seconds(1.1));