[컴퓨터 네트워크] 5장. STP

샤이니·2021년 10월 23일
0

컴퓨터 네트워크

목록 보기
4/5

Purpose of STP

Redundancy in Layer 2 Switched Networks

Layer2 Switched Network의 이중화

  • redundancy : 우회경로를 마련해 놓음
    • sigle fault 지점을 제거하고 user에 대한 network service 중단을 방지하기 위한 계층적 설계의 중요한 부분
    • Redundant network는 physical path의 추가를 요구함.
    • switch Ethernet의 redundancy는 physical, logical layer2 loop를 유발할 수 있음

Spanning Tree Protocol

fault 발생 시 connected 유지 & loop free

  • 즉 loop가 없는 layer2 topology를 생성하면서 redundancy를 허용하는 loop 방지 network protocol
  • IEEE 802.1D 은 original IEEE MAC Bridging standard for STP이다.

STP Recalculation

STP 재계산

redundant switch link 문제

  • Path redundant는 단일 실패 지점의 가능성을 제거해 multiple network service를 제공함.
  • layer2 Ethernet에는 무한 loop frame을 인식하고 제거하는 매커니즘이 없음
    • IPv4, IPv6 모두 layer3 networking device가 packet을 재전송할 수 있는 횟수를 제한하는 매커니즘을 포함함
    • router는 모든 IPv4 packet에서 TTL(Time to Live)를 감소시키고 모든 IPv6 packet에서 Hop Limit field를 감소킴. 이 field가 0이 되면 router는 packet을 삭제함.
  • 따라서 STP는 layer2 Ethernet을 위한 loop prevention mechanism으로 특별히 개발됨.

Layer 2 Loops & Broadcast Storm

The Spanning Tree Algorithm

다른 모든 switch가 single least-cost path를 결정하는 single root bridge를 선택하여 loop없는 topology를 만듬

  1. Root bridge 선택
  2. redundancy path 차단
  3. loop없는 topology
  4. link 실패로 인해 다시 계산

STP Operations

Steps to a Loop-Free Topology

  1. Elect the root bridge.
  2. Elect the root ports.
  3. Elect designated ports.
  4. Elect alternate (blocked) ports.
  • BPDU
    switch는 BPDU(Bridge Protocol Data Unit)을 사용하여 자신과 해당 연결에 대한 정보를 공유함.

    • root bridge, root port, designated port 및 alternative port를 선택하는데 사용

    • BID(BPDU를 보낸 switch를 식별하는 bridge id)가 포함되어 있음.

    • MAC address : 16진수로 표현되는 가장 낮은 값의 MAC address를 갖는 switch가 더 낮은 BID를 가짐.

1. Elect the Root Bridge

스위치가 부팅된 후 2초마다 BPDU 프레임을 보내기 시작함

Impact of Default BIDs
Determine the Root Path Cost

2. Elect the Root Ports

3. Elect Designated Ports

4. Elect Alternate (Blocked) Ports

Elect a Root Port from Multiple Equal-Cost Paths

  • Lowest sender BID
  • Lowest sender port priority
  • Lowest sender port ID

기준으로 root port 지정

STP Timers and Port States

STP convergence에는 3가지의 timer가 필요함

  • Hello Timer
    BPDU 사이의 간격. 기본값은 2초이지만 1초~10초 사이로 수정 가능

  • Forward Delay Timer
    listening & learning 상태에서 소요되는 시간.
    기본값 : 15초 (4~30초 사이로 수정 가능)

  • Max Age Timer
    STP topology 변경을 시도하기 전에 switch가 대기하는 최대 시간. 기본값 20초(6초~40초 사이 수정 가능)

  • Blocking
    Alternative port. frame 전달에 참여하지 않음.
    port는 BPDU frame을 수신해 root bridge의 위치와 root ID를 결정함. BPDU frame은 각 switch port가 최종 active STP topology에서 가정해야하는 port 역할을 결정함.
  • Listening
    Blocking 상태 이후 port는 listening state가 됨. port는 root path를 결정하기 위해 BPDU를 수신함. 또한 switch port는 자체 BPDU frame을 전송하고 switch port가 active topology에 참여할 준비를 하고 있음을 인접 switch에 알림.
  • Learning
    listening 상태 이후 learning 상태로 전환됨. learning state 동안 switch port는 BPDU를 수신 및 처리하고 frame forwarding에 참여할 준비를 함. 또한 MAC address Table을 채우기 시작함. 그러나 learning state에서는 user frame이 destination으로 전달되지는 않음.
  • Forwarding
    switch port는 active topology의 일부로 간주됨. switch port는 user traffic을 전달하고 BPDU frame을 송수신함.
  • Disabled
    Spanning Tree에 참여하지 않으며 frame을 전달하지 않음. Disable state는 switch port가 management으로 disable 된 경우 설정됨.

Operational Details of Each Port State

Per-VLAN Spanning Tree

PVST(Per-VLAN Spanning Tree)

  • 개별 VLAN에 대해 별도의 STP instance를 운영함.
  • 모든 switch의 모든 port가 VLAN 1의 구성원인 경우 Spanning Tree isntance는 하나만 있음

Evolution of STP

다양한 Version의 STP

  • STP
  • PVST+
    • PortFast, UplinkFast, BackboneFast, BPDU guard, BPDU filter, root guard, loop guard를 지원함
  • RSTP
    • Rapid Spanning Tree Protocol
    • 빠름
    • STP & RSTP Prot States
    • STP & RSTP Port Roles
  • 802.1D-2004
  • Rapid PVST+
  • MSTP
    • Multiple Spanning Tree Protocol
  • MST
    • Multiple Spanning Tree
    • Cisco 버전의 MSTP

CST(Common Spanning Tree) < MST < PST

PortFast and BPDU Guard

PC가 연결된 게 확실한 Port는 PortFast and BPDU Guard를 동시에 할 수 있음.

  • PortFast
    Listening & Learning 상태를 거치지 않고 Forwarding으로 만드는 것.
  • BPDU Guard
    유효한 PortFast Configurations에서는 다른 bridge 또는 switch가 port에 연결되어 잇음을 나타내기 때문에 PortFast-enable switch port에서 BPDU(Bridge Protocol Data Unit)를 수신해서는 안됨
    -> 이로인해 잠재적 STP loop가 발생할 수 있음
    -> BPDU Guard 실행 (port를 효과적으로 차단)

0개의 댓글