4 Network Layer
4.1 Overview of Network layer
router의 기능을 마찬가지로 세 계층으로 나누어 놨음
최종 목표: client host가 server host와 메시지를 주고 받는 것
NW의 traditional router에는 Network layer에 Data Plane과 Control Plane 모두 존재.
host의 router에는 forwarding을 위한 Data Plane만 존재 (forwarding table만 존재). routing protocol 돌리지 않아서 Control Plane은 없음
Datalink layer는 Ethernet, Wifi, fiber optic일 수도, 여러 가지가 있음
Network layer
- network layer protocols in every host & router
host에도 있고, NW router에도 있지만 기능이 다르다.
host는 forwarding만 (Data Plane), router는 Data Plane + Control Plane
- delivers segment from sending to receiving host• on sending host ) encapsulates segments(L4) into datagrams
• on intermediate routers ) forwards datagram(user data in end host), router examines header fields in all IP datagrams (패킷 단위로 delivery 되기 때문에 각 패킷에 있는 헤더를 다 보고 forwarding)
• on receiving host ) decapsulates datagram into segments - router의 핵심. Core Network는 빨리 deliver 하는 게 목적이라 복잡한 일은 그 윗단에서 end host가 처리하도록 함 (Ex. DNS resolution을 host가)
Network layer의 핵심은 host-to-host delivery
NW layer implements the host-to-host communication service.
NW layer is the most complex layers in the protocol stack.
Network service model
end host에서 출발한 user의 data를 어떻게 처리하는가?에 중점
What service does the network layer provide to the transport layer?
네트워크 계층의 목적은 host-to-host delivery. 호스트를 찾아가는 전달 하는 일
최종 고객인 application이 어떤 delivery를 요구?
docs를 받거나 저장된 영상을 부러오는 app이면 loss에 민감, 실시간으로 streaming되는 콘서트나 스포츠 중계하는 app이면 delay나 throughput에 민감
- example services for individual datagrams:
하나의 message를 deliver하는데 요구될 수 있는 것들
- guaranteed delivery ⇒ no loss
- guaranteed delivery with bounded e2e delay ⇒ delay limit
loss가 없지만 최소한 언제까진 도착하도록 요구 - example services for a flow of datagrams:
일련의 message들을 deliver하는데 요구될 수 있는 것들
- in-order datagram delivery
IP가 하지 못 함. TCP가 함
- guaranteed minimum bandwidth to flow ⇒ throughput
throughput-sensitive apps 들이 요구할 수 있음
초당 몇 개는 보낼 수 있도록 요구
- restrictions on changes in inter-packet spacing
늦어도 상관 없지만 패킷 간 간격이 일정한 속도론 오도록 요구
delay variation(delay jitter)가 적어야 함
Core network 의 핵심 delivery 두 가지
- CS (Circuit-switched networks)
- PS (Packet-switched networks)
- VC NW (Virtual Circuit) (ATM)
하나의 link를 논리적으로 나누어 virtual circuit을 설계
Packet switching에 Circuit switching의 장점을 혼합, 실패
Resource reservation: buffer, bandwidth, CPU
Fixed same path for pkts belongs to the same msg)
complexity inside network - Datagram NW (Internet)
smart end systems & simple inside network, complexity at "edge"
복잡한 건 end host가 다 함 (DNS 까지)
"elastic" → no guaranteed band/delay (IP protocol)
= minimal service guarantees
makes it easier to interconnect networks that use very heterogeneous(Ex. Ethernet, Wifi, fiber optic ..) link-layer technologies
(4계층은 동일한 IP프로토콜을 사용하는 3계층들을 지나지만, 3계층은 지나는 hop마다 2계층이 모두 다름. 아무것도 안 해서 다양한 성능을 가진 2계층들을 지나기에 좋음)
- VC NW (Virtual Circuit) (ATM)
- Internet protocol (Datagram packet-switching) 은 패킷들 사이의 관계를 모름 (한 메시지를 구성하고 있는 패킷인지 알 수 없음) ⇒ connectionless (이전 패킷과 무슨 관계인지 신경 x)router에선 congestion에 대한 feedback도 주지 않음 (TCP가 Timeout이나 3 dup-ack으로 congestion을 control)
- no call setup at network layer
transport 계층에서 내려온 segment를 바로 encapsulation - routers: no state about end-to-end connection
한 메시지 안의 여러 패킷 간의 관계에 대해 알고 있지 않음
→ 라우터는 패킷들을 개별적이고(individually), 독립적으로(independently) forwarding - packets forwarded using dest host(IP) address in datagram header, and forwarding table(FIB) at each router
FIB를 보고 패킷들을 개별적이고 독립적으로 forwarding. packet 헤더의 destination addr를 보고, router의 forwarding table(FIB: Forwarding Information Base)를 매치해 output port를 찾아 forwarding (switching). router의 ingress buffer → output buffer
- no call setup at network layer
- Datagram networks (no in-order)
- best effort : 아무것도 보장 해주지 않음
Router (logical)
- 여기서 Packet은 user의 application에서 생성된 data
- Forwarding Table (FIB)에는 user(가입자)의 data가 지나다님 ⇒ forwarding
input port로 들어온 data를 output port로 보내는 과정을 Data Plane이라고 함.
Forwarding table (FIB)은 router의 routing protocol들이 만들어 줌.
- 위는 Control plane(5장). end user는 몰라도 됨, router 운용자가 관심
Control plane에서 지나다니는 routing msg는 SW 엔지니어가 만들어낸 것.
Control plane에서 routing msg를 처리.
Routing Protocol로 Routing Table (RIB)를 만들어 루트 중 Best of best만 FIB로 보냄.
Network layer: data plane, control plane
Data plane (forwarding)
- local, per-router function
- 한 라우터의 input port에 있는 ingress buffer에서 output port에 있는 output buffer로 이동
- forwarding function
Control plane (routing)
- network-wide logic
- 여러 개의 router들을 거쳐 가야 하는 nation wide view
- 라우터들이 메시지를 주고 받으며 source부터 dest까지의 end-to-end path를 결정
- two control-plane approaches:
- traditional routing algorithms:
= destination IP address based forwarding - software-defined networking(SDN)
= generalized forwarding
- traditional routing algorithms:
Interplay between routing and forwarding
- routing algorithm으로 control plane에서 해주는 것
- user data가 왔을 때 data-plane에서 해주는 것.
이 차이는 RIB에서 FIB로 경로 중 best of best만 보내줌
FIB는 host에도 있음 (default router로 한 hop은 보내야 하니까)
FIB에는 destination IP address로 가는 output port 번호가 적혀있음
Forwarding table은 static하게 만들 수 있음 (editing이 가능)
RIB가 경로를 계속 바꿔 FIB에게 전달할 수 있음. but, FIB만 있다면 static하게 고정
Per-router control plane
같은 machine 안에 control plane과 data plane이 모두 있다는 것을 나타낸 그림
control plane은 모든 라우터에 다 들어있다. 라우터들끼리 메시지를 주고 받으며 FIB로 내려보냄
forwarding은 destination ip 주소만 보고 forwarding
⇒ Destination-based forwarding (traditional)
Logically centralized control plane
control plane과 data plane이 분리 되어 있음.
user의 data가 지나가는 data plane들은 physically 모여 있음.
control plane은 remote하게 멀리서 제어 (한 라우터에 있지 x)
control plane이 data plane을 제어하고, data plane은 forwarding만 해줌
⇒ generallized forwarding
4.2 inside a router
Cisco는 유명한 router 개발 업체. 여러 개의 보드로 이루어짐.
주황색은 switch module, 여기서 input port to output port switching을 해줌
빨간색은 control module, 이게 control-plane.
switching speed가 매우 빨라 ingress buffer에서의 delay는 거의 없음.
Queueing delay와 output link의 Band Width 제약이 TI를 높임
Router architecture overview (per-router)
router의 구조는 크게 input port(나오면 output port가 될 수도 있음), output port, switching, routing protocol이 돌아가는 routing processor
control plane은 SW를 처리하기 때문에 속도가 느림
data plane은 hardware 상으로 user data를 지나가게 하므로 거의 속도가 빠름
(ingress buffer에서 패킷 열어 보는 건 software적으로 처리하고 따로 모듈 있음)