About the PHY Module
The physical layer is at the bottom layer of OSI. The Physical Layer Protocol defines electrical signals, line states, clock requirements, data encoding, and connectors for data transmission. The device of the physical layer is called the phy.
The gray block diagram in the figure shows the internal module diagram of the PHY chip. Mac devices exchange data with PHY through the MII interface. We can see some work done by PHY when sending and receiving data from the outside. It can be simply understood:
- When sending data externally, Mac sends data to PHY through MII. The data is encoded and processed, and then sent to analog signals.
- When receiving data from the outside, the analog signal is converted into a digital signal, decoded to obtain the data, and sent to the MAC through MII.
Communication interfaces between PHY and Mac
PHY and Mac communicate via the media independ interface. Their work includes:
- Data interface, which has two independent channels (Rx/Tx.
- The management interface is composed of clock signals and data signals. It can be used to control and monitor the work of Phy.
On the basis of MII, I later had the following:
- Rmii (reduced media independant Interface) Simplifies MII, with fewer signal lines than MII.
- Gmii (Gigabit media independent interface)
- Rgmii (reduced Gigabit media independent interface)
Connection between PHY and RJ45
There are a large number of simulator devices on the phy, and Mac is a full digital device. The current IC technology can already integrate the PHY and Mac into a single chip.
In the external, the PHY is connected to the RJ45 interface, and a 1:1 transformer is usually placed between the PHY and RJ45 as the insulation module. There are several considerations:
-
- When the chip is working, the signal sent to a long distance may cause a large DC component loss.
- If PHY and RJ45 are directly connected, electromagnetic induction and static electricity can easily cause chip damage.
- If the grid environment is different, the 0 V levels at the two ends of the connection are inconsistent, resulting in a large amount of current flowing from the device with high potential to the device with low potential.
Ethernet MAC functions and basic principles
As part of an Ethernet device, Mac is a child layer of the data link layer. Mac is responsible for implementing the Multi-Channel Access Protocol (CSMA/CD) for carrier listeners with conflict detection. It provides the following functions:
- Encapsulate data into frames, including defining frames, implementing Frame Synchronization, processing the destination MAC address and source MAC address, and processing the frames in case of a transfer error with the phy.
- Control of Phy.
Network Knowledge: Physical Layer PHY and network layer Mac