大學必修-筆記
如果 arrival rate 超過 transmission rate 的話
nodal processing delay 節點處理延遲
queue delay 排隊延遲
trasmition delay 傳輸延遲
propagation delay 傳播延遲
Traffic Intensity 通訊密度 =
解決方法
Client-Server architecture 主從式架構
Pure P2P architecture 點對點架構
Hybird Client-Server(P2P)
同一個主機
不同主機
Process -> 在主機內執行的程式
P2P 的話是 Client Process Server Process 同時並行
應用程式需要什麼傳輸服務
Overviwe
HTTP connections
HTTP message
HTTP 錯誤訊息
步驟
cookies 運作方式
cookies 能做
解釋
Mail Format
領域名稱系統
用 UDP 實做
distributed database 分散資料庫
為何使用分散
application-layer protocol 在應用層執行
DNS service
將電子信件地址轉成位置
一個網站可能有多台伺服器 每個伺服器的ip和主機名稱不同 有要求傳送過來時 dns會一直改變回傳的伺服器的主機名稱及ip
Hierarchical Database 階級式資料庫
Local Name Server 查訊方式
cache 快取
DNS records
DNS messages
在DNS中新增紀錄
Client-Server 主從式
P2P 點對點
BitTorrent 位元洪流
為了確保在網路頻寬使用越來越大
影片的流暢度不受影響
spatial coding 空間編碼
temporal coding 時間編碼
DASH over HTTP 基於超文字協定的動態自適應流
manifest file 清單文件
在server端 ->
在client端 ->
提供提供不同主機上 application 之間的邏輯通訊 logical communication
send side 傳送端
rcv side 接受端
網路層
傳輸層
jojo的奇妙比喻
12 個小孩傳送信件給12個小孩行程 小孩
應用程式訊息 信封中的信
主機 房子
傳輸協定 Ann 以及 Bill (?
網路層協定 郵政服務
傳送端主機的多工
接收端主機的解多工
jojo的奇妙比喻
解多工(demultiplexing)操作
當Bill從郵差收到一批信件時
分出信的收件人是誰,然後將信交給收件人多工(multiplexing)操作
當Ann從兄弟姊妹處收集完信件
並將信件交給郵差
流程
主機的每個socket都可以指定一個port number
以埠號產生 UDP socket
以兩組資料識別 UDP socket
當主機收到 UDP segments時
以四組資料識別
無連線傳輸
UDP 的功能
checksum
假設不可靠通道是
傳送端、接收端分別只做
rdt的傳送端
rdt的接收端
簡單來說傳送方和接收方只要能正確接收資料就可以了
因為發過來的資料保證一定是正確的
假設不可靠通道是
為了解決位元錯誤的問題,加入了
如果位元沒有發生錯誤
如果位元發生錯誤
傳送端
接收方如果收到0
就知道這次不是新的報文段
可能是上次ack出錯了
傳送方無法確認就重傳了上次的報文段
所以接收方需要丟掉這個報文段
然後再次傳一次ack確認訊號如果收到的是序號為1的報文段
則接收方直接接受就可以了。
接收端
必須確認接收端封包是否重複
接收端無法得知最後一個 ACK/NAK 是否在傳送端被接收無誤
假設不可靠通道是
為了資料遺失錯誤的問題,加入了
會有以下四種狀況
base: 最久未被確認的封包的序列號碼
nextseqnum: 最小未被使用到的序列號碼
傳送端
接收端
傳送端:
收到連續的ACK之後
Window會往前滑動
傳送端可以繼續傳送新的封包
接收端:
因封包2遺失了
所以已接收的封包 3, 4, 5都丟棄掉
改善 GBN 的問題:
SR 的改善方法:
傳送端
接收端
Window size = 4 個封包
傳送端會送出序號0到3的封包
每個封包都有其邏輯的計時器
Destination-based forwarding
Generalized forwarding -> 可以跟據封包的內容來決定 forwarding
Longest prefix matching 最長前綴匹配
Switching Fabric
Head-of-the-Line 佇列前端攔阻
output ports -> router 結構與上一個相反
buffer 倒底要多大
排程
FIFO
priority scheduling
Round Robin (RR)
Weighted Fair Queuing (WFQ)
MTU max transfer size
subnet 子網
IP address
CIDR -> Classless InterDoman Routing 無類別域間路由
DHCP -> Dynamic Host Configuration Protocol 動態主機設定協定
幫忙把 網址 轉成 IP 地址
不能跨網段
DHCP Discover : 客戶端發出廣播要求IP ( 0.0.0.0 -> 255.255.255.255 )
DHCP Offer : 多個 DHCP 伺服器收到,回應未租約 IP
DHCP Request : 客戶端收到多個IP,再度廣播自己選擇了哪一個IP
DHCK Ack : 被選的 DHCP 伺服器回應,確認此IP租約。
Hierarchical addressing
NAT
不夠啦
與 IPv4 不相容
header 協定內容
tunneling
新型網路架構
利用 OpenFlow 協定將路由器的控制平面(control plane)從資料平面(data plane)中分離
改以軟體方式實作
OpenFlow
*
What are the header fields to identify a UDP socket and a TCP socket?
UDP : destination IP、destination port
TCP : source IP、source port 、destination IP、destination port
UDP:目的端IP、目的端埠號
TCP:來源端IP、來源端埠號、目的端IP、目的端埠號
前院長的中文時間
Please describe the mechanism of packet error detection using checksum.
傳送端傳送checksum 給接收端之後,接收端再經由計算所收到的segment做checksum,如果兩者相同則沒有錯誤,反之則有。
傳送端傳送檢查和給接收端之後,接收端再經由計算所收到的區段做檢查和,如果兩者相同則沒有錯誤,反之則有。
前院長的中文時間
Please calculate the checksum of the following two 16-bit binary integers:
1110011001100110 & 1101010101010101.
Please list the network applications of UDP.
Streaming multimedia app ( loss tolerant , rate sensitive )
DNS
SNMP
串流媒體應用程式
域名系統
簡單網路管理協定
前院長的中文時間
Please describe all necessary mechanisms to recover the packets with bit errors.
接收端收到封包,用checksum檢查bit error(位元錯誤),
若正確:回傳ACK,發送端送下一個封包
若錯誤:回傳NAK,發送端重送封包
ACK、NAK若有bit error,則直接重傳
Please explain why one-bit sequence number is enough for a stop-and-wait protocol.
假設傳送端傳送出0的封包,則接收端收到此封包後只需回送序列號 1,表示下一個要接收的封包,也就是不同的封包。
而識別連續的封包是否相同,只需要0、1即可。
What is the function of sequence numbers in feedback segments?
sequence number it uses to keep track of how much data it has sent.
序列號用於追蹤已傳送的資料大小。
前院長的中文時間
Please describe all necessary mechanisms to recover packet loss.
發送端送出封包時會設定countdown timer,timeout發生直接重傳。
傳送端送出封包時會設定倒數計時器,若發生逾時直接重傳。
前院長的中文時間
The performance of the stop-and-wait protocol is poor and can be improved by a pipelining protocol. Please describe the idea of the pipelining protocol.
允許傳送端同時傳送多個未確認封包。
Please describe the difference between Go-Back-N and Selective Repeat for packet retransmission, receiver window size, and number of timers
Go-Back-N:重送所有未經確認的封包,buffer size = 1,只有一個timer,綁定在最早送出且未經確認的封包,即base。
Selective Repeat:只重送遺失或損毀的封包,buffer size = sender’s buffer size,每一個封包都有綁timer。
回溯 N:重送所有未經確認的封包,接收端暫存大小 = 1,只有一個計時器,綁定在最早送出且未經確認的封包。
選擇性重複:只重送遺失或損毀的封包,接收端暫存大小 = 傳送端暫存大小,每一個封包都有綁計時器。
前院長的中文時間
How many sequence numbers are required for selective repeat? (window size=W)
2W
Please describe the problems caused by improper timeout values.
timeout values設定太大時,當檔案遺失真的發生,會花較久的時間修復。
若設定太小,容易使延遲被判斷為timeout,而有許多不必要之重傳。
逾時數值設定太大時,當檔案遺失真的發生,會花較久的時間修復。
若設定太小,容易使延遲被判斷為逾時,而有許多不必要之重傳。
前院長的中文時間
Please introduce the basic idea of calculating TCP timeout value.
EstimatedRTT = (1-α)EstimatedRTT + αSampleRTT
α=0.125
DevRTT = (1-β)DevRTT + β|SampleRTT-EstimatedRTT|
β=0.25
TimeoutInterval = EstimatedRTT + 4*DevRTT
Please describe the procedure of TCP delayed ACK in TCP receivers.
Wait up to 500ms for next segment. If no next segment, send ACK
於下個區段前等待500ms,若未收到新的區段,重傳ACK。
前院長的中文時間
Please describe the idea of TCP Fast Retransmit.
如果接收了三個連續ACK,則重傳,不用等timeout
當接收到 3 個 重複的 ACK,則立即重送該區段,而非等到重送計時器逾時。
前院長的中文時間
TCP flow control can avoid receiver buffer overflows. Please describe its procedure.
利用rwnd (reciever window size) 如果rwnd=0代表buffer full
偵測接收端窗格大小,若其為 0,代表暫存已滿。
前院長的中文時間
TCP uses three-way handshake for connection setup. Why is two-way handshake not used?
因為two way在packet loss 和delay 時會造成另一端以為建立新連線,導致一端終止一端開啟的情況。
因為雙向交握在封包延遲或遺失時,會造成另一端以為建立新連線,導致一端終止一端開啟的情況。
前院長的中文時間
Please describe the four-way handshake of closing a TCP connection.
FINbit=1, seq=x
ACKbit=1; ACKnum=x+1
FINbit=1, seq=y
ACKbit=1; ACKnum=y+1
Please describe how TCP slowstart phase adjusts CWND value.
初始CWND=1MSS,之後都將CWND加倍, done by incrementing cwnd for every ACK received
初始CWND(壅塞視窗)為1MSS,接著在每次收到ACK時將CWND加倍。
前院長的中文時間
Please describe the idea of AIMD (additive increase; multiplicative decrease)in TCP for adjusting CWND.
若有正確收到封包,CWND在每個 RTT 的時間內都呈線性成長,即CWND = CWND + 1MSS。
若有封包遺失疑慮,將CWND調整成一半。
Please describe the functions of data plane and control plane in each router.
Data plane:接收封包後 決定要去哪個output port
Control plane:決定封包在端點間的移動路徑
資料層:接收封包後決定要去哪個輸出端口。
控制層:決定封包在端點間的移動路徑。
前院長的中文時間
Please describe the problem of Head-of-the-line (HOL) blocking.
quening delay and loss due to buffer overflow
因為暫存溢出而導致封包佇列延遲或遺失。
前院長的中文時間
Please explain longest prefix matching.
find the longest matching entry in the table and forwards the packet to link associated with longest prefix number
找到子網掩碼長度最長的封包-路由表中,與目的地址的高位匹配得最多的表項。
前院長的中文時間
子網掩碼 = 子網路遮罩
[name=]
Please describe three types of switching fabrics.
memory : packet copied to system's memory
bus : datagram from input port memory to output port memory via a shared bus
crossbar : banyan networks, crossbar, other interconnection nets initially developed to connect processors in multiprocessor
記憶體:直接將封包複製到適當輸出埠記憶體中。
匯流排:透過共用匯流排直接將封包傳輸到輸出埠。
棋盤式交換器:封包會沿著連接到該輸入埠的水平匯流排移動,前往其目標輸出埠的垂直匯流排。
前院長的中文時間
Please describe the purpose of input-port queueing.
如果交換機構有 input port 封包,被攔截的封包放入quene中等待
Please describe the reasoning of IP fragmentation and the related header fields.
因為在network裡有HTU限制
Id : 辨別是否屬於同一封包
Flags : 是否最後的fragment
Fragments offset : 記錄該區段屬於原始的哪段資源
因為每個網路連結有最大傳輸單位(MTU)限制封包長度
ID:識別碼,判斷各區段是否為同一封包。
Flags:封包切割旗標,判斷本封包可否切割、本區段是否為末尾。
Fragments offset:區段位移,判斷區段屬於原始封包的哪一段資料。
前院長的中文時間
Please describe the functions of Time to Live and Upper Layer fields in IPv4 header.
(1) Time to Live:表示一個封包的存活時間,當資料每經過一個路由器時都會減一,當TTL歸零時則丟棄此封包,並回送ICMP Exceeded message 給發送端。
(2) Upper Layer(Protocol):定義在data portion中IP datagram使用的協議
(1) 存活時間:表示一個封包的存活時間,當資料每經過一個路由器時都會減一,當TTL歸零時則丟棄此封包(並回送溢時傳輸給傳送端)。
(2) 上層協定:記錄封包在傳輸層所使用的網路協定為何。
前院長的中文時間
What is CIDR?
一個運用VLSM(variable-length subnet masking)分配IP位址以及在網路上有效路由IP封包的方法。
CIDR 無類別域間路由
VLSM 變動長度子網路遮罩
前院長的中文時間
Please describe several scheduling mechanisms for output ports of a router.
去尾:丟棄到達封包。
優先度:根據優先偏好丟棄封包。
隨機:隨機丟棄封包。
前院長的中文時間
Each IP address is comprised of two parts. Please name them.
子網部分:高位元
主機部分:低位元
前院長的中文時間
NAT modifies the headers of both outgoing and incoming packets. Please list
these headers.
Outgoing:來源端地址
Incoming:目的端地址
Please describe the information stored in a NAT translation table.
WAN address 與LAN address 的mapping
廣域網地址對應區域網地址。
前院長的中文時間
Please list the benefits and drawbacks of using NATs.
優點:
- 所有設備只需一個IP地址
- 可以在不通知外界的情況下更改本地網絡中設備的地址
- 可以在不更改本地網絡中設備地址的情況下更改ISP
- 本地網內的設備無法明確尋址,外界不可見
缺點:
- 增加路徑轉換的延遲
- 失去對IP來源的可追溯性
- 導致某些應用程式的通訊失敗
挑幾點寫應該就夠了……建議是只記第一和最後
前院長的中文時間
Please describe the idea of route aggregation.
Route aggregation(路由匯總)的主要想法便是要將多筆路由資訊匯總成比較簡單的單筆路由資訊。
Why must routers perform longest prefix matching to ensure the correctness of packet routing?
使用這個法則才能正確回復新的ISP而不會回復到舊的