examples/tcp-large-transfer.cc
changeset 2997 caf9d364c6fc
parent 2996 a83b94e277d4
parent 2965 4b28e9740e3b
child 3012 56a4c75f9422
child 3239 be022cc7fec9
equal deleted inserted replaced
2996:a83b94e277d4 2997:caf9d364c6fc
   135   c1.Add (c0.Get (1));
   135   c1.Add (c0.Get (1));
   136   c1.Create (1);
   136   c1.Create (1);
   137 
   137 
   138   // We create the channels first without any IP addressing information
   138   // We create the channels first without any IP addressing information
   139   PointToPointHelper p2p;
   139   PointToPointHelper p2p;
   140   p2p.SetChannelParameter ("BitRate", DataRate(10000000));
   140   p2p.SetChannelParameter ("BitRate", DataRateValue (DataRate(10000000)));
   141   p2p.SetChannelParameter ("Delay", MilliSeconds(10));
   141   p2p.SetChannelParameter ("Delay", TimeValue (MilliSeconds(10)));
   142   NetDeviceContainer dev0 = p2p.Install (c0);
   142   NetDeviceContainer dev0 = p2p.Install (c0);
   143   NetDeviceContainer dev1 = p2p.Install (c1);
   143   NetDeviceContainer dev1 = p2p.Install (c1);
   144 
   144 
   145   // add ip/tcp stack to nodes.
   145   // add ip/tcp stack to nodes.
   146   NodeContainer c = NodeContainer (c0, c1.Get (1));
   146   NodeContainer c = NodeContainer (c0, c1.Get (1));
   168   int nBytes = 2000000;
   168   int nBytes = 2000000;
   169   uint16_t servPort = 50000;
   169   uint16_t servPort = 50000;
   170 
   170 
   171   // Create a packet sink to receive these packets
   171   // Create a packet sink to receive these packets
   172   PacketSinkHelper sink ("ns3::Tcp",
   172   PacketSinkHelper sink ("ns3::Tcp",
   173     Address (InetSocketAddress (Ipv4Address::GetAny (), servPort)));
   173                          InetSocketAddress (Ipv4Address::GetAny (), servPort));
   174 
   174 
   175   ApplicationContainer apps = sink.Install (c1.Get (1));
   175   ApplicationContainer apps = sink.Install (c1.Get (1));
   176   apps.Start (Seconds (0.0));
   176   apps.Start (Seconds (0.0));
   177 
   177 
   178   // and generate traffic to remote sink.
   178   // and generate traffic to remote sink.