In future space-borne gravitational wave (GW) detectors, time delay interferometry (TDI) will be utilized to reduce the overwhelming noise, including the laser frequency noise and the clock noise etc., by time shifting and recombining the data streams in post-processing. The successful operation of TDI relies on absolute inter-satellite ranging with meter-level precision. In this work, we numerically and experimentally demonstrate a strategy for inter-satellite distance measurement. The distances can be coarsely determined using the technique of arm-locking ranging with a large non-ambiguity range, and subsequently TDI can be used for precise distance measurement (TDI ranging) by finding the minimum value of the power of the residual noises. The measurement principle is introduced. We carry out the numerical simulations, and the results show millimeter-level precision. Further, we perform the experimental verifications based on the fiber link, and the distances can be measured with better than 0.05 m uncertainty, which can well satisfy the requirement of time delay interferometry.