LEFT | RIGHT |
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2010 Adrian Sai-wah Tam | 3 * Copyright (c) 2010 Adrian Sai-wah Tam |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 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 | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 * m_segmentSize are set by the attribute system in ns3::TcpSocket. | 77 * m_segmentSize are set by the attribute system in ns3::TcpSocket. |
78 */ | 78 */ |
79 m_cWnd = m_initialCWnd * m_segmentSize; | 79 m_cWnd = m_initialCWnd * m_segmentSize; |
80 } | 80 } |
81 | 81 |
82 /** Limit the size of in-flight data by cwnd and receiver's rxwin */ | 82 /** Limit the size of in-flight data by cwnd and receiver's rxwin */ |
83 uint32_t | 83 uint32_t |
84 TcpNewReno::Window (void) | 84 TcpNewReno::Window (void) |
85 { | 85 { |
86 NS_LOG_FUNCTION (this); | 86 NS_LOG_FUNCTION (this); |
87 return std::min (m_rxWindowSize, m_cWnd.Get ()); | 87 return std::min (m_rWnd.Get (), m_cWnd.Get ()); |
88 } | 88 } |
89 | 89 |
90 Ptr<TcpSocketBase> | 90 Ptr<TcpSocketBase> |
91 TcpNewReno::Fork (void) | 91 TcpNewReno::Fork (void) |
92 { | 92 { |
93 return CopyObject<TcpNewReno> (this); | 93 return CopyObject<TcpNewReno> (this); |
94 } | 94 } |
95 | 95 |
96 /** New ACK (up to seqnum seq) received. Increase cwnd and call TcpSocketBase::N
ewAck() */ | 96 /** New ACK (up to seqnum seq) received. Increase cwnd and call TcpSocketBase::N
ewAck() */ |
97 void | 97 void |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 m_cWnd = m_initialCWnd * m_segmentSize; | 212 m_cWnd = m_initialCWnd * m_segmentSize; |
213 } | 213 } |
214 | 214 |
215 uint32_t | 215 uint32_t |
216 TcpNewReno::GetInitialCwnd (void) const | 216 TcpNewReno::GetInitialCwnd (void) const |
217 { | 217 { |
218 return m_initialCWnd; | 218 return m_initialCWnd; |
219 } | 219 } |
220 | 220 |
221 } // namespace ns3 | 221 } // namespace ns3 |
LEFT | RIGHT |