43

I primarily come from an Embedded Software background and hence I have very limited knowledge about hardware in general. I always use to think Ethernet as that little physical connector on your computer into which you attach your Ethernet cable. And from a Software perspective all you need to do is to install the driver (in Windows) or configure the Linux kernel to include the driver for your Ethernet.

Questions:

But as I have started going down one level (towards the hardware) and looking at various datasheet and schematics, I have started to come across terms like PHY, MII, SGMII, RGMII, etc. And now I am little confused as to what constitutes an Ethernet? For example, when I say Intel 82574L 1.0 Gbps Ethernet port, where do all these terms fit in?

1
  • 5
    When you get up to 10Gbps networking you'll also encounter XGMII ("X" ten "G" gig "MII") and a whole load of other fun acronyms (XAUI, XFI, SFI, SFP, ...), same again for 40/100G :)
    – Chiggs
    Jan 27, 2014 at 17:32

6 Answers 6

44

Some definitions:

  • MAC - media access controller. This is the part of the system which converts a packet from the OS into a stream of bytes to be put on the wire (or fibre). Often interfaces to the host processor over something like PCI Express (for example).
  • PHY - physical layer - converts a stream of bytes from the MAC into signals on one or more wires or fibres.
  • MII - media independent interface. Just a standard set of pins between the MAC and the PHY, so that the MAC doesn't have to know or care what the physical medium is, and the PHY doesn't have to know or care how the host processor interface looks.

The MII was standardised a long time ago and supports 100Mbit/sec speeds. A version using less pins is also available, RMII ('R' for reduced).

For gigabit speeds, the GMII ('G' for gigabit) interface is used, with a reduced pincount version called RGMII. A very reduced pincount version called SGMII is also available ('S' for serial) which requires special capabilities on the IO pins of the MAC, whereas the other xMIIs are relatively conventional logic signals.

There are also many more varieties of interfaces used in other circumstances, may of which are linked to from the Wikipedia MII page:

http://en.wikipedia.org/wiki/Media_Independent_Interface

Regarding your specific Intel chip question - as far as I can tell (the datasheet link seems dead), that chip is a MAC, with PCIe. So it will sit between the PCIe bus on the host and some kind of gigabit physical layer (PHY).

1
  • Hi Martin T. - Thank you for this explanation. I am new to Ethernet PHY world and this simplistic explanation helped me with the basics.
    – Satish
    Oct 18, 2020 at 20:58
40

Let me try to explain:

  1. The MII, SGMII, RGMII are three kinds of interface between the MAC block and the PHY chip. The Intel 82574L is one MAC chip. Looking following figure:

    _______         __________                  ___________
     CPU  | PCI-E   |        |  MII/SGMII/RGMII |         |
     or   |<=======>| MAC    |<================>| PHY     |<====>physical interface 
     board| or else |        |                  |         |
    _______         __________                  ___________
    

    For details about MII (100Mbps), SGMII (1Gbps, serial), RGMII (1Gbps, reduced) definition, you can google them.

  2. Basically speaking, NIC (Network Interface Card) consist of one MAC block and related PHY chip, and other peripheral modules. And also one Ethernet device driver should work with the NIC hardware. The MAC block has one interface with the control CPU or PC main-board, such as PCIe bus or else.

6
  • 4
    What is a PHY chip? How it is different than a MAC chip? Also, based on your explanation it seems MII, SGMII and RGMII are just specification for interconnecting PHY and MAC chip? Is that right?
    – modest
    Apr 3, 2013 at 3:09
  • 4
    Yeah, you're right about the MII/SGMII/RGMII. The difference between PHY and MAC is easy to google. Simply speaking, PHY chip is handling the physical signals, such as working mode, duplex, and negotiation. While MAC chip is handling the data link layer, ethernet frame creation. Apr 3, 2013 at 9:55
  • Hi @tian_yufeng, May you please explain on what is the difference between RGMII and SGMII auto-negotiation? As I tried to google, for RGMII auto negotiation we only need to read the status from the PHY chip. But for SGMII, beside the negotiation on the wire, there is another negotiation between the MAC and the PHY. It makes me confused Jul 21, 2014 at 23:16
  • 1
    The Intel 82574L is not only a MAC chip, it also contains a PHY.
    – Simon
    Mar 4, 2015 at 11:13
  • So what NIC "drivers" actually drive is the MAC chip right? Those Tx and Rx ring buffers are all on the "MAC" chip I presume. Is that correct? As for the PHY "chip", can we say all it does is connect the MAC chip with the actual RJ-45 connector??
    – Skegg
    Nov 20, 2019 at 15:58
3

You might want to look for the term "7 Layers of OSI" in which some frequently heard terms;

  • Ethernet PHY Corresponds to Physical Layer which consists from the literally physical components of the communication.

  • Ethernet MAC (not the Mac Address but the Media-Access Controller) Corresponds to Data-Link Layer, which is responsible from arranging the frames before sending them to physical layer.

    Configurations such as MII, RMII, Auto-Negotion are configured from these two.And there are libraries to make your life easy.

  • Network Layer is the one responsible from routing of the packets. Protocols such as IP and DHCP are considered to be in this layer. Also this layer is the first lowest layer that is solely software based. If you are using light-weight IP for example ip & netif libraries are the ones everything else build upon.

  • Transport Layer is where transmission protocols such as TCP & UDP can be found.

Hope it helps, I don't know much about the upper layers sadly.

0

The Intel 82574L chip contains both the MAC and the PHY.

Refer to the Architecture block diagram on page 15 in the datasheet available from here: https://ark.intel.com/content/www/us/en/ark/products/32209/intel-82574l-gigabit-ethernet-controller.html

The MAC and PHY are both there, but from my non-engineer view, I was confused about the MII connections because I was expecting two separate chips.

0

In very basic terms when you connect ethernet cable to you laptop you are able to access internet. The ethernet port is the interface in above example. Likewise there is an interface connecting your Ethernet Media Access Control(MAC) to Ethernet PHY. Let me break it down here Ethernet MAC is address of NIC(Network interface Card). Ethernet PHY is the physical layer which acts as interface between your ethernet port and Ethernet MAC. Now the Ethernet MAC takes packer from processor converts it into bits and Ethernet PHY convert bits into electrical signals. The interface between the MAC and PHY is where MII/RGMII(etc) comes into picture. Being media independent means that different types of PHY devices for connecting to different transmission media (i.e. twisted pair, fiber optic, etc.) can be used without redesigning or replacing the MAC hardware. Thus any MAC may be used with any PHY, independent of the network signal transmission media.

-1

SoCs/PCs may have the number of Ethernet ports.

Fundamentally the MII,SGMII,RGMII signals are for data that a MAC device converts to PHY. PHY is the physical media you attach to (Cat5/6 cable, or fiber, or WiFi).

Thus: For each Ethernet supported device you will have Either SGMII, RGMII interfaces for the data stream. The hardware (MAC) will assemble the frames and place them in a data buffer if the Ethernet checksum is validated. At this point the data frame is transmitted to the CPU through the MII/SGMII/RGMII/other (serial or parallel bus) interfaces.

To control External chips: External ethernet chips have control lines that interface with them and configure their operations. This is done typically by MDIO/MDC control lines connecting to a MAC device. Through this interface you can get information from the MAC device like: Frames received, Errored Frames, Collisions detected, Runts, Pause Packet counts etc. So, MACs protect the data and control transmission.

Think of PHY as the Physical media for longer transmissions. It is typically encoded or modulated (Phase Amplitude Modulation or PAM).

IE: (SoC or CPU or peripheral interface) <separate PHY and MAC and shared MDIO/MDC access of PHY(SFP) and MAC> Data plane (BUSTYPE): SoC/CPU--(MII/SGMII/RGMII)--MAC--(PAM)--PHYtransceiver--Connector.

Control plane (BUSTYPE): SoC/CPU--(MDIO/MDC)---------MAC

The MDIO/MDC control bus essentially gives the user access to Clause 22 and Clause 45 registers used to control the MAC/PHY or a MAC and PHY chip interface to the actual cable.

INTERFACES can be changed for PHY connections with SFPs: SFP allows the user to plug in different interfaces (telco etc) your PC only will have a RJ485 connector with magnetics built in. But telco's use SFP to convert to Optical or Electrical interfaces between their different pieces of equipment. Optical is usually preferred due to noise immunity, distance of transmission, and electrical isolation.

ASIDES:

A transceiver on the edge of your board is connected via Fiber (SFP) or Magnetics interfaces RJ45. These signals at that point are converted to MII, SGMII or RGMII serial or parallel data bus. This is then connected to a MAC device that is capable of assembling each frame and validating the frame. The MAC also acts like a clear to send device by listening to the lines before transmitting to avoid collisions (and it performs random back off algorithms etc). It is a Media Access Control. If your familiar with ALOHA protocol it is like that but for wired connections. Switch chips have multiple ports with MACs for each port, and internal buffers with support for VLANs, port blocking, MACsec, Management Packets (defined by their destination MAC address and locked into internal tables). Switch chips keep track of source MACs to forward frames back to originators and cut down on network traffic. These are called smart switches, The earlier switches were dumb switches and just forwarded frames out all ports. Managed switches allow you to mirror ports and sniff traffic if needed.

2
  • Can you please format your answer and neatly. I didn't understood what you're trying to say. As far I have understood this, you're confusing Ethernet port with Ethernet protocol. Both are different. Signal can be transmitted to and from by any medium as you mentioned above. Oct 1, 2022 at 12:12
  • 1
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Oct 4, 2022 at 17:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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