Friday, April 1, 2011

Ethernet Autonegotiation and Duplex Mismatch

Ethernet autonegotiation uses FLPs (Fast Link Pulses) and NLPs (Normal Link Pulses) bursts (or signals) to negotiate the speed and duplex settings as well as other autonegotiation parameters between 2 NICs to allow them to operate at the highest possible performance mode.

Autonegotiation is an active method that negotiates the speed and duplex settings; while auto-sensing is a rather passive method that only detects the speed of operation – it is impossible to passively determine the duplex mode.

Autonegotiation is a protocol; hence it only works if it is running on both sides of a link. Setting a switch port to a specific speed and duplex disables autonegotiation for duplex mode. As a result, the end system connecting to the switch port is not able to see autonegotiation parameters, and hence connects only at half-duplex – duplex mismatch is occurred.

Duplex mismatch normally produce poor performance and data link errors (eg: runt errors [1], input errors, CRC errors). Always remember to hardcode the speed and duplex settings at both ends or configure autonegotiation at both ends in order to avoid duplex mismatch!
Note: The end system performs auto-sensing when the autonegotiation process fails.
[1] Runts are frames that were less than 64 bytes in size and truncated before they were fully received.

In half-duplex operation, the RX line is being monitored for frames. If the RX line is receiving a frame, no frames are sent until the RX line is clear. A collision would occur when a frame is received on the RX line while a frame is being sent on the TX line.

In full-duplex operation, the RX line is not being monitored, and the TX line is always considered available. Collisions do not occur as the TX and RX lines are completely independent.

Common Autonegotiation Failure Scenario

When one side of a link operates in full-duplex, and another side operates in half-duplex, a large number of collisions will occur on the half-duplex side; due to the full-duplex side transmits frames without checking its RX line, and chances are it will be sending frames constantly. The chances of collision is high, as when the half-duplex side transmit a frame after it sees the RX line is not receiving any frame, the full-duplex side also transmit a frame as it never check its RX line. The half-duplex side does not expect a frame to be received when it is sending a frame – a collision occurs. Additionally, the half-duplex side would have a hard-time for getting a chance to transmit, resulting in poor performance for communication with the device.

A 10Mbps Ethernet link (fixed speed) defaults to half-duplex, whereas a 100Mbps Fast Ethernet link (dual speed 10/100) defaults to full-duplex. Multispeed links (10/100/1000) default to autonegotiate the duplex mode.

Gigabit Ethernet uses a more robust autonegotiation mechanism and has low chances to fail. Therefore Gigabit Ethernet interfaces should always be set to autonegotiation.

No comments:

Post a Comment