|
|
| 947 |
NS_LOG_LOGIC (this << " Leaving zerowindow persist state"); |
947 |
NS_LOG_LOGIC (this << " Leaving zerowindow persist state"); |
| 948 |
m_persistEvent.Cancel (); |
948 |
m_persistEvent.Cancel (); |
| 949 |
} |
949 |
} |
| 950 |
m_rWnd = tcpHeader.GetWindowSize (); |
950 |
RefreshWindowSize (tcpHeader); |
| 951 |
m_rWnd <<= m_rcvScaleFactor; |
|
|
| 952 |
|
951 |
|
| 953 |
// Discard fully out of range data packets |
952 |
// Discard fully out of range data packets |
| 954 |
if (packet->GetSize () |
953 |
if (packet->GetSize () |
|
|
| 2726 |
option->GetTimestamp () << " echo=" << m_timestampToEcho); |
2725 |
option->GetTimestamp () << " echo=" << m_timestampToEcho); |
| 2727 |
} |
2726 |
} |
| 2728 |
|
2727 |
|
|
|
2728 |
void TcpSocketBase::RefreshWindowSize(TcpHeader &header) |
| 2729 |
{ |
| 2730 |
NS_LOG_FUNCTION (this << header); |
| 2731 |
// if connection is not established, window size is set from packets |
| 2732 |
// because reordering cannot occur in stage of 3-way handshakes , because only 1 packet in one time in way. |
| 2733 |
if (m_state < ESTABLISHED) |
| 2734 |
{ |
| 2735 |
m_rWnd = header.GetWindowSize (); |
| 2736 |
m_rWnd <<= m_rcvScaleFactor; |
| 2737 |
NS_LOG_DEBUG ("updating rWnd to " << m_rWnd); |
| 2738 |
return; |
| 2739 |
} |
| 2740 |
// if connection established and not ends. |
| 2741 |
// And new sequence and ack number were received less than which was before. |
| 2742 |
// - it's mean that reordering occurs. |
| 2743 |
bool reorder = false; |
| 2744 |
if (header.GetAckNumber () < m_highestAckNumber) |
| 2745 |
{ |
| 2746 |
reorder = true; |
| 2747 |
} |
| 2748 |
if (header.GetSequenceNumber () < m_highestSequenceNumber) |
| 2749 |
{ |
| 2750 |
reorder = true; |
| 2751 |
} |
| 2752 |
if (reorder == false) |
| 2753 |
{ |
| 2754 |
m_rWnd = header.GetWindowSize (); |
| 2755 |
m_rWnd <<= m_rcvScaleFactor; |
| 2756 |
m_highestAckNumber = header.GetAckNumber(); |
| 2757 |
m_highestSequenceNumber = header.GetSequenceNumber (); |
| 2758 |
NS_LOG_DEBUG ("updating rWnd to " << m_rWnd); |
| 2759 |
} |
| 2760 |
else |
| 2761 |
{ |
| 2762 |
NS_LOG_DEBUG ("Detected reordering; not updating rWnd"); |
| 2763 |
} |
| 2764 |
} |
| 2765 |
|
| 2729 |
void |
2766 |
void |
| 2730 |
TcpSocketBase::SetMinRto (Time minRto) |
2767 |
TcpSocketBase::SetMinRto (Time minRto) |
| 2731 |
{ |
2768 |
{ |