STP

Reference: [์ฑ…] IT ์—”์ง€๋‹ˆ์–ด๋ฅผ ์œ„ํ•œ ๋„คํŠธ์›Œํฌ ์ž…๋ฌธ

  • IT ํ™˜๊ฒฝ์—์„œ๋Š” SPoF (Single Point of Failure: ๋‹จ์ผ ์žฅ์• ์ )๋กœ ์ธํ•œ ์žฅ์• ๋ฅผ ํ”ผํ•˜๊ธฐ ์œ„ํ•ด ๋‹ค์–‘ํ•œ ๋…ธ๋ ฅ์„ ํ•œ๋‹ค

    • SPoF๋Š” ํ•˜๋‚˜์˜ ์‹œ์Šคํ…œ์ด๋‚˜ ๊ตฌ์„ฑ ์š”์†Œ์—์„œ ๊ณ ์žฅ์ด ๋ฐœ์ƒํ–ˆ์„ ๋•Œ ์ „์ฒด ์‹œ์Šคํ…œ ์˜ ์ž‘๋™์ด ๋ฉˆ์ถ”๋Š” ์š”์†Œ๋ฅผ ๋งํ•œ๋‹ค

    • Network์—์„œ๋„ ํ•˜๋‚˜์˜ ์žฅ๋น„ ๊ณ ์žฅ์œผ๋กœ ์ „์ฒด network๊ฐ€ ๋งˆ๋น„๋˜๋Š” ๊ฒƒ์„ ๋ง‰๊ธฐ ์œ„ํ•ด ์ด์ค‘ํ™”, ๋‹ค์ค‘ํ™”๋œ network๋ฅผ ๋””์ž์ธํ•˜๊ณ  ๊ตฌ์„ฑํ•œ๋‹ค

  • Network๋ฅผ switch ํ•˜๋‚˜๋กœ ๊ตฌ์„ฑํ–ˆ์„ ๋•Œ ๊ทธ switch์— ์žฅ์• ๊ฐ€ ๋ฐœ์ƒํ•˜๋ฉด ์ „์ฒด network์— ์žฅ์• ๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค

    • ์ด๋Ÿฐ SPoF๋ฅผ ํ”ผํ•˜๊ธฐ ์œ„ํ•ด switch ๋‘ ๋Œ€๋กœ network๋ฅผ ๋””์ž์ธํ•˜์ง€๋งŒ,

      • ๋‘ ๋Œ€ ์ด์ƒ์˜ switch๋กœ ๋””์ž์ธํ•˜๋ฉด packet์ด network๋ฅผ ๋”ฐ๋ผ ๊ณ„์† ์ „์†ก๋˜๋ฏ€๋กœ network๋ฅผ ๋งˆ๋น„์‹œํ‚ฌ ์ˆ˜ ์žˆ๋‹ค

        • ์ด๋Ÿฐ ์ƒํ™ฉ์„ Network Loop ๋ผ๊ณ  ํ•œ๋‹ค

    • Loop๋ฅผ ์˜ˆ๋ฐฉํ•˜๋ ค๋ฉด ๋ณ„๋„์˜ mechanism์ด ํ•„์š”ํ•˜๋‹ค

1. What is a Network Loop?

  • Loop๋Š” ๋ง ๊ทธ๋Œ€๋กœ network์— ์—ฐ๊ฒฐ๋œ ๋ชจ์–‘์ด ๊ณ ๋ฆฌ์ฒ˜๋Ÿผ ๋˜๋Œ์•„์˜ค๋Š” ํ˜•ํƒœ๋กœ ๊ตฌ์„ฑ๋œ ์ƒํ™ฉ์„ ๋งํ•œ๋‹ค

    • Loop ์ƒํ™ฉ์ด ๋ฐœ์ƒํ–ˆ์„ ๋•Œ network๊ฐ€ ๋งˆ๋น„๋˜๊ณ  ํ†ต์‹ ์ด ์•ˆ ๋˜๋Š” ์ƒํ™ฉ์ด ๋ฐœ์ƒํ•œ๋‹ค

  • ๋‹ค์–‘ํ•œ Loop ๊ตฌ์กฐ

    1. ๋‘ ์žฅ๋น„ ๊ฐ„์˜ ์ด์ค‘ํ™” ์—ฐ๊ฒฐ

    2. ์žฅ๋น„ ๊ฐ„์˜ ์—ฐ๊ฒฐ์ด ๋‹จ์ผ ๊ณ ๋ฆฌ ํ˜•ํƒœ๋กœ ์—ฐ๊ฒฐ

    3. ์žฅ๋น„ ๊ฐ„์˜ ์—ฐ๊ฒฐ์ด ์ค‘๋ณต ๊ณ ๋ฆฌ ํ˜•ํƒœ๋กœ ์—ฐ๊ฒฐ

1-1. Broadcast Storm

  • Loop ๊ตฌ์กฐ๋กœ network๊ฐ€ ์—ฐ๊ฒฐ๋œ ์ƒํƒœ์—์„œ ๋‹จ๋ง์—์„œ Broadcast๋ฅผ ๋ฐœ์ƒ์‹œํ‚ค๋ฉด switch๋Š” ํ•ด๋‹น packet์ด ์œ ์ž…๋œ port๋ฅผ ์ œ์™ธํ•œ ๋ชจ๋“  port๋กœ floodingํ•œ๋‹ค

    • Flooding๋œ packet์€ ๋‹ค๋ฅธ switch๋กœ๋„ ๋ณด๋‚ด์ง€๊ณ , ์ด packet์„ ๋ฐ›์€ switch๋Š” packet์ด ์œ ์ž…๋œ port๋ฅผ ์ œ์™ธํ•œ ๋ชจ๋“  port๋กœ ๋‹ค์‹œ floodingํ•œ๋‹ค

      • Loop ๊ตฌ์กฐ ์ƒํƒœ์—์„œ๋Š” ์ด packet์ด ๊ณ„์† ๋Œ์•„๊ฐ€๋Š”๋ฐ ์ด๊ฒƒ์„ Broadcast Storm์ด๋ผ๊ณ  ํ•œ๋‹ค

  • 3๊ณ„์ธต header์—์„œ๋Š” **TTL(Time to Live)**๋ผ๋Š” packet ์ˆ˜๋ช…์„ ๊ฐ–๊ณ  ์žˆ์ง€๋งŒ, switch ๊ฐ€ ํ™•์ธํ•˜๋Š” 2๊ณ„์ธต header ์—๋Š” 3๊ณ„์ธต์˜ TTL๊ณผ ๊ฐ™์€ lifetime mechanism์ด ์—†์–ด์„œ loop๊ฐ€ ๋ฐœ์ƒํ•˜๋ฉด packet์ด ์ฃฝ์ง€ ์•Š๊ณ  ๊ณ„์† ์‚ด์•„๋‚จ์•„์„œ packet ํ•˜๋‚˜๊ฐ€ ์ „์ฒด network ๋Œ€์—ญํญ์„ ์ฐจ์ง€ํ•  ์ˆ˜ ์žˆ๋‹ค

    • ์ด๋Ÿฐ broadcast storm ์€ network์˜ ์ „์ฒด ๋Œ€์—ญํญ์„ ์ฐจ์ง€ํ•˜๊ณ  network์— ์—ฐ๊ฒฐ๋œ ๋ชจ๋“  ๋‹จ๋ง์ด broadcast๋ฅผ ์ฒ˜๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด system resource๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด์„œ switch์™€ network์— ์—ฐ๊ฒฐ๋œ ๋‹จ๋ง ๊ฐ„ ํ†ต์‹ ์ด ๊ฑฐ์˜ ๋ถˆ๊ฐ€๋Šฅํ•œ ์ƒํƒœ๊ฐ€ ๋œ๋‹ค

  • Broadcast storm ์ƒํ™ฉ์ด ๋ฐœ์ƒํ•˜๋ฉด

    1. Network์— ์ ‘์†๋œ ๋‹จ๋ง์˜ ์†๋„๊ฐ€ ๋Š๋ ค์ง„๋‹ค

      • ๋งŽ์€ Broadcast๋ฅผ ์ฒ˜๋ฆฌํ•ด์•ผ ํ•˜๋ฏ€๋กœ CPU ์‚ฌ์šฉ๋ฅ ์ด ๋†’์•„์ง„๋‹ค

    2. Network ์ ‘์† ์†๋„๊ฐ€ ๋Š๋ ค์ง„๋‹ค

      • ๊ฑฐ์˜ ํ†ต์‹  ๋ถˆ๊ฐ€๋Šฅ ์ƒํƒœ๊ฐ€ ๋œ๋‹ค

    3. Network์— ์„ค์น˜๋œ switch์— ๋ชจ๋“  LED๋“ค์ด ๋™์‹œ์— ๋น ๋ฅธ ์†๋„๋กœ ๊นœ๋นก์ธ๋‹ค

  • Netowrk Loop๊ฐ€ ๋งŒ๋“ค์–ด์ง„ ์ƒํ™ฉ์—์„œ๋Š” cable์„ ์ œ๊ฑฐํ•˜๊ธฐ ์ „๊นŒ์ง€ network๊ฐ€ ๋งˆ๋น„๋œ ๊ฒƒ ๊ฐ™์€ ์ƒํƒœ๊ฐ€ ์ง€์†๋œ๋‹ค

1-2. Switch MAC Running ์ค‘๋ณต ๋ฌธ์ œ

  • Loop ๊ตฌ์กฐ ์ƒํƒœ์—์„œ๋Š” broadcast ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ unicast๋„ ๋ฌธ์ œ๋ฅผ ์ผ์œผํ‚จ๋‹ค

    • ๊ฐ™์€ packet์ด loop๋ฅผ ๋Œ์•„ ๋„์ฐฉ์ง€ ์ชฝ์—์„œ ์ค‘๋ณต ์ˆ˜์‹ ๋˜๋Š” ํ˜ผ๋ž€์„ ์ผ์œผํ‚ค๊ธฐ๋„ ํ•˜์ง€๋งŒ, ์ค‘๊ฐ„์— ์žˆ๋Š” switch์—์„œ๋„ MAC Running ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค

      • Switch๋Š” ์ถœ๋ฐœ์ง€ MAC ์ฃผ์†Œ๋ฅผ ํ•™์Šตํ•˜๋Š”๋ฐ ์ง์ ‘ ์ „๋‹ฌ๋˜๋Š” packet๊ณผ switch๋ฅผ ๋Œ์•„ ๋“ค์–ด๊ฐ„ packet ๊ฐ„์˜ port๊ฐ€ ๋‹ฌ๋ผ MAC ์ฃผ์†Œ๋ฅผ ์ •์ƒ์ ์œผ๋กœ ํ•™์Šตํ•  ์ˆ˜ ์—†๋‹ค

      • Switch MAC Address Table์—์„œ๋Š” ํ•˜๋‚˜์˜ MAC ์ฃผ์†Œ์— ๋Œ€ํ•ด ํ•˜๋‚˜์˜ port๋งŒ ํ•™์Šตํ•  ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ ๋™์ผํ•œ MAC ์ฃผ์†Œ๊ฐ€ ์—ฌ๋Ÿฌ port์—์„œ ํ•™์Šต๋˜๋ฉด MAC table์ด ๋ฐ˜๋ณต ๊ฐฑ์‹ ๋˜์–ด ์ •์ƒ์ ์œผ๋กœ ๋™์ž‘ํ•˜์ง€ ์•Š๋Š”๋‹ค

        • ์ด ํ˜„์ƒ์„ MAC Address Flapping์ด๋ผ๊ณ  ๋ถ€๋ฅธ๋‹ค

  • MAC Address Flapping ํ˜„์ƒ์„ ๋ฐฉ์ง€ํ•˜๊ธฐ ์œ„ํ•ด switch ์„ค์ •์— ๋”ฐ๋ผ ๊ฒฝ๊ณ  ๋ฉ”์‹œ์ง€๋ฅผ ๊ด€๋ฆฌ์ž์—๊ฒŒ ์•Œ๋ ค์ฃผ๊ฑฐ๋‚˜ ์ˆ˜์‹œ๋กœ ์ผ์–ด๋‚˜๋Š” flapping ํ˜„์ƒ์„ ํ•™์Šตํ•˜์ง€ ์•Š๋„๋ก ์ž๋™์œผ๋กœ ์กฐ์น˜ํ•œ๋‹ค

  • Network์— Loop๊ฐ€ ๋ฐœ์ƒํ•  ๊ฒฝ์šฐ ์•ž์˜ ๋ฌธ์ œ๋“ค ๋•Œ๋ฌธ์— network๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ๋™์ž‘ํ•˜์ง€ ์•Š์œผ๋ฏ€๋กœ loop๊ฐ€ ์ƒ๊ธฐ์ง€ ์•Š๋„๋ก ๋ฏธ๋ฆฌ network์— ์กฐ์น˜๋ฅผ ํ•ด์•ผํ•œ๋‹ค

    • Loop ๊ตฌ์„ฑ port ์ค‘ ํ•˜๋‚˜์˜ port๋งŒ ์‚ฌ์šฉํ•˜์ง€ ๋ชปํ•˜๋„๋ก shutdown ๋˜์–ด ์žˆ์–ด๋„ loop๋ฅผ ์˜ˆ๋ฐฉํ•  ์ˆ˜ ์žˆ๋‹ค

      • but, network์˜ SPoF๋ฅผ ์˜ˆ๋ฐฉํ•˜๊ธฐ ์œ„ํ•ด switch๋ฅผ ๋‘ ๊ฐœ ์ด์ƒ ๋””์ž์ธ ํ–ˆ๋Š”๋ฐ ๋‹ค์‹œ ์ˆ˜๋™์œผ๋กœ loop๋ฅผ ์ฐพ์•„ ๊ฐ•์ œ๋กœ ์‚ฌ์šฉํ•˜์ง€ ๋ชปํ•˜๊ฒŒ ํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ๋ฐ”๋žŒ์งํ•˜์ง€ ์•Š๋‹ค

        • ๋จผ์ € network์—์„œ ๋ณต์žกํ•œ cable ์—ฐ๊ฒฐ์„ ์ด์šฉํ•ด loop๋ฅผ ์ฐพ์•„๋‚ด๋Š” ๊ฒƒ์ด ํž˜๋“ค๋‹ค

        • ์ฐพ์•„๋‚ด ๊ฐ•์ œ๋กœ port๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ๋ชปํ•˜๊ฒŒ ํ•˜๋”๋ผ๋„ network์— ์žฅ์• ๊ฐ€ ๋ฐœ์ƒํ•˜๋ฉด ํ•ด๋‹น port๋ฅผ ์ˆ˜๋™์œผ๋กœ ๋‹ค์‹œ ์‚ฌ์šฉํ•˜๋„๋ก ํ•ด์•ผํ•œ๋‹ค

      • ์‚ฌ์šฉ์ž๊ฐ€ ์ด๋ ‡๊ฒŒ ์ ๊ทน์ ์œผ๋กœ ๊ฐœ์ž…ํ•˜๋Š” ๋ฐฉ๋ฒ•์œผ๋กœ๋Š” network ์žฅ์• ์— ์ ์ ˆํžˆ ๋Œ€์‘ํ•  ์ˆ˜ ์—†๋‹ค

        • ์ด๋Ÿฐ ์ด์œ ๋กœ loop๋ฅผ ์ž๋™ ๊ฐ์ง€ํ•ด port๋ฅผ ์ฐจ๋‹จํ•˜๊ณ  ์žฅ์•  ๋•Œ๋ฌธ์— ์šฐํšŒ๋กœ๊ฐ€ ์—†์„ ๋•Œ ์ฐจ๋‹จ๋œ port๋ฅผ switch๋กœ ๋‹ค์‹œ ํ’€์–ด์ฃผ๋Š” Spanning Tree Protocol์ด ๊ฐœ๋ฐœ๋˜์—ˆ๋‹ค

2. What is STP?

  • STP (Spanning Tree Protocol)์€ loop๋ฅผ ํ™•์ธํ•˜๊ณ  ์ ์ ˆํžˆ port๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ๋ชปํ•˜๊ฒŒ ๋งŒ๋“ค์–ด loop๋ฅผ ์˜ˆ๋ฐฉํ•˜๋Š” mechanism์ด๋‹ค

    • ์šฉ์–ด ๊ทธ๋Œ€๋กœ ์ž˜ ๋ป—์€ ๋‚˜๋ฌด์ฒ˜๋Ÿผ ๋ฟŒ๋ฆฌ๋ถ€ํ„ฐ ๊ฐ€์ง€๊นŒ์ง€ loop๊ฐ€ ์ƒ๊ธฐ์ง€ ์•Š๋„๋ก ์œ ์ง€ ํ•˜๋Š” ๊ฒƒ์ด Spanning Tree Protocol์˜ ๋ชฉ์ ์ด๋‹ค

  • STP๋ฅผ ์ด์šฉํ•ด loop๋ฅผ ์˜ˆ๋ฐฉํ•˜๋ ค๋ฉด ์ „์ฒด switch๊ฐ€ ์–ด๋–ป๊ฒŒ ์—ฐ๊ฒฐ๋˜๋Š”์ง€ ์•Œ์•„์•ผ ํ•œ๋‹ค

    • ์ „์ฒด์ ์ธ switch ์—ฐ๊ฒฐ ์ƒํ™ฉ์„ ํŒŒ์•…ํ•˜๋ผ๋ฉด switch ๊ฐ„์— ์ •๋ณด๋ฅผ ์ „๋‹ฌํ•˜๋Š” ๋ฐฉ๋ฒ•์ด ํ•„์š”ํ•˜๋‹ค

      • ์ด๋ฅผ ์œ„ํ•ด switch๋Š” BPDU (Bridge Protocol Data Unit) ๋ผ๋Š” protocol์„ ํ†ตํ•ด switch ๊ฐ„์— ์ •๋ณด๋ฅผ ์ „๋‹ฌํ•˜๊ณ  ์ด๋ ‡๊ฒŒ ์ˆ˜์ง‘๋œ ์ •๋ณด๋ฅผ ์ด์šฉํ•ด ์ „์ฒด network tree๋ฅผ ๋งŒ๋“ค์–ด loop ๊ตฌ๊ฐ„ ํ™•์ธํ•œ๋‹ค

        • BPDU์—๋Š” switch๊ฐ€ ๊ฐ–๊ณ  ์žˆ๋Š” ID์™€ ๊ฐ™์€ ๊ณ ์œ ๊ฐ’์ด ๋“ค์–ด๊ฐ€๊ณ  ์ด๋Ÿฐ ์ •๋ณด๋“ค์ด switch ๊ฐ„์— ๊ตํ™˜๋˜๋ฉด์„œ loop ํŒŒ์•…์ด ๊ฐ€๋Šฅํ•ด์ง„๋‹ค

        • ์ด๋ ‡๊ฒŒ ํ™•์ธ๋œ loop ์ง€์ ์„ data traffic์ด ํ†ต๊ณผํ•˜์ง€ ๋ชปํ•˜๋„๋ก ์ฐจ๋‹จํ•ด loop๋ฅผ ์˜ˆ๋ฐฉํ•œ๋‹ค

2-1. Switch Port์˜ ์ƒํƒœ ๋ฐ ๋ณ€๊ฒฝ ๊ณผ์ •

  • Spanning Tree Protocol์ด ๋™์ž‘์ค‘์ธ switch์—์„œ๋Š” loop๋ฅผ ๋ง‰๊ธฐ ์œ„ํ•ด

    • switch port์— ์‹ ๊ทœ switch๊ฐ€ ์—ฐ๊ฒฐ๋˜๋ฉด ๋ฐ”๋กœ traffic์ด ํ๋ฅด์ง€ ์•Š๋„๋ก ์ฐจ๋‹จํ•œ๋‹ค

    • ๊ทธ๋ฆฌ๊ณ  ํ•ด๋‹น port๋กœ traffic์ด ํ˜๋Ÿฌ๋„ ๋˜๋Š”์ง€ ํ™•์ธํ•˜๊ธฐ ์œ„ํ•ด

      • BPDU ๋ฅผ ๊ธฐ๋‹ค๋ ค ํ•™์Šตํ•˜๊ณ ,

      • ๊ตฌ์กฐ๋ฅผ ํŒŒ์•…ํ•œ ํ›„,

      • Traffic์„ ํ˜๋ฆฌ๊ฑฐ๋‚˜ loop ๊ตฌ์กฐ์ธ ๊ฒฝ์šฐ ์ฐจ๋‹จ ์ƒํƒœ๋ฅผ ์œ ์ง€ํ•œ๋‹ค

์ฐจ๋‹จ ์ƒํƒœ์—์„œ Traffic์ด ํ๋ฅผ ๋•Œ๊นŒ์ง€ switch port์˜ status

  • Blocking

    • Packet data๋ฅผ ์ฐจ๋‹จํ•œ ์ƒํƒœ๋กœ ์ƒ๋Œ€๋ฐฉ์ด ๋ณด๋‚ด๋Š” **BPDU (Bridge Protocol Data Unit)**๋ฅผ ๊ธฐ๋‹ค๋ฆฐ๋‹ค

    • ์ด 20์ดˆ์ธ Max Age ๊ธฐ๊ฐ„ ๋™์•ˆ ์ƒ๋Œ€๋ฐฉ switch์—์„œ BPDU๋ฅผ ๋ฐ›์ง€ ๋ชปํ–ˆ๊ฑฐ๋‚˜, ํ›„์ˆœ์œ„ BPDU๋ฅผ ๋ฐ›์•˜์„ ๋•Œ port๋Š” listening status๋กœ ๋ณ€๊ฒฝ๋œ๋‹ค

    • BPDU์˜ ๊ธฐ๋ณธ ๊ตํ™˜ ์ฃผ๊ธฐ๋Š” 2์ดˆ์ด๊ณ , 10๋ฒˆ์˜ BPDU๋ฅผ ๊ธฐ๋‹ค๋ฆฐ๋‹ค

  • Listening

    • ํ•ด๋‹น portr๊ฐ€ ์ „์†ก ์ƒํƒœ๋กœ ๋ณ€๊ฒฝ ๋˜๋Š” ๊ฒƒ์„ ๊ฒฐ์ •ํ•˜๊ณ  ์ค€๋น„ํ•˜๋Š” ๋‹จ๊ณ„์ด๋‹ค

      • ์ด ์ƒํƒœ๋ถ€ํ„ฐ๋Š” ์ž์‹ ์˜ BPDU ์ •๋ณด๋ฅผ ์ƒ๋Œ€๋ฐฉ์—๊ฒŒ ์ „์†กํ•˜๊ธฐ ์‹œ์ž‘ํ•œ๋‹ค

    • ์ด 15์ดˆ ๋™์•ˆ ๋Œ€๊ธฐํ•œ๋‹ค

  • Learning

    • ์ด๋ฏธ ํ•ด๋‹น port๋ฅผ forwarding ํ•˜๊ธฐ๋กœ ๊ฒฐ์ •ํ•˜๊ณ  ์‹ค์ œ๋กœ packet forwarding์ด ์ผ์–ด๋‚  ๋•Œ switch๊ฐ€ ๊ณง๋ฐ”๋กœ ๋™์ž‘ํ•˜๋„๋ก MAC Addess๋ฅผ learningํ•˜๋Š” ๋‹จ๊ณ„์ด๋‹ค

    • ์ด 15์ดˆ ๋™์•ˆ ๋Œ€๊ธฐํ•œ๋‹ค

  • Forwarding

    • packet์„ forwarding ํ•˜๋Š” ๋‹จ๊ณ„์ด๋‹ค

      • ์ด ๋‹จ๊ณ„์—์„œ ์ •์ƒ์ ์ธ ํ†ต์‹ ์ด ๊ฐ€๋Šฅํ•˜๋‹ค!

2-2. STP ๋™์ž‘ ๋ฐฉ์‹

  • STP๋Š” loop๋ฅผ ์—†์• ๊ธฐ ์œ„ํ•ด ๋‚˜๋ฌด๊ฐ€ ๋ฟŒ๋ฆฌ์—์„œ ๊ฐ€์ง€๋กœ ๋ป—์–ด๋‚˜๊ฐ€๋Š” ๊ฒƒ์ฒ˜๋Ÿผ topology๋ฅผ ๊ตฌ์„ฑํ•œ๋‹ค

    • Network ์ƒ์—์„œ ๋ฟŒ๋ฆฌ๊ฐ€ ๋˜๋Š” ๊ฐ€์žฅ ๋†’์€ switch๋ฅผ ์„ ์ถœํ•˜๊ณ , ๊ทธ switch๋ฅผ ํ†ตํ•ด ๋ชจ๋“  BDPU๊ฐ€ ๊ตํ™˜๋˜๋„๋ก ํ•˜๋Š”๋ฐ ์ด switch๋ฅผ Root Switch ๋ผ๊ณ  ํ•œ๋‹ค

      • ๋ชจ๋“  switch๋Š” ์ฒ˜์Œ์— ์ž์‹ ์„ root switch๋กœ ์ธ์‹ํ•ด ๋™์ž‘ํ•œ๋‹ค

        • BPDU๋ฅผ ํ†ตํ•ด 2์ดˆ๋งˆ๋‹ค ์ž์‹ ์ด root switch์ž„์„ ๊ด‘๊ณ ํ•˜๋Š”๋ฐ, ์ƒˆ๋กœ์šด switch๊ฐ€ ๋“ค์–ด์˜ค๋ฉด ์„œ๋กœ ๊ตํ™˜๋œ BPDU์— ๋“ค์–ด ์žˆ๋Š” bridge ID๊ฐ’์„ ๋น„๊ตํ•œ๋‹ค

        • Bridge ID๊ฐ’์ด ๋” ์ ์€ switch๋ฅผ root switch๋กœ ์„ ์ •ํ•˜๊ณ , ์„ ์ •๋œ root switch๊ฐ€ BPDU๋ฅผ ๋‹ค๋ฅธ siwwtch ์ชฝ์œผ๋กœ ๋ณด๋‚ธ๋‹ค

Loop๋ฅผ ์˜ˆ๋ฐฉํ•˜๊ธฐ ์œ„ํ•œ STP์˜ ๋™์ž‘ ๋ฐฉ์‹

  1. ํ•˜๋‚˜์˜ Root Switch ์„ ์ •

    • ์ „์ฒด network์—์„œ ํ•˜๋‚˜์˜ root switch๋ฅผ ์„ ์ •ํ•œ๋‹ค

    • ์ž๊ธฐ ์ž์‹ ์„ ์ „์ฒด network์˜ ๋Œ€ํ‘œ switch๋กœ ์ ์€ BPDU๋ฅผ ์˜† switch๋กœ ์ „๋‹ฌํ•œ๋‹ค

  2. Root๊ฐ€ ์•„๋‹Œ switch ์ค‘ Root Port ์„ ์ •

    • Root Switch (Bridge) ๋กœ ๊ฐ€๋Š” ๊ฒฝ๋กœ๊ฐ€ ๊ฐ€์žฅ ์งง์€ port๋ฅผ Root Port ๋ผ๊ณ  ํ•œ๋‹ค

    • Root Port๋Š” Root Bridge์—์„œ ๋ณด๋‚ธ BPDU๋ฅผ ๋ฐ›๋Š” port์ด๋‹ค

  3. ํ•˜๋‚˜์˜ segment์— ํ•˜๋‚˜์˜ ์ง€์ • (designated) Port ์„ ์ •

    • Switch์™€ switch๊ฐ€ ์—ฐ๊ฒฐ๋˜๋Š” port๋Š” ํ•˜๋‚˜์˜ **์ง€์ • ํฌํŠธ (Designated Port)**๋ฅผ ์„ ์ •ํ•œ๋‹ค

    • Switch ๊ฐ„์˜ ์—ฐ๊ฒฐ์—์„œ

      1. ์ด๋ฏธ root port๋กœ ์„ ์ •๋œ ๊ฒฝ์šฐ, ๊ทธ ๋ฐ˜๋Œ€์ชฝ์ด designated port๋กœ ์„ ์ •๋˜์–ด ์–‘์ชฝ ๋ชจ๋‘ forwarding status ๊ฐ€ ๋œ๋‹ค

      2. ์•„๋ฌด๋„ root port๊ฐ€ ์•„๋‹ ๊ฒฝ์šฐ, ํ•œ์ชฝ์€ designated port๋กœ ์„ ์ •๋””๊ณ  ๋‹ค๋ฅธ ํ•œ์ชฝ์€ **๋Œ€์ฒด ํฌํŠธ (Alternate, Non-designated)**๊ฐ€ ๋˜์–ด blocking status๊ฐ€ ๋œ๋‹ค

    • Designated Port๋Š” BPDU๊ฐ€ ์ „๋‹ฌ๋˜๋Š” port์ด๋‹ค

STP ์‚ฌ์šฉ์‹œ ๋Œ€์•ˆ - Port Fast

  • Port์— ์ƒˆ๋กœ์šด cable์ด ์—ฐ๊ฒฐ๋˜๋ฉด ๊ณง๋ฐ”๋กœ forwarding status ๋กœ ๋ณ€ํ•˜๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋ผ ์ƒ๋Œ€๋ฐฉ์ด switch์ผ ์ˆ˜๋„ ์žˆ๋‹ค๊ณ  ๊ฐ€์ •ํ•˜๊ณ  BPDU๊ฐ€ ๋“ค์–ด์˜ค๋Š”์ง€ monitoring ํ•œ๋‹ค

    • but, ์ด๋Ÿฌํ•œ mechanism์€ ๋‹จ๋ง์ด network์— ์—ฐ๊ฒฐ๋  ๋•Œ๊นŒ์ง€ ์‹œ๊ฐ„์ด ์ง€์—ฐ๋˜๋Š” ๋ฌธ์ œ ๋•Œ๋ฌธ์— switch๊ฐ€ ์•„๋‹Œ ์ผ๋ฐ˜ PC๋‚˜ server๊ฐ€ ์—ฐ๊ฒฐ๋˜๋Š” port๋ผ๋ฉด ์ด๋Ÿฐ mechanism์„ ์—†์• ๊ฑฐ๋‚˜ ์ข€ ๋” ๋น ๋ฅธ ์‹œ๊ฐ„ ์•ˆ์— forwarding status๋กœ ๋ณ€๊ฒฝ๋˜์–ด์•ผ ํ•œ๋‹ค

      • ์ด๋Ÿฐ ๊ฒฝ์šฐ ํ•ด๋‹น port๋ฅผ Port Fast ๋กœ ์„ค์ •ํ•˜๋ฉด BPDU waiting, learning ๊ณผ์ • ์—†์ด ๊ณง๋ฐ”๋กœ forwarding status๋กœ port๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค

      • Port Fast๋ฅผ ์„ค์ •ํ•œ port์— switch๊ฐ€ ์ ‘์†๋˜๋ฉด loop๊ฐ€ ์ƒ๊ธธ ์ˆ˜ ์žˆ์–ด ๋ณ„๋„๋กœ ํ•ด๋‹น port์— BPDU๊ฐ€ ๋“ค์–ด์˜ค์ž๋งˆ์ž port๋ฅผ ์ฐจ๋‹จํ•˜๋Š” BPDU Guard ์™€ ๊ฐ™์€ ๊ธฐ์ˆ ์ด ํ•จ๊ป˜ ์‚ฌ์šฉ๋˜์–ด์•ผ ํ•œ๋‹ค

2-3. ํ–ฅ์ƒ๋œ STP - RSTP, MST

  • Spanning Tree Protocol์€ loop๋ฅผ ์˜ˆ๋ฐฉํ•˜๊ธฐ ์œ„ํ•ด ๊ฐ™์€ network์— ์†ํ•œ ๋ชจ๋“  switch๊นŒ์ง€ BDPU๊ฐ€ ์ „๋‹ฌ๋˜๋Š” ์‹œ๊ฐ„์„ ๊ณ ๋ คํ•œ๋‹ค

    • ๊ทธ๋Ÿฌ๋‹ค๋ณด๋‹ˆ blocking port๊ฐ€ forwarding status๋กœ ๋ณ€๊ฒฝ๋  ๋•Œ๊นŒ์ง€ 30 ~ 50์ดˆ๊ฐ€ ์†Œ์š”๋œ๋‹ค

      • ํ†ต์‹ ์— ๊ฐ€์žฅ ๋งŽ์ด ์“ฐ์ด๋Š” TCP ๊ธฐ๋ฐ˜ application์ด network๊ฐ€ ๋Š๊ฒผ์„ ๋•Œ 30์ดˆ๋ฅผ ๊ธฐ๋‹ค๋ฆฌ์ง€ ๋ชปํ•˜๋‹ค๋ณด๋‹ˆ, STP ๊ธฐ๋ฐ˜ network์— ์žฅ์• ๊ฐ€ ์ƒ๊ธฐ๋ฉด ํ†ต์‹ ์ด ๋Š๊ธธ ์ˆ˜ ์žˆ๋‹ค

      • ๋˜ํ•œ, switch์— ์—ฌ๋Ÿฌ ๊ฐœ์˜ VLAN์ด ์žˆ์œผ๋ฉด ๊ฐ VLAN ๋ณ„๋กœ STP๋ฅผ ๊ณ„์‚ฐํ•˜๋ฉด์„œ ๋ถ€ํ•˜๊ฐ€ ๋ฐœ์ƒํ•˜๊ธฐ๋„ ํ•œ๋‹ค

  • ์œ„์˜ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด ํ–ฅ์ƒ๋œ STP๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค

3-1. RSTP (Rapid Spanning Tree Protocol)

  • Spanning Tree Protocol์€ ์ด์ค‘ํ™”๋œ switch ๊ฒฝ๋กœ ์ค‘ ์ •์ƒ์ ์ธ ๊ฒฝ๋กœ์— ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•  ๊ฒฝ์šฐ, backup ๊ฒฝ๋กœ๋ฅผ ํ™œ์„ฑํ™”ํ•˜๋Š” ๋ฐ 30 ~ 50์ดˆ๊ฐ€ ๊ฑธ๋ฆฐ๋‹ค

    • ์ด๋ ‡๊ฒŒ backup ๊ฒฝ๋กœ๋ฅผ ํ™œ์„ฑํ™”ํ•˜๋Š” ๋ฐ ์‹œ๊ฐ„์ด ๋„ˆ๋ฌด ์˜ค๋ž˜ ๊ฑธ๋ฆฌ๋Š” ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด RSTP (Rapid Spanning Tree Protocol) ๊ฐ€ ๊ฐœ๋ฐœ๋˜์—ˆ๋‹ค

  • RSTP๋Š” 2 ~ 3์ดˆ๋กœ ์ ˆ์ฒด ์‹œ๊ฐ„์ด ์งง์•„ ์ผ๋ฐ˜์ ์ธ TCP ๊ธฐ๋ฐ˜ application์ด session์„ ์œ ์ง€ํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋œ๋‹ค

  • ๊ธฐ๋ณธ์ ์ธ ๋™์ž‘ ๋ฐฉ์‹์€ STP์™€ ๊ฐ™์ง€๋งŒ, BPDU meassge ํ˜•์‹์ด ๋‹ค์–‘ํ•ด์ ธ ์—ฌ๋Ÿฌ ๊ฐ€์ง€ ์ƒํƒœ message๋ฅผ ๊ตํ™˜ํ•  ์ˆ˜ ์žˆ๋‹ค

    • STP๋Š” ์ผ๋ฐ˜ topology ๋ณ€๊ฒฝ๊ณผ ๊ด€๋ จ๋œ ๋‘ ๊ฐ€์ง€ message (TCN: Topology Change Notification, TCA: Topology Change Acknowledgement BPDU)๋งŒ ์žˆ์ง€๋งŒ

    • RSTP๋Š” 8๊ฐœ ๋น„ํŠธ๋ฅผ ๋ชจ๋‘ ํ™œ์šฉํ•ด ๋‹ค์–‘ํ•œ ์ •๋ณด๋ฅผ ์ฃผ์œ„ switch์™€ ์ฃผ๊ณ ๋ฐ›์„ ์ˆ˜ ์žˆ๋‹ค

  • ๊ธฐ์กด STP์—์„œ๋Š” topology๊ฐ€ ๋ณ€๊ฒฝ๋˜๋ฉด ๋ง๋‹จ switch์—์„œ root bridge๊นŒ์ง€ ๋ณ€๊ฒฝ ๋ณด๊ณ ๋ฅผ ๋ณด๋‚ด๊ณ  root bridge๊ฐ€ ๊ทธ์— ๋Œ€ํ•œ ์—ฐ์‚ฐ์„ ๋‹ค์‹œ ์™„๋ฃŒํ•˜๊ณ  ์ดํ›„์— ๋ณ€๊ฒฝ๋œ topology ์ •๋ณด๋ฅผ ๋ง๋‹จ switch๊นŒ์ง€ ๋ณด๋‚ด๋Š” ๊ณผ์ •์„ ๊ฑฐ์ณค๋‹ค

    • ์ถ”๊ฐ€๋กœ ์ด๋Ÿฐ ์ •๋ณด๊ฐ€ network์— ์žˆ๋Š” ๋ชจ๋“  switch๊นŒ์ง€ ์ „ํŒŒ๋˜๋Š” ์˜ˆ๋น„ ์‹œ๊ฐ„๊นŒ์ง€ ๊ณ ๋ คํ•ด์•ผ ํ•˜๋ฏ€๋กœ ์ •๋ณด๋ฅผ ํ™•์žฅํ•˜๋Š”๋ฐ ์‹œ๊ฐ„์ด ์˜ค๋ž˜ ๊ฑธ๋ ธ๋‹ค

  • RSTP์—์„œ๋Š” topology ๋ณ€๊ฒฝ์ด ์ผ์–ด๋‚œ switch ์ž์‹ ์ด ๋ชจ๋“  network์— topology ๋ณ€๊ฒฝ์„ ์ง์ ‘ ์ „ํŒŒํ•  ์ˆ˜ ์žˆ๋‹ค

    • Root bridge์— ๋ณด๊ณ ํ•˜๊ณ  ์ „ํŒŒ๋˜๋Š” ํ˜•์‹์ด ์•„๋‹ˆ๋ผ terminal switch๊ฐ€ topology ๋ณ€ํ™”๋ฅผ ๋‹ค๋ฅธ bridge์— ์ง์ ‘ ์•Œ๋ ค์ค€๋‹ค

  • RSTP๋Š” ๋‹ค์–‘ํ•œ BPDU message, ๋Œ€์ฒด port ๊ฐœ๋…, topology ๋ณ€๊ฒฝ ์ „๋‹ฌ ๋ฐฉ์‹์˜ ๋ณ€ํ™”๋กœ ์ผ๋ฐ˜ STP๋ณด๋‹ค ๋น ๋ฅธ ์‹œ๊ฐ„ ๋‚ด์— topology ๋ณ€๊ฒฝ์„ ๊ฐ์ง€ ๋ฐ ๋ณต๊ตฌ ํ•  ์ˆ˜ ์žˆ๋‹ค!

    • ์‹ค์ œ๋กœ RSTP๋Š” ๋ถˆ๊ณผ 2 ~ 3์ดˆ ์•ˆ์— ์žฅ์•  ๋ณต๊ตฌ๊ฐ€ ๊ฐ€๋Šฅํ•˜๋ฏ€๋กœ ์žฅ์• ๊ฐ€ ๋ฐœ์ƒํ•˜๋”๋ผ๋„ application session์ด ๋Š๊ธฐ์ง€ ์•Š์•„ ๋ณด๋‹ค ์•ˆ์ •์ ์œผ๋กœ network๋ฅผ ์šด์˜ํ•˜๋Š”๋ฐ ๋„์›€์ด ๋œ๋‹ค!

3-2. MST (Multiple Spanning Tree)

  • ์ผ๋ฐ˜ Spanning Tree Protocol์„ CST (Common Spanning Tree ๋ผ๊ณ  ๋ถ€๋ฅธ๋‹ค

    • VLAN ๊ฐœ์ˆ˜์™€ ์ƒ๊ด€์—†์ด spanning tree ํ•œ ๊ฐœ๋งŒ ๋™์ž‘ํ•˜๊ฒŒ ๋œ๋‹ค

      • ์ด ๊ฒฝ์šฐ, VLAN์ด ๋งŽ๋”๋ผ๋„ spanning tree๋Š” ํ•œ ๊ฐœ๋งŒ ๋™์ž‘ํ•˜๋ฉด ๋˜๋ฏ€๋กœ switch ๊ด€๋ฆฌ ๋ถ€ํ•˜๊ฐ€ ์ ๋‹ค

        • but, CST๋Š” loop๊ฐ€ ์ƒ๊ธฐ๋Š” topology์—์„œ ํ•œ ๊ฐœ์˜ port์™€ ํšŒ์„ ๋งŒ ํ™œ์„ฑํ™”๋˜๋ฏ€๋กœ ์ž์›์„ ํšจ์œจ์ ์œผ๋กœ ํ™œ์šฉํ•  ์ˆ˜ ์—†๋‹ค

      • ๋˜ํ•œ VLAN๋งˆ๋‹ค ์ตœ์ ์˜ ๊ฒฝ๋กœ๊ฐ€ ๋‹ค๋ฅผ ์ˆ˜ ์žˆ๋Š”๋ฐ port ํ•˜๋‚˜๋งŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค๋ณด๋‹ˆ ๋ฉ€๋ฆฌ ๋Œ์•„ ํ†ต์‹ ํ•ด์•ผ ํ•  ๊ฒฝ์šฐ๋„ ์ƒ๊ธด๋‹ค

  • CST์˜ ๋ฌธ์ œ์ ์„ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด PVST (Per Vlan Spanning Tree)๊ฐ€ ๊ฐœ๋ฐœ๋˜์—ˆ๋‹ค

    • VLAN๋งˆ๋‹ค ๋‹ค๋ฅธ spanning tree process๊ฐ€ ๋™์ž‘ํ•˜๋ฏ€๋กœ VLAN๋งˆ๋‹ค ๋ณ„๋„์˜ ๊ฒฝ๋กœ์™€ tree๋ฅผ ๋งŒ๋“ค ์ˆ˜ ์žˆ๊ฒŒ ๋˜์—ˆ๋‹ค

      • ๊ทธ ๊ฒฐ๊ณผ ์ตœ์ ์˜ ๊ฒฝ๋กœ๋ฅผ ๋””์ž์ธํ•˜๊ณ  VLAN๋งˆ๋‹ค ๋ณ„๋„์˜ block port๋ฅผ ์ง€์ •ํ•ด network load๋ฅผ sahringํ•˜๋„๋ก ๊ตฌ์„ฑํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋˜์—ˆ๋‹ค

        • but, spanning tree protocol ์ž์ฒด๊ฐ€ **switch์— ๋งŽ์€ ๋ถ€๋‹ด์„ ์ฃผ๋Š” protocol (2์ดˆ๋งˆ๋‹ค ๊ตํ™˜)**์ธ๋ฐ PVST๋Š” ๋ชจ๋“  VLAN๋งˆ๋‹ค ๋ณ„๋„์˜ spanning tree๋ฅผ ์œ ์ง€ํ•ด์•ผํ•˜๋ฏ€๋กœ ๋” ๋งŽ์€ ๋ถ€๋‹ด์ด ๋˜์—ˆ๋‹ค

  • ์ด๋Ÿฐ CSV์™€ PVST์˜ ๋‹จ์ ์„ ๋ณด์™„ํ•˜๊ธฐ ์œ„ํ•ด MST (Multiple Spanning Tree)๊ฐ€ ๊ฐœ๋ฐœ๋˜์—ˆ๋‹ค

    • MST์˜ ๊ธฐ๋ณธ์ ์ธ ์•„์ด๋””์–ด๋Š” ์—ฌ๋Ÿฌ ๊ฐœ์˜ VLAN์„ ๊ทธ๋ฃน์œผ๋กœ ๋ฌถ๊ณ  ๊ทธ ๊ทธ๋ฃน๋งˆ๋‹ค ๋ณ„๋„์˜ spanning tree๊ฐ€ ๋™์ž‘ํ•œ๋‹ค

      • ์ด ๊ฒฝ์šฐ, PVST๋ณด๋‹ค ํ›จ์”ฌ ์ ์€ spanning tree process๊ฐ€ ๋Œ๊ฒŒ ๋˜๊ณ  PVST์˜ ์žฅ์ ์ธ load sharing๊ธฐ๋Šฅ๋„ ํ•จ๊ป˜ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค

  • ์ผ๋ฐ˜์ ์œผ๋กœ ๋Œ€์ฒด ๊ฒฝ๋กœ์˜ ๊ฐœ์ˆ˜๋‚˜ ์šฉ๋„์— ๋”ฐ๋ผ MST์˜ spanning tree process ๊ฐœ์ˆ˜๋ฅผ ์ •์˜ํ•œ๋‹ค

    • MST์—์„œ๋Š” region ๊ฐœ๋…์ด ๋„์ž…๋˜์–ด ์—ฌ๋Ÿฌ ๊ฐœ์˜ VLAN์„ ํ•˜๋‚˜์˜ region์œผ๋กœ ๋ฌถ์„ ์ˆ˜ ์žˆ๋‹ค

      • region 1 == spanning tree 1

      • ex)

        • 11 ~ 50๋ฒˆ VLAN๊ณผ 101 ~ 150๋ฒˆ VLAN์ด ์žˆ๋‹ค๋ฉด

          • 11 ~ 50์„ ํ•˜๋‚˜์˜ region์œผ๋กœ

          • 101 ~ 150๋ฒˆ์„ ํ•˜๋‚˜์˜ region์œผ๋กœ ๋ฌถ์œผ๋ฉด ๋‘ ๊ฐœ์˜ spanning tree๋กœ 100๊ฐœ์˜ VLAN์„ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋‹ค

์Šค์œ„์น˜์˜ ๊ตฌ์กฐ์™€ ์Šค์œ„์น˜์— IP ์ฃผ์†Œ๊ฐ€ ํ• ๋‹น๋œ ์ด์œ 

  • Switch๋Š” ๊ด€๋ฆฌ์šฉ Control Plane๊ณผ packet์„ forwarding ํ•˜๋Š” Data Plane์œผ๋กœ ํฌ๊ฒŒ ๋‚˜๋‰œ๋‹ค

    • STP๋‚˜ switch ์›๊ฒฉ ๊ด€๋ฆฌ์šฉ telnet, SSH, web๊ณผ ๊ฐ™์€ service๋Š” Control Plane์—์„œ ์ˆ˜ํ–‰๋œ๋‹ค

  • Switch๋Š” 2๊ณ„์ธต์—์„œ ๋™์ž‘ํ•˜๋Š” ์žฅ๋น„์—ฌ์„œ MAC ์ฃผ์†Œ๋งŒ ์ดํ•ดํ•  ์ˆ˜ ์žˆ๋‹ค

    • Switch๊ฐ€ ๋™์ž‘ํ•˜๋Š”๋ฐ IP๋Š” ํ•„์š” ์—†์ง€๋งŒ, ์ผ์ • ๊ทœ๋ชจ ์ด์ƒ์˜ network์—์„œ ์šด์˜๋˜๋Š” switch๋Š” ๊ด€๋ฆฌ ๋ชฉ์ ์œผ๋กœ ๋Œ€๋ถ€๋ถ„ IP ์ฃผ์†Œ๊ฐ€ ํ• ๋‹น๋œ๋‹ค

Last updated