Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Ethernet length estimate via software 1

Status
Not open for further replies.

zappedagain

Electrical
Jul 19, 2005
1,074
0
0
US
Anyone know of good techniques to get an estimate/verify in software of the Ethernet cable length between two ports? IEEE 1588 PTP looks like it has the proper parameters to get a ballpark estimate, if that data is available above the PHY.

A few years back I was working with a Fluke tester that could do it, but I believe that was a full TDR. I vaguely recall some NICs would show cable length.

I saw a website hinting that you could pull the length out of the Forward Error Correction parameters, but again I don't know if that data is available above the PHY, and FEC might only be for the faster communication speeds. I'll probably be running 100 Mb.

Ideally I'd like 1 m resolution, but that's only about 5 ns delay so that is pushing it... Worse resolution that lets me discern a 30 meter cable from a 15 meter cable is still worthwhile.

Z
 
Replies continue below

Recommended for you

The Ethernet cable in question is between our sensor and the controller. A customer wants to use the cable length to control another setting automatically (on the rare occasion that they change the cable length...).

Z
 
Actually, I think that the cable length falls out of part of the 803.3 100 Mb standard for determining loss parameters. I just need to read through the 5600 pages of 802.3 to find it...

It also appears it may be up to how an individual PHY implements it.

Z
 
I just can't see how any of that could be worth a valid dang since there's crummy/good cable and crummy/good power indications that I feel, at best, are useful only for relative adjustments. Knowing you though you'll probably pull it off somehow. I look forward to hearing of any success.

Keith Cress
kcress -
 
So far it looks like it is up to the PHY, as indicated by this TI DB83640 datasheet:

DP83640_LEN100DET_bxojlt.png


There must be some underlying IEEE 802.3 magic in there somewhere...

Z
 
I finally found a non-TDR example for length estimation. Texas Instruments 'AN-1508 DP83849 Cable Diagnostics' (snla085a.pdf) gives on oversight of how a 100Mb link calculates cable length:

100MB cable length is a linear function of the Analog (AEQ) and Digital (DEQ) equalization coefficient
values in the linked state.
if (AEQ == 0) Length = (A1 × DEQ) + B1
if (AEQ == 1) Length = (A2 × DEQ) + B2
and so on ...
The algorithm for computing the electrical cable length is depicted above. The constants {A1, A2, ... } &
{B1, B2, ... } are determined by statistical study of various typical case cables. The computation is
completely handled in hardware. The resultant cable length is available using a simple register read.

With the caveat that this is only good for about +-10m accuracy.

There's a similar technique in the 802.3 standard for GigE too. This link shows that some PHY pass this info all the way to the OS -


Z
 
We need the length for absolutely nothing to do with Ethernet communication! (even though the PHY is calculating it for equalization and error correction) We run an optical fiber along with the Ethernet cable. This pair can have various lengths and are changeable in the field. If a customer changes a fiber/cable set, there is some manual optical-tuning that they have to do before they can continue to use their system. If we can automatically detect the cable length, we can automatically tune the optics. If this has the resolution I need, it seems like a very reliable way to determine the length without adding hardware.

Z
 
Status
Not open for further replies.
Back
Top