ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • STP (Spanning-Tree Protocol)
    네트워크/기술 2025. 3. 17. 09:25

    STP (Spanning-Tree Protocol)

    네트워크에서 루프(Looping) 문제를 방지하기 위해 STP(Spanning-Tree Protocol) 가 사용됩니다.
    STP는 스위치 간 우선순위를 정하고, 특정 포트를 비활성화(Blocking) 하여 루프가 발생하지 않도록 합니다.


    1. STP 개념

    순환형 네트워크 환경에서 루프 방지
    스위치 간 우선순위(Bridge ID) 결정
    특정 포트를 차단하여 루프 해결

    🖥 STP 기본 명령어:

    # show version # show spanning-tree


    2. STP 우선순위 결정 방식

    STP는 Bridge ID 값을 기준으로 Root Bridge(최상위 스위치) 를 결정합니다.

    Bridge ID = 스위치 MAC Address + STP Priority

    📌 Root Bridge 선정 기준

    • Bridge ID가 가장 낮은 스위치가 Root Bridge로 지정됨
    • Root Bridge의 모든 포트는 Designated Port (DP) 가 됨

    📌 포트 역할

    • Designated Port (DP) → STP 정보 송신
    • Root Port (RP) → Root Bridge로 가는 최적의 경로
    • Alternate Port (BLK) → 루프 방지를 위해 차단

    📌 포트 역할 결정 규칙

    • DP 맞은편 포트RP 가 된다.
    • DP와 RP는 서로 마주보는 형태, DP끼리/RP끼리는 마주볼 수 없음
    • Bridge ID 값이 높은(우선순위 낮은) 스위치의 포트가 차단됨 (BLK)

    3. STP 예제 및 출력 결과

     Root Bridge (Switch 0)

    switch0# show spanning-tree 
    VLAN0001
      Spanning tree enabled protocol ieee
      Root ID    Priority    32769
                 Address     0001.4209.EE17
                 This bridge is the root
                 Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

      Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
                 Address     0001.4209.EE17
                 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

     Switch 1

    switch1# show spanning-tree 
    VLAN0001
      Spanning tree enabled protocol ieee
      Root ID    Priority    32769
                 Address     0001.4209.EE17
                 Cost        19
                 Port        1(FastEthernet0/1)
                 Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

      Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
                 Address     00E0.B0A3.2A68
                 Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
                 Aging Time  20

    Interface        Role Sts Cost      Prio.Nbr Type
    ---------------- ---- --- --------- -------- --------------------------------
    Fa0/3            Altn BLK 19        128.3    P2p  # 차단된 포트
    Fa0/1            Root FWD 19        128.1    P2p

     
     

     Switch 2

    switch2# show spanning-tree 
    VLAN0001
      Spanning tree enabled protocol ieee
      Root ID    Priority    32769
                 Address     0001.4209.EE17
                 Cost        19
                 Port        2(FastEthernet0/2)
                 Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

      Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
                 Address     000A.4150.94DD
                 Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
                 Aging Time  20

    Interface        Role Sts Cost      Prio.Nbr Type
    ---------------- ---- --- --------- -------- --------------------------------
    Fa0/2            Root FWD 19        128.2    P2p
    Fa0/3            Desg FWD 19        128.3    P2p

     

    4. STP 작동 방식 요약

    Root Bridge가 선정되며, 모든 포트는 DP 역할을 수행
    다른 스위치는 Root Bridge로 향하는 포트를 RP로 지정
    루프가 발생하는 포트는 BLK로 설정됨

    📌 STP 작동을 확인하는 명령어

    # show spanning-tree

     


    반응형

    댓글

Designed by Tistory.