• 全部
  • 经验案例
  • 典型配置
  • 技术公告
  • FAQ
  • 漏洞说明
  • 全部
  • 全部
  • 大数据引擎
  • 知了引擎
产品线
搜索
取消
案例类型
发布者
是否解决
是否官方
时间
搜索引擎
匹配模式
高级搜索

Detailed Description and Small Skills of Ping Command in Windows

2007-09-26 发表
  • 0关注
  • 0收藏 453浏览
粉丝: 关注:

Detailed Description and Small Skills of Ping Command in Windows

We are all familiar with the ping command in Windows, but not all of us can maximize its function. I would like to share with you my experience in using the command.

  Against the help description of the ping command, I will introduce my skills in using the command. It can be used only after TCP/IP is installed.

  ping [-t] [-a] [-n count] [-l length] [-f] [-i ttl] [-v tos] [-r count] [-s count] [[-j computer-list] | [-k computer-list]] [-w timeout] destination-list

  Options:

  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.

  Continuously ping the local host, until you press Ctrl+C.

  This function has no special skills, but can be used in coordination with other parameters (mentioned later).

 

  -a Resolve addresses to hostnames.

  Resolve the NetBios name of PC.

  Example: C:\>ping -a 192.168.1.21

  Pinging ***.*** [192.168.1.21] with 32 bytes of data:

  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254

  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254

  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254

  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254

  Ping statistics for 192.168.1.21:

  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:

  Minimum = 0ms, Maximum = 0ms, Average = 0ms

  The above shows that the NetBios name of the PC with its IP being 192.168.1.21 is ***.***.

 

  -n count Number of echo requests to send.

  Send the number of echo packets specified by count.

1  Four packets are sent by default. You can use this command to customize the sending count, which is helpful for measuring the network speed. For example, perform the following operation to test the average/maximum/minimum time when 50 packets are returned:

  C:\>ping -n 50 202.103.96.68

  Pinging 202.103.96.68 with 32 bytes of data:

  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241

  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241

  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241

  Request timed out.

  ??????

  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241

  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241

  Ping statistics for 202.103.96.68:

  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:

  Minimum = 40ms, Maximum = 51ms, Average = 46ms

  The above shows that 48 packets are returned among 50 packets sent to 202.103.96.68, and two packets are lost due to unknown reasons. For the return of 48 packets, the minimum time is 40ms, the maximum time is 51ms, and the average time is 46ms.

 

  -l size Send buffer size.

  Define the size of echo packet.

  The size of ping packets in Windows is 32 bytes by default. You can customize the size and limit it to 65500 bytes. Such limit is set because of a security hole of Windows system (including other systems maybe). That is, when 65532 bytes or more are sent to the remote end for once, the remote end probably becomes down. Therefore, Microsoft limits the size of ping packets. However, this parameter is still harmful in coordination with other parameters. For example, the following is an attacking command by coordinating -l with -t (for experiment only and never execute it at will).

  C:\>ping -l 65500 -t 192.168.1.21

  Pinging 192.168.1.21 with 65500 bytes of data:

  Reply from 192.168.1.21: bytes=65500 time<10ms TTL=254

  Reply from 192.168.1.21: bytes=65500 time<10ms TTL=254

  ??????

  In this case, your PC will continuously send packets of 65500 bytes to 192.168.1.21. Sending such packets from several PCs at the same time can make the remote end crash. I have made such an experiment. When I use more than 10 PCs to ping a Win2000Pro PC, its network is completely down in five minutes and HTTP/FTP services are all stopped.

 

  -f Set Don't Fragment flag in packet.

  Send the Dont Fragment flag in packets.

  The packets are generally fragmented before sending to the remote end. This parameter disables the route fragmentation.

 

  -i TTL Time To Live.

  Specify TTL to the time when packets stay at the remote system.

  This parameter also helps you check the network operation.

 

  -v TOS Type Of Service.

  Set Type Of Service to the value specified by tos.

 

  -r count Record route for count hops.

  Record the route of transmitted and returned packets in Record route.

  In general cases, the packets you send reach the destination through some routes. This parameter helps you trace up to nine routes. For more routes, you can use other commands. I will mention it in future articles. See the following example:

  C:\>ping -n 1 -r 9 202.96.105.101(Send one packet, and up to nine routes are recorded)

  Pinging 202.96.105.101 with 32 bytes of data:

  Reply from 202.96.105.101: bytes=32 time=10ms TTL=249

  Route: 202.107.208.187 ->

  202.107.210.214 ->

  61.153.112.70 ->

  61.153.112.89 ->

  202.96.105.149 ->

  202.96.105.97 ->

  202.96.105.101 ->

  202.96.105.150 ->

  61.153.112.90

  Ping statistics for 202.96.105.101:

  Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),

  Approximate round trip times in milli-seconds:

1  Minimum = 10ms, Maximum = 10ms, Average = 10ms

  The above shows that the routes from my PC to 202.96.105.101 include: 202.107.208.187, 202.107.210.214, 61.153.112.70, 61.153.112.89, 202.96.105.149 and 202.96.105.97.

 

  -s count Timestamp for count hops.

  Set the time stamp of hop count specified by count.

  This parameter is similar to –r, but does not record the returning routes of packets or records four routes at most.

 

  -j host-list Loose source route along host-list.

  Specify the computer list route packet by computer-list. Up to nine consecutive PCs can be allowed by the intermediate gateway isolation (loose source route) IP.

 

  -k host-list Strict source route along host-list.

  Specify the computer list route packet by computer-list. Up to nine consecutive PCs cannot be allowed by the intermediate gateway isolation (strict source route) IP.

 

  -w timeout Timeout in milliseconds to wait for each reply.

  Specify the timeout, in milliseconds.

  This parameter has no skills.

  Other skills for the ping command: You can judge the destination host system to Windows or UNIX/Linux through the returned TTL value in the ping operation. Generally, the returned TTL value of Windows system is 100-130 and that of UNIX/Linux system is 240-255. Of course, the TTL value can be modified on the remote host. For example, you can achieve it in Windows system by modifying the following values in the registry table:

  [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]

  "DefaultTTL"=dword:000000ff

  255---FF

  128---80

  64----40

  32----20

  The ping command is basically explained. For some reasons including my little collection, the parameters of –j and –k are not described in detail. I hope you can add more using skills after reading this article. Thank you.

 

若您有关于案例的建议,请反馈:

作者在2007-11-01对此案例进行了修订
0 个评论

该案例暂时没有网友评论

编辑评论

举报

×

侵犯我的权益 >
对根叔知了社区有害的内容 >
辱骂、歧视、挑衅等(不友善)

侵犯我的权益

×

泄露了我的隐私 >
侵犯了我企业的权益 >
抄袭了我的内容 >
诽谤我 >
辱骂、歧视、挑衅等(不友善)
骚扰我

泄露了我的隐私

×

您好,当您发现根叔知了上有泄漏您隐私的内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到pub.zhiliao@h3c.com 邮箱,我们会尽快处理。
  • 1. 您认为哪些内容泄露了您的隐私?(请在邮件中列出您举报的内容、链接地址,并给出简短的说明)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)

侵犯了我企业的权益

×

您好,当您发现根叔知了上有关于您企业的造谣与诽谤、商业侵权等内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到 pub.zhiliao@h3c.com 邮箱,我们会在审核后尽快给您答复。
  • 1. 您举报的内容是什么?(请在邮件中列出您举报的内容和链接地址)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)
  • 3. 是哪家企业?(营业执照,单位登记证明等证件)
  • 4. 您与该企业的关系是?(您是企业法人或被授权人,需提供企业委托授权书)
我们认为知名企业应该坦然接受公众讨论,对于答案中不准确的部分,我们欢迎您以正式或非正式身份在根叔知了上进行澄清。

抄袭了我的内容

×

原文链接或出处

诽谤我

×

您好,当您发现根叔知了上有诽谤您的内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到pub.zhiliao@h3c.com 邮箱,我们会尽快处理。
  • 1. 您举报的内容以及侵犯了您什么权益?(请在邮件中列出您举报的内容、链接地址,并给出简短的说明)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)
我们认为知名企业应该坦然接受公众讨论,对于答案中不准确的部分,我们欢迎您以正式或非正式身份在根叔知了上进行澄清。

对根叔知了社区有害的内容

×

垃圾广告信息
色情、暴力、血腥等违反法律法规的内容
政治敏感
不规范转载 >
辱骂、歧视、挑衅等(不友善)
骚扰我
诱导投票

不规范转载

×

举报说明

提出建议

    +

亲~登录后才可以操作哦!

确定

亲~检测到您登陆的账号未在http://hclhub.h3c.com进行注册

注册后可访问此模块

跳转hclhub

你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作