MediSen

MediSen 1.0.1 - Windows 2000 Media Sensing Manager

MediSen version 1.0.1, Copyright © 2001 Dustin Graves <dgraves@computer.org>
MediSen comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions; see the GNU GPL for details.

An administrative tool for enabling and disabling the Windows 2000 "Media Sensing" feature. MediSen is free software distributed under the terms of the GNU General Public License.


What?

MediSen is an administrative tool for enabling and disabling the Windows 2000 "Media Sensing" feature. It indicates the current status of the Media Sensing feature for a given workstation and allows for the modification of that status. MediSen can be used to administer Windows 2000 workstations both locally and remotely. At the time this application was written, it was necessary to disable the Media Sensing feature in order to send multicast datagrams on the loopback address of a Windows 2000 workstation whose network adapter was not connected to a network.

Why?

Windows 2000 contains a new network related feature that can detect whether an active network connection is present thorough an installed network interface card. If Windows 2000 detects a "down" state for a network interface card it removes bound protocols from that adapter until it is detected to be "up" again. This, apparently, is intended for multihomed systems whose network media are not always in an "up" state (when one interface goes down, it's associated routes are removed, and all outgoing traffic is directed through another interface, if that interface is the default gateway). This also has the unfortunate side effect of making it impossible to join a multicast group, even when sending and receiving on the loopback adapter. Any attempt to join a multicast group will fail with winsock error 10049 (WSAEADDRNOTAVAIL) indicating that the requested address could not be assigned.

I have discussed this problem with Microsoft Support (case SRZ010305000785), which does not consider this to be an implementation error. During this discussion I was presented with two work-arounds for this issue which are to:

  • Disable the Media Sensing feature
  • Install a Virtual Network Device

There is also a third option of keeping your workstation plugged into a powered hub at all times in order to fool Windows 2000 into thinking that the network adapter has an active link, but this is not very practical for laptops and portable systems that do not always have ready access to an electrical outlet required to power a hub.

MediSen implements the first option of disabling the Media Sensing feature via a registry setting. More information regarding editing the registry to disable the Media Sensing feature can be found here:

http://support.microsoft.com/support/kb/articles/q239/9/24.asp

The second option of installing a "Virtual Network Device" is a simple solution that is easily done. In order to install this device, double click the Add/Remove Hardware item in the control panel, choose to add a device, choose to pick the device from a list, choose Microsoft from the vendor list, and then select Microsoft Loopback Adapter from the device list. This will install a second loopback adapter on your Windows 2000 workstation (your network adapter also has one, but it is not usable for multicast when the network is "down"). When the protocols for a "down" network adapter are unbound, all multicast traffic will be routed through this secondary loopback adapter. This is a very viable solution, however, at the time that this application was written there was a bug with the Microsoft Loopback Adapter that resulted in the Microsoft Loopback Adapter not actually routing incoming multicast datagrams to the loopback address (typically "127.0.0.1"). The datagrams are being sent, but where they are actually being sent to is a mystery. To make an application send multicast datagrams to the loopback address via the Microsoft Loopback Adapter, the application needs to be explicitly set to route outgoing traffic to the "127.0.0.1" interface. This could require a modification to an existing multicast application, which negates the viability of this option. Microsoft Support has informed me that there will be a "hot fix" for this bug in the Windows 2000 Service Pack 2.

At the current time, I've found disabling the Media Sensing feature to be the best solution to the problem, and that writing a simple application to edit the registry for the local and remote registry(s) makes this easier for a network administrator to accomplish this task. Because MediSen is capable of remote registry administration, it is possible for a network administrator to disable the Media Sensing feature for all machines on a network from a single workstation.

How?

MediSen is a fairly simple application. It provides the user with two menu options for exiting the application and connecting to a remote registry, a label indicating the Media Sensing status for a given workstation, a set of radio buttons for disabling/enabling the Media Sensing Feature for a given workstation, and two buttons for applying changes to a given workstation and exiting the application. An individual description of an item may be obtained through MediSen by right clicking the item.

*Please note that Administrative privileges may be required to use this software.*

Using the pull down menus

The two pull down menus each have one option. The "File" menu has an option to exit the application. When this option is selected the application will quit. If a modification has been made to the Media Sensing registry setting, the user will be given the choice of rebooting the workstation to allow these changes to take effect.

The "Options" menu has an option to connect to a remote network registry. When this option is selected, the user will be presented with a dialog for entering the name of the remote workstation to connect to. The user may either cancel the operation, enter the computer name by hand, or select a workstation from the network neighborhood with the "Browse" option. Loading the contents of the Network Neighborhood and connecting to a remote registry can sometimes be a slow procedure.

If using MediSen on Windows 9x to remotely administer Windows 2000 workstations, in some situations, connecting to a remote workstation's registry may fail with the error ERROR_DLL_INIT_FAILED indicating that "A dynamic link library (DLL) initialization routine failed." In order to obtain remote access to a registry from Windows 9x you must install the Microsoft Remote Registry Service. Here is the procedure for doing this with Windows 95.

Windows 95: To use RegConnectRegistry on Windows 95, you must install the Microsoft Remote Registry service. If you don't do this, calls to RegConnectRegistry return ERROR_DLL_INIT_FAILED. Perform the following steps to install the Microsoft Remote Registry service.

To install the Microsoft Remote Registry service

1. In the Network option in Control Panel, click Add.
2. In the Select Network Component Type dialog box, double-click Service.
3. In the Select Network Service dialog box, click the Have Disk button.
4. In the Install From Disk dialog box, type the path to the ADMIN\NETTOOLS\REMOTREG directory on the Windows 95 compact disc, and then click OK.
5. In the Install From Disk dialog box, click OK.
6. In the Select Network Service dialog box, click Microsoft Remote Registry, and then click OK.

The procedure for Windows 98 is the same except that step 4 is as follows:

4. In the Install From Disk dialog box, type the path to the TOOLS\RESKIT\NETADMIN\REMOTREG directory on the Windows 95 compact disc, and then click OK.

Making Sense of the Media Sensing Status Report

MediSen will display one of the following three status messages to indicate the Media Sensing status for a given host:

  1. Media Sensing feature is not currently disabled for <hostname>
  2. Media Sensing feature is currently enabled for <hostname>
  3. Media Sensing feature is currently disabled for <hostname>

<hostname> indicates the name of the host that MediSen is connected to. Option number one indicates that there is currently no setting in the registry to either enable or disable the Media Sensing feature. In this case the Media Sensing feature will default to on. Option number two indicates that the Media Sensing registry value is set to true, indicating that the Media Sensing feature is currently on. Option number three indicates that the Media Sensing registry value is set to false, indicating that the Media Sensing feature is currently off.

Making Changes to the Media Sensing Setting

The status of the Media Sensing feature can be changed by selecting the appropriate radio button and applying the change. Selecting the radio button labeled "Enable" indicates that the Media Sensing feature is to be turned on, and selecting the radio button labeled "Disable" indicates that the Media Sensing feature is to be turned off. This selection will then need to be activated with the button labeled "Apply."

A disabled apply button indicates that the current radio button choice matches the current Media Sensing registry setting, and no changes need to be applied.

Where?

MediSen is free software distributed under the terms of the GNU General Public License. You can currently download MediSen in source and binary form here:

Name Date Size
Windows 2000 binary executable: MediSen-exe.zip 21 Apr 2001 242KB
MediSen source: MediSen-1.0.1.zip 21 Apr 2001 137KB

Here is a screenshot of MediSen, selecting a remote computer from the Network Neighborhood:

MediSen Screen Shot

If you are a programmer interested in editing the registry remotely, rebooting a workstation from within in an application, or enumerating the Network Neighborhood you may be interested in taking a look at the MediSen source, even if you don't need to modify the Media Sensing setting for your computer.

Who?

MediSen is Copyright © 2001 Dustin Graves <dgraves@computer.org>

This software uses the FOX Platform Independent GUI Toolkit Library. The FOX Library is Copyright © 1997,2000-2003 Jeroen van der Zijp and is available freely under the GNU Lesser General Public License at the following site:

http://www.fox-toolkit.org

Programming: