Thoughts from the EPS Windows Server Performance Team
Useful Microsoft Blogs
Welcome back! If you're just returning from a weekend, hopefully you got some time to yourself to relax. It's Day Eleven of our Windows Server 2008 Series. Today's topic - the new WSD Port Monitor.
The WSD Port Monitor is a new printer port monitor in Windows Vista and Windows Server 2008. This port monitor supports printing to network devices that are designed to include Web Services for Devices (WSD) technology. Web Services for Devices allows network-connected IP-based devices to advertise their functionality and offer these services to clients by using the Web Services protocol. WSD-based devices and clients communicate over the network using a series of SOAP (Simple Object Access Protocol) messages over UDP and HTTP(S). WSD for Devices provides a network plug-and-play experience that is similar to installing a USB device. Web Services for Devices also defines a security profile that may be extended to provide additional protection and authentication using device-based certificates.
The WSD Port Monitor is installed by default on Windows Vista. On Windows Server 2008, the port monitor is installed along with the Print Services server role. Web Services for Devices is not available for Windows XP or Windows Server 2003. These clients can print to WSD-based devices that are shared on computers running Windows Vista or Windows Server 2008. There are four main tasks performed by the WSD Port Monitor:
These are the same functions provided by other port monitors (for example the Standard TCP/IP port monitor, tcpmon.dll). The WSD Port Monitor is implemented in wsdmon.dll. This DLL is loaded under the print spooler process (spoolsv.exe) and is defined as a port monitor in the following registry key: HKLM\SYSTEM\CurrentControlSet\Control\Print\Monitors\WSD Port. For WSD-based print devices, the WSD Port Monitor is used by default. If the print device does not support the WSD Port Monitor, then the Standard TCP/IP Port Monitor is used instead.
Now that we know what the WSD Port Monitor does, let's look at the communications mechanism used by WSD. When a WSD-based printer is connected to a network, it sends out an unsolicited "Hello" message to advertise its presence. Computers running Windows Vista or Windows Server 2008 listen for these advertisements and add the printer to their list of available network printer resources. When a WSD-based device is gracefully removed from the network it sends another message (a "Bye" message) to advertise that it is no longer available. In addition, Windows Vista and Windows Server 2008 machines can discover WSD-based printers by using a "Probe" message when searching for printers via Network Discovery or the Add Printer Wizard. A typical WSD communication sequence is shown below:
Let's examine each piece of this sequence:
Hello, Bye, Probe, Resolve and Get messages are all generated without network solicitation. These messages are used to announce device state, issue a search request, or obtain metadata. ProbeMatches, ResolveMatches, and GetResponse messages are generated in response to Probe, Resolve and Get messages. Hello, Bye, Resolve and ResolveMatches messages are sent by UDP multicast to port 3702. Get and GetResponse metadata messages occur over HTTP (TCP port 5357) or HTTPS (TCP port 5358). Probe and ProbeMatches messages are sent over UDP (port 3702) unless they are "directed" messages. A "directed" message is one where the WSD device name is known and accessed directly by name. For directed messages, the Probe and ProbeMatches messages use the same ports as the Get and GetResponse metadata messages. Obviously, to allow WSD network discovery, the Network Discovery firewall exceptions for the listed ports must be enabled in the Windows Firewall. Finally, you can disable Multicast by setting the IGMPLevel value to 0 in the following registry key: HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters.
And that brings Day Eleven to a close. Tomorrow we'll be looking at Printer Driver Packages. Until next time ...
- CC Hameed
PingBack from http://www.ditii.com/2008/02/11/windows-server-2008-the-wsd-port-monitor/
Hello , thans for your article , I have study so many about WSDMON . So I have a question that how to create a print port (WSDMON) under vista with c++ ? which function or API that can I use . I have consult in MSDN that there's nothing talking about that .
Thanks a lot
I am writing a printer device/service. Could you please confirm if the port for the host device (for discovery) can be same as port for hosted service (print)?
Thanks and regards,
We are currently working on supporting WSD for our devices, however we notice that sometimes spooler seems to send CancelJob message to our device automatically. Do you have idea why?
Thanks a lot
Is there a way to get current IP Address of the printer from a WSD port?
Ping the printer host name will give the IP
Instead of right clicking the printer and going to printer properties, just go to properties at the bottom and click web services. your ip address is there.
WSD likes to crash the print spooler or just generally cause headaches. Use tcp/ip, why try to fix something that works?
^^ to thetech: THANKS! WSD always causes my printer to hang or spool to infinity. I've been trying many fixes for this issue but your advice to use TCP/IP is so effective and so simple. Thank you for this fix!
"Ping the printer host name will give the IP"
That's assuming a lot... I added my home printer to my DNS server with a host record for "printer" instead of its real name, but I would assume anyone that isn't running their own DNS would have to query something to find that IP address. If you point to your ISP for DNS, they're going to have no idea where to send you. Does WSD have some way of providing its own DNS resolution? And if so, is it done simply by broadcast similar to ARP? My printer is in a different broadcast domain so it wouldn't work that way anyway.
For the record, my printer using WSD keeps thinking anything I print is actually an incoming fax. Thanks for trying to "improve" the way we do things, but you're just making it worse.