Back to Knowledge Base

TCP INFO — M-Lab Core Service

Edit

TCP INFO collects detailed TCP socket statistics from the Linux kernel for every connection on the M-Lab platform, capturing congestion control state, RTT, loss, and dozens of other metrics at regular intervals.

advanced core-servicesData Accessbigquerytcp

TCP INFO is an M-Lab core service that collects TCP socket statistics from the Linux kernel for every TCP connection running on the M-Lab platform. It runs as a sidecar alongside every hosted measurement test — NDT, MSAK, WeHe, and others — polling the kernel’s tcp_info structure at regular intervals throughout the life of each connection.

These statistics are the raw material for many of the metrics you see in NDT results (minimum RTT, loss rate, throughput). TCP INFO makes the underlying kernel data available directly, enabling deeper analysis than the summary statistics that test results expose.

How TCP INFO Works

The Linux kernel exposes a rich set of TCP socket metrics through the getsockopt(TCP_INFO) system call. TCP INFO’s tcp-info service polls this interface periodically during each connection and saves a time series of snapshots. Each snapshot captures the full state of the TCP socket at that moment.

This polling approach means you can observe how TCP state evolves over the duration of a test — watching the congestion window grow, seeing retransmit events, observing RTT fluctuations — rather than only seeing a summary at the end.

TCP INFO runs as a “side” service: it takes advantage of TCP connections generated by incoming tests without generating any traffic of its own. It does not affect the measurements it records.

What TCP INFO Measures

The tcp_info kernel structure exposes dozens of fields. Key metrics include:

  • RTT and RTT variance — smoothed round-trip time and its variance, as maintained by the kernel
  • Minimum RTT — the lowest RTT observed during the connection
  • Congestion window (snd_cwnd) — the sender’s current congestion window in segments
  • Send buffer — the amount of data the kernel has ready to send
  • Retransmissions — counts of retransmitted segments and lost segments
  • Bytes sent and received — total data transferred
  • TCP state — current state of the TCP state machine
  • Congestion control algorithm — which CCA is active (BBR, Cubic, etc.)
  • Pacing rate — the rate at which the kernel is sending data
  • Delivery rate — estimated bandwidth delivery rate

Because snapshots are taken at regular intervals, you can reconstruct the time series of any of these metrics for the full duration of a test.

Accessing TCP INFO Data

BigQuery

TCP INFO data is parsed into BigQuery and available for free. See Setting Up Free BigQuery Access.

The primary location is measurement-lab.ndt.tcpinfo — TCP INFO data associated with NDT tests. Additional locations may exist for other services.

TCP INFO data uses M-Lab’s standard column format as described in the Long Term Supported Schemas blog post.

Joining TCP INFO with NDT results:

-- Joining TCP info with NDT results
SELECT
  ndt.a.TestTime,
  ndt.a.MeanThroughputMbps,
  ndt.client.Geo.CountryCode,
  tcpinfo.a.FinalSnapshot.tcpinfo.MinRTT,
  tcpinfo.a.FinalSnapshot.tcpinfo.SndCwnd
FROM `measurement-lab.ndt.ndt7` AS ndt
JOIN `measurement-lab.ndt.tcpinfo` AS tcpinfo
  ON ndt.id = tcpinfo.id
WHERE ndt.date = '2024-06-01' and tcpinfo.date = '2024-06-01'

Raw Data in Google Cloud Storage

Raw TCP INFO snapshots are archived in GCS as part of each test’s sidecar data. For NDT:
gs://archive-measurement-lab/ndt/tcpinfo

Data is stored in JSONL format. Each line is one snapshot of the tcp_info struct, timestamped to the microsecond.

How People Use TCP INFO Data

Congestion control research — TCP INFO’s time-series data enables research into how different congestion control algorithms (BBR, Cubic, Reno) behave across diverse network conditions in the wild. Because M-Lab serves millions of tests globally, the dataset spans an enormous range of network environments.

RTT measurement and path latency — minimum RTT from TCP INFO is one of the most reliable available measures of propagation delay to a client (with appropriate filtering for connections that achieved sufficient data transfer).

Throughput modeling — the relationship between congestion window, RTT, and achieved throughput can be studied directly against real-world measurements.

Validating packet-level analysis — TCP INFO statistics can be cross-referenced with Packet Header captures to validate conclusions drawn from either dataset.

Understanding NDT metrics — when an NDT result seems unusual, TCP INFO time-series data often explains why — showing, for example, a congestion event mid-test or a retransmit storm that deflated the final throughput number.

Relationship to NDT and Other Tests

TCP INFO underlies the metrics reported by NDT’s ndt5 and ndt7 protocols. When NDT reports minimum RTT or loss rate, those values are derived from the tcp_info kernel data that TCP INFO collects. The raw TCP INFO tables provide access to all snapshots, not just the summary values reported in NDT results.

Source Code

Further Reading