Wednesday 25 February 2015

autonegotiation part 2


How Autonegotiation (AN) Works with Fast Link Pulse (FLP)

The purpose of AN is to automatically configure two devices that share a link segment to take maximum advantages of their capabilities. This allows devices at both ends of the link segment to advertise their capabilities, acknowledge receipt and understanding of the common mode of operation that both devices share, and reject the use of modes that are not supported by both devices.AN is performed using a modified link-integrity pulse (called FLP, or Fast Link Pulse) such that no packet or upper protocol overhead is added. Each device capable of AN, issues FLP bursts at power up, on command from the MAC, or due to user interaction. Fast Link Pulse is more than simply a pulse. It is a structured bit sequence that allows for the negotiation process. A pulse is a series of bits within a given period. It is this bit stream that sets up the link.
 
FLP bursts
 Figure1
Each FLP burst consists of 33 pulse positions that provide clock and data information. The 17 odd-numbered pulses are designated as clock pulses, while the 16 even-numbered pulse positions represent data information. A logic one is represented by the presence of a pulse, while the absence of a pulse is represented by a logic zero.
FLP burst encoding
Figure 2
The data pulses in the FLP burst encode a 16-bit link code word (LCW). A device capable of auto-negotiation transmits and receives the FLP. The receiver must identify three identical LCWs before the information is authenticated and used in the arbitration process. The devices decode the base LCW and select capabilities of the highest common denominator supported by both devices. Once the LCWs are properly received, each device transmits a FLP burst with an acknowledge bit. At this point, both devices enable the mode that is the highest common mode negotiated.
The clock pulses are used for timing and recovery of the data pulses. The 17 clock pulses are always present in the FLP burst. The first pulse on the wire is a clock pulse. The 16 data pulses may or may not be present. If the data pulse is present, it represents a value of one in the LCW for that position. The lack of a data pulse indicates a zero in the LCW for that position, as shown in figure. 
Base link code word
The base LCW is transmitted within an FLP burst after power-on, reset, or renegotiation. The DTE and its link partner communicate their capabilities by exchanging LCWs. Figure 3 defines the bit positions of the base LCW. These bit positions map directly to the data pulses in the FLP burst—bits D0 through D15.
Technology ability field
Figure 3
Selector field, which is encoded in bits D0 through D4, indicates which standard is used between IEEE 802.3 and IEEE 802.9.
The technology ability field (TAF), which is encoded in bits D5 through D12 of the FLP burst, is a sequence of bits that encode the possible modes of operations among the 100BASE-T and 10BASE-T modes.
D13: remote fault: this is set to one when the device is detecting a link failure.
D14: 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.
D15: next page: this bit is used to indicate the intention of sending other link code words after the base link code word.
AN also provides for a Parallel Detection function to allow 10Base-T, 100Base-TX, and 100Base-T4 compatible devices to be recognized even in the event that one of both modes do not support AN.
Cisco switches use auto-negotiation by default; it is then disabled if both the speed and
duplex are manually configured. You can set the speed using the speed {auto | 10 | 100 | 1000} interface subcommand, assuming the interface supports multiple speeds. You configure the duplex setting using the duplex {auto | half | full} interface subcommand




-======

Difference Between CatOS and Cisco IOS System Software

CatOS on the Supervisor Engine and Cisco IOS Software on the Multilayer Switch Feature Card (MSFC) (Hybrid): a CatOS image can be used as the system software to run the Supervisor Engine on Catalyst 6500/6000 switches. If the optional MSFC is installed, a separate Cisco IOS Software image is used to run the MSFC.
Cisco IOS Software on both the Supervisor Engine and MSFC (Native): a single Cisco IOS Software image can be used as the system software to run both the Supervisor Engine and MSFC on Catalyst 6500/6000 switches.
Note:  Refer to Comparison of the Cisco Catalyst and Cisco IOS Operating Systems for the Cisco Catalyst 6500 Series Switch for more information.

When to Use Ethernet 10/100 Mb Auto-Negotiation

Auto-negotiation is an optional function of the IEEE 802.3u Fast Ethernet standard that enables devices to automatically exchange information over a link about speed and duplex abilities.
Auto-negotiation is targeted at ports. These ports are allocated to areas where transient users or devices connect to a network. For example, many companies provide shared offices or cubes for Account Managers and System Engineers to use when they are in the office. Each office or cube has an Ethernet port permanently connected to the office network. Because it might not be possible to ensure that every user has either a 10 Mb, a 100 Mb Ethernet, or a 10/100 Mb card in their laptop, the switch ports that handle these connections must be able to negotiate their speed and duplex mode. The alternative is to provide both a 10 Mb and a 100 Mb port in each office, or cube and label them accordingly.
One of the most common causes of performance issues on 10/100 Mb Ethernet links occurs when one port on the link operates at half-duplex while the other port operates at full-duplex. This occurs when one or both ports on a link are reset and the auto-negotiation process does not result in both link partners having the same configuration. It also can occur when users reconfigure one side of a link and forget to reconfigure the other side. Both sides of a link should have auto-negotiation on, or both sides should have it off. Cisco recommends to leave auto-negotiation on for those devices compliant with 802.3u.
Many performance-related support calls are avoided if you correctly configure auto-negotiation. Many Catalyst Ethernet switching modules support 10/100 Mb and half-duplex or full-duplex. Exceptions include the Ethernet Group switch modules. The show port capabilities {mod_num} | {mod_num/port_num} command shows if the module you are working on supports 10/100 Mb and half-duplex or full-duplex. This document uses two WS-X5530 Supervisor Engine IIIs, each with two optional uplink 10/100 BaseTX Ethernet ports installed.
Note: When the WS-6748-GE-TX module is connected to a network tap device, automatic negotiation does not work. In order to resolve this issue, you must configure auto-negotiation manually. Go to the interface mode and execute this command:
Cat6K-IOS(config-if)#speed auto

When to Use Ethernet 1000 Mb Auto-Negotiation

Basically auto-negotiation in GigabitEthernet covers these items:
  • Duplex settings—While Cisco devices only support full-duplex, the IEEE 802.3z standard does have support for half-duplex GigabitEthernet. Because of this, duplex is negotiated between GigabitEthernet devices.
  • Flow Control—Becuase of the amount of traffic that can be generated by GigabitEthernet, there is a PAUSE functionality built into GigabitEthernet. The PAUSE frame is a packet that tells the far-end device to stop the transmition of packets until the sender is able to handle all the traffic and clear its buffers. The PAUSE frame has a timer included, which tells the far-end device when to start to send packets again. If that timer expires without getting another PAUSE frame, the far-end device can then send packets again. Flow-Control is an optional item and must be negotiated. Devices can be capable of sending or responding to a PAUSE frame, and they possibly do not agree to the flow-control request of the far-end neighbor.
  • Negotiation—Usually built-in Gigabit Ethernet ports are capable of negotiation, but in cases like modular SFP or GBIC types, they do not negotiate. Line protocol will be down for a Gigabit Ethernet port when connected to a Fast Ethernet port. This can be verified via the show inter gig4/3 capabilities command:
    Switch-A#show interface Gig4/3 capabilities
    GigabitEthernet4/3
    Model                    WS-X4516-10GE-Gbic
    Type                     1000BaseT
    Speed                    1000
    Duplex                   full
    
    
Assume that there are two devices, A and B. Assume that each device can have Autonegotiation enabled, or disabled. The correct behaviour of link status with autonegotiation in accordance to the IEEE Std 802.3z-1998 should be like this:
  • If A is enabled and B is enabled, then link status should be reported on both devices as link up.
  • If A is disabled and B is enabled, then A should report link up and B should report link down.
  • If A is enabled and B is disabled, then A should report link down and B should report link up.
By default, all devices are supposed to perform autonegotiation. 802.3z does not specifically define a way to turn Autonegotiation off, for both 1GigabitEthernet and 10GigabitEthernet.

Configure and Troubleshoot Ethernet 10/100Mb Auto-Negotiation on CatOS Switches

This section of the document explains how to examine the behavior of an 10/100 Mb Ethernet port that supports auto-negotiation. This procedure shows how to make changes to its default behavior and how to restore it to the default behavior. Complete these steps:
  1. Connect the two switches together.
    Ethernet port 1/1 on switch A is connected to Ethernet port 1/1 on switch B using an Ethernet crossover cable. See Appendix B for more information on crossover cables.
    Note: Your actual mod_num/port_num numbers might be different.
  2. Examine the capabilities of the ports.
    The show port capabilities 1/1 command displays the capabilities of an Ethernet 10/100 BaseTX 1/1 port on switch A.
    Issue this command for both of the ports you are troubleshooting. Both ports must support the speed and duplex capabilities if they are supposed to use auto-negotiation.
    The bold text in this output shows where the information on the speed and duplex mode capabilities are found.
    Switch-A> (enable) show port capabilities 1/1
    Model                    WS-X5530
    Port                     1/1
    Type                     10/100BaseTX
    Speed                    auto,10,100
    Duplex                   half,full
    
    
  3. Configure auto-negotiation for port 1/1 on both switches.
    Issue the set port speed 1/1 auto command to configure auto-negotiation for both speed and duplex mode on port 1/1 of both switches. Auto is the default for ports that support auto-negotiation.
    Switch-A> (enable) set port speed 1/1 auto
    Port(s) 1/1 speed set to auto detect.
    Switch-A (enable)
    Note: The set port speed {mod_num/port_num} auto command also sets the duplex mode to auto. There is no set port duplex {mod_num/port_num} auto command.
    Also, this command is redundant because the configurations of the switches had been cleared to their defaults before starting this procedure. The default behavior for Ethernet 10/100 BaseTX ports is auto-negotiation.
  4. Determine if the speed and duplex mode are set to auto-negotiate.
    Issue the show port 1/1 command to display the status of ports 1/1 on switches A and B.
    Switch-A> (enable) show port 1/1
    Port  Name               Status     Vlan       Level  Duplex Speed Type
    ----- ------------------ ---------- ---------- ------ ------ ----- ------------
     1/1                     connected  1          normal  a-full a-100 10/100BaseTX
    
    
    Switch-B> (enable) show port 1/1  
    Port  Name               Status     Vlan       Level  Duplex Speed Type
    ----- ------------------ ---------- ---------- ------ ------ ----- -----------
     1/1                     connected  1          normal a-full  a-100 10/100BaseTX
    The bold text in the preceding output shows where the information on the current status of a port can be found. Most of the normal output from the show port {mod_num/port_num} command is omitted. See Appendix C for further explanation of the fields in the output of this command.
    The a prefixes on the full and 100 indicate that this port is not hard coded (configured) for a specific duplex mode or speed. Therefore, it auto-negotiates the duplex mode and speed if the device it is connected to also auto-negotiates duplex mode and speed.
    The status is connected on both ports, which means that a link pulse is detected from the other port. The status can be connected even if duplex is incorrectly negotiated or incorrectly configured.
  5. Change the speed on port 1/1 in switch A to 10 Mb.
    In order to demonstrate what occurs when one link partner auto-negotiates and the other link partner does not, the speed on port 1/1 in switch A must be set to 10 Mb. Issue the set port speed 1/1 10 command to set this speed.
    Switch-A> (enable) set port speed 1/1 10
    Port(s) 1/1 speed set to 10Mbps.
    Switch-A> (enable)
    Note: Hard coding the speed on a port disables all auto-negotiation functionality on the port for speed and duplex.
    When a port is configured for a speed, the duplex mode is automatically configured for the mode it previously negotiated. In this case, the mode is full-duplex. Therefore, the set port speed 1/1 10 command causes the duplex mode on port 1/1 to be configured as if the command set port duplex 1/1 full is also issued. This is explained in step 6.
  6. Understand the meaning of the a prefix on the duplex and speed status fields.
    The absence of the a prefix in the status fields of the output from the show port 1/1 command on switch A shows that the duplex mode is configured for full and the speed is configured for 10.
    Switch-A> (enable) show port 1/1
    Port  Name               Status     Vlan       Level  Duplex Speed Type
    ----- ------------------ ---------- ---------- ------ ------ ----- ------------
     1/1                     connected  1          normal  full  10    10/100BaseTX
  7. View the duplex status of port 1/1 on switch B.
    The show port 1/1 command on switch B indicates that the port operates at half-duplex and 10 Mb.
    Switch-B> (enable) show port 1/1
    Port  Name               Status     Vlan       Level  Duplex Speed Type
    ----- ------------------ ---------- ---------- ------ ------ ----- ------------
     1/1                     connected  1          normal a-half a-10  10/100BaseTX
    This step shows that it is possible for a link partner to detect the speed at which the other link partner operates, even though the other link partner is not configured for auto-negotiation. In order to detect the speed, the link partner senses the type of electrical signal that arrives and sees if it is 10 Mb or 100 Mb. This is how switch B determines that port 1/1 operates at 10 Mb.
    It is not possible to detect the correct duplex mode in the same method that the correct speed can be detected. In this case, where the 1/1 port of switch B is configured for auto-negotiation and the 1/1 port of switch A is not, the 1/1 port of switch B is forced to select the default duplex mode. On Catalyst Ethernet ports, the default mode is auto-negotiate. If auto-negotiation fails, the default mode is half-duplex.
    This example also shows that a link can be successfully connected when there is a mismatch in the duplex modes. Port 1/1 on switch A is configured for full-duplex while port 1/1 on switch B is defaulted to half-duplex. Configure both link partners to avoid this.
    The a prefix on the Duplex and Speed status fields does not always mean that the current behavior is negotiated. Sometimes it can mean that the port is not configured for a speed or duplex mode.
    The previous output from switch B shows duplex as a-half and speed as a-10. This indicates that the port operates at 10 Mb in half-duplex mode. In this example, however, the link partner on this port (port 1/1 on switch A) is configured for full and 10 Mb. Therefore, it is not possible for port 1/1 on switch B to auto-negotiate current behavior. This proves that the a prefix only indicates a willingness to perform auto-negotiation, and not that auto-negotiation actually took place.
  8. Understand the duplex mismatch error.
    This message about a duplex mode mismatch is displayed on switch A after the speed on port 1/1 is changed to 10 Mb. This mismatch occurs because the 1/1 port of switch B defaults to half-duplex when it senses its link partner no longer performs auto-negotiation.
    %CDP-4-DUPLEXMISMATCH:Full/half-duplex mismatch detected o1
    It is important to note that this message is created by the Cisco Discovery Protocol (CDP), not the 802.3 auto-negotiation protocol. CDP can report problems it discovers, but it typically does not automatically fix them.
    A duplex mismatch might or might not result in an error message. Another indication of a duplex mismatch is the rapid increase of FCS and alignment errors on the half-duplex side, and runts on the full-duplex port. This can be seen in a show port {mod_num/port_num} command.
  9. Understand the spanning tree error messages.
    In addition to the duplex mismatch error message in step 8, you might also see these spanning tree messages when you change the speed on a link.
    %PAGP-5-PORTFROMSTP:Port 1/1 left bridge port 1/1
    %PAGP-5-PORTTOSTP:Port 1/1 joined bridge port 1/1
    Note: Refer to Understanding and Configuring Spanning Tree Protocol (STP) on Catalyst Switches for more information on spanning tree.
  10. Change the duplex mode to half on port 1/1 on switch A.
    Issue the set port duplex 1/1 half command to set the mode on port 1/1 in switch A to half. This demonstrates what occurs when the duplex mode is configured.
    Switch-A> (enable) set port duplex 1/1 half
    Port(s) 1/1 set to half-duplex.
    Switch-A> (enable)
    The show port 1/1 command displays the change in the duplex mode on this port.
    Switch-A> (enable) show port 1/1
    Port  Name               Status     Vlan       Level  Duplex Speed Type
    ----- ------------------ ---------- ---------- ------ ------ ----- ------------
     1/1                     connected  1          normal   half    10 10/100BaseTX
    At this point, ports 1/1 on both switches operate at half-duplex. Port 1/1 on switch B, however, is still configured to auto-negotiate, as displayed in this output of the show port 1/1 command.
    Switch-B> (enable) show port 1/1
    Port  Name               Status     Vlan       Level  Duplex Speed Type
    ----- ------------------ ---------- ---------- ------ ------ ----- ------------
     1/1                     connected  1          normal a-half a-10  10/100BaseTX
    Step 11 shows how to configure the duplex mode on port 1/1 in switch B to half. This is the recommended policy of always configuring both link partners in the same way.
  11. Set the duplex mode and speed of port 1/1 on switch B.
    This step sets the duplex mode to half and speed to 10 on port 1/1 in switch. This implements the policy of always configuring both link partners for the same behavior.
    This is the output when you issue the set port duplex 1/1 half command on switch B.
    Switch-B> (enable) set port duplex 1/1 half
    Port 1/1 is in auto-sensing mode.
    Switch-B> (enable)
    The set port duplex 1/1 half command fails because this command does not work if auto-negotiation is enabled. This also means that this command does not disable auto-negotiation. Auto-negotiation can only be disabled when you issue the set port speed {mod_num/port_num {10 | 100}} command.
    This is the output when you issue the set port speed 1/1 10 command on switch B.
    Switch-B> (enable) set port speed 1/1 10
    Port(s) 1/1 speed set to 10Mbps.
    Switch-B> (enable)
    Now the set port duplex 1/1 half command on switch B works.
    Switch-A> (enable) set port duplex 1/1 half
    Port(s) 1/1 set to half-duplex.
    Switch-A> (enable)
    The show port 1/1 command on switch B shows that the ports is configured for half-duplex and 10 Mb.
    Switch-B> (enable) show port 1/1
    Port  Name               Status     Vlan       Level  Duplex Speed Type
    ----- ------------------ ---------- ---------- ------ ------ ----- ------------
     1/1                     connected  1          normal   half    10 10/100BaseTX
    Note: The set port duplex {mod_num/port_num {half | full }} command is dependent on the set port speed {mod_num/port_num {10 | 100 }} command. In other words, you must set the speed before you can set the duplex mode.
  12. Restore the default duplex mode and speed to ports 1/1 on both switches.
    Issue the set port speed 1/1 auto command to configure ports 1/1 on both switches to auto-negotiate.
    Switch-A> (enable) set port speed 1/1 auto
    Port(s) 1/1 speed set to auto detect.
    Switch-A> (enable)
    Note: Once the duplex mode of a port is configured to something other than auto, the only method to configure the port to auto-sense the duplex mode is to issue the set port speed {mod_num/port_num} auto command. There is no set port duplex {mod_num/port_num} auto command. In other words, issuing the set port speed {mod_num/port_num} auto command has the effect of resetting both port speed sensing and duplex mode sensing to auto.
  13. View the changes of the port status on both switches.
    Issue the show port 1/1 command to examine the status of ports 1/1 on both switches.
    Switch-A> (enable) show port 1/1
    Port  Name               Status     Vlan       Level  Duplex Speed Type
    ----- ------------------ ---------- ---------- ------ ------ ----- ------------ 
     1/1                     connected  1          normal a-full a-100 10/100BaseTX
    
    
    Switch-B> (enable) show port 1/1
    Port  Name               Status     Vlan       Level  Duplex Speed Type
    ----- ------------------ ---------- ---------- ------ ------ ----- ------------
     1/1                     connected  1          normal a-full a-100 10/100BaseTX
    Both ports are now set to their default behavior of auto-negotiation. Both ports negotiate full-duplex and 100 Mb.

Auto-Negotiation on Catalyst Switches that Run Cisco IOS Software

The commands described in this section apply to these types of switch products: Catalyst 2900XL, 3500XL, 2950, 3550, 2948G-L3, 4908G-L3, Catalyst 4500/4000 that runs Cisco IOS System Software (Supervisor Engine III), and the Catalyst 6500/6000 that runs Cisco IOS System Software.
The switches that run Cisco IOS Software (as opposed to CatOS) default to auto-negotiation for speed and are set to on for the duplex. Issue the show interface slot/port status command to verify this.
This output is taken from a Catalyst 6500/6000 that runs Cisco IOS Software Release 12.1(6)E. It shows a connected port that auto-negotiates a link to 100 Mbps and half-duplex. The configuration that runs for this switch has no duplex or speed commands underneath interface FastEthernet 3/1 because auto-negotiation is the default. Issue the show interface slot/port command (without the status keyword) to see the port speed and duplex.
NativeIOS#show interfaces fastethernet 3/1 status

Port    Name               Status       Vlan       Duplex Speed Type
Fa3/1                      connected    routed     a-half a-100 10/100BaseTX

NativeIOS#show run
...
!
interface FastEthernet3/1
ip address 172.16.84.110 255.255.255.0

!--- Notice there is no speed or duplex commands under this interface because
!--- it is in the default configuration of auto-negotiate speed and duplex.


NativeIOS#show interfaces fastethernet 3/1
FastEthernet3/1 is up, line protocol is up 
 Hardware is C6k 100Mb 802.3, address is 0002.7ef1.36e0 (bia 0002.7ef1.36e0)
 Internet address is 172.16.84.110/24
 MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec, 
    reliability 255/255, txload 1/255, rxload 1/255
 Encapsulation ARPA, loopback not set
 Keepalive set (10 sec)
 Half-duplex, 100Mb/s
 ...
If you want to hard code the speed and duplex on a switch that runs Cisco IOS Software (turn off auto-negotiation), issue the speed and duplex commands underneath the specific interface. Duplex is subservient to speed in the sense that if speed is set to auto, then the duplex cannot be manually set. You might see cyclic redundancy check (CRC) error messages when both the speed and duplex settings are hardcoded on the two devices. This might be because any one of the devices runs an earlier version of Cisco IOS. You can upgrade the Cisco IOS or set the speed and duplex to auto on both devices in order to resolve this.
NativeIOS#show run
...
interface FastEthernet3/2
no ip address
!         
NativeIOS#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
NativeIOS(config)#interface fastethernet3/2
NativeIOS(config-if)#duplex full
Duplex will not be set until speed is set to non-auto value

!--- Error: On this platform, you must set the speed before the duplex.
!--- Not all switch platforms have this command ordering requirement.

NativeIOS(config-if)#speed 100
NativeIOS(config-if)#duplex full
NativeIOS(config-if)#^Z
NativeIOS#show interfaces fastethernet 3/2 status

Port    Name               Status       Vlan       Duplex Speed Type
Fa3/2                      notconnect   routed       full   100 10/100BaseTX

NativeIOS#NativeIOS#show run
...
interface FastEthernet3/2
no ip address
duplex full
speed 100

!--- Notice that the speed and duplex commands appear in the configuration
!--- now because they have been manually set to a non-default behavior.