How to modify the initial ssthreshold in NS3?

238 views
Skip to first unread message

shux...@gmail.com

unread,
Apr 6, 2017, 4:14:40 AM4/6/17
to ns-3-users
Hi, I have ran the demo "fifth.cc" in the directory "/example/tutorial". I found that tcp is in the state of slow start phrase before retransmitting. The congestion window(cwnd) is always increasing if without dropping a packet. Now I intend to modify the  initial slow start threshold to a smaller value that I could see the congestion avoidance phrase before retransmit appearing.  But I found the value of m_initialSsThresh in the class of TcpSocketBase is set to zero, I don't know why? My objective is to generate a tcp stream that contains the phrases of slow start, congestion avoidance, fast retransmit, so I need to know:
1. How to set the initial slow start threshold value?
2. How to replace the tcp protocal? for example, tcp new reno replace the cubic.

Thank you.

Tommaso Pecorella

unread,
Apr 11, 2017, 7:05:48 PM4/11/17
to ns-3-users
Hi,

the answer is... an attribute of ns3::TcpSocket:
    .AddAttribute ("InitialSlowStartThreshold",
                   
"TCP initial slow start threshold (bytes)",
                   
UintegerValue (UINT32_MAX),
                   
MakeUintegerAccessor (&TcpSocket::GetInitialSSThresh,
                                         
&TcpSocket::SetInitialSSThresh),
                   
MakeUintegerChecker<uint32_t> ())


Check the manual for details on attributes.

About how to change the TCP flavour, check the examples in the examples folder.

T.
Reply all
Reply to author
Forward
0 new messages