CCNP Switch - Switch Port Configuration

 - Always make sure both ends of a connection are set to the same speed and duplex.
Switch#sh interfaces FastEthernet0/5     counters  protocol  status
Protocols allocated:
 FastEthernet0/5: Other, IP, Spanning Tree, CDP, DTP

Ethernet Concepts
Ethernet scales to support increasing bandwidths; the Ethernet medium should be chosen to match the need at each point in the campus network.

Ethernet is a shared medium that becomes both a collision and a broadcast domain. 
When one user transmits at about the same time as another, a collision occurs.

Ethernet is based on the carrier sense multiple access collision detect (CSMA/CD)technology, which requires that transmitting stations back off for a random period of time when a collision occurs. If a station must wait its turn to transmit, it cannot transmit and receive at the same time. This is called half-duplex operation.

As an Ethernet segment becomes more crowded, it becomes more inefficient.

Ethernet switching addresses this problem by
 - dynamically allocating a dedicated 10-Mbps bandwidth to each of its ports,
 - stations can operate in full-duplex mode—transmitting and receiving simultaneously.

The Fast Ethernet specification also offers backward compatibility to support traditional 10-Mbps Ethernet. 
This negotiation involves detecting and selecting the highest physical layer technology (available bandwidth) and half-duplex or full-duplex operation.
 To properly negotiate a connection,bothends should be configured for autonegotiation.

The link speed is determined by electrical signaling so that either end of a link can determine what speed the other end is trying to use. If both ends of the link are configured to autonegotiate, they will use the highest speed that is common to them.

A link’s duplex mode, however, is negotiated through an exchange of information. 
If duplex autonegotiation fails, a switch port always falls back to its default setting: half-duplex.

Autonegotiation uses the priorities for each mode of Ethernet to determine which technology to agree on.
Priority Ethernet Mode
7 100BASE-T2 (full duplex)
6 100BASE-TX (full duplex)
5 100BASE-T2 (half duplex)
4 100BASE-T4
3 100BASE-TX
2 10BASE-T (full duplex)
1 10BASE-T
Gigabit Ethernet (IEEE 802.3z)
Same frame format. The physical layer has been modified to increase data-transmission speeds.

The “Gigabit over copper” solution that the 1000BASE-T media provides is based on the IEEE 802.3ab standard. 

10-Gigabit Ethernet  IEEE 802.3ae)
To meet the demand for aggregating many Gigabit Ethernet links over a single connection,  10-Gigabit Ethernet was developed.
Layer 2 characteristics of Ethernet have been preserved; the familiar 802.3 frame format and size,
along with the MAC protocol, remain unchanged.
IEEE 802.3ae standard differ from their predecessors only at the physical layer (PHY)
10GbE operates only at full duplex.

The standard defines several different transceivers that can be used as Physical Media Dependent (PMD) interfacesL
 - LAN PHY—Interconnects switches in a campus network, predominantly in the core layer,
 - WAN PHY—Interfaces with existing synchronous optical network (SONET) or synchronous digital hierarchy (SDH) networks typically found in metropolitan-area networks (MAN)

10GBASE-SR/SW,  10GBASE-LX4/LW4 etc.
Transceiver types are denoted by a two-letter suffix.
The first letter specifies the wavelength used: S = short, L = long, E = extra-long wavelength.
The second letter specifies the PHY type: R = LAN PHY, W = WAN PHY. For LX4 and LW4, L refers to a long wavelength, X and W refer to the coding used, and 4 refers to the number of wavelengths transmitted. WWDM is wide-wavelength division multiplexing

Cisco Catalyst switches supported 10-Gigabit Ethernet PMDs in the form of XENPAK, X2, and SFP+ transceivers. Generally, the X2 form factor is smaller than the XENPAK, and the SFP+ is smaller still, allowing more port density on a switch module.

Trancievers -

Cisco 10-Gigabit Ethernet Transceiver Modules Compatibility Matrix

Connecting Switches and Devices
Fast Ethernet (100BASE-FX) ports use two-strand multimode fiber (MMF) with MT-RJ or
SC connectors to provide connectivity.

All Catalyst switch families support 10/100 autosensing (using Fast Ethernet autonegotiation) and 10/100/1000 autosensing for Gigabit Ethernet.

Catalyst switches with Gigabit Ethernet ports have standardized rectangular openings that can accept gigabit interface converter (GBIC) or small form factor pluggable (SFP) modules. 
1000BASE-SX—Short-wavelength connectivity using SC fiber connectors and MMF for distances up to 550 m (1804 feet).
1000BASE-LX/LH—Long-wavelength/long-haul connectivity using SC fiber connectors and either MMF or single-mode fiber (SMF);
1000BASE-ZX—Extended-distance connectivity using SC fiber connectors and SMF; works for distances up to 70 km.
GigaStack—Uses a proprietary connector with a high-data-rate copper cable with enhanced signal integrity and electromagnetic interference (EMI) performance; provides a GBIC-to-GBIC connection between stacking Catalyst switches or between any two Gigabit switch ports over a short distance.
1000BASE-T—Sports an RJ-45 connector for four-pair UTP cabling; works for distances up to 100 m (328 feet).

You must use a four-pair Category 5 (or greater) UTP crossover cable to connect two 1000BASE-T switch ports back to back.

Caution: The fiber-based modules always have the receive fiber on the left connector and the transmit fiber on the right connector, as you face the connectors. These modules could produce invisible laser radiation from the transmit connector.  Therefore, always keep unused connectors covered with the rubber plugs, and don’t ever look directly into the connectors.

Switch Port Configuration

To select a single switch port
Switch(config)# interface <type module/number>
Switch(config)# interface fastethernet 0/14
To select several arbitrary ports for a common configuration setting
Switch(config)# interface range <type module/number [, type module/number ...]>
Switch(config)# interface range fastethernet 1/0/3 , fastethernet 1/0/7 ,  fastethernet 1/0/9 , fastethernet 1/0/48
Switch(config)# interface range fastethernet 1/0/1 - 48
You can define a macro that contains a list of interfaces or ranges of interfaces or both.
Switch(config)# define interface-range <macro-name> <type module/number> [,  type module/ number ...] [type module/first-number – last-number] [...]
Switch(config)# interface range macro <macro-name>
Switch(config)# define interface-range MyGroup gig 2/0/1 , gig 2/0/3 – 2/0/5
Switch(config)# interface range macro MyGroup

Port Speed
Switch(config-if)# speed {10 | 100 | 1000 | auto}
auto - default

Port Duplex Mode
The autonegotiation process repeats whenever the link status changes.
The port participatesin a negotiation by attempting full-duplex operation first and then halfduplex operation if full duplex is not successful.
A 10-Mbps Ethernet link (fixed speed) defaults to half duplex,
A 100-Mbps Fast Ethernet (dual speed 10/100) link defaults to full duplex.
Switch(config-if)# duplex {auto | full | half}
Managing Error Conditions on a Switch Port
Catalyst switches can detect error conditions automatically, without any further help.
If an error condition is detected, the switch port is put into the errdisable state and is disabled (port is shutted down automatically until someone manually enables the port again, or until a predetermined time has elapsed). 
Switch(config)# [no] errdisable detect cause [all | cause-name]
■ all—Detects every possible cause
■ arp-inspection—Detects errors with dynamic ARP inspection
■ bpduguard—Detects when a spanning-tree bridge protocol data unit (BPDU) is received on a port  configured for STP PortFast
■ channel-misconfig—Detects an error with an EtherChannel bundle
■ dhcp-rate-limit—Detects an error with DHCP snooping
■ dtp-flap—Detects when trunking encapsulation is changing from one type to another gbic-invalid—Detects the presence of an invalid GBIC or SFP module
■ ilpower—Detects an error with offering inline power
■ l2ptguard—Detects an error with Layer 2 Protocol Tunneling
■ link-flap—Detects when the port link state is “flapping” between the up and down states
■ loopback—Detects when an interface has been looped back
■ pagp-flap—Detects when an EtherChannel bundle’s ports no longer have consistent configurations
■ psecure-violation—Detects conditions that trigger port security configured on a port
■ rootguard—Detects when an STP BPDU is received from the root bridge on an unexpected port
■ security-violation—Detects errors related to port security
■ storm-control—Detects when a storm control threshold has been exceeded on a port
■ udld—Detects when a link is seen to beunidirectional(data passing in only one direction)
■ unicast-flood—Detects conditions that trigger unicast flood blocking on a port
■ vmps—Detects errors when assigning a port to a dynamic VLAN through VLAN membership policy server (VMPS)

Automatically Recover from Error Conditions
By default, ports put into the errdisable state must be re-enabled manually.
This is done by issuing the shutdown command in interface configuration mode, followed by the no shutdown command.
To automatically reenable an errdisabled port, you first must specify the errdisable causes that can be reenabled.
Switch(config)# errdisable recovery cause [all | cause-name]
If any errdisable causes are configured for automatic recovery, the errdisabled port stays down for 300 seconds, by default.
Switch(config)# errdisable recovery interval <seconds>
You can set the interval from 30 to 86,400 seconds (24 hours).
Configure all switch ports to be reenabled automatically in 1 hour after a port security violation has been detected:
Switch(config)# errdisable recovery cause psecurity-violation
Switch(config)# errdisable recovery interval 3600
Troubleshooting Port Connectivity
Switch# show interfaces fastethernet 1/0/1
FastEthernet1/0/1 is up, line protocol is up
Hardware is Fast Ethernet, address is 0009.b7ee.9801 (bia 0009.b7ee.9801)

Switch# show interface status err-disabled
Looking for Speed and Duplex Mismatches
Switch# show interfaces fastethernet 1/0/13
FastEthernet1/0/13 is up, line protocol is up
Auto-duplex (Half), Auto Speed (100), 100BASETX/FX ARP type: ARPA, ARP
Timeout 04:00:00
Always make sure both ends of a connection are set to the same speed and duplex.