This article needs additional citations for verification. (February 2011) (Learn how and when to remove this template message)
On an Ethernet connection, a duplex mismatch is a condition where two connected devices operate in different duplex modes, that is, one operates in half duplex while the other one operates in full duplex. The effect of a duplex mismatch is a link that operates inefficiently. Duplex mismatch may be caused by manually setting two connected network interfaces at different duplex modes or by connecting a device that performs autonegotiation to one that is manually set to a full duplex mode.
Duplex mismatch due to autonegotiationEdit
When a device set to autonegotiation is connected to a device that is not using autonegotiation, the autonegotiation process fails. The autonegotiating end of the connection is still able to correctly detect the speed of the other end, but cannot correctly detect the duplex mode. For backwards compatibility with Ethernet hubs, the standard requires the autonegotiating device to use half duplex in these conditions. Therefore, the autonegotiating end of the connection uses half duplex while the non-negotiating peer is locked at full duplex, and this is a duplex mismatch.
The Ethernet standards and major Ethernet equipment manufacturers recommend enabling autonegotiation. Nevertheless, network equipment allows autonegotiation to be disabled and on some networks, autonegotiation is disabled on all ports and a fixed modality of 100 Mbit/s and full duplex is used. That was often done by network administrators intentionally upon the introduction of autonegotiation, because of interoperability issues with the initial autonegotiation specification. The fixed mode of operation works well if both ends of a connection are locked to the same settings. However, maintaining such a network and guaranteeing consistency is difficult. Since autonegotiation is generally the manufacturer’s default setting it is almost certain that, in an environment where the policy is to have fixed port settings, someone will sooner or later leave a port set to use autonegotiation by mistake.
Effects of duplex mismatchEdit
Communication is possible over a connection in spite of a duplex mismatch. Single packets are sent and acknowledged without problems. As a result, a simple ping command fails to detect a duplex mismatch because single packets and their resulting acknowledgments at 1-second intervals do not cause any problem on the network. A terminal session which sends data slowly (in very short bursts) can also communicate successfully. However, as soon as either end of the connection attempts to send any significant amount of data, the network suddenly slows to very low speed. Since the network is otherwise working, the cause is not so readily apparent.
A duplex mismatch causes problems when both ends of the connection attempt to transfer data at the same time. This happens even if the channel is used (from a high-level or user's perspective) in one direction only, in case of large data transfers. Indeed, when a large data transfer is sent over a TCP, data is sent in multiple packets, some of which will trigger an acknowledgment packet back to the sender. This results in packets being sent in both directions at the same time.
In such conditions, the full-duplex end of the connection sends its packets while receiving other packets; this is exactly the point of a full-duplex connection. Meanwhile, the half-duplex end cannot accept the incoming data while it is sending – it will sense it as a collision. The half-duplex device ceases its current data transmission, sends a jam signal instead and then retries later as per CSMA/CD. This results in the full-duplex side receiving an incomplete frame with CRC error or a runt frame. It does not detect any collision since CSMA/CD is disabled on the full-duplex side. As a result, when both devices are attempting to transmit at (nearly) the same time, the packet sent by the full-duplex end will be discarded and lost due to an assumed collision and the packet sent by the half duplex device will be delayed or lost due to a CRC error in the frame.
The lost packets force the TCP protocol to perform error recovery, but the initial (streamlined) recovery attempts fail because the retransmitted packets are lost in exactly the same way as the original packets. Eventually, the TCP transmission window becomes full and the TCP protocol refuses to transmit any further data until the previously-transmitted data is acknowledged. This, in turn, will quiesce the new traffic over the connection, leaving only the retransmissions and acknowledgments. Since the retransmission timer grows progressively longer between attempts, eventually a retransmission will occur when there is no reverse traffic on the connection, and the acknowledgment are finally received. This will restart the TCP traffic, which in turn immediately causes lost packets as streaming resumes.
The end result is a connection that is working but performs extremely poorly because of the duplex mismatch. Symptoms of a duplex mismatch are connections that seem to work fine with a ping command, but "lock up" easily with very low throughput on data transfers; the effective data transfer rate is likely to be asymmetrical, performing much worse in the half-duplex to full-duplex direction than the other. In normal half-duplex operations late collisions do not occur. However, in a duplex mismatch the collisions seen on the half-duplex side of the link are often late collisions. The full-duplex side usually will register frame check sequence errors, or runt frames. Viewing these standard Ethernet statistics can help diagnose the problem.
Contrary to what one might reasonably expect, both sides of a connection need to be identically configured for proper operation. In other words, setting one side to automatic (either speed or duplex or both) and setting the other to be fixed (either speed or duplex or both) will likely result in either a speed mismatch, a duplex mismatch or both. A duplex mismatch can be fixed by either enabling autonegotiation (if available and working) on both ends or by forcing the same settings on both ends (availability of a configuration interface permitting). If there is no option but to have a locked setting on one end and autonegotiation the other (for example, an old device with broken autonegotiation connected to an unmanaged switch) half duplex must be used. All modern LAN equipment comes with autonegotiation enabled and the various compatibility issues have been resolved. The best way to avoid duplex mismatches is to use autonegotiation and to replace any legacy equipment that does not use autonegotiation or does not autonegotiate correctly.
- "Switch Port Duplex Mismatch". Archived from the original on 2011-07-14. Retrieved 2011-02-15.
- "Configuring and Troubleshooting Ethernet 10/100/1000Mb Half/Full Duplex Auto-Negotiation". Cisco. Retrieved 2012-01-12.
Cisco recommends to leave auto-negotiation on for those devices compliant with 802.3u.
- Jim Eggers and Steve Hodnett (July 2004). "Ethernet Autonegotiation Best Practices" (PDF). Sun Microsystems. Archived from the original (PDF) on 2011-05-20.
Using autonegotiation is the IEEE 802.3 standard and customers are encouraged to follow the “intent” of IEEE 802.3u/z standards and implement autonegotiation in their Ethernet environments.
- Rich Hernandez (2001). "Gigabit Ethernet Auto-Negotiation". Dell. Retrieved 2012-01-12.
- "Autonegotiation on Ethernet – It Works, It Should Be Mandatory!". 2010-03-10. Retrieved 2012-10-12.
- Gary A. Donahue (2007). Network Warrior. O'Reilly. p. 21. ISBN 978-0-596-10151-0.
- US 6580697, "Advanced ethernet auto negotiation"
- Jim Eggers and Steve Hodnett (July 2004). "Ethernet Autonegotiation Best Practices" (PDF). Sun Microsystems. Retrieved 2011-02-18.