Lion Cipher Lab

Order events across machines with Lamport and vector clocks, when wall clocks lie

Why it matters

Every incident timeline you will ever build is stitched together from logs written by different machines, and every one of those machines keeps its own clock. The clocks disagree. Some run fast, some slow, and NTP sometimes jumps one backwards to fix it. When you sort the logs by timestamp, effects can appear before their causes. A login can look like it happened after the data it unlocked was stolen, and an analyst can then tell the wrong story to the people who make decisions. Distributed systems engineers hit this problem decades ago and solved part of it without fixing the clocks at all.…

What you'll learn

Steps in this lab

  1. What you are building, and why sorting logs by time can lie
  2. Set up: a terminal, Python, and a lab folder
  3. Write the simulator: wall clocks, three logical clocks, and a referee
  4. Write the experiments harness
  5. Measure BEFORE: how wall clocks reverse cause and effect as skew grows
  6. The incident: an attacker's login that 'happens after' the data theft
  7. Measure AFTER: grade Lamport and vector clocks against ground truth
  8. Hybrid logical clocks: causality that still looks like a time
  9. Honest negative 1: vector clocks grow with every process you add
  10. Honest negatives 2 and 3: causality you did not carry, and timestamps you should not trust
  11. Do it better: what to log, and how to tell the timeline story

Open the full interactive lab →