计算机网络(本科)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.2IPv4NetworkMaskDef.网络掩码:用于标志网络地址和主机地址的代码。不同类型的网络(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/RARPICMPIGMPVersionIHLTypeofServiceTotallengthofIPdatagramIdentificationFlagsFragmentoffsetTime-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

1 / 201
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功