Notes on the TCP/CM implementation: Linux

The TCP/CM implementation replaces/modifies the following files:

  1. net/ipv4/tcp_input.c (replaced by cm_tcp_input.c)
  2. net/ipv4/tcp_output.c (replaced by cm_tcp_output.c)
  3. net/ipv4/tcp_ipv4.c
  4. net/ipv4/tcp_timer.c
  5. include/net/sock.h
  6. include/net/tcp.h

The changes to the files replaces the congestion control in normal TCP with calls to congestion manager (CM). The TCP control variables of snd_cwnd, snd_ssthresh and snd_cwn_cnt have been removed. All updates and tests of these variables have been removed.

A new variable, snd_max (the max sequence number sent so far), has been added.

Calls to tcp_write_xmit(sk) have been replaced with cm_request(SK_CM_FLOW(sk)) in accordance with the CM API.

In tcp.h, the comparison between in_flight and cwnd has been removed in tcp_snd_test, since this functionality is implemented using the CM.

In tcp_ipv4.c, tcp_v4_destroy_sock(sk) also calls cm_close(SK_CM_FLOW(sk)) in addition to doing its thing.

In tcp_timer.c, the function tcp_retrans_timer calls cm_update() for the packets it has identified as lost or reached their destination (i.e., cleared the "pipe"). The average pktsize is used when the exact amount of data is unknown.

In cm_tcp_output.c (which obsoletes tcp_output.c), the following changes have been made:

  1. tcp_send_skb() now always enqueues data and calls cm_request().
  2. A new function, tcp_cm_callback(), implements the callback for cm_requests. It simply calls tcp_write_xmit() for the socket.
  3. tcp_write_xmit() has been modified to send at most one MSS-sized packet at a time. If there is more to send, it calls cm_request() again.
  4. tcp_connect() calls cm_open in addition to doing its thing.

In cm_tcp_input.c (which obsoletes tcp_input.c), the following changes have been made:

  1. tcp_fast_retrans() calls cm_update() for the packets it has identified as lost or reached their destination (i.e., cleared the pipe). The average pktsize is used when the exact amount of data is unknown.
  2. In tcp_ack, RTT estimates of 0 are changed to 1 tick; 0 is not accepted by cm_update(). For all new acks, cm_update is called to match up the estimate of inflight data.
  3. Calls to tcp_data_snd_check() are replaced with a check for outstanding data and a call to cm_request().

Current gross hacks