Home |
RTIP-32 Configuration |
RTIP-32 ConfigurationRTIP-32 has many configuration parameters, for example, how much memory to allocate or what timeout values to use. Most values have reasonable defaults, but performance may be improved with fine tuning. The values given in this section are global variables to which an application can assign values at run-time before the stack is initialized by calling xn_rtip_init. PRIOTASK_NORMAL (default: 5)RTKernel-32 thread priority to assign to daemon and server threads (e.g., for the DHCP server, Web server, FTP server, etc.). PRIOTASK_HI (default: 6)RTKernel-32 thread priority to assign to the IP and timer threads. Each interface has one IP thread which implements the IP/TCP/UDP protocols. This priority should be equal to or higher than the priorities of application threads requiring network services. PRIOTASK_HIGHEST (default: 7)RTKernel-32 thread priority to Ethernet device driver threads. These threads process interrupt requests of the devices (e.g., to send/receive data packets). This priority should be higher than PRIOTASK_HI. SIZESTACK_NORMAL (default: 4k)Stack size for driver, IP, Timer, and most daemon and server threads. SIZESTACK_BIG (default: 16k)Stack size for the Web server and SNMP agent threads. SIZESTACK_HUGE (default: 64k)Stack size for the HTTPS Web server. CFG_MAX_THREADS_NORMAL (default: 10)Number of threads RTIP-32 may create with stack size SIZESTACK_NORMAL. CFG_MAX_THREADS_BIG (default: 10)Number of threads RTIP-32 may create with stack size SIZESTACK_BIG. CFG_MAX_THREADS_HUGE (default: 10)Number of threads RTIP-32 may create with stack size SIZESTACK_HUGE. CFG_THREAD_WAIT (default: 200)Number of milliseconds RTIP-32 should wait for an existing thread to go idle before creating a new thread. When the maximum number of threads has been reached (please see config parameters CFG_MAX_THREADS_NORMAL, CFG_MAX_THREADS_BIG, CFG_MAX_THREADS_HUGE), this timeout value is doubled. CFG_CSLIP_SLOTS (default: 8)Maximum number of simultaneous TCP connections over CSLIP with VanJacobson compression enabled. CFG_NUDPPORTS (default: 6)Number of ports (sockets) available to UDP. UDP sockets and resources are preallocated. Each UDPPORT uses approximately 58 bytes, one exchange, one semaphore and one message queue. CFG_NTCPPORTS (default: 16)Number of ports (sockets) available to TCP. TCP sockets and resources are preallocated. CFG_IP_FRAG_TTL (default: 100)Time-to-Live in seconds for fragment table entries. CFG_MAX_FRAG (default: 6000)The maximum fragment size (in bytes) processed for all protocols except ping. This size includes the protocol header. Larger packets will be dropped. CFG_MAX_FRAG_ICMP (default: 2000)The maximum fragment size (in bytes) processed for ICMP packets. The size includes the protocol header. Larger packets will be dropped. CFG_FRAG_TABLE_SIZE (default: 6)Max number of entries in the fragment table. CFG_RTSIZE (default: 10)Max number of entries in the routing table. CFG_TCP_SEND_WAIT_ACK (default: 1)This value determines whether send and sendto on a TCP socket in blocking mode should wait until all sent data has been acknowledged. The default value (enabled) corresponds to the Berkeley Unix socket semantics of blocking TCP sockets. Setting this value to 0 matches the Windows WinSock semantics. In this case, send and sendto return immediately as soon as all data has been placed in the output window. Throughput of blocking TCP sockets can be improved with CFG_TCP_SEND_WAIT_ACK set to 0, especially for applications which send many small blocks of data. This value has no effect on UDP sockets or TCP sockets in non-blocking mode. CFG_NIFACES (default: 1)Number of interfaces allowed to be open at any one time. Each interface requires one task for an IP dispatcher, five operating system semaphores, and, if the interface uses an ISA Ethernet controller, one interrupt task. Each interface requires approximately 512 bytes of RAM. CFG_NUM_DEVICES (default: 4)Max number of devices in device table. Each xn_bind... call adds en entry to the device table. Each device table entry required about 150 bytes RAM. CFG_MCLISTSIZE (default: 48)Max size of the multicast list in bytes the used Ethernet driver will support. CFG_MAX_PACKETSIZE (default: 1514)Size of an Ethernet frame. This should be at least as large as the largest packet sent or received. CFG_PACKET_SIZE0 (default: 128)The size of the packets in DCU packet buffer pool 0. See below for information on how the actual application's packet requirements can be monitored. CFG_NUM_PACKETS0 (default: 10)The number of packets of size CFG_PACKET_SIZE0 to allocate. See below for information on how the actual application's packet requirements can be monitored. CFG_PACKET_SIZE1 (default: 256)The size of the packets in DCU packet buffer pool 1. CFG_NUM_PACKETS1 (default: 20)The number of packets of size CFG_PACKET_SIZE1 to allocate. CFG_PACKET_SIZE2 (default: 512)The size of the packets in DCU packet buffer pool 2. CFG_NUM_PACKETS2 (default: 10)The number of packets of size CFG_PACKET_SIZE2 to allocate. CFG_PACKET_SIZE3 (default: 1536)The size of the packets in DCU packet buffer pool 3. CFG_NUM_PACKETS3 (default: 128)The number of packets of size CFG_PACKET_SIZE3 to allocate. CFG_PKT_LOWWATER (default: 2)Allocation of a DCU for input will fail if the number of free DCUs falls below this value. This allows sends to succeed if another machine is continuously sending packets to this machine. It should be set to a value less than the total packets. CFG_PKT_LOWWATER_OOO (default: 5)Low water mark for packets where all the DCUs in the TCP out-of-order lists will be freed. The packets will be freed by the timer task. This number should be less than the total packets but greater than CFG_PKT_LOWWATER. CFG_PKT_QUENCH (default: 10)Allocation of a DCU for input will result in a source quench ICMP message sent to the remote host if the number of free DCUs falls below this value. Once CFG_PKT_LOWWATER is reached, an ICMP quench message can no longer be sent since there aren't enough DCUs to retrieve the input message, which is needed to format the ICMP error message. Therefore, it should be set to a value greater than CFG_PKT_LOWWATER but less than the total packets. CFG_ARP_TIMEOUT (default: 600)Number of seconds after which ARP cache entries expire. Value 0xFFFFFFFFul can be used to specify that ARP cache entries never expire. CFG_ARPCLEN (default: 5)Number of ARP table entries for address resolution by hosts on the local network segment. CFG_ARPC_LIMIT (default: 20)Maximum number of packets to queue on an ARP cache entry. When this limit is exceeded, output ARP packets are dropped. Value -1 disables this feature. CFG_ARPC_MAX_RETRIES (default: 4)Number of attempts to resolve an IP address on the local LAN segment. CFG_ARPC_REQ_TIMEOUT (default: 1)Number of seconds to wait between ARP retries. CFG_KA_INTERVAL (default: 7200)Time in seconds after which Keep Alive packets are sent if a TCP socket is connected and no input packet has been received. CFG_KA_RETRY (default: 75)Number of seconds between Keep Alive packet sends. CFG_KA_TMO (default: 750)Time in seconds Keep Alive packets are sent before the connection is closed. CFG_TIMER_FREQ (default: 110)Time interval in milliseconds to perform TCP timeout and delayed ack processing. The timers are incremented at fixed intervals, so the smaller this number, the more accurate the intervals will be for processing delayed acks and checking for TCP transmission. The amount of time represented by this interval should be less than the amount of time represented by the TCP check transmission interval CFG_TMO_PROC and maximum delayed ack time CFG_MAX_DELAY_ACK. CFG_TMO_PROC (default: 500)Interval to check for TCP transmission timeouts. CFG_MAX_DELAY_ACK (default: 200)Maximum amount of time to delay sending a TCP acknowledgment in milliseconds. The ACK will be delayed only if the delay acknowledge option, SO_DELAYED_ACK, is set and the current packet is not full size. CFG_MAXRTO (default: 60000)Maximum Round Trip Time in milliseconds. As packets are acknowledged, the round trip time is recalculated. CFG_MAXRTO is the largest round trip time allowed. The round trip time is used to determine when to resend data. CFG_MINRTO (default: 6000)The minimum Round Trip Time allowed in milliseconds. CFG_RETRANS_TMO (default: 180000)The amount of time in milliseconds to do TCP retries before giving up and closing the connection. TCP retries are sent if an ACK for the current sequence byte has not been received within the current calculated Round Trip Time. CFG_REPORT_TMO (default: 18000)The amount of time in milliseconds to do TCP retries before informing the application of the problem via function ERROR_REPORT callback. Only the application is notified and it does not affect the retries. The value should be set to less than CFG_RETRANS_TMO. CFG_WIN_PROBE_MIN (default: 5)The minimum amount of time in seconds to wait before sending a window probe after receiving a zero window size from the remote host. The amount of time to wait is exponentially increased with each window probe sent until it reaches CFG_WIN_PROBE_MAX. CFG_WIN_PROBE_MAX (default: 60)The maximum amount of time in seconds to wait before sending another window probe after receiving a zero window size from the remote host. CFG_TWAITTIME (default: 120)After initiating a socket close and the other side has responded with ACK and a FIN (i.e., a close has been initiated and accepted), the number of seconds waited before releasing the socket for re-use. If the socket option SO_REUSESOCK is set, the socket might be freed and reallocated during this period if RTIP-32 runs out of sockets (see function setsockopt for details). CFG_LASTTIME (default: 220)After receiving a FIN (close) request from the other side, followed by the local host sending a FIN, the other side should respond with an ACK packet. When it does respond, the socket is released. If it does not respond within CFG_LASTTIME seconds, the socket is released. If the socket option SO_REUSESOCK is set, the socket might be freed and reallocated if RTIP-32 runs out of sockets (see function setsockopt for details). CFG_TCP_MAX_CONN (default: 5)Maximum number of pending TCP connections initiated while in listen mode. CFG_NO_MSS_VAL (default: 536)Maximum segment size in bytes to use if an input TCP SYNC message does not contain a MSS option. CFG_MSS_GATEWAY (default: 536)Maximum segment size to limit the amount of data in a TCP packet if sending through a gateway. CFG_NUM_OOO_QUE (default: 8)Max number of DCUs which may be queued on all the TCP out-of-order lists. CFG_RARP_TRIES (default: 10)Max number of times to retry a RARP request. CFG_RARP_TMO (default: 30)Timeout value in seconds before retrying a RARP request. CFG_BOOTP_RETRIES (default: 4)The number of times to retry a BOOTP request. CFG_BOOTP_RTSIZE (default: 5)Number of routers from BOOTP server which will be processed. CFG_MAX_AUTOIP (default: 50)Maximum number of times function xn_autoip will generate and attempt to use a random IP address before returning an error. CFG_PROBE_INTERVAL (default: 8)Number of seconds to wait between ARP probes to check if another host has claimed the IP address assigned to the local host through function xn_autoip. If this value is set to zero before xn_autoip is first called, no probes will be generated periodically. CFG_NAT_NUM_ENTRIES (default: 25)Maximum number of entries in the NAT translation table. This value limits the number of connections NAT clients can maintain across the RTIP-32 NAT router. CFG_NAT_TCP_TMEOUT (default: 68400)Timeout in seconds after which NAT translation table entries for TCP connections are deleted. The default is 24 hours. CFG_NAT_UDP_TMEOUT (default: 68400)Timeout in seconds after which NAT translation table entries for UDP connections are deleted. The default is 24 hours. CFG_NAT_ICMP_TMEOUT (default: 60)Timeout in seconds after which NAT translation table entries for ICMP connections are deleted. The default is 1 minute. CFG_NAT_TCP_FIN_TMEOUT (default: 360)Timeout in seconds after which NAT translation table entries for TCP connections waiting to get closed are deleted. The default is 6 minutes. CFG_NAT_UDP_PORT_MIN (default: 5001)Smallest port number NAT will use to translate UDP connections. Applications running on a NAT router should not use port numbers equal to or greater than this value. CFG_NAT_TCP_PORT_MIN (default: 5001)Smallest port number NAT will use to translate TCP connections. Applications running on a NAT router should not use port numbers equal to or greater than this value. CFG_DNS_RETRIES (default: 3)Number of retries RTIP-32 should perform when it receives no answer from a DNS server. CFG_MIN_DNS_DELAY (default: 10)Minimum and initial number of seconds RTIP-32 should wait for an answer from a DNS server. On every retry, the timeout is doubled until CFG_MAX_DNS_DELAY has been reached. CFG_MAX_DNS_DELAY (default: 60)Maximum number of seconds RTIP-32 should wait for an answer from a DNS server. On every retry, the timeout is doubled until CFG_MAX_DNS_DELAY has been reached. CFG_IP_TTL (default: 64)The default TTL value used for outgoing packets. CFG_USE_MSI (default: 1)If set to 0, RTIP-32 will not operate PCIe Ethernet controllers in MSI interrupt mode. The configuration of the packet pools should be monitored at run-time to find the optimal values required by an application. Example:#include <Rtipapi.h> #include <Rtpdbapi.h> xn_debug_error("DCU statistics:\n", DCU_STATS, 0, 0); Applications which have set the cb_wr_screen_string_fnc callback to NULL can manually display this information like this: extern "C" { extern int lowest_free_packets_array[CFG_NUM_FREELISTS]; extern int current_free_packets_array[CFG_NUM_FREELISTS]; extern int highest_free_packets_array[CFG_NUM_FREELISTS]; } ... printf("n High Curr Low\n" "------------------\n"); for (i=0; i<CFG_NUM_FREELISTS; i++) printf("%1i%6i%6i%5i\n", i, highest_free_packets_array[i], current_free_packets_array[i], lowest_free_packets_array[i]);
|