Skip to content

Commit 5b0f26f

Browse files
authored
Merge pull request #1270 from stevenengler/remove-tcp-congestion-option
Removed the TCP congestion control option
2 parents fa54d54 + 6f9cb39 commit 5b0f26f

3 files changed

Lines changed: 3 additions & 33 deletions

File tree

src/main/core/support/options.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ struct _Options {
4040
gchar* eventSchedulingPolicy;
4141
gchar* interposeMethod;
4242
SimulationTime interfaceBatchTime;
43-
gchar* tcpCongestionControl;
4443

4544
gboolean pinCPUs;
4645

@@ -145,7 +144,6 @@ Options* options_new(gint argc, gchar* argv[]) {
145144
{ "interface-qdisc", 0, 0, G_OPTION_ARG_STRING, &(options->interfaceQueuingDiscipline), "The interface queuing discipline QDISC used to select the next sendable socket ('fifo' or 'rr') ['fifo']", "QDISC" },
146145
{ "socket-recv-buffer", 0, 0, G_OPTION_ARG_INT, &(options->initialSocketReceiveBufferSize), sockrecv->str, "N" },
147146
{ "socket-send-buffer", 0, 0, G_OPTION_ARG_INT, &(options->initialSocketSendBufferSize), socksend->str, "N" },
148-
{ "tcp-congestion-control", 0, 0, G_OPTION_ARG_STRING, &(options->tcpCongestionControl), "Congestion control algorithm to use for TCP ('aimd', 'reno', 'cubic') ['reno']", "TCPCC" },
149147
{ NULL },
150148
};
151149

@@ -224,9 +222,6 @@ Options* options_new(gint argc, gchar* argv[]) {
224222
options->initialSocketSendBufferSize = CONFIG_SEND_BUFFER_SIZE;
225223
options->autotuneSocketSendBuffer = TRUE;
226224
}
227-
if(options->tcpCongestionControl == NULL) {
228-
options->tcpCongestionControl = g_strdup("reno");
229-
}
230225
if(options->dataDirPath == NULL) {
231226
options->dataDirPath = g_strdup("shadow.data");
232227
}
@@ -254,7 +249,6 @@ void options_free(Options* options) {
254249
g_free(options->heartbeatLogInfo);
255250
g_free(options->interfaceQueuingDiscipline);
256251
g_free(options->eventSchedulingPolicy);
257-
g_free(options->tcpCongestionControl);
258252
if(options->argstr) {
259253
g_free(options->argstr);
260254
}
@@ -383,11 +377,6 @@ gint options_getMinRunAhead(Options* options) {
383377
return options->minRunAhead;
384378
}
385379

386-
const gchar* options_getTCPCongestionControl(Options* options) {
387-
MAGIC_ASSERT(options);
388-
return options->tcpCongestionControl;
389-
}
390-
391380
SimulationTime options_getInterfaceBatchTime(Options* options) {
392381
MAGIC_ASSERT(options);
393382
return options->interfaceBatchTime;

src/main/core/support/options.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ gboolean options_doRunPrintVersion(Options* options);
114114
gboolean options_doRunDebug(Options* options);
115115

116116
gint options_getMinRunAhead(Options* options);
117-
const gchar* options_getTCPCongestionControl(Options* options);
118117
SimulationTime options_getInterfaceBatchTime(Options* options);
119118
gint options_getInterfaceBufferSize(Options* options);
120119
gint options_getSocketReceiveBufferSize(Options* options);

src/main/host/descriptor/tcp.c

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2555,21 +2555,11 @@ TCP* tcp_new(guint receiveBufferSize, guint sendBufferSize) {
25552555

25562556
Options* options = worker_getOptions();
25572557
guint32 initial_window = 10;
2558-
const gchar* tcpCC = options_getTCPCongestionControl(options);
25592558
gint tcpSSThresh = 0;
25602559

2561-
TCPCongestionType congestionType = tcpCongestion_getType(tcpCC);
2562-
2563-
switch(congestionType) {
2564-
default:
2565-
warning("CC %s not implemented, falling back to reno", tcpCC);
2566-
case TCP_CC_RENO:
2567-
tcp_cong_reno_init(tcp);
2568-
break;
2569-
case TCP_CC_UNKNOWN:
2570-
error("Failed to initialize TCP congestion control for %s", tcpCC);
2571-
break;
2572-
}
2560+
/* in the future we'd like to support more congestion control types
2561+
* and allow it to be set as a host option */
2562+
tcp_cong_reno_init(tcp);
25732563

25742564
tcp->send.window = initial_window;
25752565
tcp->send.lastWindow = initial_window;
@@ -2608,11 +2598,3 @@ TCP* tcp_new(guint receiveBufferSize, guint sendBufferSize) {
26082598
worker_count_allocation(TCP);
26092599
return tcp;
26102600
}
2611-
2612-
TCPCongestionType tcpCongestion_getType(const gchar* type) {
2613-
if(!g_ascii_strcasecmp(type, "reno")) {
2614-
return TCP_CC_RENO;
2615-
}
2616-
2617-
return TCP_CC_UNKNOWN;
2618-
}

0 commit comments

Comments
 (0)