前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Windows小工具 tcping

Windows小工具 tcping

作者头像
全栈程序员站长
发布2022-09-09 20:21:50
4K0
发布2022-09-09 20:21:50
举报
文章被收录于专栏:全栈程序员必看

大家好,又见面了,我是你们的朋友全栈君。

Windows小工具 tcping

一、ping和tcping的区别

1 指代不同

1、ping:是Windows、Unix和Linux系统下的一个命令。ping也属于一个通信协议,是TCP/IP协议的一部分。通过ICMP协议发送报文到对方主机上任意一个60000以上的端口,然后获取对方主机的回复 2、tcping:是一种面向连百接的、可靠的、基于字节流的传输层通信协议。使用tcp协议尝试与某一个端口建立连接,然后获取与对方主机建立一次连接的回复

2 功能不同

1、ping:利用“ping”命令可以检查网络是否连通,可以很好地帮助分析和判定网络故障。 2、tcping:适知应支持多网络应用的分层协议层次结构。 连接到不同但互连的计算机通信网络的主计算机中的成道对进程之间依靠TCP提供可靠的通信内服务。

3 特点不同

1、ping:Ping发送一个ICMP即因特网信报控制协议;回声请求消息给目的地并报告是否收到所希望的ICMPecho 2、tcping:可以从较低级别的协议获得简单的,可能不可靠的数据报服务。 原则上,TCP应该能够在从容硬线连接到分组交换或电路交换网络的各种通信系统之上操作。

二、tcping下载及使用方式

1、tcping下载方式

下载链接:https://download.elifulkerson.com/files/tcping/current/

2、tcping使用方式

仅下载tcping.exe程序,然后放入C:\Windows\System32

下载32位或64位的tcping.exe
下载32位或64位的tcping.exe

记得如果使用的是64位电脑,就要下载对应的tcping64.exe程序,放在目录中后,须改名为tcping.exe。

在这里插入图片描述
在这里插入图片描述

按下“win+r”打开cmd,输入:

代码语言:javascript
复制
检测www.baidu.com的80端口能否连通
tcping www.baidu.com 80  
在这里插入图片描述
在这里插入图片描述

输入tcping指令,可以看到关于tcping指令的帮助文档,具体如下:

代码语言:javascript
复制
C:\Users\sialee>tcping
--------------------------------------------------------------
tcping.exe by Eli Fulkerson
Please see http://www.elifulkerson.com/projects/ for updates.
--------------------------------------------------------------

Usage: tcping [-flags] server-address [server-port]

Usage (full): tcping [-t] [-d] [-i interval] [-n times] [-w ms] [-b n] [-r times] [-s] [-v] [-j] [-js size] [-4] [-6] [-c] [-g count] [-S source_address] [--file] [--tee filename] [-h] [-u] [--post] [--head] [--proxy-port port] [--proxy-server server] [--proxy-credentials username:password] [-f] server-address [server-port]

 -t     : ping continuously until stopped via control-c
 -n 5   : for instance, send 5 pings
 -i 5   : for instance, ping every 5 seconds
 -w 0.5 : for instance, wait 0.5 seconds for a response
 -d     : include date and time on each line
 -b 1   : enable beeps (1 for on-down, 2 for on-up,
                        3 for on-change, 4 for always)
 -r 5   : for instance, relookup the hostname every 5 pings
 -s     : automatically exit on a successful ping
 -v     : print version and exit
 -j     : include jitter, using default rolling average
 -js 5  : include jitter, with a rolling average size of (for instance) 5.
 --tee  : mirror output to a filename specified after '--tee'
 --append : Append to the --tee filename rather than overwriting it
 -4     : prefer ipv4
 -6     : prefer ipv6
 -c     : only show an output line on changed state
 --file : treat the "server-address" as a filename instead, loop through file line by line
          Note: --file is incompatible with options such as -j and -c as it is looping through different targets
          Optionally accepts server-port.  For example, "example.org 443" is valid.
          Alternately, use -p to force a port at command line for everything in the file.
 -g 5   : for instance, give up if we fail 5 times in a row
 -S _X_ : Specify source address _X_.  Source must be a valid IP for the client computer.
 -p _X_ : Alternate method to specify port
 --fqdn : Print domain name on each line if available
 --ansi : Use ANSI color sequences (cygwin)
 --color: Use Windows color sequences

HTTP Options:
 -h     : HTTP mode (use url without http:// for server-address)
 -u     : include target URL on each line
 --post : use POST rather than GET (may avoid caching)
 --head : use HEAD rather than GET
 --proxy-server : specify a proxy server
 --proxy-port   : specify a proxy port
 --proxy-credentials : specify 'Proxy-Authorization: Basic' header in format username:password

Debug Options:
 -f     : force tcping to send at least one byte
 --header : include a header with original args and date.  Implied if using --tee.
 --block  : use a 'blocking' socket to connect.  This prevents -w from working and uses the
            default timeout (as long as 20 seconds in my case).  However it can detect an actively
            refused connection vs a timeout.
        If you don't pass server-port, it defaults to 80.

对应的注释如下:

代码语言:javascript
复制
-t 不停的发送数据包直到 按ctrl+c 停止,可以用此命令做小破坏。
-n 5 一次发送 5 个数据包,默认一次发送4个 : tecping -n 5 www.baidu.com 会tcping 百度5次,也可以跟其他数字。
-i 5 5秒发送一个数据包 : tcping -i 5 www.baidu.com 每间隔5秒tcping一次百度,也可以跟其他数字,也可以跟小数 :tcping -i 0.5 www.baidu.com 每隔 0.5秒tcping 一次百度。
-w 0.5 tcping不通的等待时间 tcping通则忽略次参数 : tcping -w 0.5 www.baidu.com 如果ping不同会等待0.5秒,默认tcping不通等2s,tcping 通则忽略此参数。
-d 在每行前面显示详细日期时间。
-b 1-4 ping的时候会响铃,参数4会一直响铃 : tcping -b 4 www.baidu.com
每显示一行内容就会响铃一次,默认会响铃4次
-r 5 每发送5个数据包重新查找主机一次(通过DNS或路由查找)
-s ping通就立即退出
-v 显示版本信息
-j 使用默认的方法求ping的均值减小波动,网络有一定的不稳定性用此参数可以减小波动。
-js 5 用5个实例求平均值减小波动,使用这个参数系统会tcping 5次然后求出平均值作为一次结果显示,减小波动。
–tee 将结果输出到指定位置 :tcping –tee d:\test.txt192.168.0.100 会将ping的结果保存在d盘下的test文件中。
-c 只显示转变的信息(ping时间很短一般不会转变)。
-g 5 失败5次就放弃(注意默认是80端口,端口没开也算失败)
-h 以http 的模式工作,可以测试主机是否提供http服务。
–post 为了保证自己计算机的安全有些电脑禁止了别人ping 使用 post /head 参数
–head 加大ping通的机率
–proxy-server 指定代理服务 : 没有代理无法测试
–proxy-port 指定代理服务端口 : 没有代理无法测试
–proxy-credentials 使用代理的安全验证,需要输入 用户名和密码 : 没有代理无法测试
–f 强制ping命令至少发送一个比特(byte)
–file 从文件中获得ping的来源 : tcping –file d:\test.txt 我在d盘下新建一个test文件,并输入 我要tcping的所有ip或域名一行一个,然后执行命令,就会依次tcping文件中指定的地址。
–header 在头部显示时间和日期和–tee显示的格式差不多
–block tcping不通的等待时间,默认是20秒(很长),可以将 -w参数冲突掉 :tcping –block www.baiu.com 网址不正确显然tcpping 不通 默认会等待2s 但是加了 –block参数后每tcping一次会等 20s 的时间
: tcping -w 0.5 –block www.baiu.com 还是会等20s 而不是 0.5s因为–block会把 -w 会被冲突掉
有一个不懂的参数
-u 显示目标的URL 

参考:https://blog.csdn.net/gd007he/article/details/52474494

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/152529.html原文链接:https://javaforall.cn

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Windows小工具 tcping
    • 一、ping和tcping的区别
      • 1 指代不同
      • 2 功能不同
      • 3 特点不同
    • 二、tcping下载及使用方式
      • 1、tcping下载方式
      • 2、tcping使用方式
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档