While debugging your app, you may want to analyze the network traffic coming to and from your dev kit. Fiddler is a popular tool for monitoring HTTP(S) traffic, but does not capture other kinds of network traffic. You can capture a trace of all network packet traffic to and from a dev kit using the network trace capture functionality described here, and then analyze that traffic using various powerful network traffic analysis tools.
Captured content is in the “on-the-wire” state, including TLS encryption for HTTPS traffic, and IPsec protection for secure sockets, which makes direct analysis based on message content impossible. Keep in mind that often, just the fact of unexpected traffic, or the size or frequency of the packets, or the endpoints of unexpected communication flows, is enough to help find an issue with networking code. It is not always necessary to inspect packet content in order to debug a networking issue.
When you do need to see message content while debugging, change your network manifest to specify insecure debugging socket usages (SendDebug and ReceiveDebug socket usages in your secure socket descriptions) for the traffic whose content you want to inspect. See Specifying the Secure Device Association Templates for your App for more information on configuring insecure debugging sockets.
Use the Trace (xbtrace.exe) tool to activate and deactivate network traffic captures.
Start a network capture with the xbtrace start netcap command. This will initiate a network capture on the default console.
Use the “/X” argument to start tracing on a console other than the default console.
Use xbtrace stop to stop a network capture. By default, the capture is saved as “xbtrace.etl” in the current directory. To save to a different location or filename, provide the path and filename after the “stop”. For example, xbtrace stop c:\temp\sample.etl saves the trace file as c:\temp\sample.etl.
If you specify a filename and that file already exists, xbtrace gives an informative message and the trace continues to run. Note that on-console trace data is not lost when this occurs. At this time, there is no way to overwrite an existing trace file. You must delete the existing file or specify a different filename for the new trace.
To stop capture on a console that isn’t the default console, use the “/X” argument to specify a console address.
There are several different tools you can use to open a network capture file, depending on your preference or on specific tool features you wish to use.