Calculate round-trip time between two network endpoints.
Round-trip time is twice the one-way delay, which itself is the sum of propagation delay (distance divided by signal speed in the medium) and processing delay at each hop along the path. Fiber optic signals travel at roughly 2/3 the speed of light due to the glass refractive index.
RTT
RTT = 2 * (distance / (c * speed_fraction) + processing_per_hop * hops)
Light travels slower in glass (refractive index ~1.47) than in vacuum. The effective group velocity in standard single-mode fiber is approximately 200,000 km/s, or about 2/3 of the vacuum speed of light.
Routers and switches need time to look up the destination in their forwarding table, check ACLs/QoS policies, and move the packet between input and output buffers. Modern routers typically add 0.1-5ms per hop depending on load and complexity.