ASCII.jp See in detail how the automatic network connection function of Windows 8 works
In Windows 8, Windows Connection Manager automatically determines which network to connect to.
Starting with Windows 8, Windows automatically selects the network. Windows Connection Manager (hereinafter abbreviated as WCM) controls this.
Windows 8 automatically connects to the network in a predetermined order
In Windows 7, users prioritized the designation of wireless LAN connection destinations, but this mechanism was abolished in Windows 8. In Windows 8, WCM will automatically select the network unless the user manually selects the network.
For example, WCM automatically determines which network to use immediately after startup, when returning from standby, or when it becomes impossible to connect to the previously connected network.
WCM handles "interfaces" such as "wired LAN," "wireless LAN," and "mobile broadband network (WWAN, wireless WAN)." Windows can manage multiple network interfaces. Actually, there is also a network connection by Bluetooth, but WCM of Windows 8 does not manage the connection to the network via Bluetooth. There is also an internet connection via USB, specifically USB tethering on smartphones, but this is also not managed by WCM.
Looking at the icons, it seems that the network connection by Bluetooth or USB is treated the same as the wired LAN. Wired LAN has the highest priority in WCM, so WCM will not switch network connections via Bluetooth or USB to other networks without permission.
Be careful as Windows Connection Manager Bluetooth / USB tethering for connecting a wired LAN is also treated as wired.
Also, since it does not control anything for the wired LAN, it does not automatically connect or select the connection destination. For this reason, "pay-as-you-go connection" cannot be set for connections via Bluetooth or USB. In reality, mobile routers and smartphones should often be connected via Bluetooth or USB, but since it is not possible to set as a pay-as-you-go connection, Windows Update and OneDrive synchronization are similar to wired LAN. It should be noted that it will be executed on.
In Windows, the connection destinations of wireless LAN interface and mobile broadband interface are managed as information called "profile". This is because one interface can connect to multiple networks. The profile contains information about the connection such as SSID and encryption key, and settings on the Windows side such as whether to connect automatically or whether to scan during connection and switch to another connection destination. It has been.
The "interface" connects to the "network" using the "profile". In the connected state, the interface is assigned an address according to the network and becomes a part of the network. In other words, in Windows, "network" is a combination of "interface" and "profile".
Let's take a closer look at how Windows Connection Manager works
To put it simply, WCM is a mechanism that prioritizes networks (interface and profile pairs) and selects the higher-ranked networks that can be connected according to the priorities.
As a basic rule, avoid connecting to multiple networks at the same time and select one network according to the following policy.
1: Wired LAN (Ethernet) 2: Network manually connected by the user during the current session 3: Network most suitable for Internet connection 4: Network that can connect to both the domain and the Internet (during domain operation)
Wired LAN has the highest priority, and WCM always selects wired LAN if it is available. The next highest priority is the network manually selected by the user. If there is no such network, or if the connected network does not have an internet connection, WCM will switch to another network.
In addition, according to the explanation on Microsoft's site, when the interface to connect is switched, such as when the wired LAN can connect to the Internet, "soft disconnection" is performed for the other interfaces.
In Windows with multiple network interfaces, the network interface may switch automatically in this way. However, the software side tries to communicate using the network address assigned in the previous network.
Therefore, when the network is switched, the network used up to that point cannot be easily disconnected. For example, if you connect an Ethernet cable while using a wireless LAN, the wired LAN has the highest priority, so WCM selects Ethernet as the network connection, but the wireless LAN is sooner. Switch to the "soft disconnect" state using the following procedure without disconnecting.
1. The connected interface that is decided not to be used due to the selection of another profile is considered to be in the soft disconnect state. 2. When the soft disconnect is set, the corresponding interface can no longer be used. Is notified to the TCP stack 3. Existing TCP sessions are not disconnected, but new TCP sessions no longer use this interface 4. However, new sessions specify this interface (address) and on other networks If the specified destination cannot be connected (there is no route), the network specified for soft disconnection may be used. 5. The TCP stack notifies the application that the network state has changed. 6 When the application receives a network state change event, it switches the existing connection to the new network if possible. 7. Windows checks the transfer made on the soft disconnected interface every 30 seconds and the transfer amount is constant. Do nothing if above the threshold 8. Windows disconnects the interface when below a certain threshold
A "soft disconnect" is performed according to such a rule, and finally the interface is disconnected. "Soft disconnection" without disconnecting immediately is not related to interface switching and application operation, such as the cable being connected (or disconnected) during communication, so the application should be operated as much as possible. To continue.
However, since the interface is the same when changing the wireless LAN network, "soft disconnection" does not occur.