Understand Ethernet modules and their role in providing wired network communication for electronic applications.
The network cable connecting a computer, a printer, or a camera almost always uses Ethernet. The Ethernet module is the component that brings this wired network into a device, from the microcontroller to the router, and integrates the part that manages packets and the one that generates signals on the cable [1][2][3].
Ethernet is a family of wired local network technologies, described by the IEEE 802.3 standard. It was developed at Xerox in the 1970s, and speeds have increased from $10\ \mathrm{Mbit/s}$ (10BASE-T) to $100\ \mathrm{Mbit/s}$ (Fast Ethernet), $1\ \mathrm{Gbit/s}$, $10\ \mathrm{Gbit/s}$ and beyond. Devices are connected to a switch, which forwards packets only to the recipient’s port, in a star topology [1][2][3].
An Ethernet module has two main blocks.
- MAC (*Media Access Control*): builds frames, adds addresses and error checking, verifies received frames, and delivers them to the processor; it often communicates with the microcontroller via an SPI bus or dedicated interfaces (MII, RMII).
- PHY (physical layer): converts bits into electrical signals suitable for the cable and vice versa, with line coding, synchronization, and autonegotiation of speed and mode (half or full duplex) with the device at the other end.
Between the PHY and the connector, two isolation transformers (magnetics) galvanically separate the device from the cable and adapt the signals, with typical isolation of $1500\ \mathrm{V}$ effective. The connector is the modular $8P8C$ (often called RJ45) [1][2][3].
Connections use twisted pair cables (categories $5\mathrm{e}$, $6$ and higher) with four pairs. For $10$ and $100\ \mathrm{Mbit/s}$ two pairs are used (one for transmitting, one for receiving), for $1\ \mathrm{Gbit/s}$ all four. The maximum segment length is $100\ \mathrm{m}$. The signal is differential, with excellent noise immunity. Automatic pair swapping (Auto-MDIX) allows connecting two identical devices without a crossover cable. Power over the cable also exists (PoE, *Power over Ethernet*), delivering up to tens of watts to power cameras and Wi-Fi access points [1][2][3].
Data is sent in frames (*frame*). Each includes a synchronization preamble ($7$ bytes) and a start delimiter ($1$ bytes), the destination MAC address ($6$ bytes) and source ($6$ bytes), the type or length field ($2$ bytes), the data ($46$-$1500$ bytes), and an error check of $32$ bits (CRC, $4$ bytes). A minimum gap of $12$ bytes must pass between frames. The MAC address, of $48$ bits, uniquely identifies the card on the network; IP, TCP, and UDP protocols operate above Ethernet [1][2].
Each frame has a fixed overhead of $38$ bytes ($8$ of preamble, $14$ of header, $4$ of CRC, and $12$ of interframe gap). With $1500$ bytes of data, the efficiency is $1500/1538 = 97.5\ \%$; with the minimum of $46$ bytes it is $46/84 = 54.8\ \%$, because a short data payload is padded (*padding*) up to the minimum length. The maximum number of frames per second at $100\ \mathrm{Mbit/s}$ is $148\,810$ for the shortest frames [1][2].
The effective speed depends on the connected device: a microcontroller with an Ethernet module over SPI is limited by the bus speed and the module’s memory, reaching a few hundred kilobits per second or a few megabits per second, much less than the nominal speed. Collisions (in half-duplex networks), cables that are too long or damaged, interference, and degraded connectors increase errors, detected by the CRC and corrected by retransmission at higher-level protocols.
A connection at $100\ \mathrm{Mbit/s}$ (Fast Ethernet) in full duplex (typical values).
1. With frames carrying $1500$ bytes of data: $100\,000\,000/(1538\cdot8) = 8127$ frames per second, for an effective data rate of $8127\cdot1500\cdot8 = 97.5\ \mathrm{Mbit/s}$.
2. With minimum frames of $64$ bytes plus overhead ($84$ bytes total on the cable): $100\,000\,000/(84\cdot8) = 148\,810$ frames per second, but only $46$ bytes of data per frame, i.e. $54.8\ \%$ efficiency.
3. File transfer of $1\ \mathrm{MB}$: $10^{6}\cdot8/(97.5\cdot10^{6}) = 82\ \mathrm{ms}$, at the theoretical link speed.
4. With a module connected via SPI at $10\ \mathrm{MHz}$ ($1{,}25\ \mathrm{Mbyte/s}$ maximum), the speed does not exceed $10\ \mathrm{Mbit/s}$, so the network at $100\ \mathrm{Mbit/s}$ is not fully utilized.
Ethernet is used in computer and office networks, industrial and building automation, IP cameras and video surveillance systems, wired Internet of Things devices, data centers, and development boards with microcontrollers.
[1] Wikipedia (it): Ethernet
[2] Wikipedia (en): Ethernet
[3] Wikipedia (fr): Ethernet
Generating summary…