CCID2: Experimental support for tcp_congestion_ops
Subsystems (2)
PATCH 1/1 CCID2: Experimental support for tcp_congestion_ops
This is an experimental patch to bridge CCID2 and existing tcp congestion contrl algorithms. Added support for "tcp_congestion_ops" in CCID2. This allows for CCID2 to use different variants of congestion control. The default is the RFC CCID2, named with much originality, "ccid2".
I added support for a "tcp adaptor" which allows existing tcp algorithms to be used withing CCID2. They may be selected by asking for "tcp_name", where name is "reno", "vegas", etc.
The following TCP algorithms are believed to work [at least partially] with appropriate byte counting turned off:
bic, compound, cubic, highspeed, htcp, reno, scalable, vegas, veno. These don't seem to work properly [I haven't added full support yet]:
hybla, lp, westwood.
This patch is mainly an RFC. If people seem to like the idea, I can work on making the patch look good.
---
include/linux/dccp.h +1 -0
@@ -196,6 +196,7 @@ #define DCCP_SOCKOPT_CHANGE_L 3#define DCCP_SOCKOPT_CHANGE_R 4#define DCCP_SOCKOPT_CCID_RX_INFO 128#define DCCP_SOCKOPT_CCID_TX_INFO 192 +#define DCCP_SOCKOPT_CCID_TX_ALGO 193#define DCCP_SERVICE_LIST_MAX_LEN 32
net/dccp/ccids/ccid2.c +400 -52
603 lines not on this page · raw message
net/dccp/ccids/ccid2.h +18 -2
@@ -86,8 +86,6 @@ #define CCID2_SEQBUF_MAX 128*/ struct ccid2_hc_tx_sock {int ccid2hctx_cwnd; -int ccid2hctx_ssacks; -int ccid2hctx_acks;int ccid2hctx_ssthresh;int ccid2hctx_pipe;int ccid2hctx_numdupack;
@@ -109,6 +107,21 @@ struct ccid2_hc_tx_sock {unsigned long ccid2hctx_last_cong;struct ccid2_txprofile ccid2hctx_profile;u64 ccid2hctx_high_ack; +struct tcp_congestion_ops *ccid2hctx_ca_ops; +void *ccid2hctx_ca_priv; +char ccid2hctx_tcp_name[TCP_CA_NAME_MAX ]; +}; +#define DCCP_CA_NAME_MAX (TCP_CA_NAME_MAX+4+1) + +struct ccid2ca_priv { +int ccid2cap_maxincr; +int ccid2cap_acks; +int ccid2cap_ssacks; +u64 ccid2cap_last_ack; +}; + +struct ccid2ca_priv_tcp { +struct tcp_sock ccid2capt_tp; };struct ccid2_hc_rx_sock {
@@ -124,4 +137,7 @@ static inline struct ccid2_hc_rx_sock *c {return ccid_priv (dccp_sk (sk)->dccps_hc_rx_ccid); } + +static void ccid2_change_cwnd (struct ccid2_hc_tx_sock *hctx,int val); +#endif /* _DCCP_CCID2_H_ */
net/ipv4/tcp_cong.c +3 -1
@@ -94,6 +94,7 @@ void tcp_init_congestion_control(structif (icsk->icsk_ca_ops->init) icsk->icsk_ca_ops->init (sk); } +EXPORT_SYMBOL_GPL (tcp_init_congestion_control);/* Manage refcounts on socket close. */ void tcp_cleanup_congestion_control (struct sock *sk)
@@ -104,6 +105,7 @@ void tcp_cleanup_congestion_control(stru icsk->icsk_ca_ops->release (sk);module_put (icsk->icsk_ca_ops->owner); } +EXPORT_SYMBOL_GPL (tcp_cleanup_congestion_control);/* Used by sysctl to change default congestion control */ int tcp_set_default_congestion_control (const char *name)
@@ -173,7 +175,7 @@ int tcp_set_congestion_control(struct sorcu_read_unlock ();return err; } - +EXPORT_SYMBOL_GPL (tcp_set_congestion_control);/* * Linear increase during slow start
Quoted 9 lines · Andrea Bittau
This is an experimental patch to bridge CCID2 and existing tcp congestion contrl algorithms. Added support for "
tcp_congestion_ops" in CCID2. This allows for CCID2 to use different variants of congestion control. The default is the RFC CCID2, named with much originality, "ccid2".I added support for a "tcp adaptor" which allows existing tcp algorithms to be used withing CCID2. They may be selected by asking for "
tcp_name", where name is "reno", "vegas", etc.
Quoted 8 lines
The following TCP algorithms are believed to work [at least partially] with appropriate byte counting turned off:
bic, compound, cubic, highspeed, htcp, reno, scalable, vegas, veno. These don't seem to work properly [I haven't added full support yet]:
hybla, lp, westwood.This patch is mainly an RFC. If people seem to like the idea, I can work on making the patch look good.
Keep on experimenting, this is the spirit, that is why tcp_congestion_ops is in inet_connection_sock, eventually I want to have it renamed to congestion_ops, and your experiments will help in diagnosing whatever change in the existing abstractions is needed for us to get closer to this goal :-)
- Arnaldo
Quoted 2 lines · Arnaldo Carvalho de Melo
Keep on experimenting, this is the spirit, that is why
tcp_congestion_opsis ininet_connection_sock, eventually I want to have
Yea I noticed that when it was too late. The other thing to do is to abstract the state which congestion_ops use. It shouldn't access directly tcp's cwnd, srtt and so on. There should probably be a structure named something like congestion_state which contains that information. This way, both DCCP and TCP can provide the relevant information in a uniform way to the congestion algorithms.