During this decade, Wireless Sensor Networks received an increasing amount of attention from the industrial and research world. One of their applications is the indoor localization of nodes. A distance evaluation mechanism between nodes, called ranging, is required to precisely determine the nodes' positions. The research work presented in this article relates to this topic and aims to use Ultra Wide Band (UWB) radio links to achieve an efficient ranging. For localization to be cost effective and useful from an application point of view, ranging must be integrated into the usual network traffic (data, beacons, acknowledgements, etc.). However, ranging calls for time-constrained communications. Using existing messages implies spreading the data collection over time, thus making the impact of the clocks' respective drifts noticeable. This leads to a significant imprecision of the measurement of Time of Flight (ToF) and therefore distance. To correct these errors, we have introduced original techniques of dynamic algorithmic corrections to eliminate these inaccuracies. One solution is proposed and evaluated through real prototyping. The results show an accuracy of twenty centimetres, which is better than most solutions found in the literature. This correction enables precise ranging even on delayed exchanges; this last point suggests that the integration of ranging in usual network traffic is possible.