Router

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

1. What is Router?

  • Router๋Š” layer 3์—์„œ ๋™์ž‘ํ•˜๋Š” ์—ฌ๋Ÿฌ network ์žฅ๋น„์˜ ๋Œ€ํ‘œ๊ฒฉ์œผ๋กœ, ์ด๋ฆ„์ฒ˜๋Ÿผ ๊ฒฝ๋กœ๋ฅผ ์ง€์ •ํ•ด์ฃผ๋Š” ์žฅ๋น„์ด๋‹ค

  • Router์— ๋“ค์–ด์˜ค๋Š” packet์˜ ๋ชฉ์ ์ง€ IP ์ฃผ์†Œ๋ฅผ ํ™•์ธํ•˜๊ณ , ์ž์‹ ์ด ๊ฐ€์ง„ ๊ฒฝ๋กœ(Route) ์ •๋ณด๋ฅผ ์ด์šฉํ•ด packet์„ ์ตœ์ ์˜ ๊ฒฝ๋กœ๋กœ forwardingํ•œ๋‹ค

  • Router๋Š” ์›๊ฒฉ์ง€ network์™€ ์—ฐ๊ฒฐํ•  ๋•Œ ํ•„์ˆ˜ network ์žฅ๋น„์ด๋ฉฐ, network๋ฅผ ๊ตฌ์„ฑํ•˜๋Š” ํ•ต์‹ฌ ์žฅ๋น„์ด๋‹ค

    • ์„œ๋กœ ๋‹ค๋ฅธ network ๊ฐ„์— ํ†ต์‹ ํ•  ๋•Œ router๊ฐ€ ๋ฐ˜๋“œ์‹œ ํ•„์š”ํ•˜๋‹ค!

Router vs L3 Switch

  • Switch๋Š” ๋Œ€ํ‘œ์ ์ธ 2๊ณ„์ธต ์žฅ๋น„์ด์ง€๋งŒ, router์ฒ˜๋Ÿผ 3๊ณ„์ธต์—์„œ ๋™์ž‘ํ•˜๋Š” L3 Switch๋ผ๊ณ  ๋ถ€๋ฅด๋Š” ์žฅ๋น„๋„ ๋งŽ์ด ์‚ฌ์šฉ๋˜๊ณ  ์žˆ๋‹ค

  • ๊ธฐ์กด์— Router๋Š” software๋กœ ๊ตฌํ˜„ํ•˜๊ณ , switch๋Š” hardware๋กœ ๊ตฌํ˜„ํ•˜๋Š” ํ˜•ํƒœ๋กœ ๊ตฌ๋ถ„ํ•˜๊ฑฐ๋‚˜ ๋‹ค์–‘ํ•œ ๊ธฐ๋Šฅ์˜ router์™€ packet์„ ๋นจ๋ฆฌ ๋ณด๋‚ด๋Š” ๋ฐ ์ตœ์ ํ™” ๋œ switch๋กœ ๊ตฌ๋ถ„ํ–ˆ์—ˆ๋‹ค

    • ์ตœ๊ทผ์—๋Š”, ๊ธฐ์ˆ  ๋ฐœ๋‹ฌ๋กœ Router์™€ L3 switch๋ฅผ ๊ตฌ๋ถ„ํ•˜๊ธฐ๋Š” ์–ด๋ ต๋‹ค

      • ์ด ๋ฌธ์„œ์—์„œ ๋งํ•˜๋Š” ๋‚ด์šฉ์€ router๋กœ ์„ค๋ช…ํ•˜๊ณ  ์žˆ์ง€๋งŒ, L3 switch๋กœ๋„ ๋ชจ๋‘ ๋™์ผํ•˜๊ฒŒ ์ ์šฉ๋˜๋Š” ๋‚ด์šฉ์ด๋‹ค!

2. How Does a Router Work?

  • Router๋Š” ๋‹ค์–‘ํ•œ ๊ฒฝ๋กœ ์ •๋ณด๋ฅผ ์ˆ˜์ง‘ํ•ด ์ตœ์ ์˜ ๊ฒฝ๋กœ๋ฅผ routing table์— ์ €์žฅํ•œ ํ›„,

    • packet์ด router๋กœ ๋“ค์–ด์˜ค๋ฉด ๋„์ฐฉ์ง€ IP ์ฃผ์†Œ์™€ routing table์„ ๋น„๊ตํ•ด ์ตœ์„ ์˜ ๊ฒฝ๋กœ๋กœ packet์„ ๋‚ด๋ณด๋‚ธ๋‹ค

  • Switch์™€ ๋ฐ˜๋Œ€๋กœ router๋Š” ๋“ค์–ด์˜จ packet์˜ ๋ชฉ์ ์ง€ ์ฃผ์†Œ๊ฐ€ routing table์— ์—†์œผ๋ฉด packet์„ ๋ฒ„๋ฆฐ๋‹ค

  • Router๋Š” packet forwarding ๊ณผ์ •์—์„œ ๊ธฐ์กด layer 2 header ์ •๋ณด๋ฅผ ์ œ๊ฑฐํ•œ ํ›„ ์ƒˆ๋กœ์šด layer 2 header๋ฅผ ๋งŒ๋“ค์–ด๋‚ธ๋‹ค

  • ์œ„์˜ router ๋™์ž‘ ๋ฐฉ์‹์„ ๊ฒฝ๋กœ ์ง€์ •, Broadcast control, Protocol ๋ณ€ํ™˜์ด๋ผ๊ณ  ํ•œ๋‹ค

2-1. ๊ฒฝ๋กœ ์ง€์ •

  • Router์˜ ๊ฐ€์žฅ ์ค‘์š”ํ•œ ์—ญํ• ์€ ๊ฒฝ๋กœ ์ง€์ •์ด๋‹ค

    • ๊ฒฝ๋กœ ์ •๋ณด๋ฅผ ๋ชจ์•„ routing table์„ ๋งŒ๋“ค๊ณ , packet์„ forwardingํ•œ๋‹ค

      • IP ์ฃผ์†Œ๋Š” network ์ฃผ์†Œ์™€ host ์ฃผ์†Œ๋กœ ๋‚˜๋‰œ ๊ณ„์ธต ๊ตฌ์กฐ๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ์„ค๊ณ„๋˜์–ด local network์™€ ์›๊ฒฉ์ง€ network๋ฅผ ๊ตฌ๋ถ„ํ•  ์ˆ˜ ์žˆ๊ณ , network ์ฃผ์†Œ๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ๊ฒฝ๋กœ๋ฅผ ์ฐพ์•„๊ฐˆ ์ˆ˜ ์žˆ๋‹ค

      • Router๋Š” ์ด IP ์ฃผ์†Œ๋ฅผ ํ™•์ธํ•ด ์›๊ฒฉ์ง€์— ์žˆ๋Š” ์ ์ ˆํ•œ ๊ฒฝ๋กœ๋กœ packet์„ forwardingํ•œ๋‹ค

  • Router๋Š” ๊ฒฝ๋กœ๋ฅผ ์ง€์ •ํ•ด packet์„ forwarding ํ•˜๋Š” ์—ญํ• ์„ ๋‘ ๊ฐ€์ง€๋กœ ๊ตฌ๋ถ„ํ•ด ์ˆ˜ํ–‰ํ•œ๋‹ค

    1. ๊ฒฝ๋กœ ์ •๋ณด๋ฅผ ์–ป๋Š” ์—ญํ• ๊ณผ

    2. ์–ป์€ ๊ฒฝ๋กœ ์ •๋ณด๋ฅผ ํ™•์ธํ•˜๊ณ , packet์„ forwarding ํ•˜๋Š” ์—ญํ• ์ด๋‹ค

  • Router๋Š” ์ž์‹ ์ด ์–ป์€ ๊ฒฝ๋กœ ์ •๋ณด์— ํฌํ•จ๋˜๋Š” packet๋งŒ forwardingํ•˜๋ฏ€๋กœ ์ •ํ™•ํ•œ ๋ชฉ์ ์ง€ ๊ฒฝ๋กœ๋ฅผ ์–ป๋Š” ๊ฒƒ์ด ๋งค์šฐ ์ค‘์š”ํ•˜๋‹ค

Router๊ฐ€ ๊ฒฝ๋กœ ์ •๋ณด๋ฅผ ์–ป๋Š” ๋ฐฉ๋ฒ•

  • IP ์ฃผ์†Œ๋ฅผ ์ž…๋ ฅํ•˜๋ฉด์„œ ์ž์—ฐ์Šค๋Ÿฝ๊ฒŒ ์ธ์ ‘ Network ์ •๋ณด๋ฅผ ์–ป๋Š” ๋ฐฉ๋ฒ•

  • ๊ด€๋ฆฌ์ž๊ฐ€ ์ง์ ‘ ๊ฒฝ๋กœ ์ •๋ณด๋ฅผ ์ž…๋ ฅํ•˜๋Š” ๋ฐฉ๋ฒ•

  • Router๋ผ๋ฆฌ ์„œ๋กœ ๊ฒฝ๋กœ ์ •๋ณด๋ฅผ ์ž๋™์œผ๋กœ ๊ตํ™˜ํ•˜๋Š” ๋ฐฉ๋ฒ•

2-2. Broadcast Control

  • Switch๋Š” packet์˜ ๋„์ฐฉ์ง€ ์ •๋ณด๋ฅผ ๋ชจ๋ฅด๋ฉด ์–ด๋”˜๊ฐ€์— ์กด์žฌํ• ์ง€ ๋ชจ๋ฅผ ์žฅ๋น„์™€์˜ ํ†ต์‹ ์„ ์œ„ํ•ด floodingํ•ด packet์„ ๋ชจ๋“  ํฌํŠธ์— ์ „์†กํ•œ๋‹ค

    • LAN ์–ด๋”˜๊ฐ€์— ๋„์ฐฉ์ง€๊ฐ€ ์žˆ์„ ์ˆ˜ ์žˆ๋‹ค๊ณ  ๊ฐ€์ •ํ•˜๊ณ  packet์„ ์ „์ฒด network์— flooding ํ•˜๋Š” ๊ฒƒ์ด ์“ธ๋ชจ์—†๋Š” packet์ด ์ „์†Œ์˜ค๋””์–ด ์ „์ฒด network์˜ ์„ฑ๋Šฅ์— ๋ฌด๋ฆฌ๊ฐ€ ๊ฐˆ ์ˆ˜ ์žˆ๋‹ค๊ณ  ์ƒ๊ฐํ•  ์ˆ˜ ์žˆ์ง€๋งŒ,

      • LAN์€ ํฌ๊ธฐ๊ฐ€ ์ž‘์•„ flooding์— ๋Œ€ํ•œ ์˜ํ–ฅ์ด ์ž‘๊ณ ,

      • ๋„์ฐฉ์ง€ network interface card(NIC)์—์„œ ์ž์‹ ์˜ ์ฃผ์†Œ์™€ packet ๋„์ฐฉ์ง€ ์ฃผ์†Œ๊ฐ€ ๋‹ค๋ฅด๋ฉด packet์„ ๋ฒ„๋ฆฌ๊ธฐ ๋•Œ๋ฌธ์— ์ด๋Ÿฐ flooding ์ž‘์—…์€ network์— ํฐ ๋ฌด๋ฆฌ๋ฅผ ์ฃผ์ง€ ์•Š๋Š”๋‹ค

  • ๋ฐ˜๋ฉด Router๋Š” packet์„ ์›๊ฒฉ์ง€๋กœ ๋ณด๋‚ด๋Š” ๊ฒƒ์„ ๋ชฉํ‘œ๋กœ ๊ฐœ๋ฐœ๋˜์–ด Layer 3์—์„œ ๋™์ž‘ํ•˜๊ณ , ๋ถ„๋ช…ํ•œ ๋„์ฐฉ์ง€ ์ •๋ณด๊ฐ€ ์žˆ์„ ๋•Œ๋งŒ ํ†ต์‹ ์„ ํ—ˆ๋ฝํ•œ๋‹ค

    • Internet ์—ฐ๊ฒฐ์€ ๋Œ€๋ถ€๋ถ„ ์ง€์ •๋œ ๋Œ€์—ญํญ๋งŒ ๋นŒ๋ ค ์‚ฌ์šฉํ•˜๋ฏ€๋กœ, ์“ธ๋ชจ์—†๋Š” ํ†ต์‹ ์ด network๋ฅผ ์ฐจ์ง€ํ•˜๋Š” ๊ฒƒ์„ ์ตœ๋Œ€ํ•œ ๋ง‰์œผ๋ ค๊ณ  ๋…ธ๋ ฅํ•œ๋‹ค

      • ๋งŒ์•ฝ LAN์—์„œ switch๊ฐ€ ๋™์ž‘ํ•˜๋Š” ๊ฒƒ์ฒ˜๋Ÿผ

        • ๋ชฉ์ ์ง€๊ฐ€ ์—†๊ฑฐ๋‚˜

        • ๋ช…ํ™•ํ•˜์ง€ ์•Š์€ packet์ด flooding ๋œ๋‹ค๋ฉด,

      • Internet์— ์“ธ๋ชจ ์—†๋Š” packet์ด ๊ฐ€๋“ ์ฐจ ํ†ต์‹ ๋ถˆ๋Šฅ ์ƒํƒœ๊ฐ€ ๋  ์ˆ˜ ์žˆ๋‹ค

  • Router๋Š” ๋ฐ”๋กœ ์—ฐ๊ฒฐ๋˜์–ด ์žˆ๋Š” network ์ •๋ณด๋ฅผ ์ œ์™ธํ•˜๊ณ  ๊ฒฝ๋กœ ์Šต๋“ ์„ค์ •์„ ํ•˜์ง€ ์•Š์œผ๋ฉด packet์„ forwarding ํ•  ์ˆ˜ ์—†๋‹ค

    • Router์˜ ๊ธฐ๋ณธ ๋™์ž‘์€ multicast ์ •๋ณด๋ฅผ ์Šต๋“ํ•˜์ง€ ์•Š๊ณ , broadcast packet์„ ์ „๋‹ฌํ•˜์ง€ ์•Š๋Š”๋‹ค

      • Router์˜ ์ด ๊ธฐ๋Šฅ์„ ์ด์šฉํ•ด broadcast๊ฐ€ ๋‹ค๋ฅธ network๋กœ ์ „ํŒŒ๋˜๋Š” ๊ฒƒ์„ ๋ง‰์„ ์ˆ˜ ์žˆ๋‹ค

        • ์ด ๊ธฐ๋Šฅ์„ Broadcast / Multicast Control ์ด๋ผ๊ณ  ํ•œ๋‹ค

    • Network์— broadcast๊ฐ€ ๋งŽ์ด ๋ฐœ์ƒํ•˜๋Š” ๊ฒฝ์šฐ, router๋กœ network๋ฅผ ๋ถ„๋ฆฌํ•˜๋ฉด broadcast network๋ฅผ ๋ถ„ํ• ํ•ด network ์„ฑ๋Šฅ์„ ๋†’์ผ ์ˆ˜ ์žˆ๋‹ค

2-3. Protocol ๋ณ€ํ™˜

  • Router์˜ ๋˜ ๋‹ค๋ฅธ ์—ญํ• ์€ ์„œ๋กœ ๋‹ค๋ฅธ protocol๋กœ ๊ตฌ์„ฑ๋œ network๋ฅผ ์—ฐ๊ฒฐํ•˜๋Š” ๊ฒƒ์ด๋‹ค

  • ํ˜„๋Œ€ network๋Š” Ethernet์œผ๋กœ ์ˆ˜๋ ด๋˜๊ธฐ ๋•Œ๋ฌธ์— protocol ๋ณ€ํ™˜์˜ ์—ญํ• ์ด ๋งŽ์ด ์ค„์—ˆ์ง€๋งŒ, ๊ณผ๊ฑฐ์—๋Š” LAN์—์„œ ์‚ฌ์šฉํ•˜๋Š” protocol๊ณผ WAN์—์„œ ์‚ฌ์šฉํ•˜๋Š” protocol์ด ์ „ํ˜€ ๋‹ค๋ฅธ, ์™„์ „ํžˆ ๊ตฌ๋ถ„๋œ ๊ณต๊ฐ„์ด์—ˆ๋‹ค

    • LAN์€ ๋‹ค์ˆ˜์˜ ์ปดํ“จํ„ฐ๊ฐ€ ์„œ๋กœ ํ†ต์‹ ํ•˜๋Š” ๋ฐ ์ดˆ์ ์„ ๋งž์ถ”์—ˆ๊ณ , WAN์€ ์›๊ฑฐ๋ฆฌ ํ†ต์‹ ์ด ๋ชฉ์ ์ด์—ˆ๋‹ค

    • LAN ๊ธฐ์ˆ ์ด WAN ๊ธฐ์ˆ ๋กœ ๋ณ€ํ™˜๋˜์–ด์•ผ๋งŒ Internet๊ณผ ๊ฐ™์€ ์›๊ฒฉ์ง€ ๋„คํŠธ์›Œํฌ์™€์˜ ํ†ต์‹ ์ด ๊ฐ€๋Šฅํ–ˆ๊ณ , ์ด ์—ญํ• ์„ Router๊ฐ€ ๋‹ด๋‹นํ–ˆ๋‹ค

  • Router๋Š” Layer 3์—์„œ ๋™์ž‘ํ•˜๋Š” ์žฅ๋น„์ด๋ฏ€๋กœ Layer 3 ์ฃผ์†Œ ์ •๋ณด๋ฅผ ํ™•์ธํ•˜๊ณ , ๊ทธ ์ •๋ณด๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ๋™์ž‘ํ•œ๋‹ค

    • Router์— packet์ด ๋“ค์–ด์˜ค๋ฉด Layer 2๊นŒ์ง€์˜ header ์ •๋ณด๋ฅผ ๋ฒ—๊ฒจ๋‚ด๊ณ  Layer 3 ์ฃผ์†Œ๋ฅผ ํ™•์ธํ•œ ํ›„ Layer 2 hearder ์ •๋ณด๋ฅผ ์ƒˆ๋กœ ๋งŒ๋“ค์–ด ์™ธ๋ถ€๋กœ ๋‚ด๋ณด๋‚ธ๋‹ค

      • ๊ทธ๋ž˜์„œ router์— ๋“ค์–ด์˜ฌ ๋•Œ์˜ packet Layer 2 header ์ •๋ณด์™€ ๋‚˜๊ฐˆ ๋•Œ์˜ packet Layer 2 ์ •๋ณด๊ฐ€ ๋‹ค๋ฅธ ๊ฒƒ์ด๋‹ค

      • ์ด ๊ธฐ๋Šฅ์„ ์ด์šฉํ•˜๋ฉด ์ „ํ˜€ ๋‹ค๋ฅธ ๊ธฐ์ˆ  ๊ฐ„ ๋ณ€ํ™˜์ด ๊ฐ€๋Šฅํ•˜๋‹ค!

3. ๊ฒฝ๋กœ ์ง€์ • - Routing/Switch

  • Router๊ฐ€ packet์„ ์ฒ˜๋ฆฌํ•  ๋•Œ๋Š” ํฌ๊ฒŒ ๋‘ ๊ฐ€์ง€ ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•œ๋‹ค

    1. ๊ฒฝ๋กœ ์ •๋ณด๋ฅผ ์–ป์–ด ๊ฒฝ๋กœ ์ •๋ณด๋ฅผ ์ •๋ฆฌํ•˜๋Š” ์—ญํ• 

    2. ์ •๋ฆฌ๋œ ๊ฒฝ๋กœ ์ •๋ณด๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ packet์„ forwarding ํ•˜๋Š” ์—ญํ• 

  • Router๋Š” ์ž์‹ ์ด ๋ถ„๋ช…ํžˆ ์•Œ๊ณ  ์žˆ๋Š” ์ฃผ์†Œ๊ฐ€ ์•„๋‹Œ ๋ชฉ์ ์ง€๋ฅผ ๊ฐ€์ง„ packet์ด ๋“ค์–ด์˜ค๋ฉด ํ•ด๋‹น packet์„ ๋ฒ„๋ฆฌ๋ฏ€๋กœ, ๋“ค์–ด์˜ค๊ธฐ ์ „์— ๊ฒฝ๋กœ ์ •๋ณด๋ฅผ ์ถฉ๋ถ„ํžˆ ์ˆ˜์ง‘ํ•˜๊ณ  ์žˆ์–ด์•ผ router๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ๋™์ž‘ํ•œ๋‹ค

    • Router๋Š” ๋ณต์žกํ•˜๊ณ  ๋งŽ์€ ๊ฒฝ๋กœ ์ •๋ณด๋ฅผ ์–ป์–ด ์ตœ์ ์˜ ๊ฒฝ๋กœ ์ •๋ณด์ธ routing table์„ ์ ์ ˆํžˆ ์œ ์ง€ํ•ด์•ผ ํ•œ๋‹ค

  • Router๋Š” ๋‹ค์–‘ํ•˜๊ณ  ๋งŽ์€ ๊ฒฝ๋กœ ์ •๋ณด๋ฅผ ์–ป์„ ์ˆ˜ ์žˆ์ง€๋งŒ, ์›ํ•˜๋Š” ๋ชฉ์ ์ง€ ์ •๋ณด์™€ ์ •ํ™•ํžˆ ์ผ์น˜ํ•˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ๊ฐ€ ๋” ๋งŽ๋‹ค

    • Router๋Š” subnet ๋‹จ์œ„๋กœ routing ์ •๋ณด๋ฅผ ์Šต๋“ํ•˜๊ณ , routing ์ •๋ณด๋ฅผ ์ตœ์ ํ™”ํ•˜๊ธฐ ์œ„ํ•ด summary ์ž‘์—…์„ ํ†ตํ•ด ์—ฌ๋ ค ๊ฐœ์˜ subnet ์ •๋ณด๋ฅผ ๋ญ‰์ณ ์ „๋‹ฌ ํ•œ๋‹ค

      • ๊ทธ๋ž˜์„œ router์— ๋“ค์–ด์˜จ packet์˜ ๋ชฉ์ ์ง€ ์ฃผ์†Œ์™€ router๊ฐ€ ๊ฐ–๊ณ  ์žˆ๋Š” routing table ์ •๋ณด๊ฐ€ ์ •ํ™•ํžˆ ์ผ์น˜ํ•˜์ง€ ์•Š๋”๋ผ๋„ (not exact match), ์ˆ˜๋งŽ์€ ์ •๋ณด ์ค‘ ๋ชฉ์ ์ง€์— ๊ฐ€์žฅ ๊ทผ์ ‘ํ•œ ์ •๋ณด๋ฅผ ์ฐพ์•„ packet์„ forwarding ํ•ด์•ผํ•œ๋‹ค

3-1. Routing ๋™์ž‘๊ณผ Routing Table

  • ํ˜„๋Œ€ network์—์„œ๋Š” ๋‹จ๋ง๋ถ€ํ„ฐ ๋ชฉ์ ์ง€๊นŒ์ง€์˜ ๊ฒฝ๋กœ๋ฅผ ๋ชจ๋‘ ์ฑ…์ž„์ง€๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋ผ ์ธ์ ‘ํ•œ router๊นŒ์ง€๋งŒ ๊ฒฝ๋กœ๋ฅผ ์ง€์ •ํ•˜๋ฉด,

    • ์ธ์ ‘ router์—์„œ ์ตœ์ ์˜ ๊ฒฝ๋กœ๋ฅผ ํŒŒ์•…ํ•œ ํ›„,

    • router๋กœ packet์„ forwarding ํ•œ๋‹ค

  • Network๋ฅผ ํ•œ ๋‹จ๊ณ„์”ฉ ๋›ฐ์–ด๋„˜๋Š”๋‹ค๋Š” ์˜๋ฏธ๋กœ ์ด ๊ธฐ๋ฒ•์„ Hop by Hop routing์ด๋ผ๊ณ  ๋ถ€๋ฅด๊ณ , ์ธ์ ‘ํ•œ router๋ฅผ Next Hop์ด๋ผ๊ณ  ๋ถ€๋ฅธ๋‹ค

    • Router๋Š” packet์ด ๋ชฉ์ ์ง€๋กœ ๊ฐ€๋Š” ์ „์ฒด ๊ฒฝ๋กœ๋ฅผ ํŒŒ์•…ํ•˜์ง€ ์•Š๊ณ , ์ตœ์ ์˜ next hop์„ ์„ ํƒํ•ด ๋ณด๋‚ด์ค€๋‹ค

Next Hop์„ ์ง€์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•

  1. ๋‹ค์Œ router์˜ IP๋ฅผ ์ง€์ • (Next hop IP address)

  2. Router์˜ outbound interface๋ฅผ ์ง€์ •

  3. Router์˜ outbound interface์™€ ๋‹ค์Œ router์˜ IP๋ฅผ ๋™์‹œ์— ์ง€์ •

  • Router์—์„œ next hop์„ ์ง€์ •ํ•  ๋•Œ๋Š” ์ผ๋ฐ˜์ ์œผ๋กœ ์ƒ๋Œ€๋ฐฉ router์˜ Interface IP address๋ฅผ ์ง€์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์‚ฌ์šฉํ•œ๋‹ค

  • ํŠน์ˆ˜ํ•œ ๊ฒฝ์šฐ์—๋งŒ router์˜ outbound interface๋ฅผ ์ง€์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์“ธ ์ˆ˜ ์žˆ๋Š”๋ฐ, ์ƒ๋Œ€๋ฐฉ์˜ next hop IP๋ฅผ ๋ชจ๋ฅด๋”๋ผ๋„ MAC ์ฃผ์†Œ ์ •๋ณด๋ฅผ ์•Œ์•„๋‚ผ ์ˆ˜ ์žˆ์„ ๋•Œ๋งŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค

    • ํŠน์ˆ˜ํ•œ ๊ฒฝ์šฐ๋“ค

      1. WAN ๊ตฌ๊ฐ„ ์ „์šฉ์„ ์—์„œ PPP(Point-to-Point)๋‚˜ HLDC(High Level Datalink Control)์™€ ๊ฐ™์€ protocol์„ ์‚ฌ์šฉํ•ด ์ƒ๋Œ€๋ฐฉ์˜ MAC ์ฃผ์†Œ๋ฅผ ์•Œ ํ•„์š”๊ฐ€ ์—†์„ ๋•Œ

      2. ์ƒ๋Œ€๋ฐฉ router์—์„œ proxy ARP๊ฐ€ ๋™์ž‘ํ•ด ์ •ํ™•ํ•œ IP ์ฃผ์†Œ๋ฅผ ๋ชจ๋ฅด๋”๋ผ๋„ ์ƒ๋Œ€๋ฐฉ์˜ MAC ์ฃผ์†Œ๋ฅผ ์•Œ ์ˆ˜ ์žˆ์„ ๋•Œ

        • ARP๋ž€?

          • Address Resolution Protocol

          • ์ƒ๋Œ€๋ฐฉ์˜ MAC ์ฃผ์†Œ๋ฅผ ์•Œ์•„๋‚ด๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉ๋˜๋Š” protocol

  • Router๊ฐ€ packet์„ ์–ด๋””๋กœ forwardingํ• ์ง€ ๊ฒฝ๋กœ๋ฅผ ์„ ํƒํ•  ๋•Œ๋Š” ์ถœ๋ฐœ์ง€๋ฅผ ๊ณ ๋ คํ•˜์ง€ ์•Š๋Š”๋‹ค

    • ์ถœ๋ฐœ์ง€์™€ ์ƒ๊ด€์—†์ด ๋ชฉ์ ์ง€ ์ฃผ์†Œ์™€ routing table์„ ๋น„๊ตํ•ด ์–ด๋Š ๊ฒฝ๋กœ๋กœ forwarding ํ• ์ง€ ๊ฒฐ์ •ํ•œ๋‹ค

      • ๊ทธ๋ž˜์„œ routing table์„ ๋งŒ๋“ค ๋•Œ

        • ๋ชฉ์ ์ง€ ์ •๋ณด๋งŒ ์ˆ˜์ง‘ํ•˜๊ณ ,

        • packet์ด ๋“ค์–ด์˜ค๋ฉด ๋ชฉ์ ์ง€ ์ฃผ์†Œ๋ฅผ ํ™•์ธํ•ด

        • packet์„ next hop์œผ๋กœ forwardingํ•œ๋‹ค

Routing Table์— ์ €์žฅํ•˜๋Š” data

  1. ๋ชฉ์ ์ง€ ์ฃผ์†Œ

  2. Next hop IP ์ฃผ์†Œ, local outbound interface (optional!)

  • Router์—์„œ packet์˜ ์ถœ๋ฐœ์ง€ ์ฃผ์†Œ๋ฅผ ์ด์šฉํ•ด routing ํ•˜๋„๋ก PBR (Policy-Based Routing) ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์ง€๋งŒ, ๋ชฉ์ ์ง€ ์ฃผ์†Œ๋งŒ ์ˆ˜์ง‘ํ•˜๋Š” routing table๋กœ๋Š” ์ด ๊ธฐ๋Šฅ์„ ํ™œ์„ฑํ™” ํ•  ์ˆ˜ ์—†๊ณ , router ์ •์ฑ…๊ณผ ๊ด€๋ จ๋œ ๋ณ„๋„ ์„ค์ •์ด ํ•„์š”ํ•˜๋‹ค

    • PBR ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•˜๋ฉด ๊ด€๋ฆฌ๊ฐ€ ์–ด๋ ค์›Œ์ง€๊ณ , ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•˜๋ฉด ํ•ด๊ฒฐ์ด ์–ด๋ ค์šฐ๋ฏ€๋กœ ํŠน๋ณ„ํ•œ ๋ชฉ์ ์œผ๋กœ๋งŒ ์‚ฌ์šฉํ•œ๋‹ค

๋ฃจํ”„๊ฐ€ ์—†๋Š” (Loop Free) Layer 3: TTL (Time To Live)

  • Layer 3์˜ IP header์—๋Š” TTL ์ด๋ผ๋Š” field๊ฐ€ ์žˆ๋‹ค

    • ์ด field๋Š” packet์ด network์— ์‚ด์•„ ์žˆ์„ ์ˆ˜ ์žˆ๋Š” ์‹œ๊ฐ„(Hop)์„ ์ œํ•œํ•œ๋‹ค!

  • Internet ๊ตฌ๊ฐ„์—์„œ ์“ธ๋ชจ์—†๋Š” packet์ด ๋Œ์•„๋‹ค๋…€ ๋Œ€์—ญํญ์„ ๋‚ญ๋น„ํ•˜๋Š” ๊ฒƒ์„ ๋ง‰๊ธฐ ์œ„ํ•ด router๋Š” ์ฃผ์†Œ๊ฐ€ ๋ถˆ๋ถ„๋ช…ํ•œ packet์„ ๋ฒ„๋ฆฐ๋‹ค

  • but, ์šด์˜๋˜๋˜ ์‚ฌ์ดํŠธ๊ฐ€ ๊ฐ‘์ž๊ธฐ ์—†์–ด์ง€๋Š” ๊ฒฝ์šฐ๊ฐ€ ์ƒ๊ธธ ์ˆ˜ ์žˆ๊ณ , ๋Œ€์•ˆ ๊ฒฝ๋กœ๋ฅผ ์ฐพ๋‹ค๊ฐ€ ์ˆœ๊ฐ„์ ์œผ๋กœ ๋งˆ์ฃผ๋ณด๋Š” ๋‘ ๋Œ€์˜ router์˜ next hop์ด ๊ฐ๊ฐ ์ƒ๋Œ€๋ฐฉ์œผ๋กœ ๊ตฌ์„ฑ๋˜์–ด packet์ด ๋‘ router ์‚ฌ์ด์—์„œ ๊ณ„์† ์˜ค๊ฐ€๋Š” ๊ฒฝ์šฐ๊ฐ€ ์ƒ๊ธธ ์ˆ˜๋„ ์žˆ๋‹ค

    • ์ด๋Ÿด ๊ฒฝ์šฐ ๋‘ router ๊ฐ„์˜ ์ž˜๋ชป๋œ routing์œผ๋กœ L3 Loop๊ฐ€ ๋ฐœ์ƒํ•˜๊ฒŒ ๋œ๋‹ค

  • ์ด๋ ‡๊ฒŒ packet์ด ์˜๊ตฌ์ ์œผ๋กœ ์‚ฌ๋ผ์ง€์ง€ ์•Š๋Š”๋‹ค๋ฉด, ์žฅ๋น„ ๊ฐ„์— ๋™์ผํ•œ packet์ด ping-pong์„ ์น˜๊ฑฐ๋‚˜ Internet์— ์‚ฌ๋ผ์ง€์ง€ ์•Š๋Š” ์œ ๋ น packet์ด ๋„˜์ณ๋‚  ๊ฒƒ์ด๋‹ค

    • ๊ทธ๋ž˜์„œ, ๋ชจ๋“  packet์€ TTL์ด๋ผ๋Š” ์ˆ˜๋ช…๊ฐ’์„ ๊ฐ€์ง€๊ณ  ์žˆ๊ณ , ์ด ๊ฐ’์ด 0์ด ๋˜๋ฉด Network ์žฅ๋น„์—์„œ ๋ฒ„๋ ค์ง„๋‹ค

  • ์—ฌ๊ธฐ์„œ TTL์€ ์‹ค์ œ ์ดˆ์™€ ๊ฐ™์€ ์‹œ๊ฐ„ ์ด ์•„๋‹ˆ๋ผ, hop ์„ ์ง€์นญํ•˜๋ฉฐ, ํ•˜๋‚˜์˜ hop ์„ ์ง€๋‚  ๋•Œ๋งˆ๋‹ค TTL ๊ฐ’์€ 1์”ฉ ์ค„์–ด๋“ ๋‹ค

3-2. Routing (Router๊ฐ€ ๊ฒฝ๋กœ ์ •๋ณด๋ฅผ ์–ป๋Š” ๋ฐฉ๋ฒ•)

Router๊ฐ€ ๊ฒฝ๋กœ ์ •๋ณด๋ฅผ ์–ป๋Š” ๋ฐฉ๋ฒ•์€ ํฌ๊ฒŒ 3๊ฐ€์ง€๋กœ ๊ตฌ๋ถ„ํ•  ์ˆ˜ ์žˆ๋‹ค

  1. Direct Connected

  2. Static Routing

  3. Dynamic Routing

์œ„์˜ 3๊ฐ€์ง€ ๋ฐฉ๋ฒ•์„ ์ด์šฉํ•ด ๊ฒฝ๋กœ ์ •๋ณด๋ฅผ ์ˆ˜์ง‘ํ•˜๊ณ , ์ˆ˜์ง‘๋œ ๊ฒฝ๋กœ ์ •๋ณด ์ค‘ ๋ชฉ์ ์ง€์— ๋Œ€ํ•œ ์ตœ์ ์˜ ๊ฒฝ๋กœ๋ฅผ ์„ ์ •ํ•ด Routing Table์„ ๋งŒ๋“ ๋‹ค

1. Direct Connected

  • IP ์ฃผ์†Œ๋ฅผ ์ž…๋ ฅํ•  ๋•Œ ์‚ฌ์šฉ๋œ IP ์ฃผ์†Œ์™€ Subnet mask๋กœ ํ•ด๋‹น IP ์ฃผ์†Œ๊ฐ€ ์†ํ•œ Network ์ฃผ์†Œ ์ •๋ณด๋ฅผ ์•Œ ์ˆ˜ ์žˆ๋‹ค

    • Router๋‚˜ PC์—์„  ์ด ์ •๋ณด๋กœ ํ•ด๋‹น Network์— ๋Œ€ํ•œ Routing Table์„ ์ž๋™์œผ๋กœ ๋งŒ๋“ ๋‹ค

      • ์ด ๊ฒฝ๋กœ ์ •๋ณด๋ฅผ Direct Connected ๋ผ๊ณ  ํ•œ๋‹ค.

  • Direct Connected๋กœ ์ƒ์„ฑ๋˜๋Š” ๊ฒฝ๋กœ ์ •๋ณด๋Š” Interface์— IP๋ฅผ ์„ค์ •ํ•˜๋ฉด ์ž๋™์œผ๋กœ ์ƒ์„ฑ๋˜๋Š” ์ •๋ณด์ด๋ฏ€๋กœ,

    • ์ •๋ณด๋ฅผ ๊ฐ•์ œ๋กœ ์ง€์šธ ์ˆ˜ ์—†๊ณ ,

    • ํ•ด๋‹น Network ์„ค์ •์„ ์‚ญ์ œํ•˜๊ฑฐ๋‚˜ ํ•ด๋‹น Network Interface๊ฐ€ ๋น„ํ™œ์„ฑํ™”๋˜์–ด์•ผ๋งŒ ์ž๋™์œผ๋กœ ์‚ฌ๋ผ์ง„๋‹ค

2. Static Routing

  • ๊ด€๋ฆฌ์ž๊ฐ€ ๋ชฉ์ ์ง€ Netowrk์™€ Next hop ์„ router์— ์ง์ ‘ ์ง€์ •ํ•ด ๊ฒฝ๋กœ ์ •๋ณด๋ฅผ ์ž…๋ ฅ ํ•˜๋Š” ๊ฒƒ์„ Static Routing ์ด๋ผ๊ณ  ํ•œ๋‹ค

    • Static Routing์€ ๊ด€๋ฆฌ์ž๊ฐ€ ๊ฒฝ๋กœ๋ฅผ ์ง์ ‘ ์ง€์ •ํ•˜๋ฏ€๋กœ, routing ์ •๋ณด๋ฅผ ๋งค์šฐ ์ง๊ด€์ ์œผ๋กœ ์„ค์ •, ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋‹ค

  • Static Routing์€ Direct Connected ์ฒ˜๋Ÿผ ์—ฐ๊ฒฐ๋œ Network Interface ์ •๋ณด๊ฐ€ ์‚ญ์ œ๋˜๊ฑฐ๋‚˜ ๋น„ํ™œ์„ฑํ™”๋˜๋ฉด ์—ฐ๊ด€๋œ Static Routing ์ •๋ณด๊ฐ€ ์ž๋™์œผ๋กœ ์‚ญ์ œ ๋œ๋‹ค.

    • but, Physical Interface๊ฐ€ ์•„๋‹Œ Logical Interface๋Š”, Physical Interface๊ฐ€ ๋น„ํ™œ์„ฑํ™”๋˜๋”๋ผ๋„ ํ•จ๊ป˜ ๋น„ํ™œ์„ฑํ™”๋˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ๋„ ์žˆ์–ด Routing Table์—์„œ ์‚ฌ๋ผ์ง€์ง€ ์•Š์„ ์ˆ˜ ์žˆ๋‹ค.

3. Dynamic Routing

  • Static Routing์€ ๊ด€๋ฆฌ์ž๊ฐ€ ๋ณ€ํ™”๊ฐ€ ์ ์€ network์—์„œ network๋ฅผ ์†์‰ฝ๊ฒŒ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋Š” ์ข‹์€ ๋ฐฉ๋ฒ•์ด์ง€๋งŒ, ํฐ network๋Š” Static Routing ๋งŒ์œผ๋กœ๋Š” ๊ด€๋ฆฌํ•˜๊ธฐ ์–ด๋ ต๋‹ค

    • why?

      • Static Routing ์ ์šฉ ์‹œ ์žฅ์• ๋กœ ์ธํ•œ network ๊ฒฝ๋กœ ๋ฐ˜์˜์ด ๋˜์ง€ ์•Š๋Š”๋‹ค!

        • Static Routing์€ router ๋„ˆ๋จธ ๋‹ค๋ฅธ router์˜ ์ƒํƒœ ์ •๋ณด๋ฅผ ํŒŒ์•…ํ•  ์ˆ˜ ์—†๊ธฐ ๋•Œ๋ฌธ์— router ์‚ฌ์ด์˜ ํšŒ์„ ์ด๋‚˜ router์— ์žฅ์• ๊ฐ€ ๋ฐœ์ƒํ•˜๋ฉด, ์žฅ์•  ์ƒํ™ฉ์„ ํŒŒ์•…ํ•˜๊ณ  ๋Œ€์ฒด ๊ฒฝ๋กœ๋กœ packet์„ ๋ณด๋‚ผ ์ˆ˜ ์—†๊ธฐ ๋•Œ๋ฌธ!

  • Dynamic Routing์€ ์ด๋Ÿฌํ•œ Static Routing ์˜ ๋‹จ์ ์„ ๋ณด์™„ํ•˜์—ฌ, router ๋ผ๋ฆฌ ์ž์‹ ์ด ์•Œ๊ณ  ์žˆ๋Š” ๊ฒฝ๋กœ ์ •๋ณด๋‚˜ ๋งํฌ ์ƒํƒœ ์ •๋ณด๋ฅผ ๊ตํ™˜ํ•ด ์ „์ฒด network ์ •๋ณด๋ฅผ ํ•™์Šตํ•œ๋‹ค

    • ์ฃผ๊ธฐ์  or ์ƒํƒœ ์ •๋ณด๊ฐ€ ๋ณ€๊ฒฝ๋  ๋•Œ router๋ผ๋ฆฌ ๊ฒฝ๋กœ ์ •๋ณด๊ฐ€ ๊ตํ™˜๋˜๋ฏ€๋กœ, router๋ฅผ ์—ฐ๊ฒฐํ•˜๋Š” ํšŒ์„ ์ด๋‚˜ router ์ž์ฒด์— ์žฅ์• ๊ฐ€ ๋ฐœ์ƒํ•˜๋ฉด, ์ด ์ƒํ™ฉ์„ ์ธ์ง€ํ•ด ๋Œ€์ฒด ๊ฒฝ๋กœ๋กœ packet์„ forwarding ํ•  ์ˆ˜ ์žˆ๋‹ค

  • Dynamic Routing ์—์„œ๋Š” ์ž์‹ ์ด ๊ด‘๊ณ ํ•  network๋ฅผ ์„ ์–ธํ•ด์ฃผ์–ด์•ผ ํ•œ๋‹ค

Last updated