DescriptionTCP Window Scale and Timestamps Implementation
The implementation in this submission uses the TCP option interface implemented by Adrian Tam in Issue 5452045, which can be found at https://codereview.appspot.com/5452045.
TCP window scale option allows a 32-bit window to be carried in the 16-bit advertised window field of the TCP header (RFC 1323) enabling TCP simulations in high speed networks. Once window scale option is enabled through the attribute WindScaleEnabled in TcpSocketBase, the two endpoints exchange their scale factors (m_rcvWindScale) in the SYN and SYN-ACK segments at the beginning of a connection. Then all the advertised receive windows will be left-shifted by the scale factor (m_sndWindScale) before updating m_rWnd.
TCP timestamps implementation enhances the Rtt estimation in ns-3 by eliminating the use of RttHistory to keep track of timestamps. However, since the Timestamps option (TSopt) (RFC 1323) occupies 10 out of the maximum 40 bytes allowed for all TCP options, the implementation does not make TSopt mandatory. Users can enable or disable TSopt using TcpSocketBase's attribute TSEnabled. Once enabled, a TSopt will be sent in the SYN segment to initiate TSopt usage for the connection. Then each data segment and ACK segment will carry a TSopt. As stated in RFC 1323, the Timestamp Echo Reply field (TSecr) is only vaid when the ACK bit is set. When it is valid, it has the value of m_recentTS whose value is obtained by following the algorithm described in the RFC. That is, a segment's timestamp (m_ts) can only be echoed (copied into m_recentTS) if m_lastAckSent falls within its range of sequence numbers. This condition is checked in ReceivedData () before an ACK is sent. RttEstimator is also modified with the addition of EstimateRtt () to replace AckSeq () when Tsopt is used.
TcpSocketBase is also modified with the addition of 2 new member methods: ProcessSentOptions () and ProcessReceivedOptions () that in turns call the corresponding option's Set () and Get () to process all options appended to an outgoing and incoming segment, respectively.
Patch Set 1 #
Total comments: 17
Patch Set 2 : #
Total comments: 48
MessagesTotal messages: 4
|