Como o Windows confirma o acesso Wi-Fi e se a autenticação de ponto de acesso é necessária?

Índice:

Como o Windows confirma o acesso Wi-Fi e se a autenticação de ponto de acesso é necessária?
Como o Windows confirma o acesso Wi-Fi e se a autenticação de ponto de acesso é necessária?

Vídeo: Como o Windows confirma o acesso Wi-Fi e se a autenticação de ponto de acesso é necessária?

Vídeo: Como o Windows confirma o acesso Wi-Fi e se a autenticação de ponto de acesso é necessária?
Vídeo: O vídeo acaba quando eu ler um livro 5 ESTRELAS ⭐ - YouTube 2024, Abril
Anonim
O Windows é bastante hábil em dizer se você tem uma conexão com a Internet funcionando corretamente, mas como exatamente isso acontece? Explorar como o Windows lida com o problema oferece insights sobre as mensagens de conectividade do Windows.
O Windows é bastante hábil em dizer se você tem uma conexão com a Internet funcionando corretamente, mas como exatamente isso acontece? Explorar como o Windows lida com o problema oferece insights sobre as mensagens de conectividade do Windows.

A sessão de perguntas e respostas de hoje nos é oferecida por cortesia do SuperUser, uma subdivisão do Stack Exchange, um agrupamento de comunidades de perguntas e respostas da comunidade.

A questão

O leitor SuperUser N. Hinkle coloca a seguinte questão sobre o processo de verificação e autenticação da Internet no Windows:

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
, 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:
. 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:
Image
Image

How does Windows know whether or not it has a successful internet connection?

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?

Essas verificações são uma das muitas coisas que tomamos como garantidas ao usar um sistema operacional moderno, mas até mesmo os elementos mais aceitos da experiência do usuário têm um mecanismo subjacente. Como o Windows nos diz se há uma conexão com a Internet e se precisamos ou não entrar em um portal de autenticação de Wi-Fi?

A resposta

O colaborador do SuperUser Tobias Plutat oferece algumas dicas sobre o processo:

After some digging (the sheer number of network and Internet related services in Windows is astonishing), I think I found it. 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:

  1. NCSI tries to load a specific page via HTTP (more precisely: a text document) and tests whether it can be retrieved.
  2. If that is not successful, Windows reports “No Internet access”.

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.

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.

Outro colaborador, Jeff Atwood, destaca algumas citações importantes do documento Tobias References:

Here are the details of the connection status determination process:

The following list describes how NCSI might communicate with a Web site to determine whether a network has Internet connectivity:

  1. A request for DNS name resolution of

    dns.msftncsi.com

  2. Uma solicitação HTTP para

    https://www.msftncsi.com/ncsi.txt

    retornando 200 OK e o texto

    Microsoft NCSI

  3. Isso pode ser desativado com uma configuração do Registro. Se você definir:

    HKEY_LOCAL_MACHINE SYSTEM CurrentControlSet Services NlaSvc Parâmetros Internet EnableActiveProbing

    para

    0

    O Windows não irá mais investigar a conectividade com a Internet.

    A Apple faz algo muito semelhante no iOS para detectar a conectividade com a Internet e as possíveis páginas wifi do “login” do hotel, etc.

    Embora todo esse processo seja geralmente 100% transparente para os usuários finais, ocasionalmente, após a autenticação por meio de um portal da Web de ponto de acesso Wi-Fi, você se verá olhando para o conteúdo real do NSCSI.txt. Como você acabou de olhar para um documento de texto indefinido em vez da página da web que você estava tentando carregar não é mais um mistério quando acoplado com as respostas anteriores sobre o tópico.

    Tem algo a acrescentar à explicação? Soe fora nos comentários. Quer ler mais respostas de outros usuários do Stack Exchange com experiência em tecnologia? Confira o tópico de discussão completo aqui.

Recomendado: