RT-TCP/IP Components

The RT-TCP/IP Protocol Stack communicates with the Network Abstraction Layer (NAL) that accesses the physical transport layer (network card) via a Real-time network device (RTND) driver running under the Real-Time Subsystem (RTSS). The components that make up the RT-TCP/IP Stack are discussed below.

The NAL loads network drivers and the RT-TCP/IP Stack uses the drivers while running as a NAL application. PCI/PCIe devices must be converted from Windows to RTX64 using the Windows Device Manager, accessible through the RTX64 Control Panel. See the RTX64 Supported NICs document, available from the IntervalZero Customer Center, for a list of supported NICs that can be used out-of-the-box. RTND network drivers can be configured to use multiple receive and transmit queues (DMA buffer rings) for devices that support this feature.

The NAL supports delivering data to the specific receive queue by Ethernet type filtering. Multiple NAL applications can use different network queues of the same interface. The RT-TCP/IP Stack, running as a NAL application, uses the default receive queue of the interface (which receives unfiltered data) and the transmit queue with the same number. Other NAL applications can use other network queues of the interface at the same time.

The RT-TCP/IP stack consists of an internal buffer management system, timer system, and, when running, uses multiple threads to accomplish its tasks. The priority of each thread can be set independently. The timer system of the RT-TCP/IP stack uses a stack internal timer thread to handle all TCP/IP time-related functions.

Each network interface runs an interrupt service thread that handles all interrupt-related processing, and a receiving thread that handles all receive-related processing.

You can configure the RT-TCP/IP Stack in the RTX64 Control Panel.

RT-TCP/IP Stack Architecture Flow

RT-TCP/IP Stack and NAL Communication

Buffer Management

The RT-TCP/IP stack has an internal buffer management system for performance reasons. It is architected to statically allocate memory upon Stack startup. Buffers used by network drivers to receive and transmit data are not part of this memory. Packet data, sent and received by the stack, is copied by network drivers in driver receive and transmit functions.

The amount of memory needed by the Stack depends on many factors, including the size of your socket queue, the size of application buffers for transfer, the number of sockets, and the number of network interfaces, as well as the number of pre-allocated receive buffers for the device. Most of the pre-allocated memory by the Stack is used for your data. Internally, the RT-TCP/IP stack uses very minimal data.

Memory Requirements

The RT-TCP/IP Stack, when running, needs a block of memory to store its internal information (packet buffers and various control information). This block of memory is allocated during startup and is of fixed size specified by the Memory allocated for the TCP/IP Stack heap setting configured in the Control Panel. The memory to allocate depends on how much memory is available on the system and how much network traffic is expected.

If you are not sure how much memory should be allocated for stack use, use a large value, such as 10,000. Fatal errors can occur when too little memory has been allocated to the TCP/IP Stack. The TCP/IP Stack will return WSAENOBUFS to an application when memory reserves have been exhausted. This provides an indication to the user to increase this value.

Stack Timer System

The stack timer system is the one of the main component of RT-TCP/IP. It is responsible for notifying the Stack of the amount of time that has elapsed. This is very important for a protocol stack. The RT-TCP/IP stack must know how long a TCP packet takes to get to a remote system. The Stack must also know the amount of time an ARP entry has been in the ARP table. Additionally, the stack timer system uses a timer for its internal routing entries. The Stack uses a timer thread to handle all RT-TCP/IP timer-related functions.

Related topics:

Receive Thread

The primary purpose of the RT-TCP/IP Stack’s receive thread is to wait on notification from a driver’s Interrupt Service Thread (IST). Whenever there is new packet to be received, the driver’s IST signals the receive thread. The receive thread then starts processing the incoming packet from the device driver. It first calls the driver’s receive routine (RtndReceive() ) through the NAL, and then begins processing the packet. The Stack uses receive thread, which you can configure in the Control Panel, to process all incoming packets.

Interrupt Service Thread (IST)

The Interrupt Service Thread (IST) located in the interfacing driver is called within the context of the NAL process. The IST is scheduled to run when an interrupt from the network interface card (NIC) occurs. The IST normally responds to receive interrupts by acknowledging the NIC for the interrupt and then signaling the receive thread.

Interface

An interface is used by the NAL to associate an address with a Real-time Network Device (RTND) driver, which is responsible for configuring and interacting with Network Interface Cards (NICs). All NICs used by RTND drivers must be controlled by RTX64.

Related topics:

Virtual Network

The RTX64 Virtual Network consists of a Windows Virtual RTX64 Ethernet Adapter and a RTX64 Virtual NIC which is used by the RT-TCP/IP Stack.

RTX64 Virtual Network Interface (RtTCPIPVirtualNIC) defines the RTSS side of the Virtual Network point-to-point connection. This interface is provided by default if you install the Virtual Network features and sets up a default IP address and the driver association so the RT-TCP/IP Stack knows to load the RTX64 Virtual NIC driver (RtTCPIPVirtualNIC.rtdll) when the interface is enabled.

Windows Virtual RTX64 Ethernet Adapter which is an NDIS driver (Rtx64VMini.sys) that is loaded by the Windows Stack.

Related topics:

Ethernet Filter Driver

An Ethernet Filter Driver is associated with an interface. It is primarily used to filter all incoming and outgoing traffic, and to generate new network traffic.

Related topics:

Loopback

The Loopback feature requires the TCP-IP Stack to be running. For more information on this feature, see the Multicast Data Reflector sample.