how to make your own congestion control protocol in quic - PCC-UIUC/chrome_quic GitHub Wiki

As an example:

  1. Add kPcc in CongestionControlType in the file quic_protocol.h.

  2. Add const QuicTag kPCC = TAG('K', 'P', 'C', 'C'); in the file crypto_protocol.h. Because sent package manager use quic tag to distinguish different protocols.

  3. Add

  if (config.HasReceivedConnectionOptions() &&
      ContainsQuicTag(config.ReceivedConnectionOptions(), kPCC)) {
    printf("kpcc receive\n");
    send_algorithm_.reset(SendAlgorithmInterface::Create(
        clock_, &rtt_stats_, kPcc, stats_, initial_congestion_window_));
  }
  if (HasClientSentConnectionOption(config, kPCC)) {
    printf("kpcc send\n");
    send_algorithm_.reset(SendAlgorithmInterface::Create(
        clock_, &rtt_stats_, kPcc, stats_, initial_congestion_window_));
  }

in quic_sent_packet_manager.cc.

  1. Add
QuicTagVector copt;
copt.push_back(kPCC);
config_.SetConnectionOptionsToSend(copt);

in QuicClient::StartConnect() right before the line session_.reset(new QuicClientSession( in the file quic_client.cc.

  1. Add
    case kPcc:
    	printf("Test tcp.\n");
    	return new MyTcpCubicSender(clock, rtt_stats, true /* use Reno */,
                                initial_congestion_window,
                                kMaxTcpCongestionWindow, stats);

under switch (congestion_control_type) { in the file send_algorithm_interface.cc.

  1. Include your pcc header in send_algorithm_interface.cc.

  2. Add your pcc sender's .cc and .h file paths in net.gypi around

      'quic/congestion_control/tcp_cubic_sender.cc',
      'quic/congestion_control/tcp_cubic_sender.h',