第七章IP协议,报文格式

上传人:豆浆 文档编号:7137548 上传时间:2017-08-09 格式:PPT 页数:30 大小:240KB
返回 下载 相关 举报
第七章IP协议,报文格式_第1页
第1页 / 共30页
第七章IP协议,报文格式_第2页
第2页 / 共30页
第七章IP协议,报文格式_第3页
第3页 / 共30页
第七章IP协议,报文格式_第4页
第4页 / 共30页
第七章IP协议,报文格式_第5页
第5页 / 共30页
点击查看更多>>
资源描述

《第七章IP协议,报文格式》由会员分享,可在线阅读,更多相关《第七章IP协议,报文格式(30页珍藏版)》请在金锄头文库上搜索。

1、第七章IP协议:报文格式,无连接通信思想IP报文格式IP报文选项,1 引言,网络结构虚拟网络路由器为“节点”物理网为“信道”物理网在路由器间运送IP报文路由器为IP报文选择传输路径,2 无连接通信思想,IP通信的环境穿越多个网络经过多个路由器有多条可能的路径,无连接通信,不同物理网络之间存在差异通信能力、分组长度、延时允许IP报文从不同路径达到目的地路由器为每个IP报文独立选路IP通信不保证可靠性,但灵活性增加多种网络都能满足的通信方式允许多种选路策略(如可靠性、容量、延时)结合应用考虑实际通信策略,3 IP报文格式,IP报文首部携带源、目的地址报文分段、重组Service Access Po

2、intIP OptionsOthersIP报文数据Any bytes of data,IP格式图,4Bytes边界对齐Data为任意字节,IP PDU structure,struct IP_PDU U8 VerLen; /* Version and Header Length */ U8 TOS; /* Type of service */ U16 TLen; /* Total packet length */ U16 ID; /* packet identifier */ U16 FlgOff; /* Flags and Frag. Offset */ U8 TTL; /* Time To

3、 Live */ U8 Prot; /* Protocol ID, - upper SAP */ U16 hCS; /* Header Chechsum */ U32 sIP; /* Source IP addr. */ U32 dIP; /* Destination IP addr */ U8 OpData.; /* Option and data fields */;,格式域,Ver(4bit):版本号(=4)HLen(4 bit): 首部长度长度单位:4字节Total Length:本报文总长度长度单位:字节HCS:首部校验和IP只检查首部,HLen(4bytes unit),Total

4、 Length(1 bytes unit),最大HLen = 16,(11x4 bytes maxUsed in IP option),最大IP报文长度:65535 bytes(包括首部),TTL:Time To Live该报文的寿命(秒,最大255)防止路由成环时,IP被无限次转发协议规定,路由器处理IP报文时,应减去处理所用的时间,TTL为零时,丢弃该报文实际:TTL经过路由器时,被减1Protocol:上层协议类型作为IP提供的SAP,TCP,UDP,ICMP,1,17,6,IP,Assigned Protocol Number,0:Reserved1:ICMP2:IGMP3:GGP4:

5、IP6:TCP8:EGP9:IGP17:UDP23:Trunk-125:Leaf-1,29:ISO-TP446:RSVP48:MHRP88:IGRP89:OSPFIGP93:AX.2594:IPIP97:ETHERIP,IP校验和计算,只对首部进行校验和检查,数据部分由高层协议进行校验计算方法把首部看成16bit整数序列:W1、W2、模65535,即0xFFFF(不是65536)求和,结果取反任何情况下,HCS0,4 TOS, Type of Service,RFC791Bits 0-2: Precedence.Bit 3: Delay, 0 = Normal, 1 = Low.Bits 4:

6、 Throughput. 0 = Normal, 1 = HighBits 5: Relibility. 0 = Normal, 1 = HighBits 6: Cost. 0=Normal, 1= LowBits 7: Must be zero.Precedence111 - Network Control110 - Internetwork Control101 - CRITIC/ECP100 - Flash Override011 - Flash010 - Immediate001 - Priority000 - Routine,TOS, Type of Service,RFC1349,

7、 TOS for:ICMPTelnet minimum DelayFTP Max throughputTFTP - Minimize delaySMTP - Maximize throughputAny IGP - Maximize reliabilitySNMP - maximize reliabilityOther use of TOSBinary number of TOS coding,5. Fragmentation,The requirements of segmentation,Transport,IP,PhysicalNetwork,Data block size is ind

8、ependent of MTU of underlying physical network,IP packet size must matche the MTU of underlying physical network,MTU=Maximum Transmission Unit,Typical MTU: 1500 (Ethernet) 20004000 (Token Ring) 512 (Dial-up) 128 (Radio Link) others,Host,Data Block,IP Packet,Fragmentation,Gateway requires fragmentati

9、on for different MTU of physical networks,IP,MTU1,MTU2,Gateway,Example: MTU1 = 1500 Bytes MTU2 = 600 Bytes,Fragmentation & reassembly,Case 1: reassembly at Gateway and hostCase 2: reassembly only at host,IP,IP,G1,G2,MTU=1500,MTU=800,MTU=1000,2500,2200,Case 1,Case 2,Discussion,IP protocol specify tha

10、t:The fragmentation action will appear at host or gateway where needed.The assembly will only appear at IP destination host. Discussing the advantage and disadvantageAssembly at GatewayAssemble only at end point (Host),Fragmentation control,Identifier (16 bit)distinguish different IP packetsAll frag

11、s of a packet hold the same IdentifierFrag offset (13 bit)offset of a IP packet data8 bytes unit (match 64K length)FlagSegmentation status-More fragments follows-Dont frag,Some IP layer cannot handle fragmentation,Fragmentation example,0,576,1152,Offset0, M=1,Offset72(x8),M=1,Offset144(x8), M=0,MTU:

12、1500 bytes, Header :20 bytes,MTU = 600,ID = a,ID = b,ID = b,ID = a,Offset and M-bit,ID controls assembly,Implementation,Frag,NI-2,Assembly,Route &Forwarding,NI-1,IP-in,Frag,Encapsulation,Assembly buffer,Data block,Assembly problems,integrity judgement of data block?Len=Length-1+length-2+ ?If frags a

13、rrived out of sequence?Missing some of fragments?Overlap among fragments,6. IP Options,OpCode,Option-1,Option-2,End,IP Option,The options may appear or not in datagrams. They must be implemented by all IP modules (host and gateways).CopyIndicates that this option is copied into all fragments on frag

14、mentation.Class0 = control1 = reserved for future use2 = debugging and measurement3 = reserved for future use,Security,This option provides a way for hosts to send security,compartmentation, handling restrictions, and TCC (closed user group) parameters. The format for this option is as follows:,Type

15、=130 Length=11,S:16bits,SecurityC:16bits,CompartmentationH:16bits,HandlingTCC:24bits,Closed User group,Loose Source and Record Route,The loose source and record route (LSRR) option provides a means for the source of an internet datagram to supply routing information to be used by the gateways in forwarding the datagram to the destination, and to record the route information.,

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 行业资料 > 其它行业文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号