Build the Next-Generation Data Center
6 week online course starting on September 1st

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.
This article is part of You've asked for it series.


  1. Hm. I just run it and came back with some funny results . . . Maybe I should try again but following the guidance at

    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:

  5. Thanks, Steiner! Fixed the link.


You don't have to log in to post a comment, but please do provide your real name/URL. Anonymous comments might get deleted.