Version 1.0.0
Exchanging the data via TCP is a complex process that consists of several layers:
The network card handles physical communication with the network medium, the operating system manages network communication at the kernel level, and user-space network stack software provides networking capabilities to applications running in user space. Together, these components enable data transfer between applications over the network.
The network card is a hardware component responsible for interfacing between the computer and the network. It connects the computer to the physical network medium, such as Ethernet cables or wireless signals. The network card handles tasks such as encoding and decoding data into electrical signals, transmitting data onto the network medium, and receiving incoming data from the network medium. Modern network cards often include specialized hardware features, such as TCP/IP offload engines (TOE), that can accelerate certain networking tasks, including TCP/IP processing and checksum calculations.
The operating system manages communication between applications and the network card. It provides a set of networking APIs (Application Programming Interfaces) that allow applications to send and receive data over the network. The operating system is responsible for configuring and managing network interfaces, including initializing the network card, assigning IP addresses, configuring routing tables, and handling network-related events. The operating system's network stack implements networking protocols such as TCP/IP, UDP/IP, and ICMP/IP. It encapsulates data into packets, adds necessary headers (such as IP and TCP/UDP headers), and manages data transmission and reception. The operating system's network stack interacts with the network card through device drivers, which are software components that enable the operating system to communicate with hardware devices like network cards.
User-space network stack software refers to networking libraries, protocols, and utilities that operate outside the kernel space of the operating system. These software components interact with the operating system's networking APIs to send and receive data over the network. The user-space network stack is an optional extension to the kernel-space network stack provided by the operating system. It is used to implement custom networking functionality, optimize networking performance and perform network monitoring and analysis tasks. Users typically leverage user-space network stacks when they require specialized networking features, performance optimization, or flexibility beyond what is offered by the kernel-space network stack. Various socket acceleration libraries, such as Intel's Data Plane Development Kit (DPDK), Xilinx (Solarflare) OpenOnload, and Mellanox VMA (Virtual Machine Acceleration), provide optimized networking APIs and drivers for high-performance networking applications. These libraries bypass the kernel network stack and interact directly with the network hardware to achieve low-latency packet processing and high throughput.
Network congestion, characterized by exceeding a network's capacity, can result in increased latency and decreased throughput. TCP congestion, occurring for various reasons at both the network and end-system levels, poses significant challenges. On the end-system side, several factors contribute to TCP congestion, including application behaviour, socket buffer sizes, TCP window scaling, delayed acknowledgements (ACKs), congestion control algorithms, network interface configurations, CPU and memory utilization, and background traffic.
Factors contributing to TCP Congestion at the host level:
The OnixS products can (if configured so) probe the timestamp of the received data and provide it to the user along with the data.
If accessible (supported by the hardware and configured), the network interface card timestamp is used ("hardware time stamping"); otherwise, the timestamp supplied by the OS kernel or the user-level network stack is used ("software time stamping"). The user then can calculate the delay between the data received by the host system and the data delivered to the application and suspect that the receiving application processes incoming data slower than the sending application generates it.
For example, please see the "Taking timestamps of the received data" section in the OnixS C++ CME iLink 3 Binary Order Entry Handler Programming Guide.
Note: According to our measurements, enabling this feature adds around
50
-100
nanoseconds to the resulting latency.
Note: This functionality is available on Linux only.
Note: To compare hardware-based timestamps with the host time, it is necessary to
synchronize the network interface card clock with the host clock, as described in IEEE 1588-2008.
For the Xilinx (Solarflare) cards, the sfptpd
utility
can be used to perform this synchronization.
In conclusion, detecting and managing TCP congestion requires thoroughly understanding various factors influencing network performance. OnixS products offer valuable tools for monitoring and diagnosing congestion issues, empowering users to optimize TCP connections and application data handling logic effectively.