2023. 9. 20. 15:59ㆍ네트워크
STP(spanning tree protocol)
스위치들의 관계를 논리적 tree 구조로(단일경로 구조) 만들어준다.
IEEE802.1d = CST [Common Spanning Tree protocol]
PvST+ = Per vlan Spanning Tree protocol
스위치가 연결되면 2초마다 bpdu(스위치 메시지)를 발생시킨다.
bridge id(=bridge priority + mac 주소)
priority가 가장 좋은 장비(수치가 낮다)가 root bridge가 된다. [cisco default priority 32768]
priority가 같으면 mac 주소로 비교한다.
root bridge는 자신의 모든 포트를 DP(Designated Port, 데이터 송수신 포트)로 선언한다.
configuration bpdu(root bridge의 메시지)를 송신, TCN(Topology Change Notice) bpdu 보고프레임 수신
non root bridge는 자신의 모든 포트를 RP(Root Port, 데이터 송수신 포트, root의 bridge의 mac 주소 학습)로 선언한다.
***STP단점: STP 수렴시간 > IEEE 802.1w(RSTP) > IEEE802.1s(MSTP)
uplinkfast backbonefast portfast
STP 실습
- 우선순위 바꾸기
IOU3(config)#spanning-tree vlan 10 priority 0
IOU2(config)#spanning-tree vlan 10 priority 4096
- root 선정
IOU2(config)#spanning-tree vlan 30 root primary diameter 2
IOU3(config)#spanning-tree vlan 30 root secondary diameter 2
STP 수렴 시간
block state: bpdu 수신, 주소 학습 안함, 수신 frame 폐기, max age 20초
listen state: bpdu 수신, 주소 학습 안함, 수신 frame 폐기, 15초
learn state: bpdu 수신, 주소 학습, 수신 frame 폐기, 15초[LRN]
forward state[FWD]: bpdu 수신, 주소 학습, 수신 frame 전송
blk를 가지고 있는 스위치와 직접 연결된 링크가 다운 되면
listen state 15초 -> learn state 15초 -> FWD [30초]
blk를 가지고 있는 스위치와 직접 연결되지 않은 링크가 다운 되면
max age 20초 -> listen state 15초 -> learn state 15초 -> FWD [50초]
R3#debug spanning-tree events
R3#spanning tree uplinkfast
R3(config)#int f 1/2
R3(config-if)#shutdown
*Mar 1 00:21:15.639: STP: VLAN1 Fa1/2 -> blocking
*Mar 1 00:21:15.639: STP: VLAN1 new root port Fa1/3, cost 38
*Mar 1 00:21:15.639: STP: VLAN1 Fa1/3 -> listening
*Mar 1 00:21:30.659: STP: VLAN1 Fa1/3 -> learning
*Mar 1 00:21:45.659: STP: VLAN1 Fa1/3 -> forwarding
uplinkfast
backbonefast
portfast
Portfast로 설정되면 STP 알고리즘이 적용되지 않아서 실수로 루핑이 발생할 수 있는 환경이 생길 수 있다.
이것을 방지하기 위해 2가지 기술이 bpdufilter, bpduguard이다.
stp는 스위치 간의 관계인데, portfast는 스위치에 스위치가 아닌 장비가 연결되어도 동작한다.
cisco의 portfast 설정하면 stp 수렴시간을 단축시킨다.
RSTP
'네트워크' 카테고리의 다른 글
BPDU filter (0) | 2023.09.21 |
---|---|
Port-Priority 로드 분산 (1) | 2023.09.21 |
RTP (0) | 2023.09.20 |
etherchannel, LACP, PAGP (0) | 2023.09.20 |
PfR(Performance Routing) (0) | 2023.09.19 |