Ethernet – CSMA/CD – physical layer or MAC data link layer (software) implementation

ethernet

Autonegotiation works at physical layer.

Autonegotiation negotiates speed and duplex.

CSMA/CD is actually physical layer or MAC data link layer (software) implementation?

If autonegotiation is physical layer implementation, how come duplex can be negotiated? Because MAC data link layer is the one that control whether frames to be transmitted or not in half duplex mode.

Best Answer

Carrier sense and collision detect are physical layer functions; collision detect works quite differently between a bus based system like 10BASE2 and 10BASE-T. However the MAC layer is the part that uses these functions to decide when to transmit or backoff. Being at the MAC layer doesn't mean it's implemented in software though.

There is a management interface between the MAC layer and the PHY layer containing control and status registers; this, amongst other things, allows the MAC layer to set speed and duplex. If the MAC layer enables autonegotiation, it should read back the result from the status register.

The boundary between the MAC layer and PHY layer for 100Mbit/s and above is the Media Independent Interface, for example the SFP socket. So the PHY layer is on the transceiver, MAC layer on the NIC.