14

Is it possible to read the bits directly off the physical ethernet connection interface from a standard computer ethernet interface?

e.g., suppose I want to use the ethernet jack of a laptop as a differential logic probe(using a standard ethernet cable). Could I just potentially write a driver to get at the bits or is there a limit to how low a driver can go?

Essentially does the physical layer just send the bit stream to the device driver or does it do any decoding which will effect the interpretation of the bits or cause the device to malfunction(such using a different encoding scheme).

I guess what it boils down to, is, can we use the ethernet port as any standard digital differential communications link by writing a suitable driver or are we limited to the the ieee spec(8b/10b, etc...).

jsmdnq
  • 363
  • 2
  • 10
  • I'd say, you are much better off with a USB to RS232 adapter, or an Arduino, which you can program to jump through flaming hoops of any kinds in a matter of minutes... Or if something, for (very) low bandwidth, I'd even consider the sound card... – ppeterka Jan 21 '13 at 09:35
  • @ppeterka It's not low bandwidth and it's not short distances. It's basically digital communications using a different protocol than standard ethernet. – jsmdnq Jan 21 '13 at 10:10
  • @jsmdq I can read, thanks. Even if what you propose is possible, it would be highly device dependent (not to mention you have to get the documentations for all the devices to even start with it), and would take a whole lot of time. That's why I wrote what I wrote. BTW why do you need this? What is that plain ole Ehternet is not suitable for? – ppeterka Jan 21 '13 at 10:24

2 Answers2

3

To answer shortly, probably not.

Here are some of the reason why:

On a hardware link layer, there is actually no electrical connection between the computer and the ethernet cable, it is electrically isolated by small transformer and is current and not voltage driven signal, so this will be the first problem to overcome, as you would have to send a fairly precise current over two lines rather than a voltage on a single line. Ethernet transformers

PHY Hardware Interface: Then the next step, is that this is simply not controlled by the CPU where your code is being executed but by an ethernet PHY Chip interface, and there you have no (easy) way of flashing and controlling it. Some different PHY chip allows you different level of access, but I doubt you would find any that would allow you direct control over the transmission interface and even if it did, it would have to be implemented into the driver which is as well unlikely. Ethernet PHY Controller

Perhaps some other solutions as the comments above, if you want to have direct IO control on a computer, the best solution is over a serial or parallel port, perhaps you can find ethernet to serial or usb to serial port and then play with that but this would be digital signals.

Another thing you may want to use is the microphone input, as this accepts analog signals and you can have direct control over it, though be careful not burning your computer. (I've seen some bank card magnetic band using that on cellphones).

Damien
  • 1,492
  • 10
  • 32
  • Are there any cards that do allow PHY-level access? That's what I'm wondering, for the purpose of the bounty. Even if there's debugging hardware or something. – Brad Mar 02 '17 at 17:12
  • @Brad Why not use embedded hardware? There you typically have much more control over everything. Take for example the Zedboard (maybe not the best example, but the first that came into my mind because I used it for replacing the IP layer by an own protocol). There you can completely control the PHY chip (have to look in detail in the datasheet of the PHY, whether it allows you what you need to do), but it's really a mess! – yar Mar 03 '17 at 03:27
  • @yar That'd be fine. Know of any that aren't so much of a mess? :-) I don't want to invent my own hardware as much as I want to look at non-conforming Ethernet frames from other devices. – Brad Mar 03 '17 at 04:18
  • @Brad Your question is a little bit misleading. On the one hand side you say you want to "use ethernet jack of a laptop as a differential logic probe", that suggests you want to see the analog values. That might be verry difficult if not impossible. On the other hand side you say you want to read bits, i.e. digital values. If it's just the latter, then you should be able to do this from a normal PC with wireshark (good GUI) or from a program using WinPcap. Nevertheless, the Ethernet frame cannot be completely disordered in such a setup. The preamble for example must still be there I think. – yar Mar 03 '17 at 13:29
  • @yar I didn't write the question, I'm just sponsoring the bounty on it with a question that's mostly the same, trying to take the original question one step further. I know that I'm not going to get a mangled Ethernet frame on a normal network interface. I'm trying to find hardware that will let me capture those broken frames, for analysis in Wireshark or if required, just dump the data to a file and I'll pick at it with a hex editor. – Brad Mar 03 '17 at 17:54
  • @Brad Well, what about using a logic analyzer or if really needed a (mixed signal) oszilloscope? You need one, that can dump the signal into memory. Maybe you can even find a network tap that does the job, but I'm not sure whether there are some that do the job you want. – yar Mar 04 '17 at 19:01
  • @Brad, as yar suggested if you can logic analyzer is definitely the way to go to check what's going on, otherwise if you have a specific PHY chip and have direct access to it, there is probably some error / status registers you can check. – Damien Mar 08 '17 at 03:17
1

You can use libpcap/WinPcap to do this. Nevertheless you are not completely free in the choise of what you write/read on the wire. e.g. preamble and SFD must stil be there. This is so fundamental (because of noise resistance), that typical hardware just does not support anything different.

If you want to control completely everything, go to embedded hardware, find a board that uses a PHY that can give you that information and a processor that is capable of handling the data rates.

yar
  • 1,855
  • 13
  • 26