Autonegotiation


Autonegotiation is a signaling mechanism and procedure used by Ethernet over twisted pair by which two connected devices choose common transmission parameters, such as speed, duplex mode, and flow control. In this process, the connected devices first share their capabilities regarding these parameters and then choose the highest performance transmission mode they both support.
Autonegotiation is defined in clause 28 of IEEE 802.3. and was originally an optional component in the Fast Ethernet standard. It is backwards compatible with the normal link pulses used by 10BASE-T. The protocol was significantly extended in the gigabit Ethernet standard, and is mandatory for 1000BASE-T gigabit Ethernet over twisted pair.
In the OSI model, autonegotiation resides in the physical layer.

Standardization and interoperability

In 1995, the IEEE 802.3u standard was released to allow connected network adapters to negotiate the best possible shared mode of operation. The initial autonegotiation standard contained a mechanism for detecting the speed but not the duplex setting of Ethernet peers that did not use autonegotiation. The protocol that became IEEE 802.3 clause 28 was developed from a patented technology by National Semiconductor known as NWay. The company gave a letter of assurance for anyone to use their system for a one time license fee. Another company has since bought the rights to that patent.
The first version of the autonegotiation specification, in the 1995 Fast Ethernet standard IEEE 802.3u, was open to different interpretations. Although most manufacturers implemented this standard in one way, some others, including network giant Cisco, implemented it in a different way. Autonegotiation between devices that implemented it differently failed. Problems like this with autonegotiation led many network administrators to manually set the speed and duplex mode of each network interface card. However, the use of manually set configuration may also lead to duplex mismatches, in particular when two connected devices are:
Duplex mismatch problems are difficult to diagnose because the network is apparently working, and simple programs used for network tests such as ping report a valid connection; however, the network is much slower than expected.
The debatable portions of the autonegotiation specifications were eliminated by the 1998 release of 802.3. This was later followed by the release of the Gigabit Ethernet standard IEEE 802.3ab in 1999. The new standard specified that 1000BASE-T Ethernet at 1 Gbit/s over copper wiring requires autonegotiation. Currently, most network equipment manufacturers recommend using autonegotiation on all access ports and enable it as a factory default setting.
The standards for 1000BASE-TX and 10GBASE-T also require autonegotiation.

Function

Autonegotiation can be used by devices that are capable of more than one transmission rate, different duplex modes, and different standards at the same speed. Each device declares its technology abilities, that is, its possible modes of operation, and the best mode is chosen from those shared between them, with higher speed preferred over lower, and full duplex preferred over half duplex at the same speed.
Parallel detection is used when a device that is capable of autonegotiation is connected to one that is not. This happens if a device does not support autonegotiation or autonegotiation is administratively disabled on a device. In this condition, the device that is capable of autonegotiation can determine and match speed with the other device. This procedure cannot determine duplex capability, so half duplex is always assumed.
Other than speed and duplex mode, autonegotiation is used to communicate the port type and the master-slave parameters.

Priority

Upon receipt of the technology abilities of the other device, both devices decide the best possible mode of operation supported by both devices. The priority among modes specified in the 2018 edition of 802.3 is as follows:
140GBASE-Tfull duplex
225GBASE-Tfull duplex
310GBASE-Tfull duplex
45GBASE-Tfull duplex
52.5GBASE-Tfull duplex
61000BASE-Tfull duplex
71000BASE-Thalf duplex
8100BASE-T2full duplex
9100BASE-TXfull duplex
10100BASE-T2half duplex
11100BASE-T4half duplex
12100BASE-TXhalf duplex
1310BASE-Tfull duplex
1410BASE-Thalf duplex

In other words, among the modes that are supported by both devices, each device chooses the one that is the topmost in this list.

Electrical signals

Autonegotiation is based on pulses similar to those used by 10BASE-T devices to detect the presence of a connection to another device. These connection present pulses are sent by Ethernet devices when they are not sending or receiving any frames. They are unipolar positive-only electrical pulses of a nominal duration of 100 ns, with a maximum pulse width of 200 ns, generated at a 16 ms time interval. These pulses are called link integrity test pulses in the 10BASE-T terminology, and are referred to as normal link pulses in the auto-negotiation specification.
A device detects the failure of a link if neither a frame nor two of the LIT pulses is received for 50-150 ms. For this scheme to work, devices must send LIT pulses regardless of receiving any.
Auto-negotiation uses similar pulses labeled as NLP. NLP are still unipolar, positive-only, and of the nominal duration of 100 ns; but each LIT is replaced by a pulse burst consisting of 17 to 33 pulses sent 125 µs apart. Each such pulse burst is called a fast link pulse burst. The time interval between the start of each FLP burst is the same 16 milliseconds as between normal link pulses.
The FLP burst consists of 17 NLP at a 125 µs time interval. Between each pair of two consecutive NLP an additional positive pulse may be present. The presence of this additional pulse indicates a logical 1, its absence a logical 0. As a result, every FLP contains a data word of 16 bits. This data word is called a link code word. The bits of the link code word are numbered from 0 to 15, where bit 0 corresponds to the first possible pulse in time and bit 15 to the last.

The base link code word

Every fast link pulse burst transmits a word of 16 bits known as a link code word. The first such word is known as a base link code word, and its bits are used as follows:
The technology ability field is composed of eight bits. For IEEE 802.3, these are as follows:
The acknowledgement bit is used to signal the correct reception of the base code word. This corresponds to having received three identical copies of the base code word. Upon receiving these three identical copies, the device sends a link code word with the acknowledge bit set to one from six times to eight times.
The link code words are also called pages. The base link code word is therefore called a base page. The next page bit of the base page is 1 when the device intends to send other pages, which can be used to communicate other abilities. These additional pages are sent only if both devices have sent base pages with a next page bit set to 1. The additional pages are still encoded as link code words.

Message and unformatted next page

The base page is sufficient for devices to advertise which ones among the 10BASE-T, 100BASE-TX and 100BASE-T4 modes they support. For gigabit Ethernet, two other pages are required. These pages are sent if both devices have sent base pages with a next page bit set to one.
The additional pages are of two kinds: message pages and unformatted pages. These pages are still 16-bit words encoded as pulses in the same way as the base page. Their first eleven bits are data, while their second-to-last bit indicates whether the page is a message page or an unformatted page. The last bit of each page indicates the presence of an additional page.
The 1000BASE-T supported modes and master-slave data are sent using a single message page, followed by a single unformatted page. The message page contains:
The unformatted page contains a 10-bit word, called a master-slave seed value.

Duplex mismatch

A duplex mismatch occurs when two connected devices are configured in different duplex modes. This may happen for example if one is configured for autonegotiation while the other one has a fixed mode of operation that is full duplex. In such conditions, the autonegotiation device correctly detects the speed of operation, but is unable to correctly detect the duplex mode. As a result, it sets the correct speed but starts using the half-duplex mode.
When a device is operating in full duplex while the other one operates in half duplex, the connection works only at a very low throughput when both devices attempt to send frames at the same time. This is because data can be sent in both directions at the same time in full-duplex mode, but only in one direction at a time in half-duplex mode. As a result, a full-duplex device may transmit data while it is receiving. However, if the other device is working in half duplex, it does not expect to receive data ; therefore, it senses a collision and attempts to resend the frame it was sending. Depending on timing, the half-duplex device may sense a late collision, which it will interpret as a hard error rather than a normal consequence of CSMA/CD and may not attempt to resend the frame. On the other hand, the full-duplex device does not detect any collision and does not resend the frame, even if the other device has discarded it as corrupted by collision. Still, the full-duplex device, not expecting incoming frames to be truncated by collision detection, will report frame check sequence errors from the aborted frames the half-duplex device attempted to send. This combination of collisions reported at the half-duplex end and FCS errors reported by the full-duplex end can be used as an indication that a duplex mismatch is present.
This packet loss happens when both devices are transmitting at the same time. This may happen even when the link is used, from the user's perspective, in one direction only. A TCP stream requires all packets sent to be acknowledged by the receiving device. As a result, even if actual data is sent in one direction only, collision may be generated with acknowledgement packets traveling in the other direction.

Patents

Autonegotiation is covered by the US patents
971,018,
146,729,
430,143 ;
European Patent Applications SN 93308568.0 ;
Korean Patent No. 286791;
Taiwanese Patent No. 098359;
Japanese Patent No. 3705610;
Japanese Patent 4234. Applications SN H5-274147;
Korean Patent Applications SN 22995/93;
Taiwanese Patent Applications SN 83104531.