The roundtrip time is measured and compensated. Even NTP does this. Knowing the distance is not necessary for time synchronization.