1

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.

Ron Vince
  • 927
  • 2
  • 12
  • 22
  • 1
    See http://networkengineering.stackexchange.com/questions/6380/osi-model-and-networking-protocols-relationship/6381#6381 – Ron Trunk Oct 01 '14 at 09:55
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide your own answer and accept it. – Ron Maupin Aug 06 '17 at 23:43

2 Answers2

5

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.

richardb
  • 1,568
  • 8
  • 10
  • Based on your answer regarding management interface and [base link code word](http://en.wikipedia.org/wiki/Autonegotiation#The_base_link_code_word), does it mean that there is software (firmware) that sits on physical layer which communicates with MAC layer? – Ron Vince Oct 01 '14 at 12:22
  • @RonVince It seems unlikely to me that there would be a general purpose microprocessor on the transceiver. There isn't necessarily one on the NIC either. – richardb Oct 02 '14 at 09:48
  • Somehow, I think there is microcontroller on both PHY and MAC thus there is program/software. For MAC, its jobs is too intelligent for not having software (VLAN tag, MPLS label, QinQ, buffer, unicast/broadcast address). Reference: [1](http://electronicdesign.com/embedded/ethernet-mac-and-phy), [2](http://netwinder.osuosl.org/pub/netwinder/docs/nw/PHY/1890.pdf), [3](http://en.wikipedia.org/wiki/Media_Independent_Interface). Kindly clarify regarding general purpose microprocessor. – Ron Vince Oct 03 '14 at 00:52
0

The PHY is responsible for physically sensing the carrier and detecting the collision.

The MAC is responsible for using that information to decide when to transmit a packet and retransmitting the packet if a collision happens.

The PHY performs the auto-negotiation process.

At least on the implementations I have seen the host processor reads the negotiated settings from the PHY and programs them into the settings registers of the MAC and PHY (some settings, for example speed will need to be configured the same on both MAC and PHY).

How settings are read and written from the MAC and PHY is implementation dependent, typically for separate PHYs an interface called MDIO is used. On integrated MAC/PHY chips the PHY registers may be integrated into the controller's main register map.

Peter Green
  • 12,935
  • 2
  • 20
  • 46