A Discrete-Event Network Simulator
API
tcp-slow-start-test.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2015 Natale Patriciello <natale.patriciello@gmail.com>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  */
19 #ifndef TCPSLOWSTARTTEST_H
20 #define TCPSLOWSTARTTEST_H
21 
22 #include "ns3/test.h"
23 #include "tcp-general-test.h"
24 
25 namespace ns3 {
26 
39 class
41 {
42 public:
43  TcpSlowStartNormalTest (uint32_t segmentSize, uint32_t packetSize,
44  uint32_t initSsTh, uint32_t packets, TypeId& congControl,
45  const std::string &desc);
46 
47 protected:
48  virtual void CWndTrace (uint32_t oldValue, uint32_t newValue);
49  virtual void Tx (const Ptr<const Packet> p, const TcpHeader &h, SocketWho who);
50  virtual void Rx (const Ptr<const Packet> p, const TcpHeader &h, SocketWho who);
51  void QueueDrop (SocketWho who);
52  void PhyDrop (SocketWho who);
53 
54  virtual void ConfigureEnvironment ();
55  virtual void ConfigureProperties ();
56 
57  uint32_t m_ackedBytes;
58  uint32_t m_sentBytes;
61 
62  bool m_initial;
63 
64 private:
65  uint32_t m_segmentSize;
66  uint32_t m_packetSize;
67  uint32_t m_packets;
68 };
69 
78 class
80 {
81 public:
82  TcpSlowStartAttackerTest (uint32_t segmentSize, uint32_t packetSize,
83  uint32_t initSsTh, uint32_t packets, TypeId& congControl,
84  const std::string &desc);
85 
86 protected:
87  virtual Ptr<TcpSocketMsgBase> CreateReceiverSocket (Ptr<Node> node);
88 };
89 
90 } //namespace ns3
91 #endif // TCPSLOWSTARTTEST_H
92 
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Header for the Transmission Control Protocol.
Definition: tcp-header.h:44
SocketWho
Used as parameter of methods, specifies on what node the caller is interested (e.g.
General infrastructure for TCP testing.
A slow start test using a socket which sends smaller ACKs.
static const uint32_t packetSize
a unique identifier for an interface.
Definition: type-id.h:58
Test the normal behavior for slow start.