A mai Kérdések és válaszok munkamenetét a SuperUser - a Stack Exchange, a Q & A weboldalak közösségi meghajtó csoportosulásának részlegével - köszönheti.
A kérdés
A SuperUser olvasó N. Hinkle a következő kérdést fekteti le a Windows internetes ellenőrzési és hitelesítési folyamatáról:
In Windows 7, the notification area networking icon will show an error indicator if there is no internet access
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?
Az ilyen ellenőrzések egyike azon sok dolognak, amit egy modern operációs rendszer használatakor magunkévá tesszük, de még a felhasználói élmény legmegfelelőbb elemei is egy alapul szolgáló mechanizmussal rendelkeznek. Hogyan mondja el a Windows, hogy van-e internetkapcsolat, és hogy be kell-e jelentkeznünk a Wi-Fi hitelesítési portálra?
A válasz
A SuperUser közreműködője, Tobias Plutat betekintést nyújt a folyamatba:
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:
- NCSI tries to load a specific page via HTTP (more precisely: a text document) and tests whether it can be retrieved.
- 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.
Egy másik közreműködő, Jeff Atwood kiemeli néhány kulcsfontosságú idézetet a Tobias hivatkozásokból:
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:
-
A request for DNS name resolution of
dns.msftncsi.com
-
HTTP - kérelem
https://www.msftncsi.com/ncsi.txt
200 OK-t és a szöveget visszaadva
Microsoft NCSI
Ez letiltható egy rendszerleíró beállítással. Ha beállította:
HKEY_LOCAL_MACHINE SYSTEM CurrentControlSet Services NlaSvc Parameters Internet EnableActiveProbing
nak nek
0
A Windows már nem próbálja meg az internetkapcsolatot.
Az Apple valami nagyon hasonlít az iOS rendszerben az internetkapcsolat és a lehetséges "bejelentkezési" wifi oldalak észlelésére.
Bár ez az egész folyamat általában 100% -ban átlátható a végfelhasználók számára, néha a Wi-Fi hot spot internetes portálján való hitelesítés után, az NSCSI.txt aktuális tartalmát bámulja. Hogy végül egy nem-szöveges dokumentumot nézett ahelyett, hogy a betöltött weboldalt már nem rejtély, amikor a témával kapcsolatos korábbi válaszokkal párosul.
Van valami a magyarázathoz? Hangzik ki a megjegyzésekben. Szeretne többet válaszolni a többi technikus-tudós Stack Exchange felhasználóiról? Nézze meg a teljes vitafonalat itt.