[Ns-bugs] [Bug 579] TCP congestion window is not updated whent segment size chages
code@nsnam.ece.gatech.edu
code at nsnam.ece.gatech.edu
Mon Jun 29 21:49:12 PDT 2009
http://www.nsnam.org/bugzilla/show_bug.cgi?id=579
Pavel Boyko <boyko at iitp.ru> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #5 from Pavel Boyko <boyko at iitp.ru> 2009-06-30 00:49:12 EDT ---
(In reply to comment #3)
Solution by Craig looks pretty good so I close this bug as fixed. Thank you.
> I took a look at this and it is a bit more complicated, I think.
>
> There are two Attribute setters that interact when setting a third (initial)
> congestion window variable. We have to worry about consistency of: m_cWnd,
> m_initialCWnd and m_segmentSize.
>
> The only time that the segment size can be changed is from (socket) object
> creation up to the SYN of a connection which can provide an MSS option. TCP
> specs say no, can't do it afterward. Ns-3 TCP seems to ignore the MSS in the
> SYN, so as it stands we just have to deal with the static-initialization-by
> attribute problem.
>
> To make this work, to a first approximation all we have to do is to add:
>
> m_cWnd = m_initialCWnd * m_segmentSize;
>
> to the Attribute setters for both "InitialCwnd" and "SegmentSize." Then
> setting either attribute will set the initial m_cWnd correctly.
>
> However, the TCP protocol is in charge of changing m_cWnd and it isn't going to
> expect some other entity to mess with it, so I think we must not allow changes
> to m_segmentSize or m_initialCWnd after a connection leaves the CLOSED state
> unless TCP does it (modifies m_Cwnd according to the protocol, or sets
> m_segmentSize according to the MSS in a SYN).
>
> So I think the right thing to do is to also change the attribute setters to
> restrict the times (states) during which they can be used to preclude having a
> user shoot him or herself in the foot:
>
> void
> TcpSocketImpl::SetSegSize (uint32_t size)
> {
> m_segmentSize = size;
> NS_ABORT_MSG_UNLESS (m_state == CLOSED,
> "TcpSocketImpl::SetSegSize(): Cannot change segment size dynamically.");
> m_cWnd = m_initialCWnd * m_segmentSize;
> }
>
> and
>
> void
> TcpSocketImpl::SetInitialCwnd (uint32_t cwnd)
> {
> m_initialCWnd = cwnd;
> NS_ABORT_MSG_UNLESS (m_state == CLOSED,
> "TcpSocketImpl::SetInitialCwnd(): Cannot change initial cwnd
> dynamically.");
> m_cWnd = m_initialCWnd * m_segmentSize;
> }
>
> If we ever teach ns-3 TCP to repect an initial MSS, it will need to do:
>
> m_segmentSize = segmentSizeFromSynOption;
> m_cWnd = m_initialCWnd * m_segmentSize;
>
> outside of the Attribute setters. I think this covers all of the bases.
>
> Does this sound right?
>
>
>
>
>
>
>
>
>
>
> As it stands now, you can set m_segmentSize to anything you want at any time
> you want.
>
--
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the Ns-bugs
mailing list