aboutsummaryrefslogtreecommitdiff
path: root/net/dcsctp/public/dcsctp_options.h
diff options
context:
space:
mode:
Diffstat (limited to 'net/dcsctp/public/dcsctp_options.h')
-rw-r--r--net/dcsctp/public/dcsctp_options.h45
1 files changed, 39 insertions, 6 deletions
diff --git a/net/dcsctp/public/dcsctp_options.h b/net/dcsctp/public/dcsctp_options.h
index acc237a0d5..caefcff4f5 100644
--- a/net/dcsctp/public/dcsctp_options.h
+++ b/net/dcsctp/public/dcsctp_options.h
@@ -43,11 +43,33 @@ struct DcSctpOptions {
// port number as destination port.
int remote_port = 5000;
+ // The announced maximum number of incoming streams. Note that this value is
+ // constant and can't be currently increased in run-time as "Add Incoming
+ // Streams Request" in RFC6525 isn't supported.
+ //
+ // The socket implementation doesn't have any per-stream fixed costs, which is
+ // why the default value is set to be the maximum value.
+ uint16_t announced_maximum_incoming_streams = 65535;
+
+ // The announced maximum number of outgoing streams. Note that this value is
+ // constant and can't be currently increased in run-time as "Add Outgoing
+ // Streams Request" in RFC6525 isn't supported.
+ //
+ // The socket implementation doesn't have any per-stream fixed costs, which is
+ // why the default value is set to be the maximum value.
+ uint16_t announced_maximum_outgoing_streams = 65535;
+
// Maximum SCTP packet size. The library will limit the size of generated
// packets to be less than or equal to this number. This does not include any
// overhead of DTLS, TURN, UDP or IP headers.
size_t mtu = kMaxSafeMTUSize;
+ // The largest allowed message payload to be sent. Messages will be rejected
+ // if their payload is larger than this value. Note that this doesn't affect
+ // incoming messages, which may larger than this value (but smaller than
+ // `max_receiver_window_buffer_size`).
+ size_t max_message_size = 256 * 1024;
+
// Maximum received window buffer size. This should be a bit larger than the
// largest sized message you want to be able to receive. This essentially
// limits the memory usage on the receive side. Note that memory is allocated
@@ -59,7 +81,17 @@ struct DcSctpOptions {
// Maximum send buffer size. It will not be possible to queue more data than
// this before sending it.
- size_t max_send_buffer_size = 2 * 1024 * 1024;
+ size_t max_send_buffer_size = 2'000'000;
+
+ // A threshold that, when the amount of data in the send buffer goes below
+ // this value, will trigger `DcSctpCallbacks::OnTotalBufferedAmountLow`.
+ size_t total_buffered_amount_low_threshold = 1'800'000;
+
+ // Max allowed RTT value. When the RTT is measured and it's found to be larger
+ // than this value, it will be discarded and not used for e.g. any RTO
+ // calculation. The default value is an extreme maximum but can be adapted
+ // to better match the environment.
+ DurationMs rtt_max = DurationMs(8000);
// Initial RTO value.
DurationMs rto_initial = DurationMs(500);
@@ -67,8 +99,9 @@ struct DcSctpOptions {
// Maximum RTO value.
DurationMs rto_max = DurationMs(800);
- // Minimum RTO value.
- DurationMs rto_min = DurationMs(120);
+ // Minimum RTO value. This must be larger than an expected peer delayed ack
+ // timeout.
+ DurationMs rto_min = DurationMs(220);
// T1-init timeout.
DurationMs t1_init_timeout = DurationMs(1000);
@@ -79,15 +112,15 @@ struct DcSctpOptions {
// T2-shutdown timeout.
DurationMs t2_shutdown_timeout = DurationMs(1000);
- // Hearbeat interval (on idle connections only).
- DurationMs heartbeat_interval = DurationMs(30'000);
+ // Hearbeat interval (on idle connections only). Set to zero to disable.
+ DurationMs heartbeat_interval = DurationMs(30000);
// The maximum time when a SACK will be sent from the arrival of an
// unacknowledged packet. Whatever is smallest of RTO/2 and this will be used.
DurationMs delayed_ack_max_timeout = DurationMs(200);
// Do slow start as TCP - double cwnd instead of increasing it by MTU.
- bool slow_start_tcp_style = true;
+ bool slow_start_tcp_style = false;
// The initial congestion window size, in number of MTUs.
// See https://tools.ietf.org/html/rfc4960#section-7.2.1 which defaults at ~3