| 4019 | } |
| 4020 | |
| 4021 | uint32_t |
| 4022 | tcp_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 | } |
no test coverage detected