IP数据报格式 IP协议版本号 32 bits 数据报长度( bytes) 首部长度 head. type of (bytes ver length fragment- 用于 数据“类型” 16-bit identifier itgs offset 分包/ 余留步跳 time to[upper Internet 重装 在经过lve ayer checksum 每个路由器后递减 32 bit source ip address 32 bit destination ip address 用来递交有效负荷的 上层协议 Options(if any) Eg.时间戳,纪录路 由标记,定义要访问 data 的路由器 (可变长度 般为一个TCP 或∪DP数据段) 主讲人:西安交通大学程向前 第5讲网络层之二5b-1
主讲人:西安交通大学 程向前 第5讲 网络层之二 5b-1 IP 数据报格式 ver length 32 bits data (可变长度, 一般为一个 TCP 或UDP 数据段) 16-bit identifier Internet checksum time to live 32 bit source IP address IP 协议版本号 首部长度 (bytes) 余留步跳 (在经过 每个路由器后递减) 用于 分包/ 重装 数据报长度 (bytes) 用来递交有效负荷的 上层协议 head. len type of service 数据“类型” flgs fragment offset upper layer 32 bit destination IP address Options (if any) E.g. 时间戳,纪录路 由标记, 定义要访问 的路由器
IP分包&重组 口网络链路具有MTU(最大传输单 位〕属性-是有链路层最大帧的 限制决定的. o不同类型的链路,不同的 fragmentation MTUs in: one large datagram 口较大的IP分组在网络中会被分 out: 3 smaller datagrams 割 fragmented" O一个分组就被分成了若干分 组 reassembly O分组只是在最终的信宿站点 被重新“组装- reassembled o在IP分组的首部有些位标记 用来确认和排序相关的组“ 片 主讲人:西安交通大学程向前 第5讲网络层之二5b-2
主讲人:西安交通大学 程向前 第5讲 网络层之二 5b-2 IP 分包 & 重组 网络链路具有 MTU (最大传输单 位)属性 – 是有链路层最大帧的 限制决定的. 不同类型的链路, 不同的 MTUs 较大的IP分组在网络中会被分 割(“fragmented”) 一个分组就被分成了若干分 组 分组只是在最终的信宿站点 被重新“组装- reassembled” 在IP 分组的首部有些位标记 用来确认和排序相关的组“ 片” fragmentation: in: one large datagram out: 3 smaller datagrams reassembly
IP分片和重组 length ID fragflag loffse 4000|=X 〓0 个大的分组被划为若干较小的分组 length id fragflag offset 1500|=X 0 length ID fragflag offset =1500|=x 1480 length ID frago lag offset 1040=×=01=2960 主讲人:西安交通大学程向前 第5讲网络层之二5b-3
主讲人:西安交通大学 程向前 第5讲 网络层之二 5b-3 IP 分片和重组 ID =x offset =0 fragflag =0 length =4000 ID =x offset =0 fragflag =1 length =1500 ID =x offset =1480 fragflag =1 length =1500 ID =x offset =2960 fragflag =0 length =1040 一个大的分组被划为若干较小的分组
ICMP:因特网控制报文协议(工 nternet Control Message Protocol) 口用于主机、路由器、网关之间交 换网络层信息 Type Code description O报告错误: unreachab|e 0 echo reply(ping host, network, port, dest network unreachable protoco 1 dest host unreachable o进行 request/epy应答 dest protocol unreachable ping命令) dest port unreachable 口同处于网络层但“凌驾”于IP 2367 dest network unknown 之上: dest host un known O ICMP报文需要IP分组来传 source quench(congestion 输 0333333489 control -not used echo request(ping 口ICMP报文:type, code plus route advertisement first 8 bytes of ip datagram 10 router dIscovery causing error 11 000000 TTL expired bad ip header 主讲人:西安交通大学程向前 第5讲网络层之二5b-4
主讲人:西安交通大学 程向前 第5讲 网络层之二 5b-4 ICMP: 因特网控制报文协议(Internet Control Message Protocol) 用于主机、路由器、网关之间交 换网络层信息 报告错误: unreachable host, network, port, protocol 进行request/reply 应答 (ping命令) 同处于网络层但“凌驾”于 IP 之上: ICMP报文需要 IP分组来传 输 ICMP 报文: type, code plus first 8 bytes of IP datagram causing error Type Code description 0 0 echo reply (ping) 3 0 dest. network unreachable 3 1 dest host unreachable 3 2 dest protocol unreachable 3 3 dest port unreachable 3 6 dest network unknown 3 7 dest host unknown 4 0 source quench (congestion control - not used) 8 0 echo request (ping) 9 0 route advertisement 10 0 router discovery 11 0 TTL expired 12 0 bad IP header
因特网中的路由选择 口全球因特网是由诸多 Autonomous Systems(A5)互联而 成 o小型自治系统( Stub as):中小型企业 ○分区自治系统( Multihomed As):大型企业(非跨越的) o跨越式自治系统( Transit As):NBP等 口两层路由选择 O工ntra-As:由网管决定 o工nter-As:唯一性的标准 主讲人:西安交通大学程向前 第5讲网络层之二5b-5
主讲人:西安交通大学 程向前 第5讲 网络层之二 5b-5 因特网中的路由选择 全球因特网是由诸多 Autonomous Systems (AS)互联而 成: 小型自治系统(Stub AS): 中小型企业 分区自治系统(Multihomed AS):大型企业 (非跨越的) 跨越式自治系统(Transit AS): NBP等 两层路由选择: Intra-AS: 由网管决定 Inter-AS: 唯一性的标准