008A-ICMP

简介

Internet控制消息协议ICMP(Internet Control Message Protocol)是网络层的一个重要协议。ICMP协议用来在网络设备间传递各种差错和控制信息,并对于收集各种网络信息、诊断和排除各种网络故障等方面起着至关重要的作用。使用基于ICMP的应用时,需要对ICMP的工作原理非常熟悉。

ICMP用来传递差错、控制、查询等信息

ICMP重定向
ICMP差错检测

  • ICMP Echo Request和ICMP Echo Reply分别用来查询和响应某些信息,进行差错检测

ICMP错误报告

  • 当网络设备无法访问目标网络时,会自动发送ICMP目的不可达报文到发送端设备

ICMP数据包格式
在这里插入图片描述

  • Type表示ICMP消息类型,Code表示同一消息类型中的不同信息

ICMP消息封装格式
在这里插入图片描述
ICMP消息头部格式
在这里插入图片描述
ICMP消息类型和编码类型

类型编码描述
00Echo Reply
30网络不可达
31主机不可达
32协议不可达
33端口不可达
50重定向
80Echo Request

更多见:报文格式大全.chm

ICMP应用-ping
<Huawei>ping ?
  -a             Select source IP address, the default is the IP address of the
                 output interface
  -c             Specify the number of echo requests to be sent, the default is
                 5
  -d             Specify the SO_DEBUG option on the socket being used
  -f             Set Don't Fragment flag in packet (IPv4-only)
  -h             Specify TTL value for echo requests to be sent, the default is
                 255
  -i             Select the interface sending packets
  -m             Time in milliseconds to wait for sending next packet, the
                 default is 500ms
  -n             Numeric output only. No attempt will be made to lookup host
                 addresses for symbolic names
  -name          Display the host name of the destination address
  -p             No more than 8 "pad" hexadecimal characters to fill out the
                 sent packet. For example -p f2 will fill the sent packet with
                 f and 2 repeatedly
  -q             Quiet output. Nothing is displayed except the summary lines at
                 startup time and when finished
  -r             Record route. Includes the RECORD_ROUTE option in the
                 ECHO_REQUEST packet and displays the route
  -s             Specify the number of data bytes to be sent, the default is
                 56bytes
  -si            Set the specified interface as the source interface of ping
  ---- More ----

ICMP应用-Tracert

<Huawei>tracert ?
  -a             Set source IP address, the default is the IP address of the
                 output interface
  -f             First time to live, the default is 1
  -m             Max time to live, the default is 30
  -p             Destination UDP port number, the default is 33434
  -q             Number of probe packet, the default is 3
  -vpn-instance  Specify VPN-Instance of MPLS VPN
  -w             Timeout in milliseconds to wait for each reply, the default is
                 5000ms
  STRING<1-255>  IP address or hostname of a remote system
  ipv6           IPv6 Protocol
  lsp            LSP traceroute
  vc             PWE3 traceroute

<Huawei>tracert 30.0.0.2
Tracert to 30.0.0.2(30.0.0.2), max hops:30, packet length:40, 
press CTRL_C to break 
1 10.0.0.2 130 ms 50 ms 40 ms 
2 20.0.0.2 80 ms 60 ms 80 ms
3 30.0.0.2 80 ms 60 ms 70 ms
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值