Showing posts with label STP. Show all posts
Showing posts with label STP. Show all posts

23 February, 2017

General Network Challenges

Unicast Flooding :

Reasons:
 
- Asymetric Routing 
- STP TCNs  
- Full MAC Table (Attack)

Solutions:
 
- STP Portfast Feature 
- Port Security Feature 
- Unknown Unicast and Multicast Flood Control Feature (UUFB,UUFRL,UMFB)

Impact Of Microbursts:


Short Spike - Overwhelms Capacity

Merging 4 Lanes into 3

Impact: 

- Delayed/Dropped Packets/Frames
- Congestion on Downstream Systems 
- SLA 
- Application Failure

Solution: 

 - QoS

Out Of Orden Packets:

Reasons:
- Multiple Paths (L2/L3)

- Qos Treatment 
- Route / Path Problems

Solutions:
 
- Session Based Path Selection (On Etherchannel, CEF and etc...)
- TCP Reassembly 
- Permit on Intermediate Devices (FW)

30 July, 2014

Storm Control

Storm Scenario

Storm Control
- Monitor: Broadcast / MCast / Unicast
- Set Thresholds: % / PPS / BPS
- Set Actions: Slow It Down / Shutdown

* We have 2 trunk interfaces between SW1 and SW2.

! Configure Ports as Trunk
SW2(config)#vlan 50
SW2(config-vlan)#exit

SW2(config)#default int range fas 0/5-6
SW2(config)#int range fas 0/5-6
SW2(config-if-range)#switchport trunk encapsulation dot1q
SW2(config-if-range)#switchport trunk allowed vlan 50
SW2(config-if-range)#switchport mode trunk
SW2(config-if-range)#exit

SW2(config)#in vlan 50
SW2(config-if)#ip address 10.50.0.2 255.255.255.0
SW2(config-if)#no shutdown

SW2(config-if)#do show ip interface brief vlan 50
Interface              IP-Address      OK? Method Status                Protocol
Vlan50                 10.50.0.2       YES manual up                    up

SW1(config)#vlan 50
SW1(config-vlan)#exit

SW1(config)#default int range fas 0/5-6
SW1(config)#int range fas 0/5-6
SW1(config-if-range)#switchport trunk encapsulation dot1q
SW1(config-if-range)#switchport trunk allowed vlan 50
SW1(config-if-range)#switchport mode trunk
SW1(config-if-range)#exit

SW1(config)#in vlan 50
SW1(config-if)#ip address 10.50.0.1 255.255.255.0
SW1(config-if)#no shutdown

SW1(config-if)#do show ip interface brief vlan 50
Interface              IP-Address      OK? Method Status                Protocol
Vlan50                 10.50.0.1       YES manual up                    up

! Check PPS interval
SW2(config)#do show int fas 0/5 | in packets
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     3 packets input, 64 bytes, 0 no buffer
     0 input packets with dribble condition detected
     4 packets output, 280 bytes, 0 underruns
 
! Disable STP  
SW2(config)#no spanning-tree vlan 50
SW2(config)#no spanning-tree vlan 50

! Make ping 
SW2(config)#do ping 10.50.0.1 
!!!!! 

! Check PPS interval again
SW2(config)#do show int fas 0/5 | in packets
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     494948 packets input, 213124214 bytes, 0 no buffer
     0 input packets with dribble condition detected
     494878 packets output, 282131230 bytes, 0 underruns
 
! Check CPU utilization  
SW2(config)#do show process cpu
CPU utilization for five seconds: 60%/30%; one minute: 59%; five minutes: 32%

! Configure Storm Control 
SW2(config)#interface range fastEthernet 0/5-6
SW2(config-if-range)#storm-control broadcast level pps 500 100

! Verify 
SW2(config-if-range)#do show storm-control broadcast
Interface  Filter State   Upper        Lower        Current
---------  -------------  -----------  -----------  ----------
Fa0/5      Forwarding          500 pps      100 pps        6 pps
Fa0/6      Forwarding          500 pps      100 pps        1 pps

! Verify when storm is in action 
SW2(config-if-range)#do show storm-control broadcast
Interface  Filter State   Upper        Lower        Current
---------  -------------  -----------  -----------  ----------
Fa0/5      Blocking          500 pps      100 pps     5.5k pps
Fa0/6      Blocking          500 pps      100 pps     5.3k pps

* Note: Now the Broadcast not consuming all bandwidth.

! Change action mode to Shutdown
SW2(config-if-range)#storm-control action shutdown

* Note: If storm occur ports will be set as err-disable state.


14 February, 2014

The most useful command to T-Shoot Spanning Tree

#T-Shoot Spanning Tree useful command

SW2#show spanning-tree 
VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    4097
             Address     0017.956e.fa00
             Cost        19
             Port        24 (FastEthernet0/24)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
  Bridge ID  Priority    8193   (priority 8192 sys-id-ext 1)
             Address     0013.c426.0b00
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

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

SW2#show spanning-tree bridge 
                                                   Hello  Max  Fwd
Vlan                         Bridge ID              Time  Age  Dly  Protocol
---------------- --------------------------------- -----  ---  ---  --------
VLAN0001          8193 ( 8192,   1) 0013.c426.0b00    2    20   15  ieee        

SW2#show spanning-tree bridge ?
  address       Mac address of this bridge
  detail        Detailed of the status and configuration
  forward-time  Forward delay interval
  hello-time    Hello time
  id            Spanning tree bridge identifier
  max-age       Max age
  priority      Bridge priority of this bridge
  protocol      Spanning tree protocol
  |             Output modifiers
  <cr>

SW2#show spanning-tree bridge priority  
VLAN0001         8193

SW2#show spanning-tree bridge address 
VLAN0001         0013.c426.0b00

SW2#show spanning-tree bridge protocol 
VLAN0001         ieee

SW2#show spanning-tree bridge hello-time
VLAN0001         2


! See if everyone agrees on the root 

SW1#show spanning-tree vlan 1 root 

                                        Root    Hello Max Fwd
Vlan                   Root ID          Cost    Time  Age Dly  Root Port
---------------- -------------------- --------- ----- --- ---  ------------
VLAN0001          4097 0017.956e.fa00         0    2   20  15                

! This switch is Root 

SW2#show spanning-tree vlan 1 root    

                                        Root    Hello Max Fwd
Vlan                   Root ID          Cost    Time  Age Dly  Root Port
---------------- -------------------- --------- ----- --- ---  ------------
VLAN0001          4097 0017.956e.fa00        19    2   20  15  Fa0/24      

! SW2 can reach to the Root via Fa0/23 (Cost 19)

#Root Port Election 

! If Cost, Bridge ID,port priority are same, the best port will be with lower Port # we recive.

SW3#show spanning-tree vlan 1 detail | begin Port 24
 Port 24 (FastEthernet0/24) of VLAN0001 is blocking 
   Port path cost 19, Port priority 128, Port Identifier 128.24.
   Designated root has priority 4097, address 0017.956e.fa00
   Designated bridge has priority 8193, address 0013.c426.0b00
   Designated port id is 128.23, designated path cost 19
   Timers: message age 3, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 4, received 12208
   
! Check Designated port id 

Port path cost = 19
Port priority = 128
Designated port id is 128.23

! 23 is Port number of remote switch. (Fa0/23)

SW2#show spanning-tree vlan 1 summary 
Switch is in pvst mode
Root bridge for VLAN0001 is 4097.0017.956e.fa00.
Extended system ID           is enabled
Portfast Default             is disabled
PortFast BPDU Guard Default  is disabled
Portfast BPDU Filter Default is disabled
Loopguard Default            is disabled
EtherChannel misconfig guard is enabled
UplinkFast                   is disabled
BackboneFast                 is disabled
Configured Pathcost method used is short

Name                   Blocking Listening Learning Forwarding STP Active
---------------------- -------- --------- -------- ---------- ----------
VLAN0001                     0         0        0          2          2

11 December, 2013

Cisco CCNP Switch Chapter 10

# Rapid STP

- 802.1w
- Proactive System
- Redefined Port Roles
- Many STP Similarities

# Rapid STP Port Roles
* Root Port - The one switch port on each switch that has the best root path cost to the root.
* Designated Port - The switch port on a network segment that has the best root path cost to the root.
* Alternate Port - A port that has an alternative path to the root.
* Backup Port - A port that provides a redundant (but less desirable) connection to a segment where another switch port already connects.

* Edge Port - A port at the "edge" of the network, where only a single host connects. ! (PortFast Port)


#Why RSTP Is Better 
1. Because it does not forget ports
2. Because of the proactive nature, many "safety timers" of STP are eliminated
3. Any change to trunk ports flood through the network to other switches (TC Packets)
4. Because the name says "Rapid"

*By Default Switch operates in PerVLAN Spanning-Tree Plus (PVST+)

# To change STP mode use following command
Switch(config)#spanning-tree pode rapid-pvst

# To Configure Port as RSTp edge port use following command
Switch(config-if)#spanning-tree portfast

# Configure Port to act as a point-to-point link
Switch(config-if)#spanning-tree link-type point-to-point

Cisco CCNP Switch Chapter 9

#Protecting Against Unexpected BPDUs

 Cisco add two STP features that help prevent the unexpected 

* Root Guard
* BPDU Guard

# Root Guard
After an STP topology has converged and becomes loop free, switch ports are assigned the following roles:

* Root Port
* Designated Port
* Blocking Port
* Alternate Port
* Forwarding Port

* With  Root Guard feture a switch learns the current root briedge´s bridge ID. 
* If another switch advertises a superior BPDU, or one with a better bridge ID, on a port where Root Guard is enabled, 
 the local switch will not allow the new switch to become the root. Port will be kept in the root-inconsistent STP state
 No data can be sent or recived in that state, but the switch can listen to BPDUs recived on the port to detect a new root advertising itself.

* You can only enable Root Guard only on a per-port basis. (By Default it is disabled)

#To enable Root Guard use the following command
R3(config-if)#spanning-tree guard root

#To displaying inconsistentports 
S3#show spanning-tree inconsistentports

* When the superior BPDUs no longer are recived, the port is cycled through the normal STP states to return to normal use.
* Use Root Guard on switch ports where you never expect to find the root bridge for a VLAN.

# BPDU Guard
* If any BPDU (whether superior to the current root or not) is recived on a port where BPDU Guard is enabled, 
 that port immediatly is put into the errdisable state. You need re-enable port manually or set automatic recovery
 errdisable timeout function.

*By default BPDU Guard is disabled on all switch ports.

#To Enable BPDU Guard by Default use following command
S3(config)#spanning-tree portfast bpduguard default

#To Enable BPDU Guard per-port basis use following command
S3(config-if)#spanning-tree portfast bpduguard enable

*When the BPDUs no longer are recived, the port still remains in the errdisable state.
*You should use BPDU Guard on all switch ports where STP PortFast is enabled.

#Protecting Against Sudden Loss of BPDUs

Cisco has added two STP features that help detect or prevent the unexpected loss of BPDUs

* Loop Guard
* Undirectional Link Detection (UDLD) 

# Loop Guard
* If BPDUs are being sent over a link but the flow of BPDUs stops for some reason, the last-known BPDU is kept until the Max Age 
 timer expires.Then that BPDU is flushed, and the switch thinks there is no longer a need to block the port.

* When enable, Loop Guard keeps track of the BPDU activity on nondesignated ports.
* When BPDUs go missing, Loop Guard moves the port into the loop-inconsistent state. 
* The port is effectively blocking at this point to prevent a loop from forming and keep it in the nondesignated role.
* When BPDUs are recived on the port again, Loop Guard allows the port to move through the normal STP states and become active.

*By default Loop Guard is disabled on all switch ports.

#To Enable LooP Guard By Default Use The Following Command
S3(config)#spanning-tree loopguard default

#To Enable LooP Guard on Specific Switch Port The Following Command
S3(config-if)#spanning-tree guard loop

*Nondesignated ports are generally the alternative root ports and ports that normally are blocking.

#UDLD (Unidirectional Link Detection)
UDLD has two modes of operation

* Normal Mode - When a undirectional link condition is detected, the port is allowed to continue its operation.
 UDLD merely marks the port as having an undetermined state and generates a syslog message.

* Aggressive Mode - When a undirectional link condition is detected, the switch takes action to reestablish the link. 
 UDLD messages are sent out onec a second for 8 seconds. If none of those messages is echoed back, the port is placed 
 in the errdisable state so that it cannot be used.

#To Enable UDLD Globally Use The Following Command
S3(config)#udld [ enable | aggressive | message time SECONDS ] !(Ranging from 7 to 90 sec)

#To Enable UDLD on Specific Switch Port Use The Following Command
S3(config-if)#udld [ enable | aggressive | disable ] 

#Reenable ports that UDLD aggressive mode has errdisabled
S3#udld reset

#Using BPDU Filtering To Disable STP On a Port

* You always should allow STP to run on a switch to prevent loops. However, in special cases when you need to prevent 
 BPDUs from being sent or processed on one or more switch ports, you can use BPDU filtering to effectively disable STP on those ports.
* By defauld BPDU filtering is disabled on all switch port.

#Configure BPDU filtering Global Default
S3(config)#spanning-tree portfast bpdufilter default

*Note: The default keyword indicates that BPDU filtering will be enabled automaticlly on all ports that have PortFast enabled.If PortFast is disabled on a port, then BPDU filtering will not be enabled there.  

#To Enable BPDU filtering on Specific Switch Port Use The Following Command
S3(config-if)#spanning-tree bpdufilter [ enable | disable ]

*Note: Be very cearful to enable BPDU filtering only under controlled circumstances in witch you are absolutely sure that a switch port will have a single host connected and that a loop will be impossible.
*Note: Enable BPDU filtering only if the connected device cannot allow BPDUs to be accepted or sent. Otherwise, you should permit STP to operate on the switch ports as a precaution.

#Display the global BPDU Guard, BPDU filter and Loop Guard States
S3#show spanning-tree summary

10 December, 2013

Cisco CCNP Switch Chapter 8

# Root Bridge Configuration
* Configure one switch as a root bridge in a determined fashion.
* Configure another switch as a secondary root bridge, in case of primary root bridge failure.

ASw1(config)#spanning-tree extend system-id   (Priority + 12 bit VLAN ID)

# Manually setting the bridge priority value
ASw1(config)#spanning-tree vlan 10 priority  <0-61440> 

*Note: Bridge priority in increments of 4096 (Lower is prefered)
* If STP extended system ID is enabled, the default bridge-priority is 32,768 plus the VLAN number

# Primary and Secondary Configurations
ASw1(config)#spanning-tree vlan 10 root [ primary | secondary ]

#Change an interface's per VLAN spanning tree path cost
ASw1(config-if)#spanning-tree vlan 10 cost <1-200000000>
ASw1(config-if)#spanning-tree cost <1-200000000> 
   
*Note: If the vlan parameter is given, the port cost is modified only for the specified VLAN.

#Displaying STP Port Cost Values
ASw1#show spanning-tree interface fastEthernet 0/7 cost
VLAN0001            19
VLAN0006            19
VLAN0010            19
VLAN0100            19
VLAN0101            19

#Displaying STP Port Cost Values of the VLANs 
ASw1#show spanning-tree interface fastEthernet 0/7
Vlan                Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
VLAN0001            Root FWD 19        128.8    P2p
VLAN0006            Root FWD 19        128.8    P2p
VLAN0010            Root FWD 19        128.8    P2p
VLAN0100            Root FWD 19        128.8    P2p
VLAN0101            Root FWD 19        128.8    P2p

#Configuring STP Port Priority
ASw1(config-if)#spanning-tree port-priority <0-240>  (By Default is 128)

*Note: port priority in increments of 16
Ej:
ASw1(config-if)#spanning-tree vlan 10,101 port-priority 64

#Modifying STP Timers

#Number of seconds between generation of config BPDUs
ASw1(config)#spanning-tree vlan 10 hello-time <1-10>

#Maximum number of seconds the information in a BPDU is valid
ASw1(config)#spanning-tree vlan 10 max-age <6-40>

#Number of seconds for the forward delay timer    
ASw1(config)#spanning-tree vlan 10 forward-time <4-30>

#Redundant Link Convergence
* PortFast - Enables fast connectivity to be  established on access-layer switch ports to workstations that are booting.
* UplinkFast - Enables fast-uplink failover on an access-layer switch when dual up-links are connected into the distribution layer.
* BackboneFast - Enables fast convergence in the network backbone or core layer switches after a spanning-tree topology change occurs.

#PortFast
*Note:
*Port Fast Shortens the Listening and Learning states
*When a workstation link comes up, the switch imedietly moves the PortFast port into Forwarding state. Spanning-Tree loop detection
is still in operation, however, and the port moves into Blocking state if a loop is ever detected on the port.
* By default PortFast is disabled on all switch ports.

# Configure PortFast By Default
ASw1(config)#spanning-tree portfast default

# configure PortFast on specific switch port
ASw1(config-if)#spanning-tree portfast

*Note: One other benefits of PortFast is that Topology Change Notification (TCN) 

#UplinkFast
* If the primary uplink went down, up to 50 seconds could elapse before the redundant uplink could be used.
* With UplinkFast feature, when the primary root port uplink fails, another blocked uplink immediately can be brought up for use.

ASw1(config)#spanning-tree uplinkfast
ASw1(config)#spanning-tree uplinkfast max-update-rate <0-65535>

*Note: 
*The command is not allowed on the root bridge Switch 
*Range 0 to 65,535 pps (Packets Per Second)

ASw1#show spanning-tree uplinkfast
UplinkFast is enabled
Station update rate set to 150 packets/sec.
UplinkFast statistics
-----------------------
Number of transitions via uplinkFast (all VLANs)            : 2
Number of proxy multicast addresses transmitted (all VLANs) : 0
Name                 Interface List
-------------------- ------------------------------------
VLAN1                Fa1/14(fwd), Fa1/15

#BackboneFast 
* BackboneFast is simple to configure and operates by short-circuiting the Max-Age timerwhen needed.
* BackboneFast shortens the time a switch waits to detect a root path failure, ports still must go through full-length
 Forward Delay timer intervals during the Listening and Learning states. 

ASw1(config)#spanning-tree backbonefast

ASw1#show spanning-tree backbonefast
BackboneFast is enabled
BackboneFast statistics
-----------------------
Number of transition via backboneFast (all VLANs)           : 0
Number of inferior BPDUs received (all VLANs)               : 0
Number of RLQ request PDUs received (all VLANs)             : 0
Number of RLQ response PDUs received (all VLANs)            : 0
Number of RLQ request PDUs sent (all VLANs)                 : 0
Number of RLQ response PDUs sent (all VLANs)                : 0

*Note: RLQ (Root Link Query)

ASw1#show spanning-tree brief
VLAN1
  Spanning tree enabled protocol ieee
  Root ID    Priority    32768
             Address     c200.11dc.0000
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
  Bridge ID  Priority    32768
             Address     c200.11dc.0000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300
Interface                                   Designated
Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/14     128.55   128    19 FWD     0 32768 c200.11dc.0000 128.55
FastEthernet1/15     128.56   128    19 FWD     0 32768 c200.11dc.0000 128.56

#Verify STP
DSw1#show spanning-tree vlan 10
VLAN0010
  Spanning tree enabled protocol ieee
  Root ID    Priority    10
             Address     001d.45a8.4080
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
  Bridge ID  Priority    10     (priority 0 sys-id-ext 10)
             Address     001d.45a8.4080
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300
Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/1            Desg FWD 19        128.3    P2p
Fa0/2            Desg FWD 19        128.4    P2p
Fa0/3            Desg FWD 19        128.5    P2p
Fa0/4            Desg FWD 19        128.6    P2p
Fa0/24           Desg FWD 19        128.26   P2p

DSw1#show spanning-tree vlan 102
VLAN0102
  Spanning tree enabled protocol ieee
  Root ID    Priority    102
             Address     001d.a209.9980
             Cost        19
             Port        26 (FastEthernet0/24)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
  Bridge ID  Priority    4198   (priority 4096 sys-id-ext 102)
             Address     001d.45a8.4080
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300
Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/1            Desg FWD 19        128.3    P2p
Fa0/2            Desg FWD 19        128.4    P2p
Fa0/3            Desg FWD 19        128.5    P2p
Fa0/4            Desg FWD 19        128.6    P2p
Fa0/24           Root FWD 19        128.26   P2p

ASw1#show spanning-tree vlan 501
VLAN0501
  Spanning tree enabled protocol ieee
  Root ID    Priority    33269
             Address     000c.853e.cf00
             Cost        38
             Port        8 (FastEthernet0/7)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
  Bridge ID  Priority    33269  (priority 32768 sys-id-ext 501)
             Address     001e.4977.3c00
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300
Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Fa0/7               Root FWD 19        128.8    P2p
Fa0/8               Altn BLK 19        128.9    P2p