Saturday, March 17, 2012

Ethernet Auto-Negotiation

I've probably mentioned this before, but I'm surprised how many people I encounter that still don't get how auto-negotiation works.  The easiest way to spot network administrators who just don't get it is to analyze their network for duplex mismatches.  And you usually don't end up looking for those until you have users complaining about "slowness" over the network.

The problem is that most people think auto-negotiation will work if they just set the network interface in their computer to use it.  This will not guarantee a successful negotiation of the correct duplex setting.   That is because auto-negotiation requires each end of the connection to be set for auto-negotiation.  That means that in addition to the NIC in the computer, the switch that it is connected to must also be set for auto-negotiation.  This is defined as part of the IEEE 802.3 standard for Ethernet connections.

The standard says that if only one end of the connection is set for auto-negotiation, the speed (100Mbps, 1Gbps, etc..) will negotiate fine, but the duplex setting will become half-duplex.  If you want to see how you are negotiated from your PC, then you would need a tool from your NIC manufacturer.  Some manufacturers like Broadcom do offer such tools that you can install, but not all manufacturers will provide such a tool.

A more complex example would be using small, unmanaged switches with managed switches.  Those cheap unmanaged switches usually do not allow you to specify the duplex setting for each port.  Therefore, they use auto-negotiation by default.  So if you connect that to a port on a managed switch that is explicitly set for, let's say, full-duplex, then you will have a duplex-mismatch resulting in a half-duplex connection.  In this case, even if you checked the connection with a tool from a workstation connected to the unmanaged switch, you would not get correct results.  The tool would most likely show a full-duplex connection.  That is because the connection from the PC to the unmanaged switch may be fine.  The issue would be with the backbone connection from the unmanaged switch to the managed switch.

The easiest remedy for these types of duplex mismatches is to simply always use auto-negotiation on all of your devices.   Almost all modern devices are going to use auto-neg by default.  So anything you purchase and connect to your network will always negotiate the proper duplex as long as all of your network devices are configured for auto-negotiation.

Remember, it takes two for auto-negotiation over Ethernet networks.  

No comments:

Post a Comment