Configure Switch Ports (2.1.2)
Port configuration starts with the basics of duplex and speed. Sometimes switch ports must manually have their duplex mode and speed manually configured. Most of the time the technician simply connects a cable and lets the network device and switch automatically negotiate these parameters. There are also times when things go awry and there are issues. This section helps you with these basic concepts.
Duplex Communication (2.1.2.1)
Figure 2-7 illustrates full-duplex and half-duplex communication.
Figure 2-7 Duplex Modes
Full-duplex communication improves the performance of a switched LAN. Full-duplex communication increases effective bandwidth by allowing both ends of a connection to transmit and receive data simultaneously. This is also known as bidirectional communication. This method of optimizing network performance requires micro-segmentation. A micro-segmented LAN is created when a switch port has only one device connected and is operating at full-duplex. This results in a micro size collision domain of a single device. Because there is only one device connected, a micro-segmented LAN is collision free.
Unlike full-duplex communication, half-duplex communication is unidirectional. Sending and receiving data does not occur at the same time. Half-duplex communication creates performance issues because data can flow in only one direction at a time, often resulting in collisions. Half-duplex connections are typically seen in older hardware, such as hubs. Full-duplex communication has replaced half-duplex in most hardware.
Most Ethernet and Fast Ethernet NICs sold today offer full-duplex capability. Gigabit Ethernet and 10Gb NICs require full-duplex connections to operate. In full-duplex mode, the collision detection circuit on the NIC is disabled. Frames that are sent by the two connected devices cannot collide because the devices use two separate circuits in the network cable. Full-duplex connections require a switch that supports full-duplex configuration, or a direct connection using an Ethernet cable between two devices.
Standard, shared hub-based Ethernet configuration efficiency is typically rated at 50 to 60 percent of the stated bandwidth. Full-duplex offers 100 percent efficiency in both directions (transmitting and receiving). This results in a 200 percent potential use of the stated bandwidth.
Configure Switch Ports at the Physical Layer (2.1.2.2)
Just as a network card in a PC can have specific conditions such as duplex and speed set, so too can a switch port. This section examines how to configure specific parameters on a Cisco switch port and introduces auto-MDIX.
Duplex and Speed
Switch ports can be manually configured with specific duplex and speed settings. Use the duplex interface configuration mode command to manually specify the duplex mode for a switch port. Use the speed interface configuration mode command to manually specify the speed for a switch port. In Figure 2-8 and Table 2-4, port F0/1 on switch S1 and S2 are manually configured with the full keyword for the duplex command and the 100 keyword for the speed command.
Figure 2-8 Manually Configure Duplex and Speed
Table 2-4 Cisco Switch Port Configuration
Enter global configuration mode. |
S1# configure terminal |
Enter interface configuration mode. |
S1(config)# interface fastethernet 0/1 |
Configure the interface duplex mode. |
S1(config-if)# duplex full |
Configure the interface speed. |
S1(config-if)# speed 100 |
Return to privileged EXEC mode. |
S1(config-if)# end |
Save the running config to the startup config. |
S1# copy running-config startup-config |
The default setting for both duplex and speed for switch ports on Cisco Catalyst 2960 and 3560 switches is auto. The 10/100/1000 ports operate in either half- or full-duplex mode when they are set to 10 or 100 Mb/s, but when they are set to 1000 Mb/s (1 Gb/s), they operate only in full-duplex mode. When troubleshooting switch port issues, the duplex and speed settings should be checked.
All fiber optic ports, such as 100BASE-FX ports, operate only at one preset speed and are always full-duplex.
Auto-MDIX (2.1.2.3)
Until recently, certain cable types (straight-through or crossover) were required when connecting devices. Switch-to-switch or switch-to-router connections required using different Ethernet cables. Using the automatic medium-dependent interface crossover (auto-MDIX) feature on an interface eliminates this problem. When auto-MDIX is enabled, the interface automatically detects the required cable connection type (straight-through or crossover) and configures the connection appropriately. When connecting to switches without the auto-MDIX feature, straight-through cables must be used to connect to devices such as servers, workstations, or routers. Crossover cables must be used to connect a switch to another switch or repeater.
With auto-MDIX enabled, either type of cable can be used to connect to other devices, and the interface automatically corrects for any incorrect cabling. On newer Cisco routers and switches, the mdix auto interface configuration mode command enables the feature. When using auto-MDIX on an interface, the interface speed and duplex must be set to auto so that the feature operates correctly.
Figure 2-9 shows the topology, and Table 2-5 shows the commands to enable auto-MDIX.
Figure 2-9 Configure Auto-MDIX
Table 2-5 Cisco Switch Auto-MDIX Commands
Enter global configuration mode. |
S1# configure terminal |
Enter interface configuration mode. |
S1(config)# interface fastethernet 0/1 |
Configure the interface to automatically negotiate the duplex mode with the connected device. |
S1(config-if)# duplex auto |
Configure the interface to automatically negotiate speed with the connected device. |
S1(config-if)# speed auto |
Enable auto-MDIX on the interface. |
S1(config-if)# mdix auto |
Return to privileged EXEC mode. |
S1(config-if)# end |
Save the running config to the startup config. |
S1# copy running-config startup-config |
To examine the auto-MDIX setting for a specific interface, use the show controllers ethernet-controller command with the argument interface-id and the phy keyword. To limit the output to lines referencing auto-MDIX, use the include Auto-MDIX filter. As shown in Figure 2-10, the output indicates On or Off for the feature.
Figure 2-10 Verify Auto-MDIX
Verifying Switch Port Configuration (2.1.2.4)
Table 2-6 describes some of the options for the show command that are helpful in verifying common configurable switch features.
Table 2-6 Switch Verification Commands
Display interface status and configuration. |
S1# show interfaces[interface-id] |
Display current startup configuration. |
S1# show startup-config |
Display current operating configuration. |
S1# show running-config |
Display information about the flash file system. |
S1# show flash: |
Display status of system hardware and software. |
S1# show version |
Display a history of commands entered. |
S1# show history |
Display IP information about an interface. |
S1# show ip [interface-id] |
Display the MAC address table. |
S1# show mac-address-table or S1# show mac address-table |
Look at the sample abbreviated output from the show running-config command. Use this command to verify that the switch has been correctly configured. As seen in the output for S1, some key information is shown:
- Fast Ethernet 0/18 interface configured with the management VLAN 99
- VLAN 99 configured with an IP address of 172.17.99.11 255.255.0.0
Default gateway set to 172.17.99.1
S1# show running-config Building configuration... Current configuration : 1664 bytes ! <output omitted> ! interface FastEthernet0/18 switchport access vlan 99 switchport mode access ! <output omitted> ! interface Vlan99 ip address 172.17.99.11 255.255.0.0 ! <output omitted> ! ip default-gateway 172.17.99.1 ! <output omitted>
The show interfaces command is another commonly used command, which displays status and statistics information on the network interfaces of the switch. The show interfaces command is frequently used when configuring and monitoring network devices.
Look at the output from the show interfaces fastethernet 0/18 command. The first line in the output indicates that the FastEthernet 0/18 interface is up/up meaning that it is operational. Further down the output shows that the duplex is full and the speed is 100 Mb/s.
S1# show interfaces fastethernet 0/18 FastEthernet0/18 is up, line protocol is up (connected) Hardware is Fast Ethernet, address is 0cd9.96e8.8a01 (bia 0cd9.96e8.8a01) MTU 1500 bytes, BW 100000 Kbit/sec, DLY 100 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback not set Keepalive set (10 sec) Full-duplex, 100Mb/s, media type is 10/100BaseTX input flow-control is off, output flow-control is unsupported ARP type: ARPA, ARP Timeout 04:00:00 Last input 00:00:01, output 00:00:06, output hang never Last clearing of "show interface" counters never Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: fifo Output queue: 0/40 (size/max) 5 minute input rate 0 bits/sec, 0 packets/sec 5 minute output rate 0 bits/sec, 0 packets/sec 25994 packets input, 2013962 bytes, 0 no buffer Received 22213 broadcasts (21934 multicasts) 0 runts, 0 giants, 0 throttles 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored 0 watchdog, 21934 multicast, 0 pause input 0 input packets with dribble condition detected 7203 packets output, 771291 bytes, 0 underruns <output omitted>
Network Access Layer Issues (2.1.2.5)
The output from the show interfaces command can be used to detect common media issues. One of the most important parts of this output is the display of the line and data link protocol status. The following output and Table 2-7 indicate the summary line to check the status of an interface.
S1# show interfaces fastethernet 0/18
FastEthernet0/18 is up, line protocol is up (connected)
Hardware is Fast Ethernet, address is 0022.91c4.0301 (bia 0022.91c4.0e01)
MTU 1500 bytes, BW 100000 Kbit/sec, DLY 100 usec,
<output omitted>
Table 2-7 Verify the Status of a Switch Interface
Interface Status |
Line Protocol Status |
Link State |
Up |
Up |
Operational |
Down |
Down |
Interface problem |
The first parameter (FastEthernet0/1 is up) refers to the hardware layer and, essentially, reflects whether the interface is receiving the carrier detect signal from the other end. The second parameter (line protocol is up) refers to the data link layer and reflects whether the data link layer protocol keepalives are being received.
Based on the output of the show interfaces command, possible problems can be fixed as follows:
- If the interface is up and the line protocol is down, a problem exists. There could be an encapsulation type mismatch, the interface on the other end could be error-disabled, or there could be a hardware problem.
- If the line protocol and the interface are both down, a cable is not attached or some other interface problem exists. For example, in a back-to-back connection (a connection where the transmitter of one device connects directly to the receiver of another device without a transmission media between the two devices), one end of the connection may be administratively down.
- If the interface is administratively down, it has been manually disabled (the shutdown command has been issued) in the active configuration.
The following output shows an example of show interfaces command. The example shows counters and statistics for the FastEthernet0/1 interface.
S1# show interfaces fastethernet0/1 FastEthernet0/1 is up, line protocol is up Hardware is Fast Ethernet, address is 0022.91c4.0e01 (bia 0022.91c4.0e01)MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec, <output omitted> 2295197 packets input, 305539992 bytes, 0 no buffer Received 1925500 broadcasts,0 runts, 0 giants
, 0 throttles3 input errors, 3 CRC, 0 frame, 0 overrun, 0 ignored
0 watchdog, 68 multicast, 0 pause input 0 input packets with dribble condition detected 3594664 packets output, 436549843 bytes, 0 underruns8 output errors, 1790 collisions, 10 interface resets
0 unknown protocol drops 0 babbles,235 late collision
, 0 deferred <output omitted>
Some media errors are not severe enough to cause the circuit to fail but do cause network performance issues. Table 2-8 explains some of these common errors that can be detected using the show interfaces command.
Table 2-8 Network Access Layer Issues
Input Errors |
Total number of errors. It includes runts, giants, no buffer, CRC, frame,overrun, and ignored counts. |
Runts |
Packets that are discarded because they are smaller than the minimum packet size for the medium. For instance, any Ethernet pack that is less than 64 bytes is considered a runt. |
Giants |
Packets that are discarded because they exceed the maximum packet size for the medium. For example, any Ethernet packet that is greater than 1,518 bytes is considered a giant. |
CRC errors |
CRC errors are generated when the calculated checksum is not the same as the checksum received. |
Output Errors |
The sum of all errors that prevented the final transmission of datagrams out of the interface that is being examined. |
Collisions |
The number of messages retransmitted because of an Ethernet collision. |
Late Collisions |
A collision that occurs after 512 bits of the frame have been transmitted. |
“Input errors” is the sum of all errors in datagrams that were received on the interface being examined. This includes runts, giants, CRC, no buffer, frame, overrun, and ignored counts. The reported input errors from the show interfaces command include the following:
- Runt Frames: Ethernet frames that are shorter than the 64-byte minimum allowed length are called runts. Malfunctioning NICs are the usual cause of excessive runt frames, but they can be caused by improperly or unterminated cables which can also cause excessive collisions.
- Giants: Ethernet frames that are longer than the maximum allowed length are called giants. Giants are caused by the same issues as those that cause runts.
- CRC errors: On Ethernet and serial interfaces, CRC errors usually indicate a media or cable error. Common causes include electrical interference, loose or damaged connections, or using the incorrect cabling type. If you see many CRC errors, there is too much noise on the link and you should inspect the cable for damage and length. You should also search for and eliminate noise sources, if possible.
“Output errors” is the sum of all errors that prevented the final transmission of datagrams out of an interface that is being examined. The reported output errors from the show interfaces command include the following:
- Collisions: Collisions in half-duplex operations are completely normal, and you should not worry about them, as long as you can tolerate the performance when half-duplex mode is used. However, you should never see collisions in a properly designed and configured network that uses full-duplex communication. It is highly recommended that you use full-duplex unless you have older or legacy equipment that requires half-duplex.
- Late collisions: A late collision refers to a collision that occurs after 512 bits of the frame (the preamble) have been transmitted. Excessive cable lengths are the most common cause of late collisions. Another common cause is duplex misconfiguration. For example, you could have one end of a connection configured for full-duplex and the other for half-duplex. You would see late collisions on the interface that is configured for half-duplex. In that case, you must configure the same duplex setting on both ends. A properly designed and configured network should never have late collisions.
Troubleshooting Network Access Layer Issues (2.1.2.6)
Most issues that affect a switched network are encountered during the original implementation. Theoretically, after it is installed, a network continues to operate without problems. However, cabling gets damaged, configurations change, and new devices are connected to the switch that require switch configuration changes. Ongoing maintenance and troubleshooting of the network infrastructure is required.
To troubleshoot these issues when you have no connection or a bad connection between a switch and another device, follow this general process, as shown in Figure 2-11, and explained thereafter.
Figure 2-11 Troubleshooting Switch Media Issues
Use the show interfaces command to check the interface status.
If the interface is down:
- Check to make sure that the proper cables are being used. Additionally, check the cable and connectors for damage. If a bad or incorrect cable is suspected, replace the cable.
- If the interface is still down, the problem may be due to a mismatch in speed setting. The speed of an interface is typically auto-negotiated; therefore, even if speed is manually configured on one interface, the connecting interface should auto-negotiate accordingly. If a speed mismatch does occur through misconfiguration or a hardware or software issue, then that may result in the interface going down. Manually set the same speed on both connection ends if an auto negotiation problem is suspected.
If the interface is up, but issues with connectivity are still present:
- Using the show interfaces command, check for indications of excessive noise. Indications may include an increase in the counters for runts, giants, and CRC errors. If there is excessive noise, first find and remove the source of the noise, if possible. Also, verify that the cable does not exceed the maximum cable length and check the type of cable that is used. For copper cable, it is recommended that you use at least Category 5.
- If noise is not an issue, check for excessive collisions. If there are collisions or late collisions, verify the duplex settings on both ends of the connection. Much like the speed setting, the duplex setting is usually auto-negotiated. If there does appear to be a duplex mismatch, manually set the duplex on both connection ends. It is recommended to use full-duplex if both sides support it.