Left: | ||
Right: |
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) 2007 Georgia Tech Research Corporation | 3 * Copyright (c) 2007 Georgia Tech Research Corporation |
4 * Copyright (c) 2010 Adrian Sai-wah Tam | 4 * Copyright (c) 2010 Adrian Sai-wah Tam |
5 * Copyright (c) 2013 ResiliNets, ITTC, University of Kansas | |
5 * | 6 * |
6 * This program is free software; you can redistribute it and/or modify | 7 * This program is free software; you can redistribute it and/or modify |
7 * it under the terms of the GNU General Public License version 2 as | 8 * it under the terms of the GNU General Public License version 2 as |
8 * published by the Free Software Foundation; | 9 * published by the Free Software Foundation; |
9 * | 10 * |
10 * This program is distributed in the hope that it will be useful, | 11 * This program is distributed in the hope that it will be useful, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 * GNU General Public License for more details. | 14 * GNU General Public License for more details. |
14 * | 15 * |
15 * You should have received a copy of the GNU General Public License | 16 * You should have received a copy of the GNU General Public License |
16 * along with this program; if not, write to the Free Software | 17 * along with this program; if not, write to the Free Software |
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 * | 19 * |
19 * Author: Adrian Sai-wah Tam <adrian.sw.tam@gmail.com> | 20 * Author: Adrian Sai-wah Tam <adrian.sw.tam@gmail.com> |
20 */ | 21 */ |
22 | |
23 /* TCP options processing, TCP window scale and timestamp implementations | |
24 * | |
25 * Author: Truc Anh N. Nguyen <annguyen@ittc.ku.edu> | |
26 * ResiliNets Research Group http://wiki.ittc.ku.edu/resilinets | |
27 * James P.G. Sterbenz <jpgs@ittc.ku.edu>, director | |
28 */ | |
29 | |
21 #ifndef TCP_SOCKET_BASE_H | 30 #ifndef TCP_SOCKET_BASE_H |
22 #define TCP_SOCKET_BASE_H | 31 #define TCP_SOCKET_BASE_H |
23 | 32 |
24 #include <stdint.h> | 33 #include <stdint.h> |
25 #include <queue> | 34 #include <queue> |
26 #include "ns3/callback.h" | 35 #include "ns3/callback.h" |
27 #include "ns3/traced-value.h" | 36 #include "ns3/traced-value.h" |
28 #include "ns3/tcp-socket.h" | 37 #include "ns3/tcp-socket.h" |
29 #include "ns3/ptr.h" | 38 #include "ns3/ptr.h" |
30 #include "ns3/ipv4-address.h" | 39 #include "ns3/ipv4-address.h" |
31 #include "ns3/ipv4-header.h" | 40 #include "ns3/ipv4-header.h" |
32 #include "ns3/ipv4-interface.h" | 41 #include "ns3/ipv4-interface.h" |
33 #include "ns3/ipv6-header.h" | 42 #include "ns3/ipv6-header.h" |
34 #include "ns3/event-id.h" | 43 #include "ns3/event-id.h" |
35 #include "tcp-tx-buffer.h" | 44 #include "tcp-tx-buffer.h" |
36 #include "tcp-rx-buffer.h" | 45 #include "tcp-rx-buffer.h" |
37 #include "rtt-estimator.h" | 46 #include "rtt-estimator.h" |
47 #include "tcp-option.h" | |
48 #include "tcp-option-winscale.h" | |
49 #include "tcp-option-ts.h" | |
38 | 50 |
39 namespace ns3 { | 51 namespace ns3 { |
40 | 52 |
41 class Ipv4EndPoint; | 53 class Ipv4EndPoint; |
42 class Ipv6EndPoint; | 54 class Ipv6EndPoint; |
43 class Node; | 55 class Node; |
44 class Packet; | 56 class Packet; |
45 class TcpL4Protocol; | 57 class TcpL4Protocol; |
46 class TcpHeader; | 58 class TcpHeader; |
47 | 59 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
180 virtual void ReceivedData (Ptr<Packet>, const TcpHeader&); // Recv of a data, put into buffer, call L7 to get it if necessary | 192 virtual void ReceivedData (Ptr<Packet>, const TcpHeader&); // Recv of a data, put into buffer, call L7 to get it if necessary |
181 virtual void EstimateRtt (const TcpHeader&); // RTT accounting | 193 virtual void EstimateRtt (const TcpHeader&); // RTT accounting |
182 virtual void NewAck (SequenceNumber32 const& seq); // Update buffers w.r.t. AC K | 194 virtual void NewAck (SequenceNumber32 const& seq); // Update buffers w.r.t. AC K |
183 virtual void DupAck (const TcpHeader& t, uint32_t count) = 0; // Received dupa ck | 195 virtual void DupAck (const TcpHeader& t, uint32_t count) = 0; // Received dupa ck |
184 virtual void ReTxTimeout (void); // Call Retransmit() upon RTO event | 196 virtual void ReTxTimeout (void); // Call Retransmit() upon RTO event |
185 virtual void Retransmit (void); // Halving cwnd and call DoRetransmit() | 197 virtual void Retransmit (void); // Halving cwnd and call DoRetransmit() |
186 virtual void DelAckTimeout (void); // Action upon delay ACK timeout, i.e. sen d an ACK | 198 virtual void DelAckTimeout (void); // Action upon delay ACK timeout, i.e. sen d an ACK |
187 virtual void LastAckTimeout (void); // Timeout at LAST_ACK, close the connecti on | 199 virtual void LastAckTimeout (void); // Timeout at LAST_ACK, close the connecti on |
188 virtual void PersistTimeout (void); // Send 1 byte probe to get an updated win dow size | 200 virtual void PersistTimeout (void); // Send 1 byte probe to get an updated win dow size |
189 virtual void DoRetransmit (void); // Retransmit the oldest packet | 201 virtual void DoRetransmit (void); // Retransmit the oldest packet |
190 virtual void ReadOptions (const TcpHeader&); // Read option from incoming pack ets | 202 |
191 virtual void AddOptions (TcpHeader&); // Add option to outgoing packets | 203 // Process options |
bpswenson
2013/11/26 20:41:47
Need doxygen tags for all nonprivate methods
| |
204 virtual void AddOption (uint8_t); // Add an option to the option list | |
205 void ProcessSentOptions (TcpHeader&); // Add options to an outgoing packet | |
206 void ProcessReceivedOptions (const TcpHeader&); // Read options from an incomi ng packet | |
207 // Option setters | |
208 void SetOptionWinScale (TcpHeader&); // Set TCP option winscale (kind = 3) | |
209 void SetOptionTS (TcpHeader&); // Set TCP option timestamp (kind = 8) | |
210 // Option getters | |
211 void GetOptionWinScale (Ptr<TcpOption>); | |
212 void GetOptionTS (Ptr<TcpOption>); | |
192 | 213 |
193 protected: | 214 protected: |
194 // Counters and events | 215 // Counters and events |
195 EventId m_retxEvent; //< Retransmission event | 216 EventId m_retxEvent; //< Retransmission event |
196 EventId m_lastAckEvent; //< Last ACK timeout event | 217 EventId m_lastAckEvent; //< Last ACK timeout event |
197 EventId m_delAckEvent; //< Delayed ACK timeout event | 218 EventId m_delAckEvent; //< Delayed ACK timeout event |
198 EventId m_persistEvent; //< Persist event: Send 1 byte to probe f or a non-zero Rx window | 219 EventId m_persistEvent; //< Persist event: Send 1 byte to probe f or a non-zero Rx window |
199 EventId m_timewaitEvent; //< TIME_WAIT expiration event: Move this socket to CLOSED state | 220 EventId m_timewaitEvent; //< TIME_WAIT expiration event: Move this socket to CLOSED state |
200 uint32_t m_dupAckCount; //< Dupack counter | 221 uint32_t m_dupAckCount; //< Dupack counter |
201 uint32_t m_delAckCount; //< Delayed ACK counter | 222 uint32_t m_delAckCount; //< Delayed ACK counter |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
233 bool m_closeOnEmpty; //< Close socket upon tx buffer empt ied | 254 bool m_closeOnEmpty; //< Close socket upon tx buffer empt ied |
234 bool m_shutdownSend; //< Send no longer allowed | 255 bool m_shutdownSend; //< Send no longer allowed |
235 bool m_shutdownRecv; //< Receive no longer allowed | 256 bool m_shutdownRecv; //< Receive no longer allowed |
236 bool m_connected; //< Connection established | 257 bool m_connected; //< Connection established |
237 double m_msl; //< Max segment lifetime | 258 double m_msl; //< Max segment lifetime |
238 | 259 |
239 // Window management | 260 // Window management |
240 uint32_t m_segmentSize; //< Segment size | 261 uint32_t m_segmentSize; //< Segment size |
241 uint16_t m_maxWinSize; //< Maximum window size to advertise | 262 uint16_t m_maxWinSize; //< Maximum window size to advertise |
242 TracedValue<uint32_t> m_rWnd; //< Flow control window at remote side | 263 TracedValue<uint32_t> m_rWnd; //< Flow control window at remote side |
264 | |
265 // Option-related variables | |
266 std::list<uint8_t> m_optionList; //< List of all options to be added to an ou tgoing packet | |
bpswenson
2013/11/26 20:41:47
These are showing up as not commented in doxygen.
| |
267 uint8_t m_sndWindScale; //< Window shift count for incoming window f ield | |
268 uint8_t m_rcvWindScale; //< Window shift count for outgoing window f ield | |
269 bool m_windScaleRcvd; //< TRUE if incoming SYN contains window sca le option | |
270 bool m_windScaleEnabled; //< TRUE if window scale option is enabled | |
271 uint32_t m_recentTS; //< Timestamp value to be echoed in TSerc wh en a segment is sent | |
272 SequenceNumber32 m_lastAckSent; //< ACK # from last transmitted ACK | |
273 uint32_t m_ts; //< Value received in TSval· | |
274 uint32_t m_echoTS; //< Value received in TSecr | |
275 bool m_withEchoTS; //< TRUE when ACK bit is set | |
276 bool m_tsEnabled; //< TRUE if TSopt is enabled | |
277 bool m_tsRcvd; //< TRUE if SYN contains TSopt | |
243 }; | 278 }; |
244 | 279 |
245 } // namespace ns3 | 280 } // namespace ns3 |
246 | 281 |
247 #endif /* TCP_SOCKET_BASE_H */ | 282 #endif /* TCP_SOCKET_BASE_H */ |
OLD | NEW |