本文共 5937 字,大约阅读时间需要 19 分钟。
win7 wi-fi热点
Windows is quite adept at telling you if you have a properly functioning Internet connection, but how exactly does it do so? Digging into how Windows handles the problem offers insight into Windows connectivity messages.
Windows非常擅长告诉您是否具有正常运行的Internet连接,但是它到底是如何做到的? 深入了解Windows处理问题的方式可以深入了解Windows连接消息。
Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-drive grouping of Q&A web sites.
今天的问答环节由SuperUser提供,它是Stack Exchange的一个分支,它是Q&A网站的社区推动组织。
SuperUser reader N. Hinkle poses the following question about the Windows internet check and authentication process:
超级用户阅读器N.Hinkle提出了有关Windows Internet检查和身份验证过程的以下问题:
In Windows 7, the notification area networking icon will show an error indicator if there is no internet access , and the error icon goes away once there is a successful connection to the internet . Sometimes, if the WiFi connection requires an in-browser authentication step, like on many guest networks in hotels or universities, then the following pop-up bubble appears, saying as much:
在Windows 7中,如果没有Internet访问,则通知区域网络图标将显示一个错误指示器,并且一旦成功连接到Internet,该错误图标就会消失。 有时,如果WiFi连接需要浏览器内身份验证步骤(例如在酒店或大学中的许多访客网络上),则会显示以下弹出气泡,提示您:
How does Windows know whether or not it has a successful internet connection?
Windows如何知道它是否具有成功的Internet连接?
Presumably it is checking some online Microsoft service to see whether it has a successful connection, gets redirected to some other page, or doesn’t get any response at all, but I haven’t seen anywhere that this process or the services used are documented. Can anybody explain how this works?
大概是在检查某些联机Microsoft服务,以查看它是否具有成功的连接,是否重定向到其他页面或根本没有任何响应,但是我没有看到记录此过程或所用服务的任何地方。 。 谁能解释这是如何工作的?
Such checks are one of the many things we take for granted when using a modern operating system, but even the most taken for granted elements of the user experience have an underlying mechanism. How does Windows tell us if there is an internet connection and whether or not we need to log into a Wi-Fi authentication portal?
当使用现代操作系统时,这种检查是我们理所当然的事情之一,但是即使是用户体验中最被理所当然的元素也具有潜在的机制。 Windows如何告知我们是否存在Internet连接以及是否需要登录Wi-Fi身份验证门户?
SuperUser contributor Tobias Plutat offers some insight into the process:
超级用户贡献者Tobias Plutat提供了对该过程的一些见解:
After some digging (the sheer number of network and Internet related services in Windows is astonishing), . Windows Vista and 7 have a variety of Network Awareness features, one of which is the Network Connectivity Status Indicator that performs connectivity tests that in turn are used by the network systray icon. The test for internet connectivity is simple:
经过一番挖掘(Windows中与网络和Internet相关的服务数量惊人)之后, 。 Windows Vista和7具有多种网络意识功能,其中之一是网络连接状态指示器,该指示器执行连接测试,然后由网络系统托盘图标使用。 互联网连接测试很简单:
- NCSI tries to load a specific page via HTTP (more precisely: a text document) and tests whether it can be retrieved. NCSI尝试通过HTTP(更确切地说是文本文档)加载特定页面,并测试是否可以检索该页面。
- If that is not successful, Windows reports “No Internet access”. 如果不成功,Windows将报告“无Internet访问”。
The mechanism also checks whether the domain the document is hosted on resolves to the expected IP address. So, it might also assume proper internet access if this test is successful but the document can’t be retrieved.
该机制还检查文档所在的域是否解析为预期的IP地址。 因此,如果此测试成功,但它也可能假定可以正常访问Internet,但无法检索该文档。
The reason it reports “No Internet Access” when you haven’t authenticated on a Hotspot yet lies in the way a Hotspot works. It blocks all ports besides 80 and 443 (for HTTP and HTTPS, respectively), which get redirected to the Hotspot’s authentication server and might mess with DNS requests in one way or another. Thus, NCSI can neither resolve the domain its test file is hosted on, and even if it could it wouldn’t reach the actual file because HTTP traffic is redirected to the Authentication server.
当您尚未在Hotspot上进行身份验证时,它报告“没有Internet访问”的原因在于Hotspot的工作方式。 它阻止除80和443(分别用于HTTP和HTTPS)之外的所有端口,这些端口被重定向到Hotspot的身份验证服务器,并且可能以一种或另一种方式干扰DNS请求。 因此,NCSI既不能解析其测试文件所在的域,也不能解析实际的文件,因为HTTP流量已重定向到身份验证服务器。
Another contributor, Jeff Atwood, highlights some key quotes from the document Tobias references:
另一个撰稿人Jeff Atwood着重介绍了Tobias参考文献中的一些关键语录:
Here are the details of the connection status determination :
以下是连接状态确定的详细信息:
The following list describes how NCSI might communicate with a Web site to determine whether a network has Internet connectivity:
下面的列表描述了NCSI如何与网站通信以确定网络是否具有Internet连接:
A request for DNS name resolution of
dns.msftncsi.com
dns.msftncsi.com
DNS名称解析请求A HTTP request for
http://www.msftncsi.com/ncsi.txt
returning 200 OK and the textMicrosoft NCSI
对
http://www.msftncsi.com/ncsi.txt
的HTTP请求,返回200 OK和文本Microsoft NCSI
This can be disabled with a registry setting. If you set:
可以使用注册表设置禁用它。 如果您设置:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ NlaSvc\Parameters\Internet\EnableActiveProbing
HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ NlaSvc \ Parameters \ Internet \ EnableActiveProbing
to
0
, Windows will no longer probe for internet connectivity.设置为
0
,Windows将不再探测Internet连接。Apple does something very similar in iOS to detect internet connectivity and possible hotel “login” wifi pages, etc.
苹果在iOS中执行了非常类似的操作,以检测互联网连接以及可能的酒店“登录” wifi页面等。
While this entire process is usually 100% transparent to end users, occasionally after authenticating through a Wi-Fi hot spot’s web portal, you will find yourself staring at the the actual contents of . How you ended up looking at a nondescript text document instead of the web page you were attempting to load is no longer a mystery when coupled with the previous answers on the topic.
尽管整个过程通常对最终用户是100%透明的,但有时在通过Wi-Fi热点的Web门户进行身份验证之后,您会发现自己盯着的实际内容。 与主题的先前答案一起使用时,如何最终看到一个非描述性的文本文档而不是试图加载的网页已不再是一个谜。
Have something to add to the explanation? Sound off in the the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the .
有什么补充说明吗? 在评论中听起来不对。 是否想从其他精通Stack Exchange的用户那里获得更多答案? 查看 。
翻译自:
win7 wi-fi热点
转载地址:http://kijwd.baihongyu.com/