Target: 2.6.0 (Tier 4 — AAA & infrastructure services)
Context
NTP synchronizes clocks, UDP port 123. Fixed-width header, no
options, no variants worth branching on for the common case — one of
the simplest protocols in this whole roadmap, a good first PR to open
the tier.
Deliverable
Add netprotocols.NTP (layer 7, dispatched from udp.port):
- Decode the 48-byte NTPv3/v4 header (RFC 5905 §7.3): LI/VN/Mode (1
byte, three bitfields), Stratum, Poll, Precision (1 byte each),
Root Delay, Root Dispersion, Reference ID (4 bytes each), Reference
Timestamp, Origin Timestamp, Receive Timestamp, Transmit Timestamp
(8-byte NTP short/long format each).
- NTP timestamps are seconds-since-1900 fixed point, not Unix epoch —
add a display/accessor property that converts to a Python datetime
or Unix-epoch float (mirroring how this library already surfaces
hex/enum display helpers alongside raw fields), without silently
replacing the raw on-wire value.
- Register
udp.port 123 → NTP, best-effort like every other
port-table entry.
Acceptance criteria
References
RFC 5905
Part of #174
Target: 2.6.0 (Tier 4 — AAA & infrastructure services)
Context
NTP synchronizes clocks, UDP port 123. Fixed-width header, no
options, no variants worth branching on for the common case — one of
the simplest protocols in this whole roadmap, a good first PR to open
the tier.
Deliverable
Add
netprotocols.NTP(layer 7, dispatched fromudp.port):byte, three bitfields), Stratum, Poll, Precision (1 byte each),
Root Delay, Root Dispersion, Reference ID (4 bytes each), Reference
Timestamp, Origin Timestamp, Receive Timestamp, Transmit Timestamp
(8-byte NTP short/long format each).
add a display/accessor property that converts to a Python
datetimeor Unix-epoch float (mirroring how this library already surfaces
hex/enum display helpers alongside raw fields), without silently
replacing the raw on-wire value.
udp.port123 →NTP, best-effort like every otherport-table entry.
Acceptance criteria
NTPdecodes the full header including all four timestamps;bytes(NTP.decode(x)) == x.correctly (verify against a known reference timestamp).
NTP.References
RFC 5905
Part of #174