Configuring TCP Congestion Avoidance Algorithm

Jump to: navigation, search

TCP HYBLA: By default the TCP code uses the RENO Congestion Avoidance and Slow Start Algorithm to manage the TCP congestion send window. Starting with version 6.0.1.43 of the Treck stack, the user can select the TCP Hybla algorithm instead for a given TCP connection. The TCP Hybla algorithm is more suited on a long round trip time connection, such as found on a satellite link and long-delay high-speed channels (>100ms RTT, Gbit). With TCP RENO, the congestion window increase is a factor of the RTT (Round Trip Time). The TCP HYBLA aims at removing this dependence, to remove the penalty caused by a long RTT.

TCP PACING: Also starting with version 6.0.1.43 of the Treck stack, the user can enable TCP pacing for a given TCP connection. With TCP pacing enabled, the Treck stack will send the TCP segments ready to be sent (within the sender's congestion window and peer receive window) over the RTT (Round Trip Time) instead of sending them all at once. It is very important to enable TCP PACING, if the TCP Hybla algorightm is enabled, to prevent the stack from sending huge bursts of TCP segments; otherwise many TCP segments could be dropped, and The TCP Hybla performance won't be satisfactory.

TCP WESTWOOD+: By default the TCP code uses the RENO Congestion Avoidance and Slow Start Algorithm to manage the TCP congestion send window. Starting with version 6.0.1.43 of the Treck stack, the user can select the TCP Westwood+ algorithm with either RENO (default) or HYBLA for a given TCP connection. The TCP Westwood+ algorithm is particularly useful on lossy links, such as found on a wireless connection, since it uses end-to-end bandwidth estimation to discriminate the cause of packet loss, resulting in a faster recovery. While TCP RENO blindly halves the congestion window after three duplicate ACKs, TCP Westwood+ attempts to select a slow start threshold and a congestion window based on the bandwidth estimate calculated at the time the congestion is experienced.

Enabling the TCP Hybla Congestion Avoidance Algorithm

To compile the TCP Hybla code, define the TM_USE_TCP_HYBLA in <trsystem.h>.

By default the Treck stack will use the TCP Reno algorithm. To switch to the TCP Hybla algorithm for a given socket, call setsockopt() with the TM_TCP_CA_HYBLA option name at the IPPROTO_TCP level, with optionValue set to 1.

     tempInt = 1;
     errorCode = setsockopt(socketDesc, IPPROTO_TCP, TM_TCP_CA_HYBLA,(const char TM_FAR *)&tempInt, sizeof(int) );

To switch back to the TCP Reno algorithm, call setsockopt() with the TM_TCP_CA_HYBLA option name at the IPPROTO_TCP level, with option value set to 0.


TCP Hybla RTT0

The TCP Hybla algorithm has the notion of a reference connection with a shorter RTT. TCP Hybla's aim is to equalize the TCP performance on a long delay connection to the one on a shorter one, the reference connection. RTT0 is the round trip time of that reference connection. It is by default set at 25ms. You can change the default value of the reference connection Round Trip Time, by redefining the TM_TCP_HYBLA_RTT0 in <trsystem.h>. The smaller that value is, the bigger the TCP congestion window is.


Note Note: TCP Pacing should be enabled as well when the TCP Hybla algorithm is enabled.


Enabling TCP Pacing

To compile the TCP Pacing code, define the TM_USE_TCP_PACING in <trsystem.h>.

By default the TCP Pacing algorithm is turned off. To enable the TCP Pacing algorithm for a given socket, call setsockopt() with the TM_TCP_PACING option name at the IPPROTO_TCP level, with option value set to 1.

     tempInt = 1;
     errorCode = setsockopt(socketDesc, IPPROTO_TCP, TM_TCP_PACING,(const char TM_FAR *)&tempInt, sizeof(int) );

To turn off the TCP Pacing algorithm, call setsockopt() with the TM_TCP_PACING option name at the IPPROTO_TCP level, with option value set to 0.


Enabling the TCP Westwood+ Congestion Avoidance Algorithm

To compile the TCP Westwood+ code, define the TM_USE_TCP_WESTWOOD in <trsystem.h>.

By default the Treck stack will use the TCP Reno algorithm. To switch to the TCP Westwood+ algorithm for a given socket, call setsockopt() with the TM_TCP_CA_WESTWOOD option name at the IPPROTO_TCP level, with optionValue set to 1.

     tempInt = 1;
     errorCode = setsockopt(socketDesc, IPPROTO_TCP, TM_TCP_CA_WESTWOOD,(const char TM_FAR *)&tempInt, sizeof(int) );

To switch back to the TCP Reno algorithm, call setsockopt() with the TM_TCP_CA_WESTWOOD option name at the IPPROTO_TCP level, with option value set to 0.


Note Note: You can enable the TCP Westwood+ algorigthm with or without the TCP Hybla algorithm.


TCP Westwood+ default RTT at startup

The TCP Westwood+ algorithm computes a band width estimate by measuring and averaging the rate of returning ACKs. It uses a default RTT at startup used prior to the first RTT measurement. It is by default set at 50ms. You can change the default value of the default initial Round Trip Time on the connection, by redefining the TM_TCP_WESTWOOD_INIT_RTT in <trsystem.h>.


TCP Westwood+ mininum RTT for a Band Width Estimate

The TCP Westwood+ algorithm computes a band width estimate by measuring and averaging the rate of returning ACKs. A band width estimate is computed after a certain amount of time has elapsed (minimum RTT). This minimum RTT used for a band width estimate is by default set at 50ms. You can change the default value of the minimum Round Trip Time before a new band width estimate is calculated, by redefining the TM_TCP_WESTWOOD_RTT_MIN in <trsystem.h>.

Table of Contents >> Appendix A: Configuration Notes