Build the Next-Generation Data Center
6 week online course starting in spring 2017

### Measure the cable lengths on a Catalyst switch

Ken McCoy sent me a short question:

At one point someone posted an article about a command you could run on the Catalyst switch that would give you back the distance of the cable between the switch and end device, but now I can't find it.
I remembered reading the same article and after I've figured out the underlying technology is called TDR (Time Domain Reflectometer), uncle Google immediately provided a reader tip from Csaba Farkas.

1. Hm. I just run it and came back with some funny results . . . Maybe I should try again but following the guidance at http://www.cisco.com/en/US/docs/ios/fundamentals/command/reference/cf_t1.html#wp1046637

c3560#sh cable-diagnostics tdr inter gi0/2
TDR test last run on: August 19 21:47:29

Interface Speed Local pair Pair length Remote pair Pair status
--------- ----- ---------- ------------------ ----------- --------------------
Gi0/2 100M Pair A 1 +/- 4 meters Pair A Normal
Pair B 1 +/- 4 meters Pair B Normal
Pair C 2 +/- 4 meters Pair C Short
Pair D 2 +/- 4 meters Pair D Short

2. How on earth can it find the cable length?! That's clever!

3. The underlying theory is simple: an electric pulse travels along the cable with pretty well-known speed. Furthermore, when a pulse arrives at the end of an unterminated cable (or a cable break) it's bounced back due to impedance mismatch (this is "slightly" oversimplified explanation, but not further from the truth than the flat-earth theory was in middle ages :).

The switch (actually part of the NIC hardware) sends a pulse into the cable and measures when the pulse returns. Calculating distance based on measured travel time and (known) propagation speed in cable is trivial.

4. The URL for Csaba Farkas article has moved to:

http://supportwiki.cisco.com/ViewWiki/index.php/Tech_Insights:Cool_Tool_for_Solving_Layer_1_Cable_Issues

5. Thanks, Steiner! Fixed the link.