Microsoft DirectX 8.1 (Visual Basic)

Monitoring DirectPlay Network Traffic with Netmon

During game development, you might find it useful to monitor Microsoft® DirectPlay® network traffic, especially when trying to understand bugs. The network monitor (Netmon) is a standard utility for analyzing network traffic. DirectPlay includes a set of parsers, that allow you to use Netmon to analyze four components of DirectPlay messaging: the service provider layer, the transport layer, the session layer, and the voice layer.

How Netmon Works With DirectPlay

The DirectPlay protocol stack has three basic layers.

By installing the DirectPlay parsers, you can use Netmon to analyze the network traffic as it passes through any of these four layers. You can see all DirectPlay traffic by selecting the service provider parser. However, by selecting one of the higher level parsers, you can filter out traffic that might not be of interest.

With the transport layer parser, you see all voice and session traffic, but not low-level traffic such as connection handshaking. Be aware that the transport layer breaks messages that are longer than the network's Maximum Transfer Unit (MTU) into one or more fragments.

The session and voice layer parsers allow you to analyze session and voice-related traffic separately. Both of these parsers are aware of fragmentation, and notify the user, but cannot parse fragmented packets.

Configuring Netmon for DirectPlay

If you have a Windows 2000 Server system, Netmon is already installed. For Windows 2000 Professional, you must purchase a copy of Systems Management Server (SMS). See the Netmon documentation for a general discussion of how to use Netmon. To configure Netmon to handle DirectPlay traffic:

  1. Copy Dp8parse.dll from (SDK root)\bin\DXUtils to the appropriate folder. The Netmon root folder is normally installed in the \Winnt\System32 folder. If you have installed SMS, the root folder will be called NetMonFull. For Windows 2000 Server, the root folder will be called NetMon. Depending on which version of Netmon you are using, copy the parser DLL to either the ...\NetMonFull\Parsers, or ...\NetMon\parsers folder.
  2. Start Netmon
  3. Set the adapter to capture from (Capture|Networks...|Local Computer). Be sure to choose the adapter with the "Dial-up Connection" property set to FALSE.

You are now ready to start capturing traffic.

Capturing DirectPlay Network Traffic

To start the capture process, click the Start Capture button on the Netmon toolbar to open the capture view. Initially, you will see all the traffic that is passing through your adapter. You can filter that raw traffic stream to focus on only those packets that are of interest. By installing the DirectPlay parsers, you essentially add four filters to Netmon oriented to DirectPlay, which allow you to filter everything but DirectPlay traffic from your capture view.

To select a filter:

  1. Click the Edit Display Filter button on the Netmon toolbar.
  2. Double-click "Protocol == Any".
  3. Click "Disable All".
  4. Under "Disabled Protocols", double-click DPLAYSESSION, DPLAYSP, DPLAYTRANSPORT, and DPLAYVOICE.

Click OK twice to return to the capture view, and you are ready to start viewing DirectPlay traffic.

You can also apply a filter to the capture process itself, rather than to the capture view. This allows you, for instance, to capture only IP packets with specified source and destination ports. See the Netmon documentation for details.

Tips for Using Netmon with DirectPlay

Here are a few tips to using Netmon with DirectPlay :