Foundationপ্রথম নীতি থেকে
LEVEL 9 · Distributed Systems

NTP

এনটিপি

UDP-ভিত্তিক clock synchronization protocol — stratum hierarchy-তে মিলিসেকেন্ডধর্মী accuracy, guarantee নয়।

also: network-time-protocol

চার timestamp থেকে offset আর round-trip delay estimate:

offset ≈ ((t1 - t0) + (t2 - t3)) / 2
delay  ≈ (t3 - t0) - (t2 - t1)
  • Stratum 0 atomic/GPS clock → stratum 1 server → … — উপরের দিকে accuracy, নিচের দিকে scale
  • Discipline দুই রকম: slew (ধীরে ঘড়ি সরানো) আর step (লাফিয়ে বসানো) — বড় correction-এ step করলে wall clock পেছনেও যেতে পারে, elapsed-time measurement সেখানেই ভাঙে
  • LAN-এ সাধারণত sub-ms থেকে কয়েক ms; WAN-এ আরও খারাপ — sub-ms লাগলে PTP
  • Distributed algorithm-এর শিক্ষা: NTP skew-কে bounded করে, eliminate নয় — তাই correctness কখনো wall-clock ordering-এর উপর দাঁড় করানো যায় না