Presentation is loading. Please wait.

Presentation is loading. Please wait.

TCP協定 (傳輸層).

Similar presentations


Presentation on theme: "TCP協定 (傳輸層)."— Presentation transcript:

1 TCP協定 (傳輸層)

2 傳輸層協定 以TCP與UDP為主 在IP Header中的prot欄位註冊 訊息的處理時間與可靠度

3 傳輸層協定標頭 資料連結層:MAC Address 網路層:IP Address 傳輸層:port number (分時多工)
資料連結層HD 網路層HD 傳輸層HD 資料 Ethernet HD IP HD TCP/UDP HD 資料 資料連結層:MAC Address 網路層:IP Address 傳輸層:port number (分時多工)

4 常見的 port number http://www.iana.org/assignments/port-numbers Port
Keyword Function Protocol 保留 21 FTP 檔案傳輸 TCP 23 Telnet 遠端登錄 15 Netstat 網路狀態 TCP, UDP 25 SMTP 郵件傳輸 53 DNS 網域名稱伺服器 80 HTTP WWW SERVER 161 SNMP 網路管理 UDP

5 UDP User Datagram Protocol 非可靠性傳輸模式 (不檢查資料是否成功傳送到目的地) 速度快
來源port number (16) 目的port number (16) 訊息長度 (16) 檢驗和 (16) 訊息長度:以BYTE為單位,至少為8

6 TCP Transmission Control Protocol 可靠性傳輸模式 速度慢 序列號碼:確保訊息能傳遞成功 滑動訊窗

7 TCP-序列號碼 確保訊息能傳遞成功 與回應號碼(Ack)一起運作 分成單向與雙向傳送 時間 Seq=60000 Ack=20000
Data=1000 Bytes Seq=20000 Ack=61000 Data=2000 Bytes 60000 61000 20000 Seq=61000 Ack=22000 Data=1500 Bytes 22000 時間 Seq=60000 Data=1000 Bytes Ack=61000 60000 61000 Seq=61000 Data=500 Bytes Ack=61500 61500

8 TCP-滑動訊窗 透過Seq與Ack是相當耗時的 各節點使用緩衝區來達到同時傳送與處理 緩衝區稱為”訊窗” (大小固定)
滑動訊窗Sliding Window

9 TCP-滑動訊窗 X-Bytes (Max) 1 2 3 4 5 6 7 8 9 10 11 時間 Seq=60000 Data=1000 Bytes Ack=61000 Window=5000 60000 61000 Seq=61000 Data=5000 Bytes Ack=66000 Window=0 不要再送 66000 1 2 3 4 5 6 7 8 9 10 11 1 2 3 4 5 6 7 8 9 10 11 1 2 3 4 5 6 7 8 9 10 11 1 2 3 4 5 6 7 8 9 10 11 逾時… 1 2 3 4 5 6 7 8 9 10 11

10 Destination port number (16)
TCP Header Source port number (16) Destination port number (16) Sequence Number (32) HLEN (4) Acknowledge Number (32) 000000 U A P R S F Window (16) Checksum (16) Urgent Pointer (16) Options Padding

11 TCP Header Source Port Number:來源埠編號 Destination Port Number:目的埠編號
Sequence Number:序列編號 Acknowledge Number:回應號碼 HLEN:標頭長度 Reserved:保留 Control Flag:UAPRSF Window:訊窗 Checksum:檢驗和 Urgent Pointer:緊急指標 Option:選擇項

12 TCP封包擷取 請使用Ethreal擷取封包,並分析TCP Header


Download ppt "TCP協定 (傳輸層)."

Similar presentations


Ads by Google