ICMP ICMPInternet Control Message Protocol Internet RFC 792

  • Slides: 39
Download presentation

ICMP

ICMP

ICMP(Internet Control Message Protocol) Internet控制报文协议。 RFC 792 • 控制与检测IP packet 传输过程中的状态与错 误 (Used to

ICMP(Internet Control Message Protocol) Internet控制报文协议。 RFC 792 • 控制与检测IP packet 传输过程中的状态与错 误 (Used to communicate IP status and error messages between host and routers ) • ICMP控制消息虽然并不传输用户数据,但是 对于用户数据的传递起着重要的作用

Basic ICMP Headers are 32 bits in length; all contain same three fields type

Basic ICMP Headers are 32 bits in length; all contain same three fields type - 8 bit message type code thirteen message type are defined code - 8 bit; indicating why message is being sent checksum - standard internet checksum 16 bit 1’s complement sum of the payload and header for purpose of calculation the checksum field is set to zero

ICMP

ICMP

ICMP Message types ICMP消息类型 0 - Echo Reply 回显应答(Ping应答) 3 - Destination Unreachable 目标不可达

ICMP Message types ICMP消息类型 0 - Echo Reply 回显应答(Ping应答) 3 - Destination Unreachable 目标不可达 4 - Source Quench 源端被关闭(基本流控制) 5 - Redirect 重定向或改变路由 8 - Echo 回显请求(Ping请求) 9 - Router advertisement 路由器通告 10 -Route solicitation 路由器请求 11 - Time Exceeded 生存时间 12 - Parameter Problem 参数错误 13 - Timestamp 14 - Timestamp Reply 15 - Information Request 16 - Information Reply 17 - Address Mask Request 地址掩码请求 18 - Address Mask Reply 地址掩码应答

目标不可达 Destination Unreachable Codes: 0 - net unreachable ; 网络不可达 1 - host unreachable

目标不可达 Destination Unreachable Codes: 0 - net unreachable ; 网络不可达 1 - host unreachable 主机不可达 2 - protocol unreachable ; 协议不可达 3 - port unreachable sent by destination host IP module 端口不可达 4 - fragmentation needed DF set ; 需要进行分片但设置不分片比特 5 source route failed 源站路由失败 6 - destination network unknown ; 目的网络未知 7 destination host unknown 目的主机未知 8 - source host isolated ; 源主机被隔离(作废不用) 9 - comm. with destn network prohibited 目的网络被强制禁止 10 - comm. With dest host prohibited ; 目的主机被强制禁止 11 - network unreachable for service 由于服务类型TOS,网络不可达 12 - host unreachable for service 由于服务类型TOS,主机不可达 13 Communication administratively prohibited by filtering——由于过滤,通信被强制禁止 14 Host precedence violation 主机越权 15 Precedence cutoff in effect 优先中止生效

重定向或改变路由 Redirect (5) Code: 0 - redirect datagrams for the network 对网络重 定向 1

重定向或改变路由 Redirect (5) Code: 0 - redirect datagrams for the network 对网络重 定向 1 - redirect datagrams for the host 对主机重定向 2 - redirect datagrams for the type of service and the network 对服务类型和网 络重定向 3 - redirect datagrams for the type of service and host 对服务类型和主机重 定向

ICMP

ICMP

ICMP

ICMP

ICMP

ICMP

ICMP

ICMP

ICM P

ICM P

ICMPv 6 • This new version, Internet Control Message Protocol version 6 ( ICMPv

ICMPv 6 • This new version, Internet Control Message Protocol version 6 ( ICMPv 6 ), follows the same strategy and purposes of version 4 • ICMPv 6, however, is more complicated than ICMPv 4 • Some protocols that were independent in version 4 are now part of ICMPv 6 • Some new messages have been added to make it more useful

ICMP v 6 • Comparison of network layers in version 4 and version 6

ICMP v 6 • Comparison of network layers in version 4 and version 6 • Taxonomy of ICMPv 6 messages

ICMPv 6 Error Messages • One of the main responsibilities of ICMP is to

ICMPv 6 Error Messages • One of the main responsibilities of ICMP is to report errors • Four types of errors are handled • Destination unreachable • Packet too big • Time exceeded • Parameter problems

Error Messages ( cont ’) q Destination unreachable message Code 0 : No path

Error Messages ( cont ’) q Destination unreachable message Code 0 : No path to destination Code 1 : Communication is prohibited Code 2 : Beyond the scope of source address Code 3 4 5 6 : : Destination address is unreachable Port unreachable Source address failed (filtering policy) Reject route to destination

Error Messages ( cont ’) • Packet-too-big message • If a router receives a

Error Messages ( cont ’) • Packet-too-big message • If a router receives a datagram that is larger than the maximum transmission unit (MTU) size of the network through which the datagram should pass. • • Discarding the datagram • Then, sending an ICMP error packet to the source MTU field : informing the sender of the maximum size packet accepted by the network

ICMPv 6 Informational Messages • Two of the ICMPv 6 messages can be categorized

ICMPv 6 Informational Messages • Two of the ICMPv 6 messages can be categorized as informational messages • Echo request and echo reply messages • A host or router can send an echo request message to another host; the receiving computer or router can reply using the echo response message

Informational Messages ( cont ’) • Echo-request message • Echo-reply message

Informational Messages ( cont ’) • Echo-request message • Echo-reply message

ICMPv 6 Neighbor-Discovery Message • Several messages in the ICMPv 4 have been redefined

ICMPv 6 Neighbor-Discovery Message • Several messages in the ICMPv 4 have been redefined in ICMPv 6 to handle the issue of neighbor discovery • The most important issue is the definition of two new protocols that clearly define the functionality of these group messages • Neighbor-Discovery (ND) protocol • Inverse-Neighbor-Discovery (IND) protocol

Neighbor-Discovery Message ( cont ’) q Router Solicitation and Advertisement An option is added

Neighbor-Discovery Message ( cont ’) q Router Solicitation and Advertisement An option is added to allow the host to announce its physical address to make it easier for the router to respond. q Router-solicitation message q Router-advertisement message

Neighbor-Discovery Message ( cont ’) • Neighbor-solicitation message

Neighbor-Discovery Message ( cont ’) • Neighbor-solicitation message

Neighbor-Discovery Message ( cont ’) • Neighbor advertisement message

Neighbor-Discovery Message ( cont ’) • Neighbor advertisement message

Neighbor-Discovery Message ( cont ’) • Redirection message • An option is added to

Neighbor-Discovery Message ( cont ’) • Redirection message • An option is added to let the host know the physical address of the target router

Neighbor-Discovery Message ( cont ’) • Inverse-neighbor-solicitation message • Inverse-neighbor-advertisement message

Neighbor-Discovery Message ( cont ’) • Inverse-neighbor-solicitation message • Inverse-neighbor-advertisement message

ICMPv 6 Group Membership Message • The management of multicast delivery handling in IPv

ICMPv 6 Group Membership Message • The management of multicast delivery handling in IPv 4 is given to the IGMPv 3 protocol • In IPv 6, this responsibility is given to the Multicast Listener Delivery protocol • MLDv 1 is the counterpart to IGMPv 2; MLDv 2 is the counterpart to IGMPv 3 • The idea is the same as in IGMPv 3, but the sizes and formats of the messages have been changed to fit the larger multicast address size in IPv 6.

Group Membership Message ( cont ’) • Membership query message format

Group Membership Message ( cont ’) • Membership query message format

Group Membership Message ( cont ’) • Membership-report message format

Group Membership Message ( cont ’) • Membership-report message format

ping -6

ping -6

wireshark

wireshark

Ping DOS 攻击

Ping DOS 攻击

c语言实现ping源码 https: //blog. csdn. net/earbao/article/details/17265853? depth_1 utm_source=distribute. pc_relevant. nonetask&utm_source=distribute. pc_relevant. none-task 从Android源码中拷贝下来的,可以在Linux直接编译运行

c语言实现ping源码 https: //blog. csdn. net/earbao/article/details/17265853? depth_1 utm_source=distribute. pc_relevant. nonetask&utm_source=distribute. pc_relevant. none-task 从Android源码中拷贝下来的,可以在Linux直接编译运行

Thanks

Thanks