author | Brian Swenson <bswenson3@gatech.edu> |
Tue, 22 Apr 2014 11:52:55 -0400 | |
changeset 10694 | 4af272d94cfd |
parent 10440 | 1e48ff9185f1 |
child 10855 | 7ef081ddfc7f |
permissions | -rw-r--r-- |
7385
10beb0e53130
standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents:
7176
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
6694 | 2 |
/* |
3 |
* Copyright (c) 2010 Adrian Sai-wah Tam |
|
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 |
* Author: Adrian Sai-wah Tam <adrian.sw.tam@gmail.com> |
|
19 |
*/ |
|
20 |
||
21 |
#ifndef TCP_RENO_H |
|
22 |
#define TCP_RENO_H |
|
23 |
||
24 |
#include "tcp-socket-base.h" |
|
25 |
||
26 |
namespace ns3 { |
|
27 |
||
28 |
/** |
|
29 |
* \ingroup socket |
|
30 |
* \ingroup tcp |
|
31 |
* |
|
32 |
* \brief An implementation of a stream socket using TCP. |
|
33 |
* |
|
10158
971f362648c3
Link to RFC num with \RFC{num}
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7608
diff
changeset
|
34 |
* This class contains the Reno implementation of TCP, according to \RFC{2581}, |
6694 | 35 |
* except sec.4.1 "re-starting idle connections", which we do not detect for |
36 |
* idleness and thus no slow start upon resumption. |
|
37 |
*/ |
|
38 |
class TcpReno : public TcpSocketBase |
|
39 |
{ |
|
40 |
public: |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
41 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
42 |
* \brief Get the type ID. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
43 |
* \return the object TypeId |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
44 |
*/ |
6694 | 45 |
static TypeId GetTypeId (void); |
46 |
/** |
|
47 |
* Create an unbound tcp socket. |
|
48 |
*/ |
|
49 |
TcpReno (void); |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
50 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
51 |
* \brief Copy constructor |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
52 |
* \param sock the object to copy |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
53 |
*/ |
6694 | 54 |
TcpReno (const TcpReno& sock); |
55 |
virtual ~TcpReno (void); |
|
56 |
||
6697
6f1114f669ff
fix valgrind warnings for new TCP code
Tom Henderson <tomh@tomh.org>
parents:
6694
diff
changeset
|
57 |
// From TcpSocketBase |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
58 |
virtual int Connect (const Address &address); |
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
59 |
virtual int Listen (void); |
6694 | 60 |
|
61 |
protected: |
|
62 |
virtual uint32_t Window (void); // Return the max possible number of unacked bytes |
|
63 |
virtual Ptr<TcpSocketBase> Fork (void); // Call CopyObject<TcpReno> to clone me |
|
64 |
virtual void NewAck (const SequenceNumber32& seq); // Inc cwnd and call NewAck() of parent |
|
65 |
virtual void DupAck (const TcpHeader& t, uint32_t count); // Fast retransmit |
|
66 |
virtual void Retransmit (void); // Retransmit timeout |
|
67 |
||
68 |
// Implementing ns3::TcpSocket -- Attribute get/set |
|
69 |
virtual void SetSegSize (uint32_t size); |
|
70 |
virtual void SetSSThresh (uint32_t threshold); |
|
71 |
virtual uint32_t GetSSThresh (void) const; |
|
72 |
virtual void SetInitialCwnd (uint32_t cwnd); |
|
73 |
virtual uint32_t GetInitialCwnd (void) const; |
|
6697
6f1114f669ff
fix valgrind warnings for new TCP code
Tom Henderson <tomh@tomh.org>
parents:
6694
diff
changeset
|
74 |
private: |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
75 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
76 |
* \brief Set the congestion window when connection starts |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
77 |
*/ |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
78 |
void InitializeCwnd (void); |
6694 | 79 |
|
80 |
protected: |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
81 |
TracedValue<uint32_t> m_cWnd; //!< Congestion window |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
82 |
uint32_t m_ssThresh; //!< Slow Start Threshold |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
83 |
uint32_t m_initialCWnd; //!< Initial cWnd value |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
84 |
uint32_t m_retxThresh; //!< Fast Retransmit threshold |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
85 |
bool m_inFastRec; //!< currently in fast recovery |
6694 | 86 |
}; |
87 |
||
88 |
} // namespace ns3 |
|
89 |
||
90 |
#endif /* TCP_RENO_H */ |