分类: 网络与安全
2008-03-12 09:39:13
Windows 和linux ping 的比较:
Table 14-2: Ping Command
Comparison |
|
Option |
Explanation |
-c |
Number of echo requests to send. |
-f (Unix) |
Flood Ping, which sends out as many |
-f (Windows) |
Sets the Don't Fragment flag in the IP header of the echo request. |
-i |
Waits for this number of seconds between |
-m |
Specifies the TTL value, which indicates how many hops (or intermediate
route points) it should travel before giving up. |
-v |
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 |
-p |
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 |
-R (Unix) |
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 |
-j |
Uses loose source routing to force the packet to pass through the
specified hosts. |
-k |
Uses strict source routing to force the packet to pass through the exact
route specified in the host list. |
-s |
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 |
Stops Pinging the host after wait seconds. Waits timeout
milliseconds before giving up on a |
-t (Windows) |
Pings the target host until the command is terminated. |
Windows中的Cygwin提供了和linux类似的ping功能
Ping的滥用如下:
*
发送大于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,可以在路由器和防火墙上面禁止。