Media Sense

Windows 2000 TCP/IP supports Media Sense, which can improve the roaming experience for portable device users. Media Sense support, added in NDIS 5.0, provides a mechanism for the network adapter to notify the protocol stack of media connect and media disconnect events. Windows 2000 TCP/IP utilizes these notifications to assist in automatic configuration.

For instance, in Windows NT 4.0, when a portable computer was located and DHCP-configured on an Ethernet subnet, and then moved to another subnet without rebooting, the protocol stack received no indication of the move. This meant that the configuration parameters became stale, and not relevant to the new network segment. Additionally, if the computer was shut off, carried home, and rebooted, the protocol stack was not aware that the network adapter was no longer connected to a network, and again stale configuration parameters remained. This could produce problems, as subnet routes, default gateways, and other configuration parameters could conflict with dial-up parameters.

Media sense support allows the protocol stack to react to events and remove stale parameters. For example, if a Windows 2000 computer is unplugged from the network (assuming the network adapter supports Media Sense), after a damping period of 20 seconds, TCP/IP invalidates the parameters associated with the network that has been disconnected. The IP address(es) no longer allow sends, and any routes associated with the interface are invalidated.

If an application is bound to a socket that is using an address that is invalidated, it should handle the event and recover in a graceful way, such as attempting to use another IP address on the system or notifying the user of the disconnect.