【2】ping命令


root@liujie-desktop:/over/aaa/tftp-1.1# ping

Usage: ping [-LRUbdfnqrvVaA] [-c count] [-i interval] [-w deadline]
            [-p pattern] [-s packetsize] [-t ttl] [-I interface or address]
            [-M mtu discovery hint] [-S sndbuf]
            [ -T timestamp option ] [ -Q tos ] [hop1 ...] destination

root@liujie-desktop:/over/aaa/tftp-1.1# ping -s 65535 172.16.20.120
Error: packet size 65535 is too large. Maximum is 65507
root@liujie-desktop:/over/aaa/tftp-1.1# ping -s 65515 172.16.20.120
WARNING: packet size 65515 is too large. Maximum is 65507
PING 172.16.20.120 (172.16.20.120) 65515(65543) bytes of data.
ping: local error: Message too long, mtu=1500
ping: local error: Message too long, mtu=1500
ping: local error: Message too long, mtu=1500
ping: local error: Message too long, mtu=1500
ping: local error: Message too long, mtu=1500
ping: local error: Message too long, mtu=1500
^C
--- 172.16.20.120 ping statistics ---
6 packets transmitted, 0 received, +6 errors, 100% packet loss, time 4999ms

root@liujie-desktop:/over/aaa/tftp-1.1# ping -s 65507 172.16.20.120
PING 172.16.20.120 (172.16.20.120) 65507(65535) bytes of data.
65515 bytes from 172.16.20.120: icmp_seq=1 ttl=128 time=2.85 ms
65515 bytes from 172.16.20.120: icmp_seq=2 ttl=128 time=1.89 ms
65515 bytes from 172.16.20.120: icmp_seq=3 ttl=128 time=1.92 ms
65515 bytes from 172.16.20.120: icmp_seq=4 ttl=128 time=1.82 ms
65515 bytes from 172.16.20.120: icmp_seq=5 ttl=128 time=1.91 ms
^C
--- 172.16.20.120 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 1.820/2.081/2.857/0.393 ms

发送一个数据包,包大小为65507

root@liujie-desktop:/over/aaa/tftp-1.1# ping -s 65507 -c 1 172.16.20.120
PING 172.16.20.120 (172.16.20.120) 65507(65535) bytes of data.
65515 bytes from 172.16.20.120: icmp_seq=1 ttl=128 time=2.32 ms

--- 172.16.20.120 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms


C:\Documents and Settings\Administrator>ping -l 65501 192.168.10.14
Bad value for option -l, valid range is from 0 to 65500.

C:\Documents and Settings\Administrator>ping -l 65500 192.168.10.14

Pinging 192.168.10.14 with 65500 bytes of data:

Reply from 192.168.10.14: bytes=65500 time=4ms TTL=64
Reply from 192.168.10.14: bytes=65500 time=1ms TTL=64
Reply from 192.168.10.14: bytes=65500 time=1ms TTL=64
Reply from 192.168.10.14: bytes=65500 time=1ms TTL=64

Ping statistics for 192.168.10.14:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 1ms, Maximum = 4ms, Average = 1ms
100 ==20字节的首部 + TYPE(1byte icmp消息类型) + code (1) + 校验和(2) + 标识 (2) + 序号(2) + 92 数据

root@liujie-desktop:/over/aaa/tftp-1.1# ping -s 92 -c 1 172.16.20.120
PING 172.16.20.120 (172.16.20.120) 92(120) bytes of data.
100 bytes from 172.16.20.120: icmp_seq=1 ttl=128 time=0.370 ms

--- 172.16.20.120 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.370/0.370/0.370/0.000 ms



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值