Laser frequency coupling noise due to unbalanced arm lengths is the dominant noise source for space-based gravitational wave detection. Time-delay interferometry is a proposed technique to eliminate the coupling noise by constructing a virtual equal-arm-length interferometer, where the real-time information of both absolute inter-satellite distance and clock synchronization is required. Inter-satellite laser ranging based on pseudo-random noise (PRN) sequence modulation has become the main technical means for extraction of the inter-satellite distance and clock difference information. This paper shows a bi-directional laser ranging scheme based on PRN code modulation and experimentally demonstrates its function by using an optical fiber of 10 km long. The measured results of the transmission time duration and the clock difference are compared with independent methods of pulse laser ranging and 1PPS signal measurement, respectively, both of which coincide well. It is also evaluated that the laser ranging accuracy is 1.2 m, and the clock synchronization accuracy reaches 6.7 ns, applicable to TianQin with the preliminarily determined requirement of 3 m and 10 ns. This laser ranging scheme can be applied to satellite navigation and space-based gravitational wave detection.