Meaning
A specialized Linux socket option enables the collection of precise network packet timestamps at various points in the operating system network stack. Within high-frequency logging systems, so timestamping allows applications to capture timestamps when packets pass the network interface card or the kernel boundary. This option bypasses the delay and jitter introduced by user-space application processing.
Kernel Interaction
Activating this feature requires configuring socket control messages to request timing data from the kernel driver. When an application enables so timestamping, the kernel attaches timestamps directly to the packet buffer during interrupt processing. By returning these timestamps in the socket error queue or control messages, the system provides applications with highly accurate transit data.
This method is used by synchronization software to distinguish between actual network delays and internal host scheduling delays, which allows for much higher accuracy than can be achieved using standard user-space time checks that are vulnerable to operating system task switching.
Precision Metric
The accuracy of the timing record is determined by how close the measurement point is to the physical network medium. Utilizing hardware-based so timestamping provides sub-microsecond precision by using the network interface clock instead of the CPU clock. In industrial telemetry, software-level timestamping is inadequate due to unpredictable context-switch delays that corrupt the measurement records.
Performance Cost
Generating and processing detailed socket messages for every packet increases the CPU overhead of the receiving application. If the network card must capture timestamps at a very high packet rate, so timestamping can lead to packet drops if the host fails to read the socket queue quickly. The cost of enabling this option without optimizing packet-handling loops is a reduction in overall network throughput.