Wednesday, 28 December 2016

CCNP SWITCH LOOPY STP PART THREE B

PROBLEMS WITH LOOPS IN NETWORK 

Broadcast storms—Switches must flood broadcasts, so a looped topology will create multiple copies of a
single broadcast and perpetually cycle them through the loop.

MAC table instability—Loops make it appear that a single MAC address is reachable on multiple ports of a switch, and the switch is constantly updating the MAC table.

Duplicate frames— Because there are multiple paths to a single MAC, it is possible that a
frame could be duplicated in order to be flooded out all paths to a single destination MAC.
All these problems are serious and will bring a network to an effective standstill unless prevented
Removing layer-2 loops.

!!!! THEN WHY WE CREATE LOOP !!!!

Lets consider one example: that you have to design a network with 20 PC 1 server and 1 switch
your network looks like this:

but if number of users increases in future say 40 Users increase then , what will you do , then you purchase two  more switch and your network look like this:

but if you have any link failure between switch AB or BC your workstation are not able to reach the server
so you create loop into the network:




but as stated above looped network will not server our purpose , so we need one protocol which can prevent loop ...... we need STP.


Spanning Tree Protocol (STP - 802.1d) The main function of the Spanning Tree Protocol (STP) is to 
remove layer-2 loops from your topology. For STP to function, the switches need to share information.
 What they share are bridge protocol data units

STP decisions are based on the following sequence of four conditions:
1. Lowest root bridge ID
2. Lowest root path cost to root bridge
3. Lowest sender bridge ID
4. Lowest sender port ID

Root Port
After the root switch is elected, every other switch in the network needs to choose a single port
 on itself that it will use to reach the root. This port is called the root port. 
The root port is always the link directly connected to the root bridge, or the shortest path to 
the root bridge. If more than one link connects to the root bridge, then a port cost is determined
 by checking the bandwidth of each link. The lowest-cost port becomes the root port. If multiple links
 have the same cost, the bridge with the lower advertising bridge ID is used. Since multiple links 
can be from the same device, the lowest port number will be used.

Root Bridge
Switch with the lowest switch ID is chosen as root. The switch ID is made up of two components:
The switch's priority, which defaults to 32,768 on Cisco switches (two bytes in length)
The switch's MAC address (six bytes in length)
All other decisions in the network—such as which port is to be blocked and which port is to be put
 in forwarding mode—are made from the perspective of this root bridge

BPDUs
Which are sent out as multicast information that only other layer-2 devices are listening to.
 BPDUs are used to share information, and these are sent out as multicasts every two seconds. 
The BPDU contains the bridge's or switch's ID, made up of a priority value and the MAC address.
 BPDUs are used for the election process.

Path Costs
Path costs are calculated from the root switch. A path cost is basically the accumulated port costs 
from the root switch to other switches in the topology. When the root advertises BPDUs out its 
interfaces, the default path cost value in the BPDU frame is 0. When a connected switch receives 
this BPDU, it increments the path cost by the cost of its local incoming port. If the port was a
 Fast Ethernet port, then the path cost would be figured like this: 0 (the root's path cost) + 19 
(the switch's port cost) = 19. This switch, when it advertises BPDUs to switches behind it, will
 include the updated path cost. As the BPDUs propagate further and further from the root switch, 
the accumulated path cost values become higher and higher.



Connection Type New Cost Value Old Cost Value
10Gb                       2          1
1Gb                        4 1
100Mb               19 10
10Mb               100 100


Remember that path costs are incremented as a BPDU comes into a port, not when a BPDU is advertised out of a port.

Designated Port A designated port is one that has been determined as having the best (lowest) cost. A designated port will be marked as a forwarding port. Each (LAN) segment also has a single port that is uses to reach the root. This port is called a designated port

Forwarding port A forwarding port forwards frames.

Blocked port A blocked port is the port that, in order to prevent loops, will not forward frames. 

However, a blocked port will always listen to frames

Nondesignated port A nondesignated port is one with a higher cost than the designated port. 
Nondesignated ports are put in blocking mode—they are not forwarding ports.


Port States

Blocking

Ports will go into a blocking state under one of three conditions:
Election of a root switch (for instance, when you turn on all the switches in a network)
When a switch receives a BPDU on a port that indicates a better path to the root switch than the port the switch is currently using to reach the root If a port is not a root port or a designated port.
A port in a blocked state will remain there for 20 seconds by default during this state; the port is only 
listening to and processing BPDUs on its interfaces. Any other frames that the switch receives on a blocked port are dropped.

Listening
the port is still listening for BPDUs and double-checking the layer-2 topology. Again, the only traffic that is 
being processed in this state consists of BPDUs; all other traffic is dropped. default for this value is 15 seconds.

Learning
Port is still listening for and processing BPDUs on the port; however, unlike while in the listening state, the port begins to process user frames. When processing user frames, the switch is examining the source addresses in the frames and updating its CAM table, but the switch is still not forwarding these frames out destination ports. Defaults to 15 seconds

Forwarding
the port will process BPDUs, update its CAM table with frames that it receives, and forward user traffic through the port.

Disabled
A port in a disabled state is not participating in STP.

Convergence
STP convergence has occurred when all root and designated ports are in a forwarding state and all other ports are in a blocking state.



STP LAB : STATES OF STP & MANUAL/AUTOMATIC ROOT SELECTION OF STP




Automatic root selection command:

SW0(config)#spanning-tree vlan 1 root ?
  primary    Configure this switch as primary root for this spanning tree
  secondary  Configure switch as secondary root
SW0(config)#spanning-tree vlan 1 root pri
SW0(config)#spanning-tree vlan 1 root primary 

Manual root selection command with given priority:

SW0(config)#spanning-tree vlan 1 priority ?
  <0-61440>  bridge priority in increments of 4096
SW0(config)#spanning-tree vlan 1 priority 44
% Bridge Priority must be in increments of 4096.
% Allowed values are:
  0     4096  8192  12288 16384 20480 24576 28672
  32768 36864 40960 45056 49152 53248 57344 61440

note: priority is in the increment of 4096 , and default priority is 32768

after changing the priority you will find in the output, priority becomes 4097( priority + vlan-id)

SW0(config)#spanning-tree vlan 1 priority 4096
SW0(config)#do sh spanning-tree
VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    4097
             Address     0060.2F27.0393
             This bridge is the root
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    4097  (priority 4096 sys-id-ext 1)
             Address     0060.2F27.0393
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/1            Desg FWD 19        128.1    P2p
Fa0/2            Desg FWD 19        128.2    P2p

No comments:

Post a Comment