Commit 7cee7e9
committed
issue: 4043157 Set initial RTO to 1 second per RFC 6298
Change initial TCP retransmission timeout from 3 seconds to
1 second as recommended by RFC 6298 Section 2, with additional
safeguards for timer granularity and RFC 1122 compliance.
RFC 6298 states: "Until a round-trip time (RTT) measurement
has been made... the sender SHOULD set RTO <- 1 second"
This applies to all new TCP connections until an RTT
measurement is made.
Changes:
1. TCP RTO Calculation (src/core/lwip/tcp.c):
- Added get_initial_rto() helper function
- Uses round-up division
- Prevents division trunc that could cause premature timeouts
- Modified tcp_pcb_init() and tcp_pcb_recycle() to use helper
2. Timer Resolution Limits (src/core/util/sys_vars.cpp):
- Added RFC 1122 validation for tcp_timer_resolution_msec
- Enforces maximum of 500ms per RFC 1122 Section 4.2.3.2
- Logs warning and clamps value if exceeded
- Applied to both environment variable and config registry paths
3. Configuration Schema (xlio_config_schema.json):
- Added "maximum": 500 constraint to timer_msec
- Updated description to reference RFC 1122 requirement
- Prevents invalid configurations at schema validation level
4. Documentation (README):
- Added RFC 1122 reference to timer_msec documentation
Rationale:
Previous implementation used simple division (1000 / slow_tmr_interval)
which could result in:
- 0 ticks when interval > 1000ms (immediate timeout)
- 1 tick when interval = 1000ms (fires on next tick)
- Insufficient granularity with large timer intervals
The new implementation provides defense-in-depth:
- Schema validation prevents misconfiguration
- Runtime validation enforces RFC 1122 limits (delayed ACK ≤ 500ms)
- Round-up division ensures minimum 1 tick without truncation
This fixes incorrect SYN retransmission timing where the
first retry could occur prematurely or immediately, causing
TCP_USER_TIMEOUT tests to fail and connection establishment
issues.
Benefits:
- TCP/IP standards compliance (RFC 6298 and RFC 1122)
- Robust handling of timer granularity edge cases
- Faster connection establishment failure detection
- Prevents problematic timer configurations
- Matches Linux kernel TCP_TIMEOUT_INIT behavior
Signed-off-by: Tomer Cabouly <[email protected]>1 parent 6689188 commit 7cee7e9
File tree
4 files changed
+34
-5
lines changed- src/core
- config/descriptor_providers
- lwip
- util
4 files changed
+34
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
693 | 693 | | |
694 | 694 | | |
695 | 695 | | |
| 696 | + | |
696 | 697 | | |
697 | 698 | | |
698 | 699 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
| 421 | + | |
421 | 422 | | |
422 | 423 | | |
423 | | - | |
| 424 | + | |
424 | 425 | | |
425 | 426 | | |
426 | 427 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
905 | 905 | | |
906 | 906 | | |
907 | 907 | | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
908 | 913 | | |
909 | 914 | | |
910 | 915 | | |
| |||
927 | 932 | | |
928 | 933 | | |
929 | 934 | | |
930 | | - | |
| 935 | + | |
| 936 | + | |
931 | 937 | | |
932 | | - | |
| 938 | + | |
933 | 939 | | |
934 | 940 | | |
935 | 941 | | |
| |||
985 | 991 | | |
986 | 992 | | |
987 | 993 | | |
988 | | - | |
| 994 | + | |
| 995 | + | |
989 | 996 | | |
990 | | - | |
| 997 | + | |
991 | 998 | | |
992 | 999 | | |
993 | 1000 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1621 | 1621 | | |
1622 | 1622 | | |
1623 | 1623 | | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
1624 | 1634 | | |
1625 | 1635 | | |
1626 | 1636 | | |
| |||
2744 | 2754 | | |
2745 | 2755 | | |
2746 | 2756 | | |
| 2757 | + | |
| 2758 | + | |
| 2759 | + | |
| 2760 | + | |
| 2761 | + | |
| 2762 | + | |
| 2763 | + | |
| 2764 | + | |
| 2765 | + | |
| 2766 | + | |
2747 | 2767 | | |
2748 | 2768 | | |
2749 | 2769 | | |
| |||
0 commit comments