http://en.wikipedia.org/wiki/Autonegotiation
============================================
Autonegotiation is an Ethernet procedure 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. In the OSI model, autonegotiation resides in the physical layer. For Ethernet over twisted pair it is defined in clause 28 of IEEE 802.3.
Overview
The standards for 1000BASE-T, 1000BASE-TX and 10GBASE-T require autonegotiation to be always present and enabled.
(在1000BASE-T,1000BASE-TX和10GBASE-T中,auto-negotiation始终被使能。AR8031通过寄存器来设置它是否被使能,在U-Boot的初始化代码中,它默认是YES。)
Electrical signals
Auto-negotiation 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 200ns, generated at a 16 ms time interval (with a timing variation tolerance of 8 ms).
These pulses are called link integrity test (LIT) pulses in the 10BASE-T terminology, and are referred to as normal link pulses (NLP) in the auto-negotiation specification.
(Auto-negotiation使用10BASE-T进行通讯,它会在设备空闲时发送LIT脉冲。正常的link脉冲则被称为NLP。交换机和AR8031都会发送这样的脉冲,通知对方自身的特性。)
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.
(当设备在50-150ms之后还是没有检测到LIT脉冲,则认为link失败。为了让这种机制工作,即使没有接收到任何脉冲,设备也应该发送LIT脉冲。)
Auto-negotiation uses similar pulses labeled as NLP. NLP are still unipolar, positive-only, and of the nominal duration of 100ns; but each LIT is replaced by a pulse burst consisting of 17 to 33 pulses sent 125us apart. Each such pulse burst is called a fast link pulse (FLP) burst. The time interval between the start of each FLP burst is the same 16 milliseconds as between normal link pulses (variation tolerance of 8 ms).
(Auto-negotiation使用的是NLP脉冲,它也是unipolar和positive-only的,持续100ns,但是它的每一个LIT,替换成了每125us发送17个到33个脉冲这种方式。这种pulse burst则被称为FLP burst。每个FLP burst之间的时间间隔也为16ms。)
(总而言之,LIT是网络设备通知其他设备自身存在的普遍方式;而Auto-negotiation则采用了变化了的NLP来实现这样的功能。每个NLP脉冲集被称为FLP。)
The FLP burst consists of 17 NLP at a 125 us time interval (with a tolerance of 14 us). Between each pair of two consecutive NLP (i.e. at 62.5 us after first NLP of the pulse pair) 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 (LCW). 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.
(在每两个连续的NLP之间,会出现一个额外的脉冲,代表1;如果没有这个额外的脉冲,则代表0。每个FLP会包含16bit的数据,这些数据被称为LCW。)
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:
* 0-4: selector field: it indicates which standard is used between IEEE 802.3 and IEEE 802.9';
* 5-12: technology ability field: this is a sequence of bits that encode the possible modes of operations among the 100BASE-T and 10BASE-T modes;
* 13: remote fault: this is set to one when the device is detecting a link failure;
* 14: acknowledgement: the device sets this to one to indicate the correct reception of the base link code word from the other party; this is detected by the reception of at least three identical base code words;
* 15: next page: this bit is used to indicate the intention of sending other link code words after the base link code word;
The technology ability field is composed of eight bits. For IEEE 802.3, these are as follows:
* bit 0: device supports 10BASE-T
* bit 1: device supports 10BASE-T in full duplex
* bit 2: device supports 100BASE-TX
* bit 3: device supports 100BASE-TX in full duplex
* bit 4: device supports 100BASE-T4
* bit 5: pause
* bit 6: asymmetric pause for full duplex
* bit 7: reserved
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.
(当设备收到了3个一样的base code word之后,会将自身返回的link code的ack位置高,发送6至8次,通知对方自己已经收到了。)
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 (using 17 clock pulses and up to 16 bit pulses).
(当双方交换了base link code word,而且next page bit被置位,则会接着交换next page。)
Message and unformatted next page
The base page (the base link code word) is sufficient for devices to advertise which ones among the 10BAST-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.
(gigabit Ethernet需要另外的两个pages,但是10BAST-T, 100BASE-TX and 100BASE-T4就不需要了。ques:OK335xD指示接收到了有效的next page,理论上应该是不需要它的,为什么呢?)
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.
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 2012 edition of 802.3 is as follows:
1. 10GBASE-T full duplex
2. 1000BASE-T full duplex
3. 1000BASE-T half duplex
4. 100BASE-T2 full duplex
5. 100BASE-TX full duplex
6. 100BASE-T2 half duplex
7. 100BASE-T4 half duplex
8. 100BASE-TX half duplex
9. 10BASE-T full duplex
10. 10BASE-T half duplex
http://myaccount.flukenetworks.com/fnet/en-us/supportAndDownloads/KB/IT+Networking/OptiView+Series+II+Integrated+Network+Analyzer/Auto-Negotiation__how_does_it_work
===================================================
这篇博文讲得更有趣!
(从上面的内容可知,Auto-negotiation失败,和AM335x的关系并不大,而是PHY芯片AR8031的问题,可能是由于AR8031的设置不正确,也可能是因为网络变压器的接线不正确……总之,Auto-negotiation在AR8031初始化之后就应该开始,在差分线上可以观测到持续的脉冲!)
文章评论(0条评论)
登录后参与讨论