diff -r a02c44146209 src/test/ns3tcp/ns3tcp-cwnd-test-suite.cc --- a/src/test/ns3tcp/ns3tcp-cwnd-test-suite.cc Tue Apr 20 14:12:35 2010 -0400 +++ b/src/test/ns3tcp/ns3tcp-cwnd-test-suite.cc Tue Apr 20 15:11:28 2010 -0400 @@ -237,6 +237,26 @@ pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms")); // + // The idea here is that someone will look very closely at the all of the + // communications between the reference TCP and the TCP under test in this + // simulation and determine that all of the responses are correct. We expect + // that this means generating a pcap trace file from the point-to-point link + // and examining the packets closely using tcpdump, wireshark or some such + // program. So we provide the ability to generate a pcap trace of the + // test execution for your perusal. + // + // Once the validation test is determined to be running exactly as exptected, + // the set of congestion window changes is collected and hard coded into the + // test results which will then be checked during the actual execution of the + // test. + // + + if (m_writeResults) + { + pointToPoint.EnablePcapAll ("tcp-cwnd"); + } + + // // Install the point-to-point devices on both nodes and connec them up. // NetDeviceContainer devices; @@ -306,26 +326,6 @@ app->SetStartTime (Seconds (1.)); app->SetStopTime (Seconds (1.1)); - // - // The idea here is that someone will look very closely at the all of the - // communications between the reference TCP and the TCP under test in this - // simulation and determine that all of the responses are correct. We expect - // that this means generating a pcap trace file from the point-to-point link - // and examining the packets closely using tcpdump, wireshark or some such - // program. So we provide the ability to generate a pcap trace of the - // test execution for your perusal. - // - // Once the validation test is determined to be running exactly as exptected, - // the set of congestion window changes is collected and hard coded into the - // test results which will then be checked during the actual execution of the - // test. - // - - if (m_writeResults) - { - pointToPoint.EnablePcapAll ("tcp-cwnd"); - } - Simulator::Stop (Seconds(2)); Simulator::Run (); Simulator::Destroy (); @@ -443,6 +443,13 @@ p2p2.SetDeviceAttribute ("DataRate", DataRateValue (DataRate(100000))); p2p2.SetChannelAttribute ("Delay", TimeValue (MilliSeconds(10))); + if (m_writeResults) + { + // Write a pcap for tcp cwnd testcase with out-of-order delivery + PointToPointHelper pointToPoint; + pointToPoint.EnablePcapAll ("tcp-cwnd-ood"); + } + // And then install devices and channels connecting our topology. NetDeviceContainer dev0 = p2p1.Install (n0n1); NetDeviceContainer dev1 = p2p2.Install (n1n2); @@ -487,13 +494,6 @@ app->SetStartTime (Seconds (1.0)); app->SetStopTime (Seconds (5.4)); - if (m_writeResults) - { - // Write a pcap for tcp cwnd testcase with out-of-order delivery - PointToPointHelper pointToPoint; - pointToPoint.EnablePcapAll ("tcp-cwnd-ood"); - } - // Finally, set up the simulator to run. Simulator::Stop (Seconds(5.4)); Simulator::Run (); diff -r a02c44146209 src/test/ns3tcp/ns3tcp-loss-test-suite.cc --- a/src/test/ns3tcp/ns3tcp-loss-test-suite.cc Tue Apr 20 14:12:35 2010 -0400 +++ b/src/test/ns3tcp/ns3tcp-loss-test-suite.cc Tue Apr 20 15:11:28 2010 -0400 @@ -94,6 +94,12 @@ pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps")); pointToPoint.SetChannelAttribute ("Delay", StringValue ("200ms")); + if (m_writeResults) + { + pointToPoint.EnablePcapAll ("tcp-loss-test-case-1"); + pointToPoint.EnableAsciiAll ("tcp-loss-test-case-1"); + } + NetDeviceContainer devices; devices = pointToPoint.Install (n0, n1); @@ -135,12 +141,6 @@ pem->SetList (sampleList); devices.Get (1)->SetAttribute ("ReceiveErrorModel", PointerValue (pem)); - if (m_writeResults) - { - pointToPoint.EnablePcapAll ("tcp-loss-test-case-1"); - pointToPoint.EnableAsciiAll ("tcp-loss-test-case-1"); - } - Simulator::Stop (simStopTimeObj); Simulator::Run (); Simulator::Destroy (); @@ -203,6 +203,12 @@ pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps")); pointToPoint.SetChannelAttribute ("Delay", StringValue ("200ms")); + if (m_writeResults) + { + pointToPoint.EnablePcapAll ("tcp-loss-test-case-2"); + pointToPoint.EnableAsciiAll ("tcp-loss-test-case-2"); + } + NetDeviceContainer devices; devices = pointToPoint.Install (n0, n1); @@ -243,12 +249,6 @@ pem->SetList (sampleList); devices.Get (1)->SetAttribute ("ReceiveErrorModel", PointerValue (pem)); - if (m_writeResults) - { - pointToPoint.EnablePcapAll ("tcp-loss-test-case-2"); - pointToPoint.EnableAsciiAll ("tcp-loss-test-case-2"); - } - Simulator::Stop (simStopTimeObj); Simulator::Run (); Simulator::Destroy (); diff -r a02c44146209 src/test/ns3tcp/ns3tcp-socket-test-suite.cc --- a/src/test/ns3tcp/ns3tcp-socket-test-suite.cc Tue Apr 20 14:12:35 2010 -0400 +++ b/src/test/ns3tcp/ns3tcp-socket-test-suite.cc Tue Apr 20 15:11:28 2010 -0400 @@ -91,6 +91,11 @@ pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps")); pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms")); + if (m_writeResults) + { + pointToPoint.EnablePcapAll ("tcp-socket-test-case-1"); + } + NetDeviceContainer devices; devices = pointToPoint.Install (n0, n1); @@ -131,11 +136,6 @@ m_inputs.Add (464); // ns-3 TCP default segment size of 536 Simulator::Schedule(writerStopTimeObj, &SocketWriter::Close, socketWriter); - if (m_writeResults) - { - pointToPoint.EnablePcapAll ("tcp-socket-test-case-1"); - } - Simulator::Stop (simStopTimeObj); Simulator::Run (); Simulator::Destroy (); @@ -202,6 +202,11 @@ csma.SetChannelAttribute ("DataRate", StringValue ("5Mbps")); csma.SetChannelAttribute ("Delay", StringValue ("2ms")); + if (m_writeResults) + { + csma.EnablePcapAll ("tcp-socket-test-case-2", false); + } + NetDeviceContainer devices; devices = csma.Install (nodes); @@ -246,10 +251,6 @@ m_inputs.Add (1); Simulator::Schedule(writerStopTimeObj, &SocketWriter::Close, socketWriter); - if (m_writeResults) - { - csma.EnablePcapAll ("tcp-socket-test-case-2", false); - } Simulator::Stop (simStopTimeObj); Simulator::Run (); Simulator::Destroy ();