Computer Network CH4 Network Layer Data plane
Computer Network CH4 network layer data plane
Network layer: our goals
understand principles behind network layer services, focusing on data plane:
- network layer service models
- forwarding versus routing
- how a router works
- addressing
- generalized forwarding
- Internet architecture
instantiation, implementation in the Internet
- IP protocol
- NAT, middleboxes
question for CH3:TCP receiver
會延遲回復ACK
- 500ms,delay ack
- 之後一次回覆連續的ACK,避免網路中都是ACK的訊息
如果有封包沒收到,後續收到的封包都會回傳那個沒收到封包的series number
- 對於傳送端而言就是duplicate
- 會進行重傳
network layer: overview
Network-layer services and protocols
sender:
- 封裝segments變成datagram
receiver:
- 丟給transport layer
- Ip datagram解封裝
internet的host每個都有network layer protocol
routers:
- check header fields of each datagram
- from input to output
functions
- forwarding
- 知道甚麼來源的IP要丟到哪裡?
- routing
- 決定從source 到 destination要走哪裡
Network layer: data plane, control plane
based source IP and destination IP from datagram to decide which port to go
Data plane:
- local, per-router function
- determines how datagram arriving on router input port is forwarded to router output port
Control plane
- network-wide logic
- determines how datagram is routed among routers along end-end path from source host to destination host
two control-plane approaches:
- 規劃整個datagram的路徑
- traditional routing algorithms: implemented in routers
- software-defined networking (SDN): implemented in (remote) servers
network service model
Ex.
- individual of datagram
- guaranteed delivery
- for a flow of datagram
- in-order datagram delivery
- gurantee minimum bandwith to flow
- …
Best effort網際網路在使用的
- No guarantees on:
- successful datagram delivery to destination
- timing or order of delivery
- bandwidth available to end-end flow
其他不會考(看過就好)
reflection on best-effort service
for most of the time
- provisioning bandwith
What’s inside a router?
router architecture overview
each router has a routing processor
input port function p4.16
input port queueing
- datagram進入速度大於forwarding rate
forwarding method
Destination-based
最長前綴匹配(這個方法不重要)
- 盡量匹配最長的情況
switching fabrics
via memory
- 1st generation
- traditional
- speed depends on memory bandwith
- 2 bus crossing per datagram
via bus
- speed limited by bus bandwith
- 32Gps bus, Cisco 5600
via interconnection network
- multistage switch
- n*n switch from multiple stages of smaller switches
- speed up , via parallel
input port queueing
If switch fabric slower than input ports combined -> queueing may occur at input queues
- queueing delay and loss due to input buffer overflow!
Head-of-the-Line (HOL) blocking: queued datagram at front of queue prevents others in queue from moving forward
output port queueing
How much buffering?
Buffer Management
packet scheduling FCFS
決定哪個封包接下來會被送向link
FCFS
- first come, first served
priority sheduling
- 封包有不同的優先權
- 根據優先權做分類
- 根據優先權做分類
如果已經處理,就繼續執行
但如果有封包同時進來
- 根據優先權排序
Round Robin scheduling
- 會輪流的傳遞不同優先度的封包
- weighted fair queueing
- 每個cycle分配給不同優先權封包的時間,基於各個優先權的權重
- minimum bandwith guarantee
sidebar: network neutrality(看過就好 偏無聊)
網路中立性
- 只要合法,ISP業者就應該中立
- 不能歧視
不考這個小節的名詞解釋
ISP?(不重要)
ISP業者究竟是提供甚麼東西?
IP:the internet protocol
network layer
Internet
- host, router network layer functions:
- path-selection algo.
- decide how packet go
- put to forwarding table
IP datagram format
IPV4
- IP address
- 32 bits
- 32 bits
packet length最大長度是1500 bytes
- 因為使用的是etherNet
- 這種網路中一個最大的傳送單位就是1500 bytes
overhead
- IP有五列總共5*4 = 20 bytes
IP addressing: introduction
子網路的高bit會一樣
- 223.1.1.1
- 223.1.1.2
每一個host可以有多個interface
- connection between host/router and physical link
- 前提是有多張網卡
subnet
中間沒有其他中介的路由器
- 有相同的high level class
IP address structure
- subnet part
- same high order bit
- host part
- low order bit
- low order bit
Recipe for defining subnets:
- detach each interface from its host or router, creating “islands” of isolated networks
- each isolated network is called a subnet
Ex.
- 223.1.3.0/24
- 24代表前24個bits 是subnet part
- 24代表前24個bits 是subnet part
CIDR
how to get one ip
host如何取得
DHCP
- 會服務這個subnet底下連接的裝置
- 分配IP給這些裝置
- 可以知道發IP的router在哪裡
DHCP EX.(沒甚麼好講的)
電信業者跟學校就是跟更上層的人要IP
- ICANN
network address translation IPv6
NAT: network address translation
- 可以不用告知外界便調整內網中的裝置IP
source ip 要轉換成 NAT ip
- 路由器要透過轉譯表(NAT ip + port)
- 轉換內網中正確的ip
- 轉換內網中正確的ip
NAT has been controversial:
- routers “should” only process up to layer 3
- address “shortage” should be solved by IPv6
- violates end-to-end argument (port # manipulation by network-layer device)
transparent的問題?
- NAT traversal
- 外網的host沒辦法找到內網的host
IPv6: motivation
40 bytes fixed length header
- address become 128 bits
- flow label
transition
- v4 and v6 可以同時存在
- router可能不支援v6
- 可以把v6塞進v4裡面 = tunneling
- 可以把v6塞進v4裡面 = tunneling
IPv6
- 發展太久了
Generalized Forwarding, SDN
match plus action
- traditional
- basic forwarding table(aka flow table)
- destination based
- generalized forwarding
- any header field can determine action
- 可以讀header中很多的資料
- 有多種action
Flow table abstraction
總而言之,可以看很多欄位的資料
- 執行很多不同的動作
- link, network and transport layer header could be used
可以藉此實現firewall(會考喔)
要使用上述的功能,要滿足下面的條件
- openflow
- generalized forwarding
- 硬體要支援
- 可以有以下的功能
Ex.(看過就好)
summary