Count ITS time in TAI, with the leap seconds since 2004
TimestampIts is TAI-based (TS 102 894-2 V2.5.1), 5 s ahead of UTC. ItsTime left the leap seconds out, so the PoTi set the micrOBU's clock 5 s behind: it rejected other stations' VAMs as Invalid_Timestamp and restarted its stack (time_regression). CAM/VAM generationDeltaTime and the GN TST were 5 s off too. ItsTime adds the leap seconds (IANA leap-seconds.list) and converts back for received DENMs. Golden vectors regenerated through asn1tools.
This commit is contained in:
@@ -47,8 +47,10 @@ chain only grants psid 638 and so cannot sign CAMs. Not EU-registered: receivers
|
||||
the EU trust list drop what it signs.
|
||||
|
||||
Time: the signature's generationTime comes from the PoTi timestamp, which follows the app's
|
||||
`ItsTime` convention (UTC-based, no leap seconds). The colleague's VBS adds the 5 leap seconds.
|
||||
Which one is right is the open question documented in `ItsTime.kt`.
|
||||
`ItsTime`: TimestampIts counts TAI milliseconds since 2004 (TS 102 894-2 V2.5.1), so it includes the
|
||||
5 leap seconds inserted since then, as the colleague's VBS does. Until 2026-10 the app left them out:
|
||||
its PoTi set the micrOBU's clock 5 s behind, which made it reject other stations' messages as
|
||||
Invalid_Timestamp and restart its stack whenever a correctly timed source had set the clock before.
|
||||
|
||||
## Earlier notes (Phase 2, superseded)
|
||||
|
||||
|
||||
@@ -34,6 +34,9 @@ from pathlib import Path
|
||||
|
||||
LLC_SNAP_GN = b"\xaa\xaa\x03\x00\x00\x00\x89\x47"
|
||||
ITS_EPOCH_UNIX = 1072915200
|
||||
# generationTime (IEEE 1609.2 Time64) counts TAI microseconds since the ITS epoch: 5 leap seconds ahead of
|
||||
# UTC since 2017-01-01 (IANA leap-seconds.list), as TimestampIts and the app's ItsTime.
|
||||
LEAP_SECONDS_SINCE_2004 = 5
|
||||
|
||||
|
||||
def pcap_frames(path: Path):
|
||||
@@ -227,7 +230,8 @@ def main() -> int:
|
||||
# generationTime is compared with the file's modification time (end of the recording) instead.
|
||||
recorded_until = args.pcap.stat().st_mtime
|
||||
for ts, mac, r in ours[:5]:
|
||||
gen = r["generation_time_us"] / 1e6 + ITS_EPOCH_UNIX if r["generation_time_us"] else None
|
||||
gen = (r["generation_time_us"] / 1e6 + ITS_EPOCH_UNIX - LEAP_SECONDS_SINCE_2004
|
||||
if r["generation_time_us"] else None)
|
||||
print(" %s from %s: signer %s %s, psid %d, ITS PDU station %s, generationTime %s UTC "
|
||||
"(%+.0f s before the recording ended), canonical %s, signature %s" % (
|
||||
f"{ts:.3f}", mac.hex(":"), r["signer"], r["digest"], r["psid"], its_station(r.get("payload", b"")),
|
||||
|
||||
Reference in New Issue
Block a user