STP 1 - Spanning Tree Protocol and BPDU packets - 스패닝 트리 프로토콜 및 BPDU 패킷


STP - Spanning Tree Protocol 스패닝 트리 프로토콜//IEEE 802.1D
BPDU - Bridge Packet Data Unit
 
트리 프로토콜 생성은 루프가 없는 토폴로지를 만드는 데 사용됩니다.기본 개념은 스위치 간에 BPDU 패킷을 교환하여 중복 링크를 식별하는 것입니다.
기본적으로 몇 가지 절차를 거쳐야 한다.
1. Root Bridge Election - 루트 브리지를 선택하고 이를 전제로 이후의 토폴로지 분석//smaller priority <<<<<< smaller MAC address
2. Root Port Election - 비 루트 브리지 포트 선택 루트(루트 브리지에 도달하는 최상의 경로 & 루트 브리지 루트 path cost = 0)
3. Designated Port Election - 비뿌리 브리지 사이의 연결을 선택하고 Designated port//maller root path cost <<<<< smaller BPDU sender bridge ID//all rest port will be in blocked
 
STP는 다음과 같은 다섯 가지 포트 상태를 정의합니다.
  • disabled
  • listening
  • learning
  • blocking
  • forwarding

  • STP (802.1D) Port State
    RSTP (802.1w) Port State
    Is Port Included in Active Topology?
    Is Port Learning MAC Addresses?
    Disabled
    Discarding
    No
    No
    Blocking
    Discarding
    No
    No
    Listening
    Discarding
    Yes
    No
    Learning
    Learning
    Yes
    Yes
    Forwarding
    Forwarding
    Yes
    Yes
     
    주요 사항:
    1 - root bridge has no root port, only designated port
    2 - once converaged, root bridge generates BPDU, no-root bridge receive BPDU, then update info ( Bridge ID, path cost) then forward out via designated port.
    3 - when topology change, non-bridge switch send TCN to root, then root update BPDU data field and send out BPDU to notify other switch topoloy has been changed.
    ================
    인터넷에서 어떤 사람이 질문하고 또렷한 대답을 하는 것을 보고 나의 몇 가지 의문도 설명했다.
     Ques:
    1- Does only Root bridge generate BPDU packet for whole stp domain or another swtiches in stp domain generate BPDU?
    In 802.1d Spanning-Tree, only the Root Bridge was responsible creating/generating fresh BPDUs every Hello-Time (2-seconds by default).  The Root Bridge would then transmit those new BPDUs on all of its Designated Ports.  A downstream bridge that was directly-connected to the Root Bridge would receive those BPDUs on a port that might be either a Root Port or Blocking Port (if that downstream switch had an alternative path to the Root with a lower cumulative Cost).
    ----a. If a downstream bridge received those BPDUs on a Blocked Port, it would process the BPDU and then drop it.  It could NOT forward that BPDU any further.
    ----b. If a downstream bridge received those BPDUs on a Root Port, it would process that BPDU, change the Sending Bridge-ID to it's own ID, update the "Root Cost"field, and then forward that BPDU out any Designated Ports it had.
    2- Do Designated ports and Root ports on other switches recieve BPDU from peer switches ?
    In 802.1d, if the Root Bridge temporarily stopped sending BPDUs for a few seconds (maybe because it's CPU was spiked at 100%, or it was having memory shortage issues, yada, yada, yada) then you would notice that there were NO BPDUs anywhere in the switched topology for that duration of time. In other words, if you (as a non-Root bridge) didn't receive a BPDU, you had nothing to send to anyone else.
     
    3. Does any change(included disconnect cable or port shutdown) on switches of one STP domain result in STP process from scratch for election of root bridge and all phases for convergence of STP,as same as creating STP for first time ?
    Ans: Root Bridge election will happen only when the existing root goes down. Any link disconnect/port shutdown will not trigger the election of root bridge again.
     
    4. what does one switch do after receiving BPDU on portfast port?
    Ans: It depends on where you have enabled portfast. when portfast is enabled globally, that port will lose its portfast status and would start operating as normal STP port. But when the portfast is enabled on the interface mode, then since LIS/LRN stages are bypassed on the portfast enabled port, you may be at a risk of causing loop.
    5. what is minimum and maximum of STP convergence time ? Is it based on number of switch in STP domain?
    Ans: Well this depends on the time of failure.. generally , STP convergence will start from disabled -> Listening -> Learning -> Forwarding/Blocking.
    Listening is 15 sec, Learning is 15 sec.  so convergence time is 30 seconds for a link to come in forwarding state. but this depends on the type of failure as well.
    if it is an indirect link failure, it could be Max age (20)sec + Lis (15) sec + lear (15 ) sec = 50 sec delay.
     
    When a link goes down/comes up, the switch generates TCN and send it on its root port towards the root bridge. all the switches towards the root will relay this towards the root bridge.
    when the root bridge receives this , it sets the TCN Flag on its BPDU to "Yes"and send it across to all the switches downstream. so all the switches will set the CAM table aging timeout to forward delay (for the vlan's in which the failure was detected) and starts learning the CAM table again.
     
    자세한 내용은 다음과 같습니다.
    http://www.cisco.com/c/en/us/support/docs/lan-switching/spanning-tree-protocol/24062-146.html

    좋은 웹페이지 즐겨찾기