-2
\$\begingroup\$

I've read that NICs (Network Interface Controller) send and receive binary data as pulses of electricity, light, or radio waves.

The NICs that use electricity to send and receive data are the most common. The process by which a NIC uses electricity to send and receive data is exceedingly complicated. Instead, just think of a charge on the wire as a one, and no charge as a zero. Michael Meyers

Could you tell me about the "exceedingly complicated" process. I'd like to know this in detail.

thank you

\$\endgroup\$
  • 11
    \$\begingroup\$ Most. Useless. Explanation. Ever. \$\endgroup\$ – stevenvh Mar 1 '12 at 9:56
  • 2
    \$\begingroup\$ en.wikipedia.org/wiki/Ethernet_physical_layer \$\endgroup\$ – Toby Jaffey Mar 1 '12 at 10:22
  • 2
    \$\begingroup\$ Radio waves are also electricity, and even light is. \$\endgroup\$ – stevenvh Mar 1 '12 at 12:00
  • 1
    \$\begingroup\$ @Tim - It's an electromagnetic wave, just like radio, only working in a different wavelength. See also this representation of the EM spectrum. \$\endgroup\$ – stevenvh Mar 1 '12 at 12:35
  • 2
    \$\begingroup\$ What's the practical problem that you are currently attempting to solve? Are you designing a NIC yourself? \$\endgroup\$ – Martin Mar 1 '12 at 13:32
16
\$\begingroup\$

You cannot really send the data without modification (0V - 0, some positive voltage - 1) over long lines noise can disrupt it and also, if the data contains a lot of "0" or "1" in sequence, the receiving device can lose count (was it 1000 zeros or 1001?), so line codes are used.

RS232, for example, just sends the data (also called non-return-to-zero (NRZ) code), +10V for "0" and -10V for "1". However, each byte is started with a "start" bit and ended with a "stop" bit. The receiver does not "lose count" within the byte, however, you have to send at least 10 bits to send 8 bits of useful information.

RS232

One of the simpler codes is called return-to-zero. Here "1" is represented by one voltage level (for example +5V), "0" is represented by another (for example -5V), but the signal returns to zero after half a bit.

RZ

Now the receiver will not lose count of the ones and zeros, but this code has two problems. 1) It uses twice the bandwidth (has double the frequency) of the bit rate and 2) if there is a long string of "0" or "1", the signal will have a DC component, which may be undesirable.

10Mbps Ethernet uses Manchester code, which still uses twice the bandwidth, but has no DC component. There are two versions of it, basically one is the inverse of the other. In the IEEE version, "1" is represented by low-to-high transition in the "middle" of a bit and "0" is represented by high-to-low transition in the middle of the bit. Manchester code

There is also MLT-3 code, which uses 3 voltage levels. The code cycles trough -1, 0, +1 levels. If you need to transmit "1" then the code goes to the next level, if you need to transmit "0" then it stays the same, like this:

MLT-3
It does not require high frequencies (the frequency is about 0.25x bit rate), but is not self-clocking - a long string of zeros will result in the receiver "losing count".

However, there are also other codes, that are picked out from a table, for example, 4b/5b takes 4 data bits and encodes them to 5 bits on the wire. Then you can use MLT-3 or NRZ and the receiver will not lose count. There are also other codes - 8b/10b, 64b/66b.

If you want to know more, go to Wikipedia to read about line coding.

Also, a transmitter may add error correction codes to the bitstream, so that the receiver can detect and correct transmission errors, NICs (at least Ethernet) usually do not do that, because he cable is usually reliable and if there are errors, they are passed up the stack so the higher level protocols can deal with them.

For error correction, got to this Wikipedia article. Understanding error correction requires understanding of math :)

\$\endgroup\$
  • \$\begingroup\$ "It uses twice the bandwidth (has double the frequency) of the bit rate". Shouldn't this be 50% more bandwidth, as we're transferring 3 states (+5V, 0V, -5V) over the wire, instead of just two states? \$\endgroup\$ – colemik May 27 '12 at 22:05
  • \$\begingroup\$ @trismarck the frequency is still the same as the shortest pulse is half the "bit width" so the transmission line has to be capable of double the bit frequency. \$\endgroup\$ – Pentium100 May 27 '12 at 23:00
  • \$\begingroup\$ ok, I get it, bit frequency =def= how many '[physical] signal states' per second (or per a reference entity of time). Here, we always need to send two bits: the actual signal, and the 'termination of the signal' state (0V), so we're actually sending two [physical] signals to send one [virtual] signal, and that's why the bit frequency doubles. The number of signal states can be 2,3,5 or unlimited, and still the bit frequency of the signal stream is constant (constant == equals two in this example). \$\endgroup\$ – colemik May 27 '12 at 23:11
  • \$\begingroup\$ @trismarck Just imagine sending a very long string of "1" or "0" (so the signal never negative (or positive)) and you will see the doubled frequency easily. If you only sent alternating "1" and "0" then it probably would be possible to get away with a lower bandwidth line, but not for any other "data", so the line has to account for the worst case scenario. \$\endgroup\$ – Pentium100 May 27 '12 at 23:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.