10base-T is the oldest Ethernet standard that runs over regular twisted pair cable. 10base-T requires UTP cables of Cat3 or higher, with a total length of maximum 100m. I wanted to figure out if you can generate “hard” packets for Ethernet; packets that somehow may expose problems in the hardware: signals with DC offsets, high frequency signals, low frequency signals, signals where the clock might be hard to track, … This post describes the journey of an ethernet frame from memory to wire.
Note that, although I try to be fairly correct in this explanation, I’m still cutting some corners. The one and only true explanation is in the full IEEE802.3 document.
Bytes to bits
The first step in this process is called serialization. Computers usually work with a bunch of bits at a time (typically 32 or 64). While it is possible to transmit a bunch of bits at the same time as well, 10base-T only transmits a single bit at a time. Thus, we need to convert a series of bytes into a series of bits. The 10base-T standard sends out the bits of each byte with the least-significant bit first: i.e. when transmitting 0x33 over the wire, the first signal will be a 1.
To notify the other end of the line that a frame is about to be sent, every transmission starts with a preamble. In 10base-T this is a series of 64 bits, alternating 1 and 0, ending with two consecutive 1s: 0x55 55 55 55 55 55 55 D5. This last bytes is also called the start-of-frame indicator.
After the preamble is sent, the receiver has synchronized its clock to the incomming bitstream and is ready to accept the data. This data always starts with destination MAC address and ends with the FCS.
Bits to voltage
This bitstream needs to be converted into voltages and currents. Also, the other side should be able to determine where one bit ends and where the next bits starts. 10base-T uses Manchester encoding to mark the beginning and ending of bits. The Manchester code converts every bit into a transition: a 1-bit is a transition from low to high; the 0-bit is a transition from high to low. This ensures that the clocking-circuit on the receiving end will be able to see every bit. Note that this encoding may introduce extra transitions: two consecutive 1-bits need an additional high-to-low transition in between them.
The transmitter will put a +1V differential signal onto the TD-lines to indicate a high-state; it will put a -1V differential signal onto the lines to indicate a low state. Note that this voltage will be lower on the receiving end due to cable losses.
When the last bit is transmitted, the transmitter will keep the lines in a high state for approximately 2-bit-times (depending on the value of the last bit). After that, the line goes into idle with 0V.
To detect the presence of a link partner, 10base-T specifies a Link Integrity Test (LIT) signal; nowadays usually referred to as the Normal Link Pulse (NLP). This is a short, 100ns, positive signal generated every 16±8ms. This is the signal that brings up the green led on most Ethernet ports.
The resulting signal is fairly stable in its characteristics:
- It is impossible to introduce a DC-offset since the Manchester encoding delivers an equal amount of 1s and 0s, independent of the data pattern
- The highest frequency is achieved by sending a long run of 0x00 or 0xFF. This results in a 10MHz signal on the line
- The lowest frequency is achieved by sending a long run of alternating bits 0x55. This results in a 5MHz signal on the line
http://www.fpga4fun.com/10BASE-T1.html – FPGA project supporting 10BASE-T