1 / 43

第三章 TCP/IP 协议栈

第三章 TCP/IP 协议栈. 本章目标. 通过本章的学习,您应该掌握以下内容 : 掌握 TCP/IP 分层模型 掌握三次握手过程 理解 OSI 和 TCP/IP 模型的区别和联系. TCP/IP 介绍. 主机. 主机. Internet. TCP/IP. 早期的协议族 全球范围. TCP/IP 协议族. 7. 5. 6. 应用层. 5. 应用层. 表示层. 4. 4. 会话层. 3. 3. 主机到主机层. 传输层. 2. 2. Internet 层. 网络层. 1. 1. 数据链路层. 网络接入层. 物理层.

gil-levine
Download Presentation

第三章 TCP/IP 协议栈

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 第三章TCP/IP协议栈

  2. 本章目标 • 通过本章的学习,您应该掌握以下内容: • 掌握TCP/IP分层模型 • 掌握三次握手过程 • 理解OSI和TCP/IP模型的区别和联系

  3. TCP/IP介绍 主机 主机 Internet TCP/IP • 早期的协议族 • 全球范围

  4. TCP/IP 协议族 7 5 6 应用层 5 应用层 表示层 4 4 会话层 3 3 主机到主机层 传输层 2 2 Internet层 网络层 1 1 数据链路层 网络接入层 物理层

  5. 应用层概述 文件传输 - TFTP * - FTP * - NFS E-Mail - SMTP 远程登陆 - Telnet * - rlogin * 网络管理 - SNMP * 名称管理 - DNS* 应用层 主机到主机层 Internet层 网络接入层 * 路由器使用

  6. 主机到主机层概述 Transmission Control Protocol (TCP) User Datagram Protocol (UDP) 面向连接 非面向连接 应用层 主机到主机层 Internet层 网络接入层

  7. TCP 数据格式 Bit 0 Bit 15 Bit 16 Bit 31 Destination port (16) Source port (16) Sequence number (32) Acknowledgement number (32) 20Bytes Headerlength (4) Reserved (6) Code bits (6) Window (16) Checksum (16) Urgent (16) Options (0 or 32 if any) Data (varies)

  8. 端口号 RIP FTP TELNET SMTP DNS TFTP SNMP 应用层 520 21 23 25 53 69 161 端口号 传输层 TCP UDP

  9. TCP 端口号 源端口 目标端口 … Telnet Z Host Z Host A 目标端口 = 23. SP DP 1028 23 …

  10. 1 TCP 三次握手 Host A Host B 发送 SYN (seq=100 ctl=SYN) 接收 SYN

  11. 1 2 TCP 三次握手 Host A Host B 发送 SYN (seq=100 ctl=SYN) 接收 SYN 发送 SYN, ACK (seq=300 ack=101 ctl=syn,ack) 接收 SYN

  12. 1 2 3 TCP 三次握手 Host A Host B 发送 SYN (seq=100 ctl=SYN) 接收 SYN 发送 SYN, ACK (seq=300 ack=101 ctl=syn,ack) 接收 SYN 建立会话 (seq=101 ack=301 ctl=ack) TCP连接建立

  13. TCP 简单确认 发送方 接收方 • 滑动窗口 = 1

  14. TCP 简单确认 发送方 接收方 发送 1 接收 1 • 滑动窗口 = 1

  15. TCP 简单确认 发送方 接收方 发送 1 接收 1 发送 ACK 2 接收 ACK 2 • 滑动窗口 = 1

  16. TCP 简单确认 发送方 接收方 发送 1 接收 1 发送 ACK 2 接收 ACK 2 发送 2 接收 2 • 滑动窗口 = 1

  17. TCP 简单确认 发送方 接收方 发送 1 接收 1 发送 ACK 2 接收 ACK 2 发送 2 接收 2 发送 ACK 3 接收 ACK 3 • 滑动窗口 = 1

  18. TCP 简单确认 发送方 接收方 发送 1 接收 1 发送 ACK 2 接收 ACK 2 发送 2 接收 2 发送 ACK 3 接收 ACK 3 发送 3 接收 3 • 滑动窗口 = 1

  19. TCP 简单确认 发送方 接收方 发送 1 接收 1 发送 ACK 2 接收 ACK 2 发送 2 接收 2 • 滑动窗口 = 1 发送 ACK 3 接收 ACK 3 发送 3 接收 3 发送 ACK 4 接收 ACK 4

  20. TCP 顺序号和确认号 源端口 目标端口 顺序号 # 确认号 # … 我发送 #10. Source Dest. Seq. Ack. 1028 23 10 1

  21. TCP 顺序号和确认号 源端口 目标端口 顺序号 # 确认号 # … 我发送 #10. 我已收到 #10, 现在我需要 #11. Source Dest. Seq. Ack. 1028 23 10 1 Source Dest. Seq. Ack. 23 1028 1 11

  22. TCP 顺序号和确认号 源端口 目标端口 顺序号 # 确认号 # … 我发送 #10. 我已收到 #10, 现在我需要 #11. Source Dest. Seq. Ack. 1028 23 10 1 Source Dest. Seq. Ack. 23 1028 1 11 Source Dest. Seq. Ack. 1028 23 11 2

  23. TCP 顺序号和确认号 源端口 目标端口 顺序号 # 确认号 # … 我发送 #11 我已收到 #11, 现在我需要 #12. Source Dest. Seq. Ack. 1028 23 10 1 Source Dest. Seq. Ack. 23 1028 1 11 Source Dest. Seq. Ack. 1028 23 11 2 Source Dest. Seq. Ack. 23 1028 2 12

  24. TCP 窗 口 发送方 接收方

  25. TCP 窗 口 发送方 接收方 Window size = 3 Send 1 Window size = 3 Send 2 Window size = 3 Send 3

  26. TCP 窗 口 发送方 接收方 Window size = 3 Send 1 Window size = 3 Send 2 Window size = 3 Send 3 数据 3 被丢弃 ACK 3 Window size = 2

  27. TCP 窗 口 发送方 接收方 Window size = 3 Send 1 Window size = 3 Send 2 Window size = 3 Send 3 数据 3 被丢弃 ACK 3 Window size = 2 Window size = 3 Send 3 Window size = 3 Send 4

  28. TCP 窗 口 发送方 接收方 Window size = 3 Send 1 Window size = 3 Send 2 Window size = 3 Send 3 数据 3 被丢弃 ACK 3 Window size = 2 Window size = 3 Send 3 Window size = 3 Send 4 ACK 5 Window size = 2

  29. UDP 数据格式 Bit 0 1 Bit 15 Bit 16 Bit 31 Destination port (16) Source port (16) 8Bytes Length (16) Checksum (16) Data (if any) • 没有顺序号和确认号

  30. Internet 层概述 Internet Protocol (IP) Internet Control Message Protocol (ICMP) Address Resolution Protocol (ARP) Reverse Address Resolution Protocol (RARP) 应用层 主机到主机层 • OSI 网络层对应的是TCP/IP的internet层 Internet层 网络接入层

  31. IP 数据 Bit 0 1 Bit 15 Bit 16 Bit 31 Version(4) HeaderLength (4) Priority & Type of Service (8) Total Length (16) Flags(3) Identification (16) Fragment offset (13) 20Bytes Time to live (8) Protocol (8) Header checksum (16) Source IP Address (32) Destination IP Address (32) Options (0 or 32 if any) Data (varies if any)

  32. 协议域 TransportLayer UDP TCP ProtocolNumbers 6 17 • 决定上层协议 InternetLayer IP

  33. ICMP协议 Application Destination Unreachable Echo (Ping) Other Transport 1 ICMP Internet Network Access

  34. ARP协议 我需要知道176.16.3.2的物理地址. 172.16.3.1 172.16.3.2 IP: 172.16.3.2 = ???

  35. 我需要知道176.16.3.2的物理地址. 我知道你的请求,这是我的物理地址 ARP协议 172.16.3.1 172.16.3.2 IP: 172.16.3.2 = ???

  36. 我需要知道176.16.3.2的物理地址. 我知道你的请求,这是我的物理地址 ARP协议 172.16.3.1 172.16.3.2 IP: 172.16.3.2 = ??? IP: 172.16.3.2 Ethernet: 0800.0020.1111

  37. 我需要知道176.16.3.2的物理地址. 我知道你的请求,这是我的物理地址 ARP协议 172.16.3.1 172.16.3.2 • 映射 IP Ethernet • Local ARP IP: 172.16.3.2 = ??? IP: 172.16.3.2 Ethernet: 0800.0020.1111

  38. RARP协议 我的地址是多少? Ethernet: 0800.0020.1111 IP = ???

  39. RARP协议 我听到了广播你的地址是 172.16.3.25. 我的地址是多少? Ethernet: 0800.0020.1111 IP = ???

  40. RARP协议 我听到了广播你的地址是 172.16.3.25. 我的地址是多少? Ethernet: 0800.0020.1111 IP = ??? Ethernet: 0800.0020.1111 IP: 172.16.3.25

  41. RARP协议 我听到了广播你的地址是 172.16.3.25. 我的地址是多少? • 映射 Ethernet IP Ethernet: 0800.0020.1111 IP = ??? Ethernet: 0800.0020.1111 IP: 172.16.3.25

  42. 本章总结 • 通过本章的学习,您应该掌握以下内容: • 掌握TCP/IP分层模型 • 掌握三次握手过程 • 理解OSI和TCP/IP模型的区别和联系

  43. 问题回顾 • OSI和TCP/IP层次模型的区别 • TCP/IP的优点 • ARP和RARP各用在什么场合

More Related