141 |
141 |
142 int nBytes = 2000000; |
142 int nBytes = 2000000; |
143 uint16_t servPort = 50000; |
143 uint16_t servPort = 50000; |
144 |
144 |
145 // Create a packet sink to receive these packets |
145 // Create a packet sink to receive these packets |
146 PacketSinkHelper sink ("ns3::Tcp", |
146 PacketSinkHelper sink ("ns3::TcpSocketFactory", |
147 InetSocketAddress (Ipv4Address::GetAny (), servPort)); |
147 InetSocketAddress (Ipv4Address::GetAny (), servPort)); |
148 |
148 |
149 ApplicationContainer apps = sink.Install (c1.Get (1)); |
149 ApplicationContainer apps = sink.Install (c1.Get (1)); |
150 apps.Start (Seconds (0.0)); |
150 apps.Start (Seconds (0.0)); |
151 |
151 |
152 // and generate traffic to remote sink. |
152 // and generate traffic to remote sink. |
153 //TypeId tid = TypeId::LookupByName ("ns3::Tcp"); |
153 //TypeId tid = TypeId::LookupByName ("ns3::TcpSocketFactory"); |
154 Ptr<Socket> localSocket = Socket::CreateSocket (c0.Get (0), Tcp::GetTypeId ()); |
154 Ptr<Socket> localSocket = Socket::CreateSocket (c0.Get (0), TcpSocketFactory::GetTypeId ()); |
155 localSocket->Bind (); |
155 localSocket->Bind (); |
156 Simulator::ScheduleNow (&StartFlow, localSocket, nBytes, |
156 Simulator::ScheduleNow (&StartFlow, localSocket, nBytes, |
157 ipInterfs.GetAddress (1), servPort); |
157 ipInterfs.GetAddress (1), servPort); |
158 |
158 |
159 Config::ConnectWithoutContext ("/NodeList/*/ApplicationList/*/Rx", |
159 Config::ConnectWithoutContext ("/NodeList/*/ApplicationList/*/Rx", |