Skip to content

telemetry/geoprobe: add version and target IP to LocationOffset wire format#3260

Open
ben-dz wants to merge 1 commit intomainfrom
bdz/geo-offsets-versioned
Open

telemetry/geoprobe: add version and target IP to LocationOffset wire format#3260
ben-dz wants to merge 1 commit intomainfrom
bdz/geo-offsets-versioned

Conversation

@ben-dz
Copy link
Contributor

@ben-dz ben-dz commented Mar 13, 2026

Summary of Changes

  • Adds Version (uint8) and TargetIP ([4]byte) fields to the LocationOffset struct, bumping the wire format to v1 (174 bytes, up from 169)
  • Version is validated on unmarshal — unknown versions are rejected with a clear error
  • Target IP captures the IPv4 address of the TWAMP measurement target, propagated through the reference chain
  • Updates all serialization paths (Marshal, Unmarshal, GetSigningBytes) and the raw-byte ParseOffsetInfo parser
  • Updates RFC16 to match the implementation

Diff Breakdown

Category Files Lines (+/-) Net
Core logic 5 +65 / -5 +60
Tests 3 +89 / -7 +82
Docs 1 +2 / -1 +1

~58% of new lines are tests.

Key files (click to expand)
  • controlplane/telemetry/internal/geoprobe/offset.go — new Version/TargetIP fields, IPToTargetIP/FormatTargetIP helpers, updated Marshal/Unmarshal/GetSigningBytes with version check
  • controlplane/telemetry/internal/geoprobe/offset_test.go — updated all fixtures for new fields, added TestLocationOffset_UnsupportedVersion
  • controlplane/telemetry/internal/geoprobe/signer_test.go — updated all signing/verification test fixtures
  • tools/twamp/pkg/signed/packet.go — adjusted LocationOffsetSize (169→174), shifted byte offsets in ParseOffsetInfo, added TargetIP to OffsetInfo
  • tools/twamp/pkg/signed/packet_test.go — updated byte offsets in test blob construction, added TargetIP assertion
  • controlplane/telemetry/cmd/geoprobe-target/main.go — surface TargetIP in JSON and text output
  • controlplane/telemetry/cmd/geoprobe-agent/main.go — populate Version and TargetIP when constructing offsets
  • controlplane/telemetry/internal/geoprobe/publisher.go — populate Version and TargetIP in DZD publisher path

Testing Verification

  • All existing offset Marshal/Unmarshal, signing, and chain verification tests updated and passing with new fields
  • New TestLocationOffset_UnsupportedVersion test validates that corrupted version byte is rejected
  • TestLocationOffset_Size updated to assert the new 174-byte size
  • TestParseOffsetInfo validates correct extraction of TargetIP from raw bytes at the new offsets

@ben-dz ben-dz force-pushed the bdz/geo-offsets-versioned branch from e8f1b61 to 2d8955d Compare March 13, 2026 21:34
@ben-dz ben-dz marked this pull request as ready for review March 13, 2026 21:36
@ben-dz ben-dz requested review from nikw9944 and snormore March 13, 2026 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant