计算机网络(本科)TCPiP协议及应用ppt课件.ppt
《计算机网络(本科)TCPiP协议及应用ppt课件.ppt》由会员分享,可在线阅读,更多相关《计算机网络(本科)TCPiP协议及应用ppt课件.ppt(201页珍藏版)》请在三一办公上搜索。
1、TCP/IP协议及应用,第七章,主要内容,协议栈IP地址TCP/IP协议IPv6,1、TCP/IP协议栈,Application,Presentation,Session,Transport,Network,Data link,Physical,1,2,3,4,5,6,7,2、IP地址,IPv4,2.1 IPv4,2.1 IPv4逻辑地址分类,2.1 IPv4地址范围,2.1 IPv4-特殊地址,网络地址,2.1 IPv4-特殊地址,指定网络广播地址(路由器可转发),2.1 IPv4-特殊地址,受限广播地址(路由器不转发),2.1 IPv4-特殊地址,回环地址,2.1 IPv4-特殊地址,公共
2、地址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的互连,2.1 IPv4-特殊地址,2.1 IPv4-特殊地址,物理地址(48bits)Ipconfig /allRoute Print,特殊地址小结,特殊地址网络地址,不可以用作主机地址广播地址
3、,不可以用作主机地址回环地址公共地址内部地址,一个主机发送一个分组时如何发现目的地在那里?网络掩码,2.2 IPv4 Network Mask,Def. 网络掩码:用于标志网络地址和主机地址的代码。不同类型的网络(A、B、C)具有不同的网络掩码255.0.0.0 255.255.0.0 255.255.255.0网络地址的获取:逻辑“与”,2.2 Sub-Network Mask,划分网络号和主机边界对子网进行精确的划分,减小子网络空间子网掩码就是将Hostid的一部分作为网络Netid的延伸掩码地址的格式:前N位1+后M位0=32掩码地址“与”IP地址 = 对应子网的“实际网络地址”,路由特
4、点子网划分对外部的路由器是透明的对子网内部的路由器是不透明的,2.2 Sub-Network Mask,子网掩码举例,子网掩码举例,学校将 202.183.56.0(C类地址)分配给两个系,每个系约有120台计算机。掩码地址可定义为:255.255.255.128系1地址范围:202.183.56.1202.183.56.126 子网地址:11001010 10110111 00111000 0 xxxxxxx系2地址范围:202.183.56.129202.183.56.254 子网地址:11001010 10110111 00111000 1xxxxxxx,思考题:已知网络地址202.11
5、2.11.0今有A、B、C三个机构需要的ip地址分别为120、60和62个,如何划分子网,子网掩码、地址和ip地址范围是多少?,3 TCP/IP协议,网络层协议: ICMP IGMP ARP RARP传输层协议: UDP TCP 应用层协议: SMTP/POP HTTP DNS FTP,不同层次的协议,数据帧的分用过程,3.1 网络层协议,网络层协议格式头格式ARP/RARPICMPIGMP,Version (4 bits): tells that this is IP Version 4 (IPv4),IPv4 header structure,IPv4 header structure,H
6、eader length (4 bits) is needed since Options + Padding can vary in length.Options:Security (packet classification), Strict source routing (the whole routing list), Loose source routing (the mandatory routing list), Record route (record the IP address of each hop), Timestamp (record the IP address a
7、nd timestamp of each hop).,IPv4 header structure,Version,IHL,Type of Service,Total length of IP datagram,Identification,Flags,Fragment offset,Time-to-live,Protocol,Header checksum (for error control),Source IP address,Destination IP address,Options,Padding,Payload of IP datagram,ToS = Type of Servic
8、e (8 bits) is used for QoS management purposes.The first 3 bits of TOS indicate priorities, 0 being low (normal packet) and 7 being high (network control packet); the next 3 bits indicate service types, being delay, throughput, and reliability; the last 2 bits are reserved. Source could use service
9、type bits to indicate the routing metrics to be used.,IPv4 header structure,Version,IHL,Type of Service,Total length of IP datagram,Identification,Flags,Fragment offset,Time-to-live,Protocol,Header checksum (for error control),Source IP address,Destination IP address,Options,Padding,Payload of IP da
10、tagram,Datagram length (16 bits): since this field is 16 bits long, the IP datagram can contain up to 216 = 65535 bytes (in theory).Most routers, however, cannot handle such large datagrams.,SEU 31,IPv4 header structure,Version,IHL,Type of Service,Total length of IP datagram,Identification,Flags,Fra
11、gment offset,Time-to-live,Protocol,Header checksum (for error control),Source IP address,Destination IP address,Options,Padding,Payload of IP datagram,IP fragmentation: a large IP datagram may be fragmented (in any router along the path) and will be reassembled at the destination.Flags: 1st bit rese
12、rved; 2nd bit DF, 0fragment yes, 1fragment no; 3rd bit MF, 0last fragment, 1more fragment.,All fragments contain the same number,Has value zero in last fragment,Position of fragment in original datagram,IPv4 header structure,Version,IHL,Type of Service,Total length of IP datagram,Identification,Flag
13、s,Fragment offset,Time-to-live,Protocol,Header checksum (for error control),Source IP address,Destination IP address,Options,Padding,Payload of IP datagram,Time-to-live (8 bits): this number is decreased by one in each router along the path. If number zero is reached in a router, IP datagram is disc
14、arded and router sends an ICMP message (TTL expired) to the source of the datagram.,SEU 33,IPv4 header structure,Version,IHL,Type of Service,Total length of IP datagram,Identification,Flags,Fragment offset,Time-to-live,Protocol,Header checksum (for error control),Source IP address,Destination IP add
15、ress,Options,Padding,Payload of IP datagram,Protocol field (8 bits): describes which higher layer protocol is used (TCP, UDP, SCTP .). The header of this upper protocol is located at the beginning of the IP datagram payload.e.g. 6TCP, 17UDP, 1ICMP, 89OSPF, etc.,Starts here .,SEU 34,IPv4 header struc
16、ture,Version,IHL,Type of Service,Total length of IP datagram,Identification,Flags,Fragment offset,Time-to-live,Protocol,Header checksum (for error control),Source IP address,Destination IP address,Options,Padding,Payload of IP datagram,Header checksum (16 bits): used for error control (if used, rout
17、ers along the path have to recalculate the checksum).This kind of error control is not used in IPv6 (since the same error control function is offered by TCP - and even UDP).,SEU 35,IPv4 header structure,Version,IHL,Type of Service,Total length of IP datagram,Identification,Flags,Fragment offset,Time
18、-to-live,Protocol,Header checksum (for error control),Source IP address,Destination IP address,Options,Padding,Payload of IP datagram,Source and destination IP address (32 bits each): note that these addresses are not changed in routers along the route.,通过捕获的分组查看IP头格式,地址解析协议(ARP/RARP),ARP/RARP,ARP帧格
19、式,ARP分组格式,以太网为1,IP0800,硬件地址长度,协议地址长度,ARP,example,broadcast,unicast,使用ARP协议的四种情况,ARP缓存-cache,Arp a g s d 主机内设置缓冲区,是为了快速查找通过主机演示 Arp -aArp dArp s,C:Documents and SettingsAdministratorPING 172.18.12.199Pinging 172.18.12.199 with 32 bytes of data:Reply from 172.18.12.199: bytes=32 timeARP -DC:Documents
20、and SettingsAdministratorARP -ANo ARP Entries FoundC:Documents and SettingsAdministratorARP -S 172.18.12.199 00-88-88-88-88-88C:Documents and SettingsAdministratorAPR -AAPR 不是内部或外部命令,也不是可运行的程序或批处理文件。,C:Documents and SettingsAdministratorARP -AInterface: 172.18.12.192 - 0 x10005 Internet Address Phys
21、ical Address Type 172.18.12.199 00-88-88-88-88-88 staticC:Documents and SettingsAdministratorPING 172.18.12.199Pinging 172.18.12.199 with 32 bytes of data:Request timed out.Request timed out.Request timed out.Request timed out.Ping statistics for 172.18.12.199: Packets: Sent = 4, Received = 0, Lost
22、= 4 (100% loss),C:Documents and SettingsAdministratorARP -DC:Documents and SettingsAdministratorARP -ANo ARP Entries Found,C:Documents and SettingsAdministratorPING 172.18.12.199Pinging 172.18.12.199 with 32 bytes of data:Reply from 172.18.12.199: bytes=32 time,通过sniffer工具察看保存结果,Arp欺骗,A: ip地址 192.16
23、8.0.1 硬件地址 AA:AA:AA:AA:AA:AAB: ip地址 192.168.0.2 硬件地址 BB:BB:BB:BB:BB:BBC: ip地址 192.168.0.3 硬件地址 CC:CC:CC:CC:CC:CC,Arp欺骗的实施,研究192.0.0.3这台主机,发现这台主机的漏洞。根据发现的漏洞使主机A当掉,暂时停止工作。这段时间里,入侵者把自己的ip改成192.0.0.3 发一个源ip地址为192.168.0.3,源MAC地址为BB:BB:BB:BB:BB:BB的包给主机C,要求主机C更新自己的arp转换表。 主机更新了arp表中关于主机A的ip-mac对应关系。防火墙失效了,
24、入侵的ip变成合法的mac地址,可以telnet 了。,ARP欺骗的防范,不要把网络安全信任关系建立在ip地址的基础上或硬件mac地址基础上,理想的关系应该建立在ip+mac基础上。 设置静态的mac-ip对应表,不要让主机刷新设定好的转换表。,ARP Proxy,RARP,RARP,RARP,思考题:1、如何利用ARP协议实现一个LAN内的IP地址使用情况监控?2、ARP攻击的基本原理?,3.1.2 ICMP,用于网络设备和结点之间的控制和差错报文的传输(主机之间,而不是应用之间)Error message一些网络错误信息Ping测试工具Traceroute路由跟踪windows trace
25、rt封装于IP数据包内部,ICMP,ICMP报文分类,覆盖整个ICMP报文,共有15种类型,ICMP报文分类,ICMP报文分类,ICMP 差错报文,ICMP 差错报文,封装形式,ICMP差错报文包含原ip数据报的头部和前8个数据字节,目的是使接受该ICMP报文的主机识别上层协议与应用进程,ICMP 差错报文,目的不可达,ICMP 差错报文,重定向分组中含有路由信息,路由优化,A要发送分组到B,通过默认路由到R1,R1转发时发现下一跳是R2,并且A、R1、R2直接互联。,ICMP 差错报文,重定向重定向报文只能由路由器产生重定向报文是用于主机而不是路由器的,ICMP 查询报文,ICMP 查询报文
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 计算机网络 本科 TCPiP 协议 应用 ppt 课件
链接地址:https://www.31ppt.com/p-1438935.html