您好,欢迎访问三七文档
当前位置:首页 > IT计算机/网络 > 网络与通信 > 计算机网络(本科)TCPiP协议及应用
TCP/IP协议及应用第七章主要内容1.协议栈2.IP地址3.TCP/IP协议4.IPv61、TCP/IP协议栈ApplicationPresentationSessionTransportNetworkDatalinkPhysical12345672、IP地址IPv42.1IPv42.1IPv4逻辑地址分类2.1IPv4地址范围2.1IPv4-特殊地址网络地址2.1IPv4-特殊地址指定网络广播地址(路由器可转发)2.1IPv4-特殊地址受限广播地址(路由器不转发)2.1IPv4-特殊地址回环地址2.1IPv4-特殊地址公共地址IETF分别从A、B、C三类地址中取出一段地址范围保留用作内部网络地址,他们分别是:10.0.0.0~10.255.255.255172.16.0.0~172.31.255.255192.168.0.0~192.168.255.255这些地址范围是专门用来标识内部网络的,不能用来访问Internet,因为Internet上路由器不会转发目标地址在上述三个范围内的数据包。公共地址与Internet的互连NAT专用网本地主机x1.x2.x3.x4源地址a3.b3.c3.d3a1.b1.c1.d1a2.b2.c2.d2…an.bn.cn.dn公共IP地址库源地址x1.x2.x3.x4源地址x1.x2.x3.x4Internet2.1IPv4-特殊地址2.1IPv4-特殊地址物理地址(48bits)Ipconfig/allRoutePrint特殊地址小结特殊地址网络地址,不可以用作主机地址广播地址,不可以用作主机地址回环地址公共地址内部地址一个主机发送一个分组时如何发现目的地在那里?网络掩码2.2IPv4NetworkMaskDef.网络掩码:用于标志网络地址和主机地址的代码。不同类型的网络(A、B、C)具有不同的网络掩码255.0.0.0255.255.0.0255.255.255.0网络地址的获取:逻辑“与”2.2Sub-NetworkMask划分网络号和主机边界对子网进行精确的划分,减小子网络空间子网掩码就是将Hostid的一部分作为网络Netid的延伸掩码地址的格式:前N位1+后M位0=32掩码地址“与”IP地址=对应子网的“实际网络地址”路由特点子网划分对外部的路由器是透明的对子网内部的路由器是不透明的2.2Sub-NetworkMask子网掩码举例路由器202.183.56.1xxxxxxx202.183.56.0xxxxxxx路由器202.183.56.xxxxxxxxx子网掩码举例学校将202.183.56.0(C类地址)分配给两个系,每个系约有120台计算机。掩码地址可定义为:255.255.255.128系1地址范围:202.183.56.1—202.183.56.126子网地址:1100101010110111001110000xxxxxxx系2地址范围:202.183.56.129—202.183.56.254子网地址:1100101010110111001110001xxxxxxx思考题:已知网络地址202.112.11.0今有A、B、C三个机构需要的ip地址分别为120、60和62个,如何划分子网,子网掩码、地址和ip地址范围是多少?3TCP/IP协议网络层协议:ICMPIGMPARPRARP传输层协议:UDPTCP应用层协议:SMTP/POPHTTPDNSFTP…不同层次的协议数据帧的分用过程3.1网络层协议网络层协议格式头格式ARP/RARPICMPIGMPVersionIHLTypeofServiceTotallengthofIPdatagramIdentificationFlagsFragmentoffsetTime-to-liveProtocolHeaderchecksum(forerrorcontrol)SourceIPaddressDestinationIPaddressOptionsPaddingPayloadofIPdatagramVersion(4bits):tellsthatthisisIPVersion4(IPv4)IPv4headerstructureIPv4headerstructureVersionIHLTypeofServiceTotallengthofIPdatagramIdentificationFlagsFragmentoffsetTime-to-liveProtocolHeaderchecksum(forerrorcontrol)SourceIPaddressDestinationIPaddressOptionsPaddingPayloadofIPdatagramHeaderlength(4bits)isneededsinceOptions+Paddingcanvaryinlength.Options:Security(packetclassification),Strictsourcerouting(thewholeroutinglist),Loosesourcerouting(themandatoryroutinglist),Recordroute(recordtheIPaddressofeachhop),Timestamp(recordtheIPaddressandtimestampofeachhop).IPv4headerstructureVersionIHLTypeofServiceTotallengthofIPdatagramIdentificationFlagsFragmentoffsetTime-to-liveProtocolHeaderchecksum(forerrorcontrol)SourceIPaddressDestinationIPaddressOptionsPaddingPayloadofIPdatagramToS=TypeofService(8bits)isusedforQoSmanagementpurposes.Thefirst3bitsofTOSindicatepriorities,0beinglow(normalpacket)and7beinghigh(networkcontrolpacket);thenext3bitsindicateservicetypes,beingdelay,throughput,andreliability;thelast2bitsarereserved.Sourcecoulduseservicetypebitstoindicatetheroutingmetricstobeused.IPv4headerstructureVersionIHLTypeofServiceTotallengthofIPdatagramIdentificationFlagsFragmentoffsetTime-to-liveProtocolHeaderchecksum(forerrorcontrol)SourceIPaddressDestinationIPaddressOptionsPaddingPayloadofIPdatagramDatagramlength(16bits):sincethisfieldis16bitslong,theIPdatagramcancontainupto216=65535bytes(intheory).Mostrouters,however,cannothandlesuchlargedatagrams.SEU31IPv4headerstructureVersionIHLTypeofServiceTotallengthofIPdatagramIdentificationFlagsFragmentoffsetTime-to-liveProtocolHeaderchecksum(forerrorcontrol)SourceIPaddressDestinationIPaddressOptionsPaddingPayloadofIPdatagramIPfragmentation:alargeIPdatagrammaybefragmented(inanyrouteralongthepath)andwillbereassembledatthedestination.Flags:1stbit–reserved;2ndbit–DF,0=fragmentyes,1=fragmentno;3rdbit–MF,0=lastfragment,1=morefragment.AllfragmentscontainthesamenumberHasvaluezeroinlastfragmentPositionoffragmentinoriginaldatagramIPv4headerstructureVersionIHLTypeofServiceTotallengthofIPdatagramIdentificationFlagsFragmentoffsetTime-to-liveProtocolHeaderchecksum(forerrorcontrol)SourceIPaddressDestinationIPaddressOptionsPaddingPayloadofIPdatagramTime-to-live(8bits):thisnumberisdecreasedbyoneineachrouteralongthepath.Ifnumberzeroisreachedinarouter,IPdatagramisdiscardedandroutersendsanICMPmessage(TTLexpired)tothesourceofthedatagram.SEU33IPv4headerstructureVersionIHLTypeofServiceTotallengthofIPdatagramIdentificationFlagsFragmentoffsetTime-to-liveProtocolHeaderchecksum(forerrorcontrol)SourceIPaddressDestinationIPaddressOptionsPaddingPayloadofIPdatagramProtocolfield(8bits):describeswhichhigherlayerprotocolisused(TCP,UDP,SCTP...).TheheaderofthisupperprotocolislocatedatthebeginningoftheIPdatagrampayload.e.g.6=TCP,17=UDP,1=ICMP,89=OSPF,etc.Startshere...SEU34IPv4headerstructureVersionIHLTypeofServiceTotallengthofIPdatagramIdentificationFlagsFragmentoffsetTime-to-liveProtocolHeaderchecksum(forerrorcontrol)SourceIPaddressDestinationIPaddressOptionsPaddingPayloadofIPdatagramHeaderchecksum(16bits):usedforerrorcontrol(ifused,routersalongthepathhavetorecalculatethechecksum).ThiskindoferrorcontrolisnotusedinIPv6(sincethesameerrorcontrolfunctionisofferedbyTCP-andevenUDP).SEU35IPv4headerstructureVersionIHLTypeofServiceTotallengthof
本文标题:计算机网络(本科)TCPiP协议及应用
链接地址:https://www.777doc.com/doc-8613956 .html