src/internet/model/tcp-westwood.h
author Natale Patriciello <natale.patriciello@gmail.com>
Mon, 13 Jul 2015 17:57:09 -0700
changeset 11513 99af6df16387
parent 11512 c0e78011217c
permissions -rw-r--r--
Window() is now managed inside TcpSocketBase
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9696
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
     2
/*
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
     3
 * Copyright (c) 2013 ResiliNets, ITTC, University of Kansas 
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
     4
 *
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
     7
 * published by the Free Software Foundation;
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
     8
 *
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    12
 * GNU General Public License for more details.
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    13
 *
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    17
 *
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    18
 * Authors: Siddharth Gangadhar <siddharth@ittc.ku.edu>, Truc Anh N. Nguyen <annguyen@ittc.ku.edu>,
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    19
 * and Greeshma Umapathi
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    20
 *
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    21
 * James P.G. Sterbenz <jpgs@ittc.ku.edu>, director
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    22
 * ResiliNets Research Group  http://wiki.ittc.ku.edu/resilinets
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    23
 * Information and Telecommunication Technology Center (ITTC)
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    24
 * and Department of Electrical Engineering and Computer Science
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    25
 * The University of Kansas Lawrence, KS USA.
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    26
 *
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    27
 * Work supported in part by NSF FIND (Future Internet Design) Program
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    28
 * under grant CNS-0626918 (Postmodern Internet Architecture),
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    29
 * NSF grant CNS-1050226 (Multilayer Network Resilience Analysis and Experimentation on GENI),
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    30
 * US Department of Defense (DoD), and ITTC at The University of Kansas.
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    31
 */
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    32
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    33
#ifndef TCP_WESTWOOD_H
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    34
#define TCP_WESTWOOD_H
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    35
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    36
#include "tcp-socket-base.h"
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    37
#include "ns3/packet.h"
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    38
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    39
namespace ns3 {
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    40
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    41
/**
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    42
 * \ingroup socket
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    43
 * \ingroup tcp
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    44
 *
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    45
 * \brief An implementation of a stream socket using TCP.
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    46
 *
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    47
 * This class contains the implementation of TCP Westwood and Westwood+.
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    48
 *
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    49
 * Westwood and Westwood+ employ the AIAD (Additive Increase/Adaptive Decrease) 
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    50
 * congestion control paradigm. When a congestion episode happens, 
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    51
 * instead of halving the cwnd, these protocols try to estimate the network's
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    52
 * bandwidth and use the estimated value to adjust the cwnd. 
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    53
 * While Westwood performs the bandwidth sampling every ACK reception, 
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    54
 * Westwood+ samples the bandwidth every RTT.
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    55
 *
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    56
 * The two main methods in the implementation are the CountAck (const TCPHeader&)
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    57
 * and the EstimateBW (int, const, Time). The CountAck method calculates
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    58
 * the number of acknowledged segments on the receipt of an ACK.
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    59
 * The EstimateBW estimates the bandwidth based on the value returned by CountAck
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    60
 * and the sampling interval (last ACK inter-arrival time for Westwood and last RTT for Westwood+).   
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    61
 */
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    62
class TcpWestwood : public TcpSocketBase
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    63
{
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    64
public:
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
    65
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
    66
   * \brief Get the type ID.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
    67
   * \return the object TypeId
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
    68
   */
9696
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    69
  static TypeId GetTypeId (void);
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    70
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    71
  TcpWestwood (void);
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
    72
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
    73
   * \brief Copy constructor
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
    74
   * \param sock the object to copy
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
    75
   */
9696
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    76
  TcpWestwood (const TcpWestwood& sock);
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    77
  virtual ~TcpWestwood (void);
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    78
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
    79
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
    80
   * \brief Protocol variant (Westwood or Westwood+)
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
    81
   */
9696
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    82
  enum ProtocolType 
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    83
  {
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    84
    WESTWOOD,
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    85
    WESTWOODPLUS
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    86
  };
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    87
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
    88
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
    89
   * \brief Filter type (None or Tustin)
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
    90
   */
9696
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    91
  enum FilterType 
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    92
  {
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    93
    NONE,
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    94
    TUSTIN
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    95
  };
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    96
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
    97
protected:
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
    98
  virtual Ptr<TcpSocketBase> Fork (void); // Call CopyObject<TcpTahoe> to clone me
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
    99
  virtual void NewAck (SequenceNumber32 const& seq); // Inc cwnd and call NewAck() of parent
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
   100
  virtual void DupAck (const TcpHeader& t, uint32_t count);  // Treat 3 dupack as timeout
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
   101
  virtual void Retransmit (void); // Retransmit time out
9696
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   102
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   103
  /**
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   104
   * Process the newly received ACK
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   105
   *
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   106
   * \param packet the received ACK packet
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   107
   * \param tcpHeader the header attached to the ACK packet
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   108
   */  
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   109
  virtual void ReceivedAck (Ptr<Packet> packet, const TcpHeader& tcpHeader);
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   110
  
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   111
  /**
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   112
   * Estimate the RTT, record the minimum value,
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   113
   * and run a clock on the RTT to trigger Westwood+ bandwidth sampling
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
   114
   * \param header the packet header
9696
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   115
   */
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   116
  virtual void EstimateRtt (const TcpHeader& header);
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   117
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   118
private:
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   119
  /**
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   120
   * Calculate the number of acknowledged packets upon the receipt of an ACK packet
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   121
   *
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   122
   * \param tcpHeader the header of the received ACK packet
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   123
   * \return the number of ACKed packets
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   124
   */
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   125
  int CountAck (const TcpHeader& tcpHeader);
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   126
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   127
  /**
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   128
   * Update the total number of acknowledged packets during the current RTT
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   129
   *
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   130
   * \param acked the number of packets the currently received ACK acknowledges
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   131
   */
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   132
  void UpdateAckedSegments (int acked);
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   133
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   134
  /**
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   135
   * Estimate the network's bandwidth
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   136
   *
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   137
   * \param acked the number of acknowledged packets returned by CountAck
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   138
   * \param tcpHeader the header of the packet
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   139
   * \param rtt the RTT estimation
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   140
   */
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   141
  void EstimateBW (int acked, const TcpHeader& tcpHeader, Time rtt);
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   142
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   143
  /**
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   144
   * Tustin filter
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   145
   */
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   146
  void Filtering (void);
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   147
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   148
protected:
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
   149
  bool                   m_inFastRec;              //!< Currently in fast recovery if TRUE
9696
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   150
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
   151
  TracedValue<double>    m_currentBW;              //!< Current value of the estimated BW
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
   152
  double                 m_lastSampleBW;           //!< Last bandwidth sample
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
   153
  double                 m_lastBW;                 //!< Last bandwidth sample after being filtered
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
   154
  Time                   m_minRtt;                 //!< Minimum RTT
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
   155
  double                 m_lastAck;                //!< The time last ACK was received
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
   156
  SequenceNumber32       m_prevAckNo;              //!< Previously received ACK number
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
   157
  int                    m_accountedFor;           //!< The number of received DUPACKs
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
   158
  enum ProtocolType      m_pType;                  //!< 0 for Westwood, 1 for Westwood+
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
   159
  enum FilterType        m_fType;                  //!< 0 for none, 1 for Tustin
9696
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   160
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
   161
  int                    m_ackedSegments;          //!< The number of segments ACKed between RTTs
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
   162
  bool                   m_IsCount;                //!< Start keeping track of m_ackedSegments for Westwood+ if TRUE
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9696
diff changeset
   163
  EventId                m_bwEstimateEvent;        //!< The BW estimation event for Westwood+
9696
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   164
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   165
};
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   166
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   167
} // namespace ns3
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   168
4b977376f383 Westwood and Westwood+
Anh Nguyen annguyen@ittc.ku.edu
parents:
diff changeset
   169
#endif /* TCP_WESTWOOD_H */