uzbek-plus/logs/b7/b7a/B7A-RESULT.md
q 8d7721c775 B7: add network time bootstrap and persistent B7C cache
B7A: QMI DMS time vs VNIIFTRI NTP (DMS = UTC - 0.28 s, sigma 1 ms; NITZ = DMS
truncated to 1 s). B7B: a 1970 -> 2026 date -s step is harmless for the modem
stack. B7C: aurora-modem probes DMS/NITZ along the start flow and steps
CLOCK_REALTIME once at the first valid sample (REG registered/attached), never
RTC; background SNTP check (query only) after START OK. 3/3 class-A cold boots
PASS (residual +0.04/+0.36/+0.84 s), cache 14fe453a written (B7C_WRITE_VERIFIED)
and verified by a normal power-on (V1, +0.26 s).

Also publishes the prerequisite R2 (boot-hang / lk eMMC investigation, T4
telnet baseline that B7C builds on) and R3 (autonomous cold boot, NCM loss)
material, and extends tools/publish-sanitize.py to r2/, r3/, b7/.
Binary images, initramfs, busybox and raw logs stay out (see b7/*/SHA256SUMS).
2026-10-02 20:18:25 +03:00

3.5 KiB
Raw Permalink Blame History

B7A — QMI time vs VNIIFTRI NTP (measurement only): QMI DMS time is usable as a pre-IP bootstrap (error ≈ −0.28 s)

2026-10-02, same boot as R3A/R3B (uptime ≈ 2290–2424 s, Beeline LTE PCI 55). Board clock was NOT changed (still 1970, adjtimex status UNSYNC, offset 0 after the test); no RTC write, no eMMC write (writes 0), no cache/rootfs change. Only RAM files in /tmp/b7 and three temporary /32 routes via wwan0, removed afterwards (route table back to the original).

Tools

  • ntpd: Alpine v3.22 busybox-static 1.37.0-r20 (signature-verified, sha256 a6bb1e6e…), in /tmp/b7/busybox, ntpd -w -d = query only. Debian busybox-static has no ntpd (b7a-provenance.txt).
  • Names via bearer DNS 10.10.22.3: ntp1/2/3.vniiftri.ru = 89.109.251.21/22/23 (stratum 1, refid "IRTF").
  • Board timestamps: busybox adjtimex time.tv_sec/usec (CLOCK_REALTIME, µs) taken right before and after every query; offset = value − midpoint.

Run

6 rounds × (DMS ×3, NITZ ×2, ntp1/ntp2/ntp3 × ~4 replies each), 72 NTP replies; per round/server the min-delay reply (57–76 ms RTT). Board clock drift vs NTP fit: +1.70 ppm; residuals ≤ 4.7 ms. NTP servers agree with each other within ≤ 7.7 ms per round.

Results

n DMS/NITZ − NTP
DMS System time (Unix = ms/1000 + 315964800) 18 mean −280.2 ms, median −280.3, range −281.6 … −278.1, σ 1.0 ms
3GPP NITZ (--nas-get-network-time, 1 s resolution) 12 −1161.6 … −359.6 ms
  • Max observed deviation: DMS 281.6 ms behind NTP; NITZ 1.16 s behind NTP.
  • qmicli round trip 33–42 ms (half-window ≤ 20.9 ms), i.e. the 280 ms is not command latency: it is a constant modem-side bias (σ 1 ms over 137 s, no drift).
  • DMS formula: the GPS-epoch constant 315964800 is right and there is no 18 s GPS–UTC leap offset (that would show as ≈ +18000 ms). With the formula, DMS = UTC − 0.28 s on 18/18 samples. The formula is confirmed to within the constant −0.28 s bias, on this boot/cell only.
  • NITZ seconds equal DMS truncated to whole seconds (NITZ − NTP lies in (−1280, −280] ms, matching floor(DMS)). It adds no information beyond DMS. Its only use is as a "network time was received" flag and as a cross-check.
  • Full table (uptime / DMS / NITZ / ntp1 / ntp2 / ntp3): b7a-analysis.txt.

Conclusion

QMI DMS System time can be used as the time bootstrap before IP is up. It needs no USB host and no DNS, it is ready as soon as wwan0qmi0 exists, and it is ≈ 0.28 s slow. That is far inside what TLS certificate checks and logs need. Recommendations for B7B/B7C (not done):

  • Use DMS, cross-check it against NITZ (|DMS − NITZ| < 2 s) and a sanity floor (≥ image build date). Do not add a fixed +0.28 s correction yet, because the bias is measured on one boot/cell only.
  • Refine with SNTP to VNIIFTRI over wwan0 once the bearer is up (needs an ntpd binary in the image: busybox in rootfs lacks it).
  • Not known yet: whether DMS time is valid before registration/NITZ on a class-A cold boot (it might be free-running from 1980/2017). Measure that in B7B/B7C from the controller log.

Files (logs/b7/b7a/)

b7a-provenance.txt, b7a-01-prep-raw.txt (sha, --help, nslookup), b7a-02-trial-raw.txt (routes add + trial ntpd), raw/ (log + every qmicli/ntpd raw output r1..r6), b7a-raw.tar (sha 16f0bac7…), measure.out, b7a-03-pack.txt, b7a-04-cleanup-raw.txt (routes del, clock untouched, bearer OK), b7a-analysis.txt. Scripts: b7/b7a/b7a-measure.sh, b7a-analyze.py; busybox.static + apk + apkverify.py + SHA256SUMS.