Pages

Duplex mismatches 100BASE-TX

I encountered a situation a few days ago where the two devices were not correctly negotiating the duplex setting. One box was a Cisco 2950 switch, the other was a Linux machine.
Although the ehternet interfaces of the 2 boxes were both capable of 100BASE-TX (full duplex) it was clear that the Linux machine's eth1 was running in half duplex mode
A tool on Linux which can display/change an ethernet card setting is ethtool.
Now for a bit of theory:

The link speed is determined by electrical signaling, so that either end of a link can determine what
the other end is trying to use. If both ends of the link are configured to autonegotiate, they will use
the highest speed that is common to them.
A link’s duplex mode, however, is negotiated through an exchange of information. This means that
for one end to successfully autonegotiate the duplex mode, the other end must also be set to autonegotiate.
Otherwise, one end will never see any duplex information from the other end and won’t
determine the correct common mode.
As I closely checked the Cisco switch, the port on which the Linux machine was connected has been set up (as per Cisco) to operate at speed 100 (Mbit) and in full-duplex mode.

Linux defaults to automatically negotiating the speed and duplex of it's NIC automatically with that of the switch to which it is attached.
According to the theory above the Linux machine's eth interface did not received any information about the duplex setting from the
attached switch, therefore it set up its duplex mode to half-duplex.

Ways to overcome this:

1. The safe way (how I did it)
Turn off autonegotiation and set up the duplex mode and speed manually. This can be achieved on Linux with with ethtool,
on Cisco via CLI (for example)
Linux:
ethtool -s ethX speed 100 duplex full autoneg off
Cisco 2950:
Switch(config-if)# duplex full
Switch(config-if)# speed 100
2. The "unsafe" way
Enable autonegotiation on both connected devices. I said that this method is "unsafe" because configuring a switch port to auto-negotiate the speed
and duplex often isn't sufficient because there can be differences in the implementation of the protocol standard.

Other reasons for duplex mismatch might be faulty cabling, bad ethernet card....but I won't discuss them here

No comments: