windows Ping 失败但 http 链接有效

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/220794/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 11:29:44  来源:igfitidea点击:

Ping fails but http link works

windows

提问by user11718

In one of the system (Windows), if I ping to a particular public forum site, [lets say testsite.com here], then I get a request timed out message. However, if I just put that site address in the browser (used IE6, but its not specific) with http://, then the link works fine and the browser goes to the web page. What is it that the browser doing differently ?

在其中一个系统 (Windows) 中,如果我 ping 到特定的公共论坛站点,[在这里说 testsite.com],那么我会收到请求超时消息。但是,如果我只是将该站点地址放入带有 http:// 的浏览器(使用 IE6,但不是特定的),那么链接就可以正常工作并且浏览器会转到网页。浏览器有何不同之处?

回答by Randy

The site may be behind a firewall that blocks ICMP requests (e.g., ping). HTTP requests that your browser sends out goes over TCP/IP.

该站点可能位于阻止 ICMP 请求(例如,ping)的防火墙后面。浏览器发出的 HTTP 请求通过 TCP/IP。

回答by Laurent

Ping sends an ICMP request package. The webserver can choose to ignore it and not respond, instead of responding with an ICMP response.

Ping 发送 ICMP 请求包。Web 服务器可以选择忽略它而不响应,而不是使用 ICMP 响应进行响应。

The web brower uses HTTP, which means it opens a TCP connection on port 80 by using a SYN/SYNACK/ACK exchange.

Web 浏览器使用 HTTP,这意味着它通过使用 SYN/SYNACK/ACK 交换在端口 80 上打开 TCP 连接。

These two processes are completely different and independant, so you can enable/disable either independantly.

这两个过程完全不同且独立,因此您可以独立启用/禁用。

回答by Serge Wautier

Public servers often don't respond to ping requests. After all, people don't type ping testsite.com before they open their browser, right? So there's no real point to answer pings forthese sites. On the other hand:

公共服务器通常不响应 ping 请求。毕竟,人们在打开浏览器之前不会输入 ping testsite.com ,对吧?所以没有真正的意义来回答这些网站的 ping 问题。另一方面:

A few years ago, a kid managed to simultaneously bring amazon.com and a couple of other such big sites down to thei knees during a couple of hours by having a few hundreds machines bomb them with loads of ping requests.

几年前,一个孩子在几个小时内设法同时让 amazon.com 和其他几个这样的大网站瘫痪,让数百台机器用大量的 ping 请求轰炸他们。

Since then, ping has not been considered that much friendly by admins.

从那时起,管理员就不再认为 ping 是那么友好了。

回答by CMS

The browser uses the TCP/IP protocol to communicate with the server the HTTP requests, when you use ping, it uses the ICMPprotocol and seems the server behind a firewall that drops the ICMP Echo Requests.

浏览器使用 TCP/IP 协议与 HTTP 请求的服务器进行通信,当您使用 ping 时,它使用ICMP协议并且似乎服务器位于防火墙后面,该服务器会丢弃ICMP Echo 请求

回答by Samir Talwar

A ping is essentially an "echo request" packet sent over IMCP (a protocol). The correct response to a ping is a handily "echo response" packet. However, if you send an echo response packet, people know you exist. Now, when you're running a web server, this isn't a big deal, but when you're running a standard desktop, you don't want people knowing you exist. The result is that many security-minded people will disable ping responses by default, even on server machines.

ping 本质上是通过 IMCP(一种协议)发送的“回显请求”数据包。对 ping 的正确响应是一个方便的“回显响应”数据包。但是,如果您发送回声响应数据包,人们就会知道您的存在。现在,当您运行 Web 服务器时,这没什么大不了的,但是当您运行标准桌面时,您不希望人们知道您的存在。结果是许多有安全意识的人会默认禁用 ping 响应,即使在服务器机器上也是如此。

回答by Claudiu

Ping packets, as others have stated, are a different type of packet than 'HTML' packets - Ping packets are ICMP/IPwhile HTML are TCP/IP. All kinds of stuff in between you and the website could choose to block the ICMP packets while allowing TCP packets through.

正如其他人所说,Ping 数据包是与“HTML”数据包不同类型的数据包 - Ping 数据包是ICMP/IP而 HTML 是TCP/IP。您和网站之间的各种东西都可以选择阻止 ICMP 数据包,同时允许 TCP 数据包通过。

回答by Ates Goral

It's not the browser. There could be a firewall between you and the server that's blocking the ping requests or the server simply may not be responding to pings. It's a common security measure.

这不是浏览器。您和服务器之间可能有防火墙阻止了 ping 请求,或者服务器可能根本没有响应 ping。这是一种常见的安全措施。

回答by IAmCodeMonkey

Ping (also known as ICMP) and the http protocol work completely differently and use different ports. Different devices/firewalls along the way may block ping but most allow http through.

Ping(也称为 ICMP)和 http 协议的工作方式完全不同并且使用不同的端口。沿途不同的设备/防火墙可能会阻止 ping,但大多数允许 http 通过。