how to make your own congestion control protocol in quic - PCC-UIUC/chrome_quic GitHub Wiki
As an example:
-
Add
kPccinCongestionControlTypein the filequic_protocol.h. -
Add
const QuicTag kPCC = TAG('K', 'P', 'C', 'C');in the filecrypto_protocol.h. Because sent package manager use quic tag to distinguish different protocols. -
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.
- 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.
- 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.
-
Include your pcc header in
send_algorithm_interface.cc. -
Add your pcc sender's
.ccand.hfile paths innet.gypiaround
'quic/congestion_control/tcp_cubic_sender.cc',
'quic/congestion_control/tcp_cubic_sender.h',