tcping.exe是一个控制台应用程序,其运行方式类似于“ping”,但它可以在tcp端口上运行

官网:https://elifulkerson.com/projects/tcping.php

前言

以往我们在Windows平台中测试网络连通性最常用的命令是“ping server address”,ping使用ICMP协议,又或者我们需要测试服务器端口连通性,可能还要需要借助“telnet server address port”,如果服务器&防火墙禁止了icmp协议,我们得到的结果可能是错误的,这时候就需要请出今天的主角:tcping

tcping使用TCP协议,默认通过tcp server address 80端口进行探测,你可以为它指定端口如:tcping server address 3389

tcping是独立的一个exe文件,不需要注册任何dll文件,你可以将它放至你windows的任何路径下进行使用

适用场景:

  • 当ICMP被禁止时,主机处于活动状态
  • 服务正在运行
  • 防火墙允许我连接正在运行的服务

1、如何使用?

下载最新版本的tcping(注意区分32位和64位)

https://elifulkerson.com/projects/tcping.php

2、重命名

如果你习惯了cmd,我建议你将tcping64.exe重命名tcping.exe,剪切至C:\Windows\System32目录下

随便打开cmd命令提示行,直接输入命令:

tcping  x.x.x.x

tcping x.x.x.x port

3、常用参数

-t#连续的ping可以让你实时查看统计数据,停止按Ctrl+C

-n count#发送指定数量的探测器

-w#为响应等待指定的毫秒数,这在网络很慢或很高的网络延迟中很有用

-4#使用 IPv4
-6#使用 IPv6

-d#输入每行的时期

4、更多参数请移步至:

https://elifulkerson.com/projects/tcping.php

#Usage

NAME
    tcping - simulate "ping" over tcp by establishing a connection to network hosts.
    Measures the time for your system to [SYN], receive the target's [SYN][ACK] and send [ACK].  Note that the travel time for
    the last ACK is not included - only the time it takes to be put on the wire a tthe sending end.

SYNOPSIS
    tcping [-tdsvf46] [-i interval] [-n times] [-w interval] [-b n] [-r times][-j depth] [--tee filename] [-f] destination [port]

DESCRIPTION
    tcping measures the time it takes to perform a TCP 3-way handshake (SYN, SYN/ACK, ACK) between itself and a remote host.
    The travel time of the outgoing final ACK is not included, only the (minimal) amount of time it has taken to drop it on
    the wire at the near end.  This allows the travel time of the (SYN, SYN/ACK) to approximate the travel time of the
    ICMP (request, response) equivalent.
    
OPTIONS
    -4      Prefer using IPv4

    -6      Prefer using IPv6

    -t      ping continuously until stopped via control-c

    -n count
            send _count_ pings and then stop.  Default 4.
    
    -i interval
            Wait _interval_ seconds between pings.  Default 1.  Decimals permitted.
    
    -w interval
            Wait _interval_ seconds for a response.  Default 2.  Decimals permitted.

    -d      include date and time on every output line
    
    -f      Force sending at least one byte in addition to making the connection.

    -g count
            Give up after _count_ failed pings.
    
    -b type
            Enable audible beeps.
            '-b 1' will beep "on down".  If a host was up, but now its not, beep.
            '-b 2' will beep "on up".  If a host was down, but now its up, beep.
            '-b 3' will beep "on change".  If a host was one way, but now its the other, beep.
            '-b 4' will beep "always".

    -c      only show output on a changed state
    
    -r count
            Every _count_ pings, we will perform a new DNS lookup for the host in case it changed.

    -s      Exit immediately upon a success.        

    -v      Print version and exit.

    -j      Calculate jitter.  Jitter is defined as the difference between the last response time and the historical average.

    -js depth
            Calculate jitter, as with -j but with an optional _depth_ argument specified. If _depth_ is specified tcping will
            use the prior _depth_ values to calculate a rolling average.

    --tee _filename_
            Duplicate output to the _filename_ specified.  Windows can still not be depended upon to have a useful command line 
            environment. Don't tease me, *nix guys.

    --append
            When using --tee, append to rather than overwrite the output file.
            
    --file
            Treat the "destination" option as a filename.  That file becomes a source of destinations, looped through on a
            line by line basis.  Some options don't work in this mode and statistics will not be kept.


    destination
            A DNS name, an IP address, or (in "http" mode) a URL.
            Do not specify the protocol ("http://") in "http" mode.  Also do not specify server port via ":port" syntax.
            For instance:   "tcping http://www.elifulkerson.com:8080/index.html" would fail
            Use the style:  "tcping www.elifulkerson.com/index.html 8080" instead.
                                
    port
            A numeric TCP port, 1-65535.  If not specified, defaults to 80.

    --header
            include a header with the command line arguments and timestamp.  Header is implied if using --tee.
            
HTTP MODE OPTIONS   
    -h      Use "http" mode.  In http mode we will attempt to GET the specified document and return additional values including
            the document's size, http response code, kbit/s.
    -u      In "http" mode, include the target URL on each output line.
    
    --post  Use POST instead of GET in http mode.
    --head  Use HEAD instead of GET in http mode.
    --get   Shorthand to invoke "http" mode for consistency's sake.

    --proxy-server _proxyserver_
            Connect to _proxyserver_ to request the url rather than the server indicated in the url itself.
    --proxy-port _port_
            Specify the numeric TCP port of the proxy server.  Defaults to 3128.
    --proxy-credentials username:password
            Specify a username:password pair which is sent as a 'Proxy-Authorization: Basic' header.


RETURN VALUE
    tcping returns 0 if all pings are successful, 1 if zero pings are successful and 2 for mixed outcome.

BUGS/REQUESTS
    Please report bugs and feature requests to the author via contact information on http://www.elifulkerson.com
    
AVAILABILITY
    tcping is available at http://www.elifulkerson.com/projects/tcping.php