tcp ping或traceroute如何工作? 它是否考虑了build立TCP握手所需的时间?
另外在ICMP ping中,您可以指定数据包大小,这可以在TCP ping中实现吗?
我相信你是指这些公用事业:
http://www.vdberg.org/~richard/tcpping.html
http://michael.toren.net/code/tcptraceroute/
由于tcpping需要tcptraceroute,我将从tcptraceroute开始。
tcptraceroute的作者指出,与传统的traceroute不同,“通过发送TCP SYN数据包而不是UDP或ICMP ECHO数据包,tcptraceroute能够绕过最常见的防火墙filter。
更进一步:值得注意的是,tcptraceroute从来没有完全build立与目标主机的TCP连接。
所以,tcptraceroute并没有测量完成三次握手所花费的时间,因为这从来没有发生过。 它测量从最初的SYN到SYN / ACK的时间。 这有时被称为半开连接扫描。
从nmap手册页:
This technique is often referred to as half-open scanning, because you don't open a full TCP connection. You send a SYN packet, as if you are going to open a real connection and then wait for a response. A SYN/ACK indicates the port is listening (open), while a RST (reset) is indicative of a non-listener. If no response is received after several retransmissions, the port is marked as filtered. The port is also marked filtered if an ICMP unreachable error (type 3, code 1,2, 3, 9, 10, or 13) is received.
至于你的数据包大小的问题,上面的描述也有答案。 由于tcptraceroute发送一个标准的SYN包,它应该是一个小包,也许是64个字节。
我不知道“TCP Ping”或“TCP Traceroute”的标准规范或参考实现,因此您可能需要select一对特定的工具来实现这些testing,然后使用数据包嗅探器来查看这些特定工具的function。
它是否考虑了build立TCP握手所需的时间?
否…您的机器发送3个UDP数据包(TTL(生存时间)为1)。当这些数据包到达下一跳路由器时,它会将TTL降低到0,从而拒绝数据包。 它将在传输过程中(代码0)发送一个ICMP超时时间(types11),TTL等于0,返回到你的机器 – 带有自己的源地址,因此你现在知道path中第一个路由器的地址。
“Traceroute”是一个networkingdebugging实用程序,它试图跟踪数据包通过networking的path。 Traceroute以小的生存时间(TTL)值传输数据包。 在每个路由器上,数值减1,如果TTL达到0,数据包已经过期并被丢弃。 Traceroute取决于通用路由器在发生这种情况时发送RFC 792中logging的ICMP Time Exceeded消息的做法。