一 ping概述:
(1)用途:用来测试两个主机之间的连通性。
ping使用了ICMP回送请求和回送回答报文。发送一份ICMP回显请求,并等待返回ICMP回显应答。
ping是应用层直接使用网络层ICMP的一个例子,它没有通过运输层的TCP或UDP。
(2)选项:
*-b:ping广播地址。
*-c count:设置接收ICMP回显应答的数量,接收count个后,就停止。
*-f:If interval is not given,it sets interval to zero and outputs packets as fast as they come back or one hundred per second,whichever is more.使用-f的ping会给计算机和网络造成很大负责,所有只有root可以使用。
*-i interval:设定数据包发送间隔为interval秒。The default is to wait for one second between each packet-normally,or not to wait in flood mode. Only super-user may set interval to values less 0.2 seconds.
*-s packetsize:指定发送数据的字节大小。默认是56字节,加上ICMP首部的8个字节,共64字节。
*-t ttl:set the IP Time to live。