Configuring and Controlling the Network
The eRTOS RtConfig.rtreg file provides several options for configuring network behavior and performance. This file and the RtKrnlConfig.ini file are available from <InstallDrive>\MaxRT\eRTOS\.
Topics:
- Configuring and Controlling the Network Link Layer (NL2)
- Configuring and Controlling the TCP/IP Stack
Configuring and Controlling the Network Link Layer (NL2)
Controlling NL2 Startup Behavior
The status of the NL2AutoStart parameter in the RtKrnlConfig.ini file determines whether the NL2 starts automatically when the kernel starts.
To start the NL2 with the kernel:
Set NL2AutoStart to 1 to start the NL2 automatically when the kernel starts. The default value is 0 (do not start the NL2 with the kernel).
To start the NL2 independent of the kernel:
Set NL2AutoStart to 0 to start the NL2 independent from the kernel. This is the default behavior.
NL2 Configuration Settings
The RtConfig.rtreg configuration file contains several options for configuring the Network Link Layer (NL2). You can find these by Section Path [HKEY_LOCAL_MACHINE\SOFTWARE\INTERVALZERO\eRTOS\NL2]
Setting | Type | Recommended value | Description |
---|---|---|---|
Verbose |
DWORD |
1 |
Allows the NL2 to be run in verbose mode.
|
IdealProcessor |
DWORD |
0 |
The processor number on which the NL2’s main thread will run. Note: Processor numbers are zero based. Processor 0 is the first processor. |
MainThreadPriority |
DWORD |
60 |
The priority of the NL2’s main thread. This value must be within the range 0 to 127. |
ExtMSpacePoolMinimumSize |
DWORD |
1048576 |
The minimum size of the NL2 process's external MSpace in bytes. The minimum is 65536 bytes. The best value to use depends on the number of enabled interfaces and queues. |
MSpacePoolExpandable |
DWORD |
1 |
Controls whether the NL2 process will request additional memory when its MSpace is exhausted.
|
MSpacePoolExpandSize |
DWORD |
1048576 |
The size of memory requested if the NL2 expands its MSpace. |
Configuring and Controlling the TCP/IP Stack
Note: eRTOS does not validate or prevent the configuration of multiple enabled interfaces with the same IP address.
Controlling TCP/IP Stack Startup Behavior
The status of the TCPIPAutoStart parameter in the RtKrnlConfig.ini file determines whether the TCP/IP Stack starts automatically.
To start the TCP/IP Stack with the NL2:
Set the TCPIPAutoStart setting to 1 to start the TCP/IP Stack automatically.
Note: If TCPIPAutoStart is enabled (TCPIPAutoStart=1), the NL2AutoStart must be set to 1 as well.
TCP/IP Stack Configuration Settings
The RtConfig.rtreg configuration file contains several options for configuring the TCP/IP Stack. You can find these settings under Section Path [HKEY_LOCAL_MACHINE\SOFTWARE\INTERVALZERO\eRTOS\TCPIP]
Setting | Type | Recommended value | Description |
---|---|---|---|
Memory |
DWORD |
4096 |
The amount of memory, in kilobytes, allocated to the TCP/IP stack. |
MaxConcurrency |
DWORD |
0 |
The number of threads allowed to run concurrently within the TCP/IP Stack. The range is 0 to 10340. The TCP/IP Stack needs to initialize certain attributes when started to allow a certain number of threads to run and provide services for each client that requests services. For example, running a client and a server application will require 1 concurrency each. The TCP/IP Stack running by itself requires 1 concurrency to run the Loopback service. Loading and managing interfaces requires an average of 3 threads, thus a concurrency of 3 for each interface. Note: We recommend that this value be calculated automatically (0, default). Note: If the TCP/IP Stack requires more threads than the initialization process prepared for, the Stack will crash. |
IdealProcessor |
DWORD |
0 |
The processor number on which the TCP/IP Stack will run. Note: Processor numbers are zero-based. Processor 0 is the first processor. |
MaxSockets |
DWORD |
64 |
The maximum number of sockets. The TCP/IP Stack allocates actual socket memory when it creates a socket, so it must know the maximum number of sockets it must create. The specified value must be in the range of 1 to 32765. The default value is 64. Note: In the running system, the socket range is 0 to the maximum number of sockets. For example, if the maximum number of sockets is set to 64, the range is 0 to 63. |
TickInterval | DWORD | 100 |
The Stack timer tick interval. The Stack timer is an internal timer used for all internal synchronization. The TCP/IP Stack requires a fixed-time notification for every Stack timer interval to update its elapsed time counters. Since several protocols are implemented within the Stack, dealing with individual timers would be cumbersome. Therefore, the TCP/IP Stack is optimized to use a single notification for how much time has elapsed. The Stack timer system manages all the different timers used within the TCP/IP Stack. The specified value must be within the range of 1 to 1000 milliseconds. |
TimerIdealProcessor | DWORD | 0 |
The ideal processor for the TCP/IP Stack Timer. Note: Processor numbers are zero based. Processor 0 is the first processor. |
TimerPriority | DWORD | 66 | The priority of the TCP/IP Stack's first real-time timer thread, which updates timer variables. This value must be within the range 1-127, where 1 is the lowest priority and 127 is the highest priority. |
IPReassemblyTimeout | DWORD | 60 |
The time-out interval on IP reassembly. Note: We recommend that you decrease the IP reassembly time-out value so that it is less than the wrap-around time in an IP ID field. |
ExtMSpacePoolMinimumSize | DWORD | 6422528 |
The minimum size of the TCP/IP process's external MSpace, in bytes. The minimum is 65536 bytes. This value needs to be large enough to support TCP/IP Stack heap allocation and must be at least the TCP/IP Stack heap allocation size plus 2176 kilobytes. You can use the following formula to determine the amount of memory you need to allocate: Minimum size for external MSpace = StackHeap(k) + 2176k + (64k * numberOfEnabledInterfaces) |
MSpacePoolExpandable | DWORD | 1 |
Controls whether the TCP/IP process will request additional memory when its MSpace is exhausted.
|
MSpacePoolExpandSize | DWORD | 1048576 | Sets the size of memory requested if the TCP/IP Stack expands its MSpace. |
MaxArpEntries | DWORD |
Sets the maximum number of ARP entries allowed by the TCP/IP Stack. Each ARP cache entry is 100 bytes. It is recommended that the maximum ARP cache entries supported be greater than the total number of devices with which the interface communicates. Note: If the value is too small, the ARP cache can overflow. The potential for an overflow increases when the most network devices are offline. Note: When an overflow occurs, the TCP/IP Stack presents the warning message tfRtClone: ARP cache full, which indicates that the maximum number of entries supported should be increased. |
|
TimerExecutePriority | DWORD | 60 |
The priority of the TCP/IP Stack's second real-time timer thread, which executes functions for expired timers. This value must be in the range 1-127, where 1 is the lowest priority and 127 is the highest priority. This value must be less than or equal to the value set for Stack timer priority. |