MCPcopy Create free account
hub / github.com/F-Stack/f-stack / tcp_compute_initwnd

Function tcp_compute_initwnd

freebsd/netinet/tcp_input.c:4021–4046  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4019}
4020
4021uint32_t
4022tcp_compute_initwnd(uint32_t maxseg)
4023{
4024 /*
4025 * Calculate the Initial Window, also used as Restart Window
4026 *
4027 * RFC5681 Section 3.1 specifies the default conservative values.
4028 * RFC3390 specifies slightly more aggressive values.
4029 * RFC6928 increases it to ten segments.
4030 * Support for user specified value for initial flight size.
4031 */
4032 if (V_tcp_initcwnd_segments)
4033 return min(V_tcp_initcwnd_segments * maxseg,
4034 max(2 * maxseg, V_tcp_initcwnd_segments * 1460));
4035 else if (V_tcp_do_rfc3390)
4036 return min(4 * maxseg, max(2 * maxseg, 4380));
4037 else {
4038 /* Per RFC5681 Section 3.1 */
4039 if (maxseg > 2190)
4040 return (2 * maxseg);
4041 else if (maxseg > 1095)
4042 return (3 * maxseg);
4043 else
4044 return (4 * maxseg);
4045 }
4046}

Callers 4

cc_conn_initFunction · 0.85
rc_init_windowFunction · 0.85
rack_get_bwFunction · 0.85
newreno_after_idleFunction · 0.85

Calls 2

minFunction · 0.85
maxFunction · 0.85

Tested by

no test coverage detected