src/test/ns3tcp/ns3tcp-cwnd-test-suite.cc
author Tom Henderson <tomh@tomh.org>
Fri, 17 Dec 2010 21:07:57 -0800
changeset 6696 5b61f3c1ba10
parent 6009 e1b696a1ed28
child 6697 6f1114f669ff
permissions -rw-r--r--
Update TCP regression tests
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4772
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     2
/*
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     3
 * Copyright (c) 2009 University of Washington
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     4
 *
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     8
 *
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    12
 * GNU General Public License for more details.
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    13
 *
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    17
 */
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    18
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    19
#include "ns3/log.h"
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    20
#include "ns3/abort.h"
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    21
#include "ns3/test.h"
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    22
#include "ns3/pcap-file.h"
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    23
#include "ns3/config.h"
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    24
#include "ns3/string.h"
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    25
#include "ns3/uinteger.h"
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    26
#include "ns3/data-rate.h"
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    27
#include "ns3/inet-socket-address.h"
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    28
#include "ns3/point-to-point-helper.h"
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    29
#include "ns3/internet-stack-helper.h"
5379
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
    30
#include "ns3/ipv4-global-routing-helper.h"
4772
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    31
#include "ns3/ipv4-address-helper.h"
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    32
#include "ns3/packet-sink-helper.h"
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    33
#include "ns3/tcp-socket-factory.h"
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    34
#include "ns3/simulator.h"
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    35
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    36
using namespace ns3;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    37
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    38
NS_LOG_COMPONENT_DEFINE ("Ns3CwndTest");
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    39
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    40
// ===========================================================================
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    41
// This is a simple test to demonstrate how a known good model (a reference 
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    42
// implementation) may be used to test another model without resorting to 
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    43
// storing stimulus or response vectors.
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    44
//
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    45
// Node zero contains the model under test, in this case the ns-3 TCP 
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    46
// implementation.  Node one contains the reference implementation that we
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    47
// assume will generate good test vectors for us.  In this case, a Linux
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    48
// TCP implementation is used to stimulate the ns-3 TCP model with what we
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    49
// assume are perfectly good packets.  We watch the ns-3 implementation to
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    50
// see what it does in the presence of these assumed good stimuli.
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    51
//
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    52
// The test is arranged as a typical ns-3 script, but we use the trace system
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    53
// to peek into the running system and monitor the ns-3 TCP.
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    54
//
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    55
// The topology is just two nodes communicating over a point-to-point network.
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    56
// The point-to-point network is chosen because it is simple and allows us to
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    57
// easily generate pcap traces we can use to separately verify that the ns-3
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    58
// implementation is responding correctly.  Once the oopration is verified, we
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    59
// enter a list of responses that capture the response succinctly.
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    60
//
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    61
//         node 0                 node 1
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    62
//   +----------------+    +----------------+
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    63
//   |    ns-3 TCP    |    |    Linux TCP   |
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    64
//   +----------------+    +----------------+
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    65
//   |    10.1.1.1    |    |    10.1.1.2    |
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    66
//   +----------------+    +----------------+
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    67
//   | point-to-point |    | point-to-point |
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    68
//   +----------------+    +----------------+
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    69
//           |                     |
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    70
//           +---------------------+
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    71
//                5 Mbps, 2 ms
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    72
//
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    73
// ===========================================================================
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    74
//
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    75
class SimpleSource : public Application 
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    76
{
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    77
public:
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    78
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    79
  SimpleSource ();
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    80
  virtual ~SimpleSource();
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    81
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    82
  void Setup (Ptr<Socket> socket, Address address, uint32_t packetSize, uint32_t nPackets, DataRate dataRate);
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    83
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    84
private:
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    85
  virtual void StartApplication (void);  
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    86
  virtual void StopApplication (void);
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    87
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    88
  void ScheduleTx (void);
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    89
  void SendPacket (void);
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    90
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    91
  Ptr<Socket>     m_socket;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    92
  Address         m_peer;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    93
  uint32_t        m_packetSize;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    94
  uint32_t        m_nPackets;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    95
  DataRate        m_dataRate;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    96
  EventId         m_sendEvent;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    97
  bool            m_running;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    98
  uint32_t        m_packetsSent;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    99
};
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   100
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   101
SimpleSource::SimpleSource ()
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   102
  : m_socket (0), 
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   103
    m_peer (), 
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   104
    m_packetSize (0), 
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   105
    m_nPackets (0), 
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   106
    m_dataRate (0), 
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   107
    m_sendEvent (), 
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   108
    m_running (false), 
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   109
    m_packetsSent (0)
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   110
{
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   111
}
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   112
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   113
SimpleSource::~SimpleSource()
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   114
{
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   115
  m_socket = 0;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   116
}
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   117
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   118
void
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   119
SimpleSource::Setup (Ptr<Socket> socket, Address address, uint32_t packetSize, uint32_t nPackets, DataRate dataRate)
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   120
{
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   121
  m_socket = socket;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   122
  m_peer = address;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   123
  m_packetSize = packetSize;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   124
  m_nPackets = nPackets;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   125
  m_dataRate = dataRate;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   126
}
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   127
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   128
void
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   129
SimpleSource::StartApplication (void)
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   130
{
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   131
  m_running = true;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   132
  m_packetsSent = 0;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   133
  m_socket->Bind ();
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   134
  m_socket->Connect (m_peer);
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   135
  SendPacket ();
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   136
}
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   137
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   138
void 
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   139
SimpleSource::StopApplication (void)
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   140
{
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   141
  m_running = false;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   142
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   143
  if (m_sendEvent.IsRunning ())
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   144
    {
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   145
      Simulator::Cancel (m_sendEvent);
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   146
    }
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   147
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   148
  if (m_socket)
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   149
    {
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   150
      m_socket->Close ();
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   151
    }
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   152
}
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   153
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   154
void 
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   155
SimpleSource::SendPacket (void)
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   156
{
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   157
  Ptr<Packet> packet = Create<Packet> (m_packetSize);
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   158
  m_socket->Send (packet);
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   159
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   160
  if (++m_packetsSent < m_nPackets)
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   161
    {
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   162
      ScheduleTx ();
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   163
    }
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   164
}
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   165
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   166
void 
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   167
SimpleSource::ScheduleTx (void)
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   168
{
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   169
  if (m_running)
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   170
    {
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   171
      Time tNext (Seconds (m_packetSize * 8 / static_cast<double> (m_dataRate.GetBitRate ())));
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   172
      m_sendEvent = Simulator::Schedule (tNext, &SimpleSource::SendPacket, this);
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   173
    }
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   174
}
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   175
5379
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   176
class Ns3TcpCwndTestCase1 : public TestCase
4772
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   177
{
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   178
public:
5379
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   179
  Ns3TcpCwndTestCase1 ();
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   180
  virtual ~Ns3TcpCwndTestCase1 ();
4772
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   181
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   182
private:
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   183
  virtual bool DoRun (void);
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   184
  bool m_writeResults;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   185
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   186
  class  CwndEvent {
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   187
  public:
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   188
    uint32_t m_oldCwnd;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   189
    uint32_t m_newCwnd;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   190
  };
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   191
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   192
  TestVectors<CwndEvent> m_responses;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   193
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   194
  void CwndChange (uint32_t oldCwnd, uint32_t newCwnd);
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   195
};
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   196
5379
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   197
Ns3TcpCwndTestCase1::Ns3TcpCwndTestCase1 ()
4772
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   198
  : TestCase ("Check to see that the ns-3 TCP congestion window works as expected against liblinux2.6.26.so"),
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   199
    m_writeResults (false)
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   200
{
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   201
}
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   202
5379
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   203
Ns3TcpCwndTestCase1::~Ns3TcpCwndTestCase1 ()
4772
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   204
{
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   205
}
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   206
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   207
void
5379
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   208
Ns3TcpCwndTestCase1::CwndChange (uint32_t oldCwnd, uint32_t newCwnd)
4772
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   209
{
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   210
  CwndEvent event;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   211
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   212
  event.m_oldCwnd = oldCwnd;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   213
  event.m_newCwnd = newCwnd;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   214
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   215
  m_responses.Add (event);
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   216
}
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   217
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   218
bool
5379
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   219
Ns3TcpCwndTestCase1::DoRun (void)
4772
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   220
{
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   221
  //
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   222
  // Just create two nodes.  One (node zero) will be the node with the TCP
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   223
  // under test which is the ns-3 TCP implementation.  The other node (node
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   224
  // one) will be the node with the reference implementation we use to drive
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   225
  // the tests.
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   226
  //
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   227
  NodeContainer nodes;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   228
  nodes.Create (2);
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   229
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   230
  //
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   231
  // For this test we'll use a point-to-point net device.  It's not as simple
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   232
  // as a simple-net-device, but it provides nice places to hook trace events
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   233
  // so we can see what's moving between our nodes.
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   234
  //
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   235
  PointToPointHelper pointToPoint;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   236
  pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   237
  pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   238
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   239
  //
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   240
  // Install the point-to-point devices on both nodes and connec them up.
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   241
  //
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   242
  NetDeviceContainer devices;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   243
  devices = pointToPoint.Install (nodes);
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   244
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   245
  //
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   246
  // Install two variants of the internet stack.  The first, on node zero 
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   247
  // uses the TCP under test, which is the default ns-3 TCP implementation.
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   248
  //
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   249
  InternetStackHelper stack;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   250
  stack.Install (nodes.Get (0));
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   251
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   252
  //
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   253
  // The other node, node one, is going to be set up to use a Linux TCP
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   254
  // implementation that we consider a known good TCP.
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   255
  //
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   256
  std::string nscStack = "liblinux2.6.26.so";
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   257
  stack.SetTcp ("ns3::NscTcpL4Protocol", "Library", StringValue("liblinux2.6.26.so"));
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   258
  stack.Install (nodes.Get (1));
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   259
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   260
  //
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   261
  // Assign the address 10.1.1.1 to the TCP implementation under test (index
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   262
  // zero) and 10.1.1.2 to the reference implementation (index one).
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   263
  //
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   264
  Ipv4AddressHelper address;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   265
  address.SetBase ("10.1.1.0", "255.255.255.252");
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   266
  Ipv4InterfaceContainer interfaces = address.Assign (devices);
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   267
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   268
  //
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   269
  // We need a place to send our TCP data on the node with the reference TCP 
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   270
  // implementation.  We aren't really concerned about what happens there, so
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   271
  // just create a sink.
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   272
  //
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   273
  uint16_t sinkPort = 8080;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   274
  Address sinkAddress (InetSocketAddress(interfaces.GetAddress (1), sinkPort));
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   275
  PacketSinkHelper packetSinkHelper ("ns3::TcpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), sinkPort));
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   276
  ApplicationContainer sinkApps = packetSinkHelper.Install (nodes.Get (1));
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   277
  sinkApps.Start (Seconds (0.));
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   278
  sinkApps.Stop (Seconds (1.1));
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   279
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   280
  //
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   281
  // We want to look at changes in the ns-3 TCP congestion window.  The 
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   282
  // congestion window is flow clontrol imposed by the sender, so we need
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   283
  // to crank up a flow from the ns-3 TCP node to the NSC TCP node and hook the
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   284
  // CongestionWindow attribute on the socket.  Normally one would use an on-off
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   285
  // application to generate a flow, but this has a couple of problems.  First,
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   286
  // the socket of the on-off application is not created until Application Start
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   287
  // time, so we wouldn't be able to hook the socket now at configuration time.  
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   288
  // Second, even if we could arrange a call after start time, the socket is not 
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   289
  // public.
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   290
  //
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   291
  // So, we can cook up a simple version of the on-off application that does what
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   292
  // we want.  On the plus side we don't need all of the complexity of the on-off
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   293
  // application.  On the minus side, we don't have a helper, so we have to get
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   294
  // a little more involved in the details, but this is trivial.
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   295
  //
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   296
  // So first, we create a socket and do the trace connect on it; then we pass this
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   297
  // socket into the constructor of our simple application which we then install
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   298
  // in the node with the ns-3 TCP.
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   299
  //
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   300
  Ptr<Socket> ns3TcpSocket = Socket::CreateSocket (nodes.Get (0), TcpSocketFactory::GetTypeId ());
5379
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   301
  ns3TcpSocket->TraceConnectWithoutContext ("CongestionWindow", MakeCallback (&Ns3TcpCwndTestCase1::CwndChange, this));
4772
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   302
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   303
  Ptr<SimpleSource> app = CreateObject<SimpleSource> ();
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   304
  app->Setup (ns3TcpSocket, sinkAddress, 1040, 10, DataRate ("5Mbps"));
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   305
  nodes.Get (0)->AddApplication (app);
5531
f900254c52e1 Align tcp test program with Application API change
Tom Henderson <tomh@tomh.org>
parents: 5403
diff changeset
   306
  app->SetStartTime (Seconds (1.));
f900254c52e1 Align tcp test program with Application API change
Tom Henderson <tomh@tomh.org>
parents: 5403
diff changeset
   307
  app->SetStopTime (Seconds (1.1));
4772
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   308
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   309
  //
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   310
  // The idea here is that someone will look very closely at the all of the
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   311
  // communications between the reference TCP and the TCP under test in this
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   312
  // simulation and determine that all of the responses are correct.  We expect
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   313
  // that this means generating a pcap trace file from the point-to-point link
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   314
  // and examining the packets closely using tcpdump, wireshark or some such
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   315
  // program.  So we provide the ability to generate a pcap trace of the 
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   316
  // test execution for your perusal.
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   317
  //
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   318
  // Once the validation test is determined to be running exactly as exptected,
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   319
  // the set of congestion window changes is collected and hard coded into the 
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   320
  // test results which will then be checked during the actual execution of the
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   321
  // test.
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   322
  //
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   323
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   324
  if (m_writeResults)
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   325
    {
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents: 5531
diff changeset
   326
      pointToPoint.EnablePcapAll ("tcp-cwnd");
4772
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   327
    }
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   328
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   329
  Simulator::Stop (Seconds(2));
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   330
  Simulator::Run ();
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   331
  Simulator::Destroy ();
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   332
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   333
  //
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   334
  // As new acks are received by the TCP under test, the congestion window 
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   335
  // should be opened up by one segment (MSS bytes) each time.  This should
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   336
  // trigger a congestion window change event which we hooked and saved above.
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   337
  // We should now be able to look through the saved response vectors and follow
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   338
  // the congestion window as it opens up when the ns-3 TCP under test 
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   339
  // transmits its bits
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   340
  //
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   341
  // From inspecting the results, we know that we should see N_EVENTS congestion
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   342
  // window change events.  The window should expand N_EVENTS - 1 times (each
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   343
  // time by MSS bytes) until it gets to its largest value.  Then the application
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   344
  // sending stops and the window should be slammed shut, with the last event 
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   345
  // reflecting the change from LARGEST_CWND back to MSS
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   346
  //
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   347
  const uint32_t MSS = 536;
5403
530155ecdbcb fix ns3-tcp-cwnd unit test
Craig Dowell <craigdo@ee.washington.edu>
parents: 5384
diff changeset
   348
  const uint32_t N_EVENTS = 20;
4772
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   349
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   350
  CwndEvent event;
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   351
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   352
  NS_TEST_ASSERT_MSG_EQ (m_responses.GetN (), N_EVENTS, "Unexpectedly low number of cwnd change events");
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   353
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   354
5403
530155ecdbcb fix ns3-tcp-cwnd unit test
Craig Dowell <craigdo@ee.washington.edu>
parents: 5384
diff changeset
   355
  for (uint32_t i = 0, from = MSS, to = MSS * 2; i < N_EVENTS; ++i, from += MSS, to += MSS)
4772
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   356
    {
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   357
      event = m_responses.Get (i);
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   358
      NS_TEST_ASSERT_MSG_EQ (event.m_oldCwnd, from, "Wrong old cwnd value in cwnd change event " << i);
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   359
      NS_TEST_ASSERT_MSG_EQ (event.m_newCwnd, to, "Wrong new cwnd value in cwnd change event " << i);
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   360
    }
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   361
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   362
  return GetErrorStatus ();
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   363
}
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   364
5379
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   365
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   366
// ===========================================================================
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   367
// Test case for cwnd changes due to out-of-order packets. A bottleneck 
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   368
// link is created, and a limited droptail queue is used in order to 
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   369
// force dropped packets, resulting in out-of-order packet delivery. 
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   370
// This out-of-order delivery will result in a different congestion 
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   371
// window behavior than testcase 1.  Specifically, duplicate ACKs
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   372
// are encountered.
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   373
//
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   374
// Network topology
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   375
//
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   376
//        1Mb/s, 10ms      100kb/s, 10ms     1Mb/s, 10ms
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   377
//    n0--------------n1-----------------n2---------------n3
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   378
//
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   379
// ===========================================================================
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   380
class Ns3TcpCwndTestCase2 : public TestCase
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   381
{
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   382
public:
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   383
  Ns3TcpCwndTestCase2 ();
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   384
  virtual ~Ns3TcpCwndTestCase2 ();
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   385
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   386
private:
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   387
  virtual bool DoRun (void);
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   388
  bool m_writeResults;
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   389
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   390
  class  CwndEvent {
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   391
  public:
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   392
    uint32_t m_oldCwnd;
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   393
    uint32_t m_newCwnd;
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   394
  };
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   395
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   396
  TestVectors<CwndEvent> m_responses;
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   397
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   398
  void CwndChange (uint32_t oldCwnd, uint32_t newCwnd);
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   399
};
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   400
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   401
Ns3TcpCwndTestCase2::Ns3TcpCwndTestCase2 ()
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   402
  : TestCase ("Check to see that the ns-3 TCP congestion window works as expected for out-of-order packet delivery"),
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   403
    m_writeResults (false)
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   404
{
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   405
}
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   406
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   407
Ns3TcpCwndTestCase2::~Ns3TcpCwndTestCase2 ()
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   408
{
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   409
}
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   410
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   411
void
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   412
Ns3TcpCwndTestCase2::CwndChange (uint32_t oldCwnd, uint32_t newCwnd)
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   413
{
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   414
  CwndEvent event;
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   415
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   416
  event.m_oldCwnd = oldCwnd;
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   417
  event.m_newCwnd = newCwnd;
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   418
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   419
  m_responses.Add (event);
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   420
}
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   421
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   422
bool
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   423
Ns3TcpCwndTestCase2::DoRun (void)
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   424
{
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   425
  // Set up some default values for the simulation.
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   426
  Config::SetDefault ("ns3::DropTailQueue::MaxPackets", UintegerValue (4));
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   427
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   428
  NodeContainer n0n1;
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   429
  n0n1.Create (2);
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   430
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   431
  NodeContainer n1n2;
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   432
  n1n2.Add (n0n1.Get (1));
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   433
  n1n2.Create (1);
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   434
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   435
  NodeContainer n2n3;
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   436
  n2n3.Add (n1n2.Get (1));
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   437
  n2n3.Create (1);
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   438
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   439
  PointToPointHelper p2p1;
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   440
  p2p1.SetDeviceAttribute ("DataRate", DataRateValue (DataRate(1000000)));
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   441
  p2p1.SetChannelAttribute ("Delay", TimeValue (MilliSeconds(10)));
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   442
  PointToPointHelper p2p2;
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   443
  p2p2.SetDeviceAttribute ("DataRate", DataRateValue (DataRate(100000)));
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   444
  p2p2.SetChannelAttribute ("Delay", TimeValue (MilliSeconds(10)));
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   445
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   446
  // And then install devices and channels connecting our topology.
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   447
  NetDeviceContainer dev0 = p2p1.Install (n0n1);
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   448
  NetDeviceContainer dev1 = p2p2.Install (n1n2);
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   449
  NetDeviceContainer dev2 = p2p1.Install (n2n3);
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   450
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   451
  // Now add ip/tcp stack to all nodes.
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   452
  InternetStackHelper internet;
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   453
  internet.InstallAll ();
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   454
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   455
  // Later, we add IP addresses.
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   456
  Ipv4AddressHelper ipv4;
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   457
  ipv4.SetBase ("10.1.3.0", "255.255.255.0");
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   458
  ipv4.Assign (dev0);
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   459
  ipv4.SetBase ("10.1.2.0", "255.255.255.0");
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   460
  ipv4.Assign (dev1);
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   461
  ipv4.SetBase ("10.1.1.0", "255.255.255.0");
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   462
  Ipv4InterfaceContainer ipInterfs = ipv4.Assign (dev2);
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   463
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   464
  // and setup ip routing tables to get total ip-level connectivity.
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   465
  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   466
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   467
  // Set up the apps
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   468
  uint16_t servPort = 50000;
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   469
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   470
  // Create a packet sink to receive these packets on n3
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   471
  PacketSinkHelper sink ("ns3::TcpSocketFactory",
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   472
                         InetSocketAddress (Ipv4Address::GetAny (), servPort));
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   473
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   474
  ApplicationContainer apps = sink.Install (n2n3.Get (1));
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   475
  apps.Start (Seconds (0.0));
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   476
  apps.Stop (Seconds (5.4));
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   477
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   478
  // Create the socket for n0
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   479
  Address sinkAddress (InetSocketAddress(ipInterfs.GetAddress (1), servPort));
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   480
  Ptr<Socket> ns3TcpSocket = Socket::CreateSocket (n0n1.Get (0), TcpSocketFactory::GetTypeId ());
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   481
  ns3TcpSocket->TraceConnectWithoutContext ("CongestionWindow", MakeCallback (&Ns3TcpCwndTestCase2::CwndChange, this));
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   482
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   483
  // Create and start the app for n0
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   484
  Ptr<SimpleSource> app = CreateObject<SimpleSource> ();
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   485
  app->Setup (ns3TcpSocket, sinkAddress, 1040, 1000, DataRate ("1Mbps"));
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   486
  n0n1.Get (0)->AddApplication (app);
5531
f900254c52e1 Align tcp test program with Application API change
Tom Henderson <tomh@tomh.org>
parents: 5403
diff changeset
   487
  app->SetStartTime (Seconds (1.0));
f900254c52e1 Align tcp test program with Application API change
Tom Henderson <tomh@tomh.org>
parents: 5403
diff changeset
   488
  app->SetStopTime (Seconds (5.4));
5379
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   489
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   490
  if (m_writeResults)
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   491
    {
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   492
      // Write a pcap for tcp cwnd testcase with out-of-order delivery
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents: 5531
diff changeset
   493
      PointToPointHelper pointToPoint;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents: 5531
diff changeset
   494
      pointToPoint.EnablePcapAll ("tcp-cwnd-ood");
5379
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   495
    }
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   496
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   497
  // Finally, set up the simulator to run.
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   498
  Simulator::Stop (Seconds(5.4));
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   499
  Simulator::Run ();
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   500
  Simulator::Destroy ();
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   501
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   502
  //
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   503
  // As new acks are received by the TCP under test, the congestion window 
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   504
  // should be opened up by one segment (MSS bytes) each time.  This should
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   505
  // trigger a congestion window change event which we hooked and saved above.
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   506
  // We should now be able to look through the saved response vectors and follow
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   507
  // the congestion window as it opens up when the ns-3 TCP under test 
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   508
  // transmits its bits
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   509
  //
6696
5b61f3c1ba10 Update TCP regression tests
Tom Henderson <tomh@tomh.org>
parents: 6009
diff changeset
   510
  // From inspecting the results, we know that we should see 43 congestion
5b61f3c1ba10 Update TCP regression tests
Tom Henderson <tomh@tomh.org>
parents: 6009
diff changeset
   511
  // window change events. On the ninth change event, the window should 
5b61f3c1ba10 Update TCP regression tests
Tom Henderson <tomh@tomh.org>
parents: 6009
diff changeset
   512
  // be cut from 5360 to 4288 due to 3 dup acks (NewReno behavior is to
5b61f3c1ba10 Update TCP regression tests
Tom Henderson <tomh@tomh.org>
parents: 6009
diff changeset
   513
  // cut in half, and then add 3 segments (5360/2 + 3*536 = 4288)
5b61f3c1ba10 Update TCP regression tests
Tom Henderson <tomh@tomh.org>
parents: 6009
diff changeset
   514
  // It should then increment cwnd by one segment per ack throughout
5b61f3c1ba10 Update TCP regression tests
Tom Henderson <tomh@tomh.org>
parents: 6009
diff changeset
   515
  // the fast recovery phase.  The trace shows that three segments are lost
5b61f3c1ba10 Update TCP regression tests
Tom Henderson <tomh@tomh.org>
parents: 6009
diff changeset
   516
  // within the fast recovery window (with sequence numbers starting at
5b61f3c1ba10 Update TCP regression tests
Tom Henderson <tomh@tomh.org>
parents: 6009
diff changeset
   517
  // 9113, 10721, and 12329).  This last segment (12329) is not recovered
5b61f3c1ba10 Update TCP regression tests
Tom Henderson <tomh@tomh.org>
parents: 6009
diff changeset
   518
  // by a fast retransmit and consequently, a coarse timeout is taken and
5b61f3c1ba10 Update TCP regression tests
Tom Henderson <tomh@tomh.org>
parents: 6009
diff changeset
   519
  // cwnd is reset to MSS at event index 31.  It slow starts again, and takes
5b61f3c1ba10 Update TCP regression tests
Tom Henderson <tomh@tomh.org>
parents: 6009
diff changeset
   520
  // another fast retransmit at index 41.
5379
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   521
  //
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   522
  const uint32_t MSS = 536;
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   523
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   524
  CwndEvent event;
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   525
6696
5b61f3c1ba10 Update TCP regression tests
Tom Henderson <tomh@tomh.org>
parents: 6009
diff changeset
   526
  NS_TEST_ASSERT_MSG_EQ (m_responses.GetN (), 43, "Unexpected number of cwnd change events");
5379
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   527
5403
530155ecdbcb fix ns3-tcp-cwnd unit test
Craig Dowell <craigdo@ee.washington.edu>
parents: 5384
diff changeset
   528
  for (uint32_t i = 0, from = MSS, to = MSS * 2; i < 9; ++i, from += MSS, to += MSS)
5379
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   529
    {
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   530
      event = m_responses.Get (i);
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   531
      NS_TEST_ASSERT_MSG_EQ (event.m_oldCwnd, from, "Wrong old cwnd value in cwnd change event " << i);
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   532
      NS_TEST_ASSERT_MSG_EQ (event.m_newCwnd, to, "Wrong new cwnd value in cwnd change event " << i);
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   533
    }
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   534
6696
5b61f3c1ba10 Update TCP regression tests
Tom Henderson <tomh@tomh.org>
parents: 6009
diff changeset
   535
  // Cwnd should be back to (10/2 + 3) = 8*MSS
5379
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   536
  event = m_responses.Get (9);
6696
5b61f3c1ba10 Update TCP regression tests
Tom Henderson <tomh@tomh.org>
parents: 6009
diff changeset
   537
  NS_TEST_ASSERT_MSG_EQ (event.m_newCwnd, 8*MSS, "Wrong new cwnd value in cwnd change event " << 9);
5379
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   538
6696
5b61f3c1ba10 Update TCP regression tests
Tom Henderson <tomh@tomh.org>
parents: 6009
diff changeset
   539
  // Fast recovery
5b61f3c1ba10 Update TCP regression tests
Tom Henderson <tomh@tomh.org>
parents: 6009
diff changeset
   540
  for (uint32_t i = 10, from = 8*MSS, to = 9 * MSS; i < 31; ++i, from += MSS, to += MSS)
5379
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   541
    {
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   542
      event = m_responses.Get (i);
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   543
      NS_TEST_ASSERT_MSG_EQ (event.m_oldCwnd, from, "Wrong old cwnd value in cwnd change event " << i);
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   544
      NS_TEST_ASSERT_MSG_EQ (event.m_newCwnd, to, "Wrong new cwnd value in cwnd change event " << i);
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   545
    }
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   546
6696
5b61f3c1ba10 Update TCP regression tests
Tom Henderson <tomh@tomh.org>
parents: 6009
diff changeset
   547
  // Slow start again after coarse timeout
5b61f3c1ba10 Update TCP regression tests
Tom Henderson <tomh@tomh.org>
parents: 6009
diff changeset
   548
  for (uint32_t i = 32, from = MSS, to = MSS * 2; i < 41; ++i, from += MSS, to += MSS)
5379
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   549
    {
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   550
      event = m_responses.Get (i);
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   551
      NS_TEST_ASSERT_MSG_EQ (event.m_oldCwnd, from, "Wrong old cwnd value in cwnd change event " << i);
6696
5b61f3c1ba10 Update TCP regression tests
Tom Henderson <tomh@tomh.org>
parents: 6009
diff changeset
   552
      NS_TEST_ASSERT_MSG_EQ (event.m_newCwnd, to, "Wrong new cwnd value in cwnd change event " << i);
5379
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   553
    }
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   554
6696
5b61f3c1ba10 Update TCP regression tests
Tom Henderson <tomh@tomh.org>
parents: 6009
diff changeset
   555
  // Fast retransmit again; cwnd should be back to 8*MSS
5b61f3c1ba10 Update TCP regression tests
Tom Henderson <tomh@tomh.org>
parents: 6009
diff changeset
   556
  event = m_responses.Get (41);
5b61f3c1ba10 Update TCP regression tests
Tom Henderson <tomh@tomh.org>
parents: 6009
diff changeset
   557
  NS_TEST_ASSERT_MSG_EQ (event.m_newCwnd, 8*MSS, "Wrong new cwnd value in cwnd change event " << 41);
5379
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   558
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   559
  return GetErrorStatus ();
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   560
}
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   561
4772
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   562
class Ns3TcpCwndTestSuite : public TestSuite
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   563
{
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   564
public:
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   565
  Ns3TcpCwndTestSuite ();
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   566
};
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   567
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   568
Ns3TcpCwndTestSuite::Ns3TcpCwndTestSuite ()
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   569
  : TestSuite ("ns3-tcp-cwnd", SYSTEM)
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   570
{
5379
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   571
  AddTestCase (new Ns3TcpCwndTestCase1);
5d2766b6aafc Testcase for bug 647
Josh Pelkey <jpelkey@gatech.edu>
parents: 4772
diff changeset
   572
  AddTestCase (new Ns3TcpCwndTestCase2);
4772
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   573
}
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   574
7b6ae6bf0055 add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   575
Ns3TcpCwndTestSuite ns3TcpCwndTestSuite;