Chinaunix首页 | 论坛 | 博客
  • 博客访问: 19882191
  • 博文数量: 679
  • 博客积分: 10495
  • 博客等级: 上将
  • 技术积分: 9308
  • 用 户 组: 普通用户
  • 注册时间: 2006-07-18 10:51
文章分类

全部博文(679)

文章存档

2012年(5)

2011年(38)

2010年(86)

2009年(145)

2008年(170)

2007年(165)

2006年(89)

分类: 网络与安全

2008-03-12 09:39:13

§14.2           PING

Windows linux ping 的比较:

Table 14-2: Ping Command Comparison

Option

Explanation

-c (Unix)
-n (Windows)

Number of echo requests to send.

-f (Unix)

Flood Ping, which sends out as many Pings as fast as it can. Prints a dot (.) for each request it sends out and a backspace (H ) for every reply it receives. Provides a visual method of seeing how many packets you're dropping. Also a good way to eat up bandwidth! Only the super user can use this option.

-f (Windows)

Sets the Don't Fragment flag in the IP header of the echo request.

-i > (Unix)

Waits for this number of seconds between Pings (default is 1).

-m > (Unix)
-i > (Windows)

Specifies the TTL value, which indicates how many hops (or intermediate route points) it should travel before giving up.

-v > (Windows)

Specifies the Type of Service (TOS) value. The TOS flags tell IP stacks how they should handle certain packets. TOS is specified as a 4-bit number where 1 = minimize monetary cost, 2 = maximize reliability, 4 = maximize throughput, and 8 = minimize delay.

-n (Unix) -a (Windows)

The –n option in Unix tells Ping not to look up names for IP addresses (i.e., numeric output only). The –a option in Windows tells Ping that it should look up names for IP addresses. Unix Ping and Windows Ping utilities handle name resolution differently by default.

-p > (Unix)

Lets you pad the header of the ICMP packet you're sending with a specific data pattern to see if you get that same data pattern back in return.

-q (Unix)

Doesn't display the actual Pings—only the summary of Pings at program termination.

-R (Unix)
-r (Windows)

Specifies the "record route" option in the ICMP packet (for count number of hops in Windows). If routers pay attention to this option, they'll record the route the packet takes in the IP options and it will be displayed by Ping when it receives the response packet. Just as most routers ignore source routing options, they ignore this option as well.

-j > (Windows)

Uses loose source routing to force the packet to pass through the specified hosts.

-k > (Windows)

Uses strict source routing to force the packet to pass through the exact route specified in the host list.

-s > (Unix) -l > (Windows)

Lets you specify the size of the ICMP packet. An ICMP header is 8 bytes long, so your actual packet will be size + 8 bytes. 56 bytes is the default size for Unix, 24 for Windows. This translates to 64 and 32 bytes, respectively, when you figure in the 8-byte ICMP header.

-w > (Unix)
-w > (Windows)

Stops Pinging the host after wait seconds. Waits timeout milliseconds before giving up on a Ping request.

-t (Windows)

Pings the target host until the command is terminated.

 

Windows中的Cygwin提供了和linux类似的ping功能
 
Ping的滥用如下:

     Ping of Death

        发送大于65,536 bytes的包,主要问题在于deals with reassembling fragmented packets. Windows 95 and versions of NT可以发送大于65,536 bytes的包,其他的不可以。

     Smurfing

Ping广播地址可能导致Denial-of-Service (DoS)。大量的ICMP echo replies back to the Pinging host 会导致ping的机器崩溃。可以利用IP欺骗引向其他server,导致其崩溃。实现方法见第一章。解决的办法是系统不回应广播的ping,可以在路由器和防火墙上面禁止。

阅读(6910) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2008-03-12 09:41:06

上一篇:http://blog.chinaunix.net/u/21908/showart.php?id=494249