OLD | NEW |
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) 2018 NITK Surathkal | 3 * Copyright (c) 2018 NITK Surathkal |
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 NS_LOG_FUNCTION (this); | 82 NS_LOG_FUNCTION (this); |
83 } | 83 } |
84 | 84 |
85 TcpClassicRecovery::~TcpClassicRecovery (void) | 85 TcpClassicRecovery::~TcpClassicRecovery (void) |
86 { | 86 { |
87 NS_LOG_FUNCTION (this); | 87 NS_LOG_FUNCTION (this); |
88 } | 88 } |
89 | 89 |
90 void | 90 void |
91 TcpClassicRecovery::EnterRecovery (Ptr<TcpSocketState> tcb, uint32_t dupAckCount
, | 91 TcpClassicRecovery::EnterRecovery (Ptr<TcpSocketState> tcb, uint32_t dupAckCount
, |
92 uint32_t unAckDataCount, uint32_t lastSackedByte
s) | 92 uint32_t unAckDataCount, uint32_t deliveredBy
tes) |
93 { | 93 { |
94 NS_LOG_FUNCTION (this << tcb << dupAckCount << unAckDataCount << lastSackedByt
es); | 94 NS_LOG_FUNCTION (this << tcb << dupAckCount << unAckDataCount); |
95 NS_UNUSED (unAckDataCount); | 95 NS_UNUSED (unAckDataCount); |
96 NS_UNUSED (lastSackedBytes); | 96 NS_UNUSED (deliveredBytes); |
97 tcb->m_cWnd = tcb->m_ssThresh; | 97 tcb->m_cWnd = tcb->m_ssThresh; |
98 tcb->m_cWndInfl = tcb->m_ssThresh + (dupAckCount * tcb->m_segmentSize); | 98 tcb->m_cWndInfl = tcb->m_ssThresh + (dupAckCount * tcb->m_segmentSize); |
99 } | 99 } |
100 | 100 |
101 void | 101 void |
102 TcpClassicRecovery::DoRecovery (Ptr<TcpSocketState> tcb, uint32_t lastAckedBytes
, | 102 TcpClassicRecovery::DoRecovery (Ptr<TcpSocketState> tcb, uint32_t deliveredBytes
) |
103 uint32_t lastSackedBytes) | |
104 { | 103 { |
105 NS_LOG_FUNCTION (this << tcb << lastAckedBytes << lastSackedBytes); | 104 NS_LOG_FUNCTION (this << tcb << deliveredBytes); |
106 NS_UNUSED (lastAckedBytes); | 105 NS_UNUSED (deliveredBytes); |
107 NS_UNUSED (lastSackedBytes); | |
108 tcb->m_cWndInfl += tcb->m_segmentSize; | 106 tcb->m_cWndInfl += tcb->m_segmentSize; |
109 } | 107 } |
110 | 108 |
111 void | 109 void |
112 TcpClassicRecovery::ExitRecovery (Ptr<TcpSocketState> tcb) | 110 TcpClassicRecovery::ExitRecovery (Ptr<TcpSocketState> tcb) |
113 { | 111 { |
114 NS_LOG_FUNCTION (this << tcb); | 112 NS_LOG_FUNCTION (this << tcb); |
115 // Follow NewReno procedures to exit FR if SACK is disabled | 113 // Follow NewReno procedures to exit FR if SACK is disabled |
116 // (RFC2582 sec.3 bullet #5 paragraph 2, option 2) | 114 // (RFC2582 sec.3 bullet #5 paragraph 2, option 2) |
117 // For SACK connections, we maintain the cwnd = ssthresh. In fact, | 115 // For SACK connections, we maintain the cwnd = ssthresh. In fact, |
118 // this ACK was received in RECOVERY phase, not in OPEN. So we | 116 // this ACK was received in RECOVERY phase, not in OPEN. So we |
119 // are not allowed to increase the window | 117 // are not allowed to increase the window |
120 tcb->m_cWndInfl = tcb->m_ssThresh.Get (); | 118 tcb->m_cWndInfl = tcb->m_ssThresh.Get (); |
121 } | 119 } |
122 | 120 |
123 std::string | 121 std::string |
124 TcpClassicRecovery::GetName () const | 122 TcpClassicRecovery::GetName () const |
125 { | 123 { |
126 return "TcpClassicRecovery"; | 124 return "TcpClassicRecovery"; |
127 } | 125 } |
128 | 126 |
129 Ptr<TcpRecoveryOps> | 127 Ptr<TcpRecoveryOps> |
130 TcpClassicRecovery::Fork () | 128 TcpClassicRecovery::Fork () |
131 { | 129 { |
132 return CopyObject<TcpClassicRecovery> (this); | 130 return CopyObject<TcpClassicRecovery> (this); |
133 } | 131 } |
134 | 132 |
135 } // namespace ns3 | 133 } // namespace ns3 |
136 | 134 |
OLD | NEW |