Real-Time Considerations
The TCP/IP Stack for wRTOS is configured such that IP fragmentation is enabled by default, and payload sizes are limited to what can fit in a single Ethernet packet.
Optimized Buffer Sizes
The following table specifies the optimized buffer sizes that may be used with send, sendto, recv, and recvfrom for an IP MTU of 1500 bytes:
| Socket Type | Optimized Buffer Size (bytes) |
|---|---|
|
SOCK_STREAM |
1460 |
|
SOCK_DGRAM |
1472 |
TCP/IP Default Parameters
- The default interval between TCP keep-alive probes is 75 seconds. The default maximum number of retransmissions without responses from the remote is 12.
- For a non-established connection, since there is no computed round trip time yet, the connection times out after 75 seconds or when 12x the default network round trip time has elapsed, whichever occurs first. Use socket option TCP_MAXRT to change the connection timeout for a socket.
To change the Hal Timer Period using wRTOS Settings:
Note: Use caution when setting the HAL Timer Period below 20 microseconds. If the HAL timer period is set too low, it can inversely impact performance or cause your system to hang. Fully test the timer period you set with your real-time application on all systems on which you will deploy to verify that the hardware can accomplish the compilations required in the period set.
- Open wRTOS Settings.
- Click System Behavior.
- Select a period from the HAL Timer Period (microseconds) drop-down menu. The available values are:
- 1000, 500, 200, 100 (default), 50, 20, 10, 5, 2, 1
If you have configured a custom HAL timer period not listed in the drop-down menu, you can type it in.