【2】ping命令

来源:互联网 发布:linux应用软件 编辑:程序博客网 时间:2024/06/07 03:56


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.120Error: packet size 65535 is too large. Maximum is 65507
root@liujie-desktop:/over/aaa/tftp-1.1# ping -s 65515 172.16.20.120WARNING: packet size 65515 is too large. Maximum is 65507PING 172.16.20.120 (172.16.20.120) 65515(65543) bytes of data.ping: local error: Message too long, mtu=1500ping: local error: Message too long, mtu=1500ping: local error: Message too long, mtu=1500ping: local error: Message too long, mtu=1500ping: local error: Message too long, mtu=1500ping: 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.120PING 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 ms65515 bytes from 172.16.20.120: icmp_seq=2 ttl=128 time=1.89 ms65515 bytes from 172.16.20.120: icmp_seq=3 ttl=128 time=1.92 ms65515 bytes from 172.16.20.120: icmp_seq=4 ttl=128 time=1.82 ms65515 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 4006msrtt 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.120PING 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.14Bad value for option -l, valid range is from 0 to 65500.C:\Documents and Settings\Administrator>ping -l 65500 192.168.10.14Pinging 192.168.10.14 with 65500 bytes of data:Reply from 192.168.10.14: bytes=65500 time=4ms TTL=64Reply from 192.168.10.14: bytes=65500 time=1ms TTL=64Reply from 192.168.10.14: bytes=65500 time=1ms TTL=64Reply from 192.168.10.14: bytes=65500 time=1ms TTL=64Ping 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.120PING 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 0msrtt min/avg/max/mdev = 0.370/0.370/0.370/0.000 ms



原创粉丝点击