Help to understand the behaviour of TCP-Cubic module in FreeBSD

Debojyoti Roy deb.roy.jyoti at gmail.com
Tue Jan 8 12:39:08 UTC 2013


Hi Everyone,

I am trying to develop TCP-CUBIC and using Free-BSD as a standard device
for testing.


To load the Cubic module in FreeBSD the following commands were executed :

kldload ./cc_cubic.ko
sysctl -w net.inet.tcp.cc.algorithm=cubic

The test method has been attached which was used to understand the
behaviour of TCP-Cubic.

There are few questions regarding the behaviour of FreeBSD.

Q1) After receiving Full Acknowledgement from the receiver, sender entered
into Congestion Avoidance State. At that moment filghtsize was equal to 0
and CWND became 1. Now, sender will increase its CWND according to CUBIC
algorithm but FreeBSD follows Slow Start Algorithm by incrementing CWND
from 1 --> 2 --> 4 segments. As per my understanding, if FreeBSD follows
TCP-Cubic functionality, it should be in TCP friendly region. So, CWND
should be 7 in next RTT. Calculation has been provided below :

*W_tcp(t) = W_Max * (1 - beta) + 3 * beta/(2 - beta) * t/RTT*

*=> W_tcp(t) = 7 *

*[W_Max = 8, congestion occurs = 18.874sec , current time = 18.878sec,
therefore elapsed time t = 0.004 sec, RTT = (18.878 - 18.876) = 0.002 sec,
beta = 0.2]*
But I find that it incremented to 2 rather than 7.

Could you please explain this behaviour ?

Q2) If my tool acknowledges all the packets coming from FreeBSD after Fast
Retransmit, the segment sequence was 1 --> 2 --> 4 --> 5 --> 6 --> 7 --> 8
--> 6 --> 6 --> 6... Why after sending 8 segments in congestion avoidance
state, CWND unexpectedly sets to 6 ?

Q3) What will be the unit of t and RTT (i.e seconds or miliseconds) ?

Q4) In Cubic-draft both concave and convex use the same formula. Only
difference in convex it depends on max_increment_rate. How does
max_increment_rate variable can be calculated ?

If I have any wrong understanding please rectify me and I will be very
grateful if you could answer the questions as soon as possible.

Thanks in advance,
Debojyoti Roy
-------------- next part --------------
The following method has been used to test the Cubic in congestion avoidance state : 

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
| Test 		Action in																	    |
| Step No.	the step							Comments									    |
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|    1		RECEIVER sends SYN packet					Connection Estublishment							    |
|    2		FreeBSD sends SYN-ACK packet															    |
|    3		RECEIVER sends ACK packet															    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    4		FreeBSD sends 4 segments					From here we can infer that initial window size is 4. So, CWND = 4		    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    5		RECEIVER sends ACK for all 4 segments				FreeBSD will follow the Slow Start Algorithm. Hence it should make CWND = 2 x 4 = 8 |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    6		FreeBSD sends 8 segments															    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    7		RECEIVER sends 3-Duplicate ACKs of last segment of step 5	FreeBSD realises the Congestion has occured					    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    8		FreeBSD retransmits the lost segment				FreeBSD in Fast Retransmit state						    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    9		RECEIVER sends the ACK of the last segment of step 6		FreeBSD exits from Fast Recovery						    |
|		(i.e Full ACK)
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    10		FreeBSD sets CWND = 1 and sends 1 segment			FreeBSD increases CWND in Slow Start manner.
					    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    11		RECEIVER sends ACK of the single segment													    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    12		FreeBSD sets CWND = 2 x CWND or 2 and sends 2 segments												    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    13		RECEIVER sends ACK of 2 segments														    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    14		FreeBSD sets CWND = 2 x CWND or 4 and sends 4 segments												    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    15		RECEIVER sends ACK of 4 segments														    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    16		FreeBSD sets CWND = CWND + 1 or 5 and sends 5 segments		FreeBSD increases CWND in Congestion Avoidence manner (RFC 2581)		    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    17		RECEIVER sends ACK of 5 segments														    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    18		FreeBSD sets CWND = CWND + 1 or 6 and sends 6 segments												    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    19		RECEIVER sends ACK of 6 segments														    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    20		FreeBSD sets CWND = CWND + 1 or 7 and sends 7 segments												    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    21		RECEIVER sends ACK of 7 segments														    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    22		FreeBSD sets CWND = CWND + 1 or 8 and sends 8 segments												    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    23		RECEIVER sends ACK of 8 segments														    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    24		FreeBSD sets CWND = 6 and sends 6 segments													    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    25		RECEIVER sends ACK of 6 segments														    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    26		FreeBSD sets CWND = 6 and sends 6 segments													    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    27		RECEIVER sends ACK of 6 segments														    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    28		FreeBSD sets CWND = 6 and sends 6 segments													    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    29		RECEIVER sends ACK of 6 segments														    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    30		FreeBSD sets CWND = 6 and sends 6 segments													    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    31		RECEIVER sends ACK of 6 segments														    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    32		FreeBSD sets CWND = 6 and sends 6 segments													    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|    33		RECEIVER sends ACK of 6 segments														    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+


More information about the freebsd-questions mailing list