Thursday, July 21, 2016

CCIE 400-101: Layer 2 Technologies - PortFast, BPDU Guard, BPDU Filter

PortFast


  • The PortFast feature was originally developed to overcome a situation where a PC was unable to obtain a DHCP address due to the port failing to transition into the forwarding state in time. 
  • This results from STP going through the listening and learning states, which would normally take 30 seconds. 
  • The PortFast feature allows the port to enter the forwarding state immediately, bypassing the listening and learning states.
  • Should be configured only on edge ports connecting to end devices.
  • A PortFast enabled port will continue to transmit BPDUs and participate in STP.
  • If the port receives BPDUs, the PortFast feature is disabled.
  • Two ways to enable PortFast: globally (spanning-tree portfast default) or per interface (spanning-tree portfast).
  • Both commands enable PortFast on operational access ports.
  • To enable PortFast on both access and trunk ports, use the spanning-tree portfast trunk command.


BPDU Guard


  • BPDU guard prevents a port from receiving BPDUs.
  • If the port still receives a BPDU, it is put in the error-disabled state.
  • Much like the PortFast feature, BPDU Guard has two configuration options: globally (spanning-tree portfast bpduguard default) and per interface (spanning-tree bpduguard enable).
  • If configured globally, BPDU Guard is dependent on the operational PortFast state.
  • The per interface configuration unconditionally enables BPDU Guard on the port, independent of PortFast or access/trunk mode.
  • There are two ways to recover an err-disabled port, either by manually re-enabling with shutdown and no shutdown commands or by configuring automatic err-disable recovery with errdisable recovery cause bpduguard. 


BPDU Filter


  • BPDU Filter prevents specified ports from sending or receiving BPDUs.
  • Again, there are two methods to configure this feature: globally (spanning-tree portfast bpdufilter default) and per interface (spanning-tree bpdufilter enable). 
  • The interface configuration filters both incoming and outgoing BPDUs unconditionally – independent of the operational PortFast state or access/trunk mode. This is effectively the equivalent of turning off STP.
  • The global BPDU Filter is enabled on interfaces in operational PortFast state. 
  • In global mode, the switch does not filter incoming BPDUs, but most (though not all) outgoing BPDUs are filtered. When a port comes up, 11 BPDUs are sent out. 
  • If BPDUs are received, the PortFast and BPDU Filter features are disabled.


Summary


  • PortFast immediately moves the port into the forwarding state, bypassing listening and learning states.
  • A PortFast enabled port will continue to transmit BPDUs.
  • If a BPDU is received, PortFast is disabled.
  • The switch never generates a TCN when a PortFast enabled port goes up or down.
  • There is a difference between administrative and operational state.
  • The spanning-tree portfast trunk command enables PortFast on both access and trunk ports.
  • BPDU Guard and BPDU Filter global mode is dependent on operational PortFast.
  • BPDU Guard and BPDU Filter interface mode is unconditional.
  • Misconfigured BPDU Filter is much more dangerous than misconfigured PortFast, yet IOS does not generate a warning message about that.
  • PortFast can create a temporary loop of max. 2 seconds (default Hello interval) until the next BPDU is received and PortFast is disabled. BPDU Filter can create a permanent loop, because all BPDUs are ignored.
  • Remember the operation of STP - when BPDUs are sent and not sent.



References

Advanced STP Features: PortFast, BPDU Guard, and BPDU Filter

Friday, February 19, 2016

CCIE 400-101: Layer 2 Technologies - Switch Priority, Port Priority, Path Cost, STP Timers

Switch Priority


  • The IEEE 802.1D standard requires that each switch has an unique bridge identifier (BID),  which controls the selection of the root switch.
  • For PVST+/RPvST+, the same switch must have different bridge IDs for each configured VLAN.
  • Each VLAN on the switch has a unique 8-byte bridge ID. 
  • The 2 most-significant bytes are used for the switch priority, and the remaining 6 bytes are derived from the switch MAC address.
  • The switch supports the IEEE 802.1t spanning-tree extensions, and some of the bits previously used for the switch priority are now used as the VLAN identifier. 
  • The result is that fewer MAC addresses are reserved for the switch, and a larger range of VLAN  IDs can be supported, all while maintaining the uniqueness of the BID.
  • The 2 bytes previously used for the switch priority are reallocated into a 4-bit priority value and a 12-bit extended system ID value equal to the VLAN ID.


  • The default switch priority is 32768.
  • The switch priority can be manually configured with the spanning-tree vlan <vlan-id> priority <0-61440> command.
  • The priority can be changed only in increments of 4096. 
  • Valid priority values are 0, 4096, 8192, 12288, 16384, 20480, 24576, 28672, 32768, 36864, 
  • 40960, 45056, 49152, 53248, 57344, and 61440. All other values are rejected.
  • There are also two indirect ways to affect the switch priority: spanning-tree vlan <vlan-id> root primary and spanning-tree vlan <vlan-id> root secondary.
  • The primary keyword sets the switch priority to 24576 if that priority allows the switch to become the root. Otherwise, this command sets the switch priority to 4096 lower than the current root.
  • The secondary keyword always sets the switch priority to 28672.
  • This primary/secondary logic is only applied at the time of command execution. The switch priority does not dynamically change if another switch later advertises a better priority.


Port Priority


  • Much like the bridge ID, STP also assigns a unique port ID for each interface.
  • The port ID is a 2-byte field, divided into a 4-bit priority value and a 12-bit interface identifier.
  • The interface identifier is fixed.
  • The default port priority value is 128.
  • The port priority can be manually reconfigured with the spanning-tree vlan <vlan-id> port-priority <0-224>, in increments of 32.
  • The priority values are 0, 32, 64, 96, 128, 160, 192, and 224. All other values are rejected.
  • IMPORTANT: The switch looks at the information in the received BPDU to decide which port to block - not what is locally configured on the switch.
  • This can be confusing when show spanning-tree vlan <vlan-id> output displays seemingly conflicting information.


Cat2#sh spanning-tree vlan 1

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    24577
             Address     0018.1820.2700
             Cost        19
             Port        24 (FastEthernet0/24)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     000b.46e2.6980
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Fa0/23              Altn BLK 19        128.23   P2p
Fa0/24              Root FWD 19        128.24   P2p


  • From the above output, you might mistakenly conclude that Fa0/23 should be Root Port and Fa0/24 should be Alternate Port because of the lower port ID (Fa0/23 - 128.23 < Fa0/24 - 128.24). However, this is what is locally configured on the switch and does not affect the STP port blocking process.
  • To see what the switch is learning from its upstream neighbor, you must look at more detailed output.


Cat2#show spanning-tree vlan 1 int fa0/23 detail
 Port 23 (FastEthernet0/23) of VLAN0001 is alternate blocking
   Port path cost 19, Port priority 128, Port Identifier 128.23.
   Designated root has priority 24577, address 0018.1820.2700
   Designated bridge has priority 24577, address 0018.1820.2700
   Designated port id is 128.25, designated path cost 0
   Timers: message age 1, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 1938, received 694

Cat2#show spanning-tree vlan 1 int fa0/24 detail
 Port 24 (FastEthernet0/24) of VLAN0001 is root forwarding
   Port path cost 19, Port priority 128, Port Identifier 128.24.
   Designated root has priority 24577, address 0018.1820.2700
   Designated bridge has priority 24577, address 0018.1820.2700
   Designated port id is 64.26, designated path cost 0
   Timers: message age 2, forward delay 0, hold 0
   Number of transitions to forwarding state: 2
   Link type is point-to-point by default
   BPDU: sent 1993, received 697


  • The highlighted information signifies why Fa0/24 is forwarding and Fa0/23 is not (received port ID 64.26 < 128.25).


Path Cost


  • Path cost is simply the cost to reach the root switch.
  • Each interface has a default cost assigned to it based on bandwidth (for example, 100 Mbps = 19).
  • There are two cost assignment methods: the short method (spanning-tree pathcost method short -  the default) and the long method (spanning-tree pathcost method long).
  • The short method uses a 16-bit format that yields values from 1-65535. 
  • The long method uses a 32-bit format that yields values from 1-200,000,000. 


  • Why is the maximum 200,000,000 when a 32-bit number can clearly have a higher value?
    • Limiting the range of the Path Cost parameter to 1-200,000,000 ensures that the accumulated Path Cost cannot exceed 32 bits over a concatenation of 20 hops.
  • The switch calculates its port cost by adding its interface cost to the root path cost in the  received BPDU. Example: a switch located two 100 Mbps hops away from the root bridge would  have a path cost of 38 (19 + 19 = 38).
  • The cost value can be manually altered with the spanning-tree vlan <vlan-id> cost <value> command.


STP Timers


  • There are several STP timers, three of which are commonly known and play a key role in STP operation:
    • Hello: The hello time is the time between each BPDU that is sent on a port. This time is equal to 2 seconds (sec) by default, but you can tune the time to be between 1 and 10 sec.
    • Forward Delay: The forward delay is the time that is spent in the listening and learning state. This time is equal to 15 sec by default, but you can tune the time to be between 4 and 30 sec.
    • Max Age: The max age timer controls the maximum length of time that a switchport saves its configuration BPDU information. This time is 20 sec by default, but you can tune the time to be between 6 and 40 sec.
  • Each configuration BPDU contains these three parameters. 
  • Each configuration BPDU also contains another time-related parameter that is known as the Message Age. 
  • The Message Age contains the length of time that has passed since the root bridge initially originated the BPDU. 
  • The root bridge sends all its BPDUs with a message age value of 0, and all subsequent switches add 1 to this value. 
  • Effectively, this value contains the information on how far you are from the root bridge when you receive a BPDU.
  • In addition to the timers, IEEE 802.1D defines other parameters related to STP (like the STP domain diameter). See: Understanding and Tuning Spanning Tree Protocol Timers.


References

CCIE Routing and Switching v5.0 Official Cert Guide, Volume 1
Understanding Spanning Tree Port Priority
Configuring STP
Spanning Tree Port Costs
Understanding and Tuning Spanning Tree Protocol Timers

Monday, February 8, 2016

CCIE 400-101: Layer 2 Technologies - STP Concepts

STP Versions

  • The first IEEE-standardized STP, also often called the “legacy” STP, was originally described in 802.1D. 
  • The Rapid STP (RSTP) was standardized in 802.1w, while Multiple STP (MSTP) was covered in 802.1s. 
  • The latest 802.1D-2004 standard no longer includes the legacy STP at all (which is considered obsolete), and instead, it covers the RSTP originally found in 802.1w. 
  • The 802.1s MSTP is integrated into 802.1Q-2005 and later revisions. 
  • Therefore, RSTP is covered in 802.1D while MSTP is covered in 802.1Q, and legacy STP has been dropped.

STP Concepts

  • STP uses special messaging between switches to establish a loop-free topology by logically blocking redundant links. 
  • STP protocol messages are called Bridge Protocol Data Units (BPDUs). 
  • STP operation is based on the ability to compare any two arbitrary Configuration BPDUs and determine which one of them is better, or superior.
  • For a detailed breakdown of a BPDU, see: BPDU Format and STP Timers. 
  • The determine the superior BPDU, they are compared in the following sequence of values, looking for the first occurrence of a lower value:
    • Root Bridge ID (RBID)
    • Root Path Cost (RPC)
    • Sender Bridge ID (SBID)
    • Sender Port ID (SPID)
    • Receiver Port ID (RPID; not included in the BPDU, evaluated locally; very uncommon) 
  • Only Configuration BPDUs are compared.
  • Each port in STP stores (that is, remembers) the superior BPDU it has either sent or received. 
  • Essentially, each port stores the Designated Port’s BPDU — whether it is the port itself that is Designated or it is a neighbor’s port. 
  • Should a port store a received BPDU, it must be received again within a time interval of MaxAge-MessageAge seconds; otherwise it will expire after this period. 
  • To determine which ports forward and block, STP follows a three-step process:
    1. Elect the root switch: the switch with the lowest bridge ID.
    2. Determine root port on each switch: the port on each non-root switch that receives the best BPDU.
    3. Determine the designated port for each segment: the switch that sends the superior BPDU on the segment.

Determining the Root Port

  • Each non-root switch chooses exactly one port as its Root Port, i.e. the port that receives the best resulting BPDU. 
  • This means that the switch adds the port's cost to the advertised Root Path Cost value, yielding a resulting BPDU.
  • BPDUs received on the Root Port of a non-root switch are forwarded out its designated ports after updating the Root Path Cost, Sender Bridge ID, Send Port ID, and MessageAge fields accordingly. 
  • BPDUs received on other ports of a non-root switch are processed but they are not forwarded.
  • Many people think of STP costs as being associated with a segment; however, the cost is actually associated with interfaces. Good design practices dictate using the same STP cost on each segment, but the values can be different.
  • On recent Catalyst switches, the default costs correspond to the 802.1D-1998 version of the standard if PVST or Rapid PVST is used, and to the 802.1D-2004 version if MSTP is used. 
  • With PVST and Rapid PVST, the 802.1D-2004 costs can be activated using the spanning-tree pathcost method long global configuration command. 
  • By default, spanning-tree pathcost method short is configured, causing the switch to use the older revision of the costs.


Determining the Designated Port

  • Designated switch = switch forwarding BPDUs on a LAN segment. 
  • Designated Port = the port that the designated switch uses to forward frames onto the segment. 
  • All other ports are neither Root or Designated will be moved to Blocking state (Non-Designated ports). 
  • The become the Designated Port, the switch must send superior BPDUs on the segment.
  • The tiebreakers during Designated Port selection are the same as before (how to find the superior BPDU).
  • Neither Root Ports nor Blocking ports send BPDUs. 

Summary

  • The root switch is the switch that has the lowest Bridge ID in the topology. 
  • On each non-root switch, a Root Port is the port receiving the best (that is, superior) resulting BPDUs from all received BPDUs on all ports. 
  • On each connected segment, a Designated Port is the port sending the best (that is, superior) BPDUs on the segment. 
  • All ports that are neither Root Ports nor Designated Ports are superfluous in an active topology and will be put into the Blocking state. 
  • Configuration BPDUs are sent out only from Designated Ports.
  • Each port stores the best (that is, superior) BPDU it has received or sent itself. 
  • Designated Ports store the BPDU they send; Root and Blocking ports store the best BPDU they receive. 
  • The stored BPDU determines the role of the port and is used for comparisons.
  • Received superior stored BPDUs will expire in MaxAge-MessageAge seconds if not received within this time period.

About STP Timers

  • The MessageAge field is an estimation of the BPDU’s age since it was originated by the root bridge. 
  • At the root bridge, the MessageAge is set to 0. Any other switch will increment this value, usually by 1, before forwarding the BPDU further. 
  • The remaining lifetime of a BPDU after being received by a switch is MaxAge-MessageAge. 
  • Finally, the remaining fields carry the values of STP timers: MaxAge, HelloTime, ForwardDelay. These timer values always reflect the timer settings on the root switch.  
  • Timers configured on a non-root switch are not used and would become effective only if the switch itself became the root switch. 

References 

CCIE Routing and Switching v5.0 Official Cert Guide, Volume 1

Tuesday, February 2, 2016

CCIE 400-101: Layer 2 Technologies - VSS, StackWise concepts

VSS

  • VSS will allow up to two physical Cisco Catalyst 6500 or 4500 switches to operate as one virtual switch. 

 
  • The two physical chassis do not need to be identical in the type of modules installed or even type of chassis. 
  • The supervisors need to be of same type with same software version.
  • One virtual switch member chassis will act as the active virtual switch member, while the other member will be in hot standby state for the control plane. 
  • The data planes of both chassis are active and hence perform packet forwarding at full combined capacity.  
  • The VSS active switch controls the VSS, running the Layer 2/3 control protocols for the switching modules on both switches. 
  • The virtual switch link (VSL) connects the two VSS devices. 
  • The VSL is a special link that carries control and data traffic between the active and standby switches. 
  • VSS effectively simplifies or even eliminates the need for common Layer 2/3 protocols like STP or FHRPs. (Note: STP should still be enabled to protect against misconfiguration.)  
  • When one of the virtual switch members fails, there is no reconvergence of protocols in the network. 
  • The access layer or core layer switches continues to forward traffic because they only detect a link failure in an EtherChannel bundle 
  • The VSS mechanism during switch failure is far superior in comparison with the traditional model where one switch failure results indeterminist convergence of multiple control protocols like STP, HSRP and routing protocol. 
  • Multichassis EtherChannel (MEC) is an EtherChannel whose member ports can be distributed across the member switches in a VSS.



StackWise

  • Individual switches intelligently join to create a single switching unit. 
  • The switches are united into a single logical unit using special stack interconnect cables that create a bidirectional closed-loop path. 
  • This bidirectional path acts as a switch fabric for all the connected switches.  
  • Network topology and routing information is updated continuously through the stack interconnect. 
  • The stack is managed as a single unit by a master switch, which is elected from one of the stack member switches. 
  • Stack master election:
    1. User priority - The network manager can select a switch to be master.
    2. Hardware and software priority - This will default to the unit with the most extensive feature set.
    3. Default configuration - If a switch has preexisting configuration information, it will take precedence over switches that have not been configured.
    4. Uptime - The switch that has been running the longest is selected.
    5. MAC address - Each switch reports its MAC address to all its neighbors for comparison. The switch with the lowest MAC address is selected. 
  • The master switch is elected and serves as the control center for the stack.  
  • Both the master and member switches act as forwarding agents.  
  • Up to nine separate switches can be joined together. 
  • The stack can have switches added and removed without affecting stack performance.
  • The stack shares an IP address and is managed as a single object. 
  • The stack has only one configuration file, which is distributed to each member in the stack.


References

Virtual Switching System (VSS) Q&A
Cisco StackWise and StackWise Plus Technology

Monday, February 1, 2016

CCIE 400-101: Layer 2 Technologies - SPAN, RSPAN, ERSPAN

  • SPAN = Switch Port Analyzer
  • RSPAN = Remote SPAN
  • ERSPAN = Encapsulated RSPAN
  • A method of directing all traffic from a source port or source VLAN to a single port. 
  • SPAN is sometimes referred to as session monitoring because of the commands used to configure it. 
  • The feature is useful for many applications. For example, all traffic from a voice VLAN can be delivered to a single switch port to facilitate call recording.
  • In a single SPAN session, you can monitor received (Rx), transmitted (Tx), or bidirectional (both) [default] source port traffic.
  • Rx refers to traffic entering the source port or VLAN. The traffic is copied and sent to the SPAN destination before any modifications occur (ACL/VACL, QoS, policing etc.).
  • Tx refers to traffic leaving the source port or VLAN. The traffic is copied and sent to the SPAN destination after any modifications occur (ACL/VACL, QoS, policing etc.). 
  • The destination port can be on the local switch (SPAN) or on another switch in the network (RSPAN). 
  • In RSPAN, a specific VLAN must be configured across the entire switching path from the source port or VLAN to the RSPAN destination port. 
  • Encapsulated Remote SPAN (ERSPAN), as the name implies, creates a GRE tunnel for all captured traffic and allows it to be extended across Layer 3 domains. 
  • Regardless of the type of SPAN, a SPAN source port can be any type of port—a routed port, a physical switch port, an access port, a trunk port, an EtherChannel port (either one physical port or the entire port-channel interface), and so on.  
  • On a SPAN source VLAN, all active ports in that VLAN are monitored.  
  • As ports are added or removed from that VLAN, the sources are dynamically updated to include new ports or exclude removed ports. 
  • When a trunk port is monitored as a source port, all VLANs active on the trunk are monitored by default.  
  • You can use VLAN filtering in order to limit SPAN traffic monitoring on trunk source ports to specific VLANs. 
  • VLAN filtering affects only traffic forwarded to the destination SPAN port and does not affect the switching of normal traffic. 
  • VLAN filtering applies only to port-based sessions and is not allowed in sessions with VLAN sources. 
  • Also, a port configured as a SPAN destination cannot be part of a SPAN source VLAN.
  • The state of the destination port is up/down by design. The interface shows the port in this state in order to make it evident that the port is currently not usable as a production port. 
  • When it is a destination port, it does not participate in any of the Layer 2 protocols (STP, VTP, CDP, DTP, PagP). 
  • SPAN/RSPAN/ERSPAN usually ignores CDP, spanning-tree BPDUs, VTP, DTP, and PAgP frames. However, these traffic types can be forwarded along with the normal SPAN traffic if the encapsulation replicate command is configured.
  • There are a number of restrictions for SPAN/RSPAN/ERSPAN ports, including: 
    • The source can be either one or more ports or a VLAN, but not a mix of these. 
    • A SPAN destination port cannot be a source port, and a source port cannot be a destination port. 
    • Only one SPAN/RSPAN/ERSPAN session can send traffic to a single destination port. 
    • A SPAN destination port ceases to act as a normal switch port. That is, it passes only SPAN-related traffic.
  • For details, see: SPAN, RSPAN, and ERSPAN.

Example:

-- SPAN --

monitor session 1 source interface fa0/12
monitor session 1 destination interface fa0/24



-- RSPAN --

S1#
vlan 199
 remote span
monitor session 3 source vlan 42
monitor session 3 destination remote vlan 199


S2#
vlan 199
 remote span
monitor session 5 source remote vlan 199
monitor session 5 destination interface fa0/19



-- ERSPAN --

R1#
monitor session 1 type erspan-source
 source interface GigabitEthernet0/1/0
 no shutdown
 destination
  erspan-id 101
  ip address 10.1.1.1
  origin ip address 172.16.1.1


R2#
monitor session 2 type erspan-destination
 destination interface GigabitEthernet2/2/1
 no shutdown
 source
  erspan-id 101
  ip address 10.1.1.1 

  

R1# show monitor session 1

Session 1
---------
Type : ERSPAN Source Session
Status : Admin Enabled
Source Ports :
RX Only : Gi0/1/0
Destination IP Address : 10.1.1.1
MTU : 1464
Destination ERSPAN ID : 101
Origin IP Address : 172.16.1.1


 

References

CCIE Routing and Switching v5.0 Official Cert Guide, Volume 1
SPAN, RSPAN, and ERSPAN
Catalyst SPAN Configuration Example

Sunday, January 31, 2016

CCIE 400-101: Layer 2 Technologies - LACP, PAgP, manual, load balancing, EtherChannel misconfiguration guard

Overview

  • EtherChannel allows multiple physical links to combine into one logical channel. 
  • This allows load sharing of traffic among the links in the channel as well as redundancy in the event that one or more links in the channel fail. 
  • Each EtherChannel can consist of up to eight compatibly configured Ethernet ports.
  • The following settings must be identical for all EtherChannel member ports :
    • Speed settings
    • Duplex settings
    • STP settings
    • VLAN membership (for access ports)
    • Native VLAN (for trunk ports)
    • Allowed VLANs (for trunk ports)
    • Trunking encapsulation protocol (for trunk ports) 
  • When an EtherChannel is configured in either PAgP or LACP mode, the system negotiates with the other end of the channel to determine which ports should become active. If the remote port cannot negotiate an EtherChannel, the local port is put into an independent state and continues to carry data traffic as would any other single link. 
  • When an EtherChannel is in the on mode, no negotiations take place. The switch forces all compatible ports to become active in the EtherChannel. 
  • After an EtherChannel is configured, the physical ports assigned to the port-channel inherit configuration changes applied to the port-channel. 
  • Configuration changes applied to the physical port affect only the port where you apply the configuration.

PAgP

  • PAgP is a Cisco-proprietary protocol. 
  • PAgP has two modes: auto and desirable. 
  • auto: Places a port into a passive negotiating state, in which the port responds to PAgP packets it receives but does not start PAgP packet negotiation. 
  • desirable: Places a port into an active negotiating state, in which the port starts negotiations with other ports by sending PAgP packets. 
  • A port in the auto mode cannot form an EtherChannel with another port that is also in the auto mode because neither port starts PAgP negotiation.
  • The PAgP silent/non-silent submode is a complete mystery. The documentation says that silent mode should be used for connections to servers that do not support PAgP. This silent mode would allow the channel to form without receiving any PAgP packets from the other side. This does not make any sense! How can a channel be negotiated if the other device does not speak PAgP? The documentation further states that if not specified, silent mode is assumed. In that case, auto and auto should be able to form an EtherChannel (not tested). 
  • Trunk ports send and receive PAgP protocol data units (PDUs) on the lowest numbered VLAN.  
  • In Layer 2 EtherChannels, the first port in the channel that comes up provides its MAC address to the EtherChannel. If this port is removed from the bundle, one of the remaining ports in the bundle provides its MAC address to the EtherChannel. 
  • For Layer 3 EtherChannels, the MAC address is allocated by the stack master as soon as the interface is created. 

LACP

  • LACP is the standards-based equivalent of PAgP, defined in IEEE 802.3ad. 
  • Two modes: active and passive. 
  • active: Places a port into an active negotiating state in which the port starts negotiations with other ports by sending LACP packets. 
  • passive: Places a port into a passive negotiating state in which the port responds to LACP packets that it receives, but does not start LACP packet negotiation. This setting minimizes the transmission of LACP packets. 
  • Ports can form an EtherChannel when they are in different LACP modes as long as the modes are compatible.
    • active and active/passive will form an EtherChannel 
    • passive and passive will not because neither port starts LACP negotiation. 
  • Configure a LACP EtherChannel with up to16 Ethernet ports of the same type. Up to eight ports can be active, and up to eight ports can be in standby mode. 
  • If you configure more than eight links for an EtherChannel group, the software automatically decides which of the hot-standby ports to make active.  
  • Four elements affect this decision:
    • LACP system priority
    • System ID (the switch MAC address)
    • LACP port priority
    • Port number 
  • Numerically lower values have higher priority. 
  • Determining which ports are active and which are hot standby is a two-step procedure. 
    • First, the system looks at the system priority and system ID to choose a "master" switch. 
    • Second, active and standby ports are decided based on the "master's" port priority and port number values. 
    • The port priority and port number of the other switch are not used.

Manual

  • EtherChannel on mode can be used to manually configure an EtherChannel.
  • The on mode forces a port to join an EtherChannel without negotiations.
  • Useful if the remote device does not support PAgP or LACP.
  • Caution: If the group is misconfigured, packet loss or spanning-tree loops can occur.
  • The command is channel-group <id> mode on.

Layer 2, Layer 3

  • The main difference between configuring a Layer 2 or Layer 3 EtherChannel is using the no switchport command to change the interfaces from Layer 2 to Layer 3 mode.
  • In Layer 3 EtherChannels, the IP address is configured under the logical port-channel interface.

Example:

-- Layer 2 --

interface range fa0/13 - 15
 switchport mode access
 switchport access vlan 10
 channel-group 1 mode active


S1# show etherchannel summary
Flags:  D - down        P - bundled in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      f - failed to allocate aggregator

M - not in use, minimum links not met
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port

Number of channel-groups in use: 1
Number of aggregators:           1

Group  Port-channel  Protocol    Ports
------+-------------+-----------+-----------------------------------------------
1      Po1(SU)         LACP      Fa0/13(P)   Fa0/14(P)   Fa0/15(P)   


-- Layer 3 --

interface range fa0/13 - 15
 no switchport
 channel-group 1 mode active
! 
interface Po1
 ip address 192.168.100.1 255.255.255.0
 no shutdown

S1# show etherchannel summary
Flags:  D - down        P - bundled in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      f - failed to allocate aggregator

M - not in use, minimum links not met
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port

Number of channel-groups in use: 1
Number of aggregators:           1

Group  Port-channel  Protocol    Ports
------+-------------+-----------+-----------------------------------------------
1      Po1(RU)         LACP      Fa0/13(P)   Fa0/14(P)   Fa0/15(P)   


Load Balancing

  • EtherChannel frame distribution uses a Cisco-proprietary hashing algorithm.
  • The algorithm is deterministic; if you use the same addresses and session information, you always hash to the same port in the channel.
  • This method prevents out-of-order packet delivery.
  • The Cisco-proprietary hash algorithm computes a value in the range 0 to 7.
  • With this value as a basis, a particular port in the EtherChannel is chosen.
  • This table lists the ratios of the values that each port accepts, which depends on the number of ports in the EtherChannel: 

  • Hence, in essence, you can only achieve perfect load balancing, even with random addresses, if you have two, four, or eight ports in the port channel.
  • EtherChannel load balancing can use MAC addresses, IP addresses, or Layer 4 port numbers and either source mode, destination mode, or both.
  • The mode you select applies to all EtherChannels that you configure on the switch.
  • Use the option that provides the greatest variety in your configuration.
  • Issue the port-channel load-balance {src-mac | dst-mac | src-dst-mac | src-ip | dst-ip | src-dst-ip | src-port | dst-port | src-dst-port | mpls} global configuration command in order to configure the load balancing.

EtherChannel Misconfiguration Guard

  • A misconfiguration can occur if the interfaces on the local switch are configured in an EtherChannel, but the interfaces on the other device are not.
  • The misconfiguration is detected by comparing the source MAC address of the incoming BPDUs.
  • If the switch sees different source MAC addresses (correctly bundled ports share a common MAC address), the ports are put in the err-disabled state and an error message is logged.
  • Use the spanning-tree etherchannel guard misconfig command to enable the feature (enabled by default).

References

Configuring EtherChannels
Understanding EtherChannel Load Balancing and Redundancy on Catalyst Switches
EtherChannel Considerations

Monday, January 25, 2016

CCIE 400-101: Layer 2 Technologies - VTPv3

Overview 


VTPv3 extends and enhances the functionality of VTP from previous versions. The operation of VTP is improved in three major areas:
  • more secure administrative control: only a predefined device is allowed to update the VLAN topology
  • extended functionality: VTPv3 supports the advertisement of extended range and private VLAN information
  • support for MST

VTPv3 still retains the same core operation as previous versions.  A VTP update message can be sent over a trunk but not over access ports or Layer 3 interfaces. Only devices in the same VTP domain are able to exchange and process VTP information.

In previous versions a new switch with the default domain name of NULL used the domain name of the first VTP message that it received. This behavior has changed with VTP version 3, which now requires manual configuration prior to enabling VTPv3.

Catalyst6500-1(config)# vtp version 3
Cannot set the version to 3 because domain name is not configured.


VTP messages that include a mismatching domain name are ignored and dropped.

Since the functional base in VTP version 3 is left unchanged from VTP version 2, so backward compatibility is built in. It is possible, on a per link basis, to automatically discover and support VTP version 2 devices


VTPv3 Enhancements


VTP version 3 added a number of enhancements to VTP version 1 and 2, including the following:
  • support for extended range and private VLANs
  • feature enhancement beyond support for a single database or VTP instance (MST support)
  • protection from unintended database overrides
  • option for clear-text or hidden password protection
  • configuration option on a per-port basis instead of only on a global scheme
  • optimized resource handling and more efficient transfer of information

While VTP version 1 and 2 interacted with the VLAN process directly, VTP version 3 introduces the concept of transferring opaque databases. This approach provides expanded usability,  allowing independent databases (or tables) aka VTP instances that go beyond just serving the VLAN environment. VTP version 3 supports a VLAN instance and a separate MST instance.

In VTP version 3, the configuration revision number works the same as in previous versions, but only a specific devices in the domain, a primary server, is allowed to update other devices.


VTPv3 Operation

 

In addition to the three well-known roles (server, client, and transparent), a fourth role (off) is now available.

Transparent: Holds a locally created configuration on permanent storage (NVRAM). Does not
originate or evaluate received VTP advertisements. Relays received VTP messages on trunks if the STP state for VLAN 1 is forwarding. A domain check, as in VTP version 1, is not implemented.

Client: Holds received VTP information in temporary storage space. Local configuration is not
possible. The default MST configuration will be used at boot time until a VTP version 3
message arrives.

Off: Contrary to the transparent mode, the switch will not relay received VTP messages. Off
mode can be configured globally or on a per port basis. Formerly available only in CAT OS.

Server: VTPv3 expands and enhances the server role. By default, the secondary server subtype is applied. Only one server per domain can be prompted to be a primary server. Manual configuration on a secondary server locally is not possible. The role of a primary server for the VLAN database and MST database can be divided among two different physical devices if desired. When a device is designated as the primary server, a sanity check is performed in the domain. A warning message is generated if a conflicting device is discovered. The sanity check can be skipped be issuing the force keyword. If a secondary server is promoted to become a primary server without specifying VLAN or MST, the VLAN isntance is assumed.


Message Protection and Security

 

With VTPv3, two password configuration options are available: hidden and secret. When the hidden option is used, the password is not stored in a readable format. The password can no longer be viewed by a show command or inspected in the vlan.dat file. If the hidden option is applied, the administrator will be prompted to enter the password, when promoting a secondary server to a primary server. A former primary server that is reconnected to a domain after a reload will automatically revert to secondary server mode.


VTP Interoperability

 

VTPv3 operates with VTPv2 but not with VTPv1.  Devices running VTPv1, and capable of running VTPv2, will be triggered to run VTPv2 by a VTPv3 device. There is no interaction available for VTPv1-only devices. Therefore, before implementing VTPv3, it is recommended to verify that all switches in the existing or prospective VTP domain will be capable of running VTPv2 at a minimum.  After receiving VTPv2 advertisements, a VTPv3 sends both VTPv3 and VTPv2-compatible messages.


Risks and Dependencies

 

The risks of using VTPv3 are minimal, practically none worth mentioning. The only major consideration involves the interoperability issues related to using different versions of VTP and the general design of the VTP domain.  Further, a software upgrade might be required because VTPv3 is available starting from the 12.2(33)SXI code version.


Further Reading

VTP Version 3