timestamps

command
v0.1.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Command timestamps shows when packets actually arrived, using the time the device recorded for each one rather than the time this program got round to looking.

That difference is the whole point. Reading a clock in the receive loop measures the receive loop: if the loop is busy for a millisecond, every packet it then collects looks like it arrived at once. A timestamp taken by the NIC (or, on AF_PACKET, by the kernel as it fills the ring) was taken before any of this code ran, so the gaps between them are what happened on the wire.

sudo go run ./examples/timestamps -i eth0

It uses the AF_PACKET backend, so it needs no particular hardware. On a ConnectX the mlx5 backend reports the card's own 4 ns clock instead; the loop below does not change, only the Open call.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL