Network Layer

미노·2025년 6월 12일

Computer Network

목록 보기
16/23

Goal

  • Transport layer에서 만들어진 pkt, datagram을 어떤 경로로 destination에게 보낼지를 결정 → Routing

2 key network-layer functions

  • routing : source에서 destination으로 어떻게 보낼지 전체 경로를 짜는 프로세스
  • forwarding : routing된 경로를 따라 pkt을 보낼 때, 각각의 router에서 어디로 보낼지를 결정하는 프로세스

Network layer : data plane, control plane

  • Data plane : 하나의 라우터에서 어떻게 forwarding을 할 것인가?, forwarding을 수행
  • Control plane : routing을 수행
    • traditional routing algorithm : 각각의 router에는 forwarding을 해야하는 table이 있음
      • 테이블이 새롭게 수정되면 이를 업데이트 하기가 어려움
    • SDN (software-defined-networking) : 위의 방식을 소프트웨어로 정의하다보니, 업데이트가 용이

Router architecture overview

  • 라우터의 구조 :
    • routing processor : Input port로 부터 들어오는 Datagram의 헤더를 확인하여 어느 output port로 내보낼지를 관리, 즉 routing을 관리 → control plane의 영역
    • router input, output port : Datagram이 들어오고 나가는 port
    • high-speed switching fabric

Input port functions

  • line termination : physical layer
  • link layer protocol : link layer, ethernet
  • queue : physical - link layer로 부터 들어오는 datagram이 쌓이는 buffer
    • forwarding 되는 속도보다 들어오는 Datagram이 더 많으면 패킷이 쌓이게 됨 → queueing
    • forwarding은 input port memory 내부에 있는 forwarding table에 의해 outport가 결정이 되는데, 이는 두 가지 방식이 있음.
    • destination-based forwarding : Datagram의 header의 값들 중 destination의 주소만 확인한 후 output port를 결정 → 옛날방식
    • generalized forwarding : Datagram의 header의 여러 값들을 보고 보냄. 더욱 잘 고를 수 있음

Destination-based forwarding

  • forwarding table에는 주소의 범위에 따른 output port가 정해져있음
  • ‘*’은 어느 값이 와도 상관이 없다는 의미

Longest prefix matching

  • header의 destination의 ip와 가장 많이 match되는 링크를 결정함

  • 첫 번째 주소는 Link interface 0번으로 결정이 됨
  • 두 번째 주소는 Link interface 1번으로 결정이 됨

Switching fabrics

  • pkt을 input buf → output buf로 전달
  • switching rate : input → output으로 전송되는 속도의 비율
  • 세 가지 방식이 있음

Memory, Bus, Interconnection network

  • memory : 가장 오래된 방식
  • bus : 공유버스를 사용
  • interconnection network : 모든 길을 만들어 놓음

Switching via a memory

  • input port에서 memory에 pkt을 옮겼다가 → Copy
  • output port에서 memory에 있는 pkt을 가져감 → Paste
  • 복사하고 옮기는데 시간이 걸림 → memory bandwidth에 따라 성능이 달라짐
  • 두 번 작업이 일어남 → 낭비하는 자원이 발생

Switching via a bus

  • 공유버스를 통해 pkt switching이 발생
  • bus connection : bus의 bandwidth에 따라 속도가 결정이 됨

Switching via interconnection network

  • bus의 단점을 극복하기 위해 고안된 방식
  • 여러개의 bus를 교차시켜 각각의 포트와 이어지게 만듦 → H/W 구성이 더 복잡해짐
  • 만약 N x N 이라면 computation delay가 발생
  • 보안도 강력해짐 → 다른 포트의 라인을 볼 수 없음

Input port queueing

  • Input port로 들어오는 Datagram보다 switch fabric의 처리량이 적으면 queueing이 발생한다.
  • HOL (Head-of-the-Line) blocking : 큐의 앞에 있는 datagram이 나가기 전까지 뒤의 datagram들은 나갈 수 없음.

Output port queueing

  • buffering : output port에서 transmission되는 속도보다 더 빠르게 들어올 때 발생
    • Datagram은 loss 될 수 있음
  • scheduling discipline (policy): 큐에 쌓여진 datagram들 중 스케줄링하여 내보냄
  • 적절한 버퍼의 크기가 중요함

How much buffering?

  • 버퍼의 크기를 얼마로 정해야 라우터가 괜찮을까?
  • rule of thumb : 대략적인 관계식
RTTCNRTT \cdot C \over \sqrt N
  • buf size : RTT * C
  • buf size를 증가시키면 delay가 증가함
  • RTT가 길어지게 되면 실시간 서비스가 느려지게 됨

Buffer management

  • drop : output queue가 가득찼을 때 무엇부터 버릴지
    • tail drop : 맨 뒤에 온 것을 버림
    • prioirty : 우선순위가 낮은 것을 버림

Packet scheduling : FCFS (First Come First Served)

  • 먼저 온 패킷이 먼저 전송이 됨 (FIFO)
  • high priority queue에 있는 pkt 먼저 전송 → low priority queue pkt은 계속 기다려야함

Packet scheduling : RR (Round Robin)

  • 우선순위에 관계없이 무작위로 queue를 번갈아가면서 pkt을 전송
  • 버퍼들간의 우선순위가 없음, 먼저 들어온 pkt이어도 늦게 나갈 수가 있음

Packet scheduling : WFQ (weighted fair queueing)

  • RR 방식에 우선순위를 부여함 → 우선순위가 낮더라도 처리가 되어야 하기 때문 (for quality of service)
  • waiting factor : queue에 우선순위를 부여 할 인자 → wf의 합은 1임
  • Q : waiting factor가 각 queue마다 동등하다면?
    • A : RR 방식과 동일

Internet Protocol

Internet Protocol

0개의 댓글