<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Network Monitor</title><link>http://blogs.technet.com/netmon/default.aspx</link><description>This blog will focus on using Network Monitor 3 and future versions as well as provide t-shooting information on network problems, especially as it pertains to using Network Sniffers.


&lt;script type="text/javascript" language="javascript"&gt;
var sc_project=1927735; 
var sc_invisible=1; 
var sc_partition=17; 
var sc_security="5448b4d1"; 
&lt;/script&gt;

&lt;script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/frames.js"&gt;&lt;/script&gt;&lt;noscript&gt;&lt;a href="http://www.statcounter.com/" target="_blank"&gt;&lt;img  src="http://c18.statcounter.com/counter.php?sc_project=1927735&amp;amp;java=0&amp;amp;security=5448b4d1&amp;amp;invisible=1" alt="free website hit counter" border="0"&gt;&lt;/a&gt; &lt;/noscript&gt;
</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Adapters Are Missing After Upgrading to Windows 7</title><link>http://blogs.technet.com/netmon/archive/2009/10/23/adapters-are-missing-after-upgrading-to-windows-7.aspx</link><pubDate>Fri, 23 Oct 2009 21:35:44 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3288878</guid><dc:creator>PaulELong</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/netmon/comments/3288878.aspx</comments><wfw:commentRss>http://blogs.technet.com/netmon/commentrss.aspx?PostID=3288878</wfw:commentRss><description>&lt;p&gt;If you have just upgraded to Windows 7, you might notice that you no longer see any adapters listed in your Select Networks selection. There is a very simple way to fix this problem.&lt;/p&gt;  &lt;p&gt;First run CMD as administrator. If you have not done this before, you can use the search option in the start menu to find CMD. Then right click it and select &amp;quot;Run as Administrator&amp;quot;. Now type &amp;quot;nmconfig /install&amp;quot; and enter. This will re-bind the Network Monitor Driver to the adapters. Next time you run Network Monitor, the adapters should show up again.&lt;/p&gt;  &lt;p&gt;For more information, please see this &lt;a href="http://support.microsoft.com/kb/968216/"&gt;KB article&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3288878" width="1" height="1"&gt;</description></item><item><title>Reassembling Packets with the Network Monitor API</title><link>http://blogs.technet.com/netmon/archive/2009/10/12/reassembling-packets-with-the-network-monitor-api.aspx</link><pubDate>Mon, 12 Oct 2009 18:00:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3286257</guid><dc:creator>PaulELong</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/netmon/comments/3286257.aspx</comments><wfw:commentRss>http://blogs.technet.com/netmon/commentrss.aspx?PostID=3286257</wfw:commentRss><description>&lt;P&gt;Network traffic by nature is fragmented. Limits of various network packet sizes force protocols to chop up data into multiple frames. When you capture data or read it from a trace with the API (NMAPI) you see only the fragments by default. But as the engine is collecting packets, it can be configured to pass up the reassembled payloads as well. For an intro to how assembly works in the UI, please see the &lt;A href="http://blogs.technet.com/netmon/archive/2008/07/11/nm3-tv-video-help-for-using-nm3.aspx" mce_href="http://blogs.technet.com/netmon/archive/2008/07/11/nm3-tv-video-help-for-using-nm3.aspx"&gt;video on reassembly&lt;/A&gt;. We also released a recent &lt;A href="http://channel9.msdn.com/posts/MichaelHawker/Microsoft-Network-Monitor-Experts-Day-Part-5-Advanced-API/" mce_href="http://channel9.msdn.com/posts/MichaelHawker/Microsoft-Network-Monitor-Experts-Day-Part-5-Advanced-API/"&gt;video on Channel 9&lt;/A&gt; which has some information about the API and reassembly. I would also recommend reading the "Introduction to the Network Monitor API" in the help file for a general background.&lt;/P&gt;
&lt;H3&gt;Configuring the Parser&lt;/H3&gt;
&lt;P&gt;The first step is to configure your parser to reassemble. Your API tool for breaking apart a frame is called the Frame Parser object. But to create a frame parser, you start by creating a Frame Parser Configuration. This configuration allows you to add data fields and properties. But it also allows you configure your parser for Reassembly and Conversations. In this case Reassembly might depend on Conversations, so we will enable them both. Here's how I setup my Parser Configuration and Frame Parser.&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: silver 1px solid; TEXT-ALIGN: left; BORDER-LEFT: silver 1px solid; PADDING-BOTTOM: 4px; LINE-HEIGHT: 12pt; BACKGROUND-COLOR: #f4f4f4; MARGIN: 20px 0px 10px; PADDING-LEFT: 4px; WIDTH: 97.5%; PADDING-RIGHT: 4px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; MAX-HEIGHT: 200px; FONT-SIZE: 8pt; OVERFLOW: auto; BORDER-TOP: silver 1px solid; CURSOR: text; BORDER-RIGHT: silver 1px solid; PADDING-TOP: 4px" id=codeSnippetWrapper&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" id=codeSnippet&gt;&lt;SPAN style="COLOR: #008000"&gt;// Returns a frame parser with a filter and one data field.&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="COLOR: #008000"&gt;// INVALID_HANDLE_VALUE indicates failure.&lt;/SPAN&gt;&lt;BR&gt;HANDLE&lt;BR&gt;MyLoadNPL(&lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt;)&lt;BR&gt;{&lt;BR&gt;    HANDLE myFrameParser = INVALID_HANDLE_VALUE;&lt;BR&gt;    ULONG ret;&lt;BR&gt;&lt;BR&gt;    &lt;SPAN style="COLOR: #008000"&gt;// Use NULL to load default NPL set.&lt;/SPAN&gt;&lt;BR&gt;    ret = NmLoadNplParser(NULL, NmAppendRegisteredNplSets, MyParserBuild, 0, &amp;amp;g_NplParser);&lt;BR&gt;&lt;BR&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(ret == ERROR_SUCCESS){&lt;BR&gt;        ret = NmCreateFrameParserConfiguration(g_NplParser, MyParserBuild, 0, &amp;amp;g_FrameParserConfig);&lt;BR&gt;&lt;BR&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(ret == ERROR_SUCCESS)&lt;BR&gt;        {&lt;BR&gt;            &lt;SPAN style="COLOR: #008000"&gt;// Order is important here, must turn on Conversations before Reasembly.&lt;/SPAN&gt;&lt;BR&gt;            ret = NmConfigConversation(g_FrameParserConfig, NmConversationOptionNone , &lt;SPAN style="COLOR: #0000ff"&gt;TRUE&lt;/SPAN&gt;);&lt;BR&gt;            &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(ret != ERROR_SUCCESS)&lt;BR&gt;            {&lt;BR&gt;                wprintf(L&lt;SPAN style="COLOR: #006080"&gt;"Failed to config reassembly, error 0x%X\n"&lt;/SPAN&gt;, ret);&lt;BR&gt;            }&lt;BR&gt;&lt;BR&gt;            ret = NmConfigReassembly(g_FrameParserConfig, NmReassemblyOptionNone , &lt;SPAN style="COLOR: #0000ff"&gt;TRUE&lt;/SPAN&gt;);&lt;BR&gt;            &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(ret != ERROR_SUCCESS)&lt;BR&gt;            {&lt;BR&gt;                wprintf(L&lt;SPAN style="COLOR: #006080"&gt;"Failed to config reassembly, error 0x%X\n"&lt;/SPAN&gt;, ret);&lt;BR&gt;            }&lt;BR&gt;&lt;BR&gt;            &lt;SPAN style="COLOR: #008000"&gt;// Property so we can show the highest protocol description.&lt;/SPAN&gt;&lt;BR&gt;            ret = NmAddProperty(g_FrameParserConfig, L&lt;SPAN style="COLOR: #006080"&gt;"property.Description"&lt;/SPAN&gt;, &amp;amp;g_DescPropID);&lt;BR&gt;            &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(ret != ERROR_SUCCESS)&lt;BR&gt;            {&lt;BR&gt;                wprintf(L&lt;SPAN style="COLOR: #006080"&gt;"Failed to add field, error 0x%X\n"&lt;/SPAN&gt;, ret);&lt;BR&gt;            }&lt;BR&gt;&lt;BR&gt;            ret = NmCreateFrameParser(g_FrameParserConfig, &amp;amp;myFrameParser, NmParserOptimizeNone);&lt;BR&gt;&lt;BR&gt;            &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(ret != ERROR_SUCCESS)&lt;BR&gt;            {&lt;BR&gt;                wprintf(L&lt;SPAN style="COLOR: #006080"&gt;"Failed to create frame parser, error 0x%X\n"&lt;/SPAN&gt;, ret);&lt;BR&gt;                NmCloseHandle(g_FrameParserConfig);&lt;BR&gt;                NmCloseHandle(g_NplParser);&lt;BR&gt;                &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; INVALID_HANDLE_VALUE;&lt;BR&gt;            }&lt;BR&gt;        }&lt;BR&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt;&lt;BR&gt;        {&lt;BR&gt;            wprintf(L&lt;SPAN style="COLOR: #006080"&gt;"Unable to load parser config, error 0x%X\n"&lt;/SPAN&gt;, ret);&lt;BR&gt;            NmCloseHandle(g_NplParser);&lt;BR&gt;            &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; INVALID_HANDLE_VALUE;&lt;BR&gt;        }&lt;BR&gt;&lt;BR&gt;    }&lt;BR&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt;&lt;BR&gt;    {&lt;BR&gt;        wprintf(L&lt;SPAN style="COLOR: #006080"&gt;"Unable to load NPL\n"&lt;/SPAN&gt;);&lt;BR&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; INVALID_HANDLE_VALUE;&lt;BR&gt;    }&lt;BR&gt;&lt;BR&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt;(myFrameParser);&lt;BR&gt;}&lt;/PRE&gt;&lt;BR&gt;&lt;/DIV&gt;
&lt;P&gt;After creating your Frame Parser Configuration Object, you'll want to set any options first. This will let the engine optimize properly when adding other things like properties and data fields. It's also important that you turn on conversations before reassembly. Placing them in the wrong order will turn off Reassembly&lt;A&gt;&lt;/A&gt;&lt;A&gt; due to a bug in our &lt;/A&gt;&lt;A&gt;API&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Above we also added a property so that I can show the description of the current frame. This is not necessary for reassembly to work, but it helps us understand the example.&lt;/P&gt;
&lt;H3&gt;Parsing the Frames&lt;/H3&gt;
&lt;P&gt;&lt;A&gt;It is up to the parsers (NPL) to mark each frames fragment type: &lt;I&gt;First=1&lt;/I&gt;, &lt;I&gt;Middle=2&lt;/I&gt;, &lt;I&gt;Last=3&lt;/I&gt; or &lt;I&gt;None=0.&lt;/I&gt; The engine tracks these fragments and returns a new inserted raw frame once a &lt;I&gt;Last&lt;/I&gt; fragment is detected for a specific protocol.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;When you parse a raw frame using NmParseFrame, the last parameter passed is a pointer to a HANDLE that will contain an InsertedRawFrame if one is present. Otherwise this value will be set to &lt;I&gt;INVALID_HANDLE_VALUE&lt;/I&gt; for any frame that doesn't return a reassembled payload. For frames that do have a reassembled payload, the handle returned will contain a raw frame. You can now use your frame parser to parse this raw frame.&lt;/P&gt;
&lt;P&gt;The main part of my code simply retrieves frames from the capture file iteratively and calls ParseFrame, which does all the work. If an inserted frame is found, the function calls itself. The function is recursive because the handles for a RawFrame, ParsedFrame and InsertedRawFrame have to be closed in the order they were opened. There are other ways to do this, but for this example a recursive routine was the easiest. You will also want to insure the frames are in order. For instance you could use NmOpenCaptureFileInOrder to make sure the TCP frames are ordered correctly.&lt;/P&gt;
&lt;P&gt;In my case I parse and display all the frames so that you can get a feel for the pattern that occurs as frames fragments are marked by the engine. It also helps to shows how fragmentation looks at different protocol layers. If you were interested in only the reassembled frames or frames that are not fragmented to begin with, you could identify those as having a fragment type of &lt;I&gt;None&lt;/I&gt; and no &lt;I&gt;InsertedRawFrame&lt;/I&gt;.&lt;/P&gt;
&lt;P&gt;Here's the recursive frame parsing routine:&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: silver 1px solid; TEXT-ALIGN: left; BORDER-LEFT: silver 1px solid; PADDING-BOTTOM: 4px; LINE-HEIGHT: 12pt; BACKGROUND-COLOR: #f4f4f4; MARGIN: 20px 0px 10px; PADDING-LEFT: 4px; WIDTH: 97.5%; PADDING-RIGHT: 4px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; MAX-HEIGHT: 200px; FONT-SIZE: 8pt; OVERFLOW: auto; BORDER-TOP: silver 1px solid; CURSOR: text; BORDER-RIGHT: silver 1px solid; PADDING-TOP: 4px" id=codeSnippetWrapper&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" id=codeSnippet&gt;&lt;SPAN style="COLOR: #008000"&gt;// Recursive Parsing routine.  If an inserted frame is found, the recusive routine is called again.  This&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="COLOR: #008000"&gt;// allows us to close our handles in the order there were created.&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt;&lt;BR&gt;MyParseFrame(HANDLE frameParser, HANDLE rawFrame, ULONG curFrame, PULONG reassembleFrames, &lt;SPAN style="COLOR: #0000ff"&gt;int&lt;/SPAN&gt; reassembleCount)&lt;BR&gt;{&lt;BR&gt;    ULONG ret;&lt;BR&gt;    HANDLE ParsedFrame = INVALID_HANDLE_VALUE;&lt;BR&gt;    HANDLE InsRawFrame = INVALID_HANDLE_VALUE;&lt;BR&gt;&lt;BR&gt;    &lt;SPAN style="COLOR: #008000"&gt;// NmUseFrameNumber and valid unique frame numbers are neccessary for Reassembly to work properly.&lt;/SPAN&gt;&lt;BR&gt;    ret = NmParseFrame(frameParser, rawFrame, curFrame + *reassembleFrames, NmFieldDisplayStringRequired | NmUseFrameNumberParameter, &amp;amp;ParsedFrame, &amp;amp;InsRawFrame); &lt;BR&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(ret == ERROR_SUCCESS)&lt;BR&gt;    {&lt;BR&gt;        &lt;SPAN style="COLOR: #008000"&gt;// Returns the highest level protocol description just to show which&lt;/SPAN&gt;&lt;BR&gt;        &lt;SPAN style="COLOR: #008000"&gt;// frame we are working on.&lt;/SPAN&gt;&lt;BR&gt;        PBYTE buf = GetDescription(frameParser);&lt;BR&gt;&lt;BR&gt;        &lt;SPAN style="COLOR: #008000"&gt;// Get the fragment information which helps understand what is happening,&lt;/SPAN&gt;&lt;BR&gt;        &lt;SPAN style="COLOR: #008000"&gt;// but not needed for reassembly to work.&lt;/SPAN&gt;&lt;BR&gt;        NM_FRAGMENTATION_INFO FragInfo;&lt;BR&gt;        GetFragType(ParsedFrame, &amp;amp;FragInfo);&lt;BR&gt;&lt;BR&gt;        wprintf(L&lt;SPAN style="COLOR: #006080"&gt;"%5d-%d: %5d      %-5.5s-%d    %-.45s\n"&lt;/SPAN&gt;, curFrame+1, reassembleCount, curFrame+(*reassembleFrames)+1, FragInfo.FragmentedProtocolName, FragInfo.FragmentType, buf);&lt;BR&gt;&lt;BR&gt;        free(buf);&lt;BR&gt;&lt;BR&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(InsRawFrame != INVALID_HANDLE_VALUE)&lt;BR&gt;        {&lt;BR&gt;            (*reassembleFrames)++;&lt;BR&gt;            MyParseFrame(frameParser, InsRawFrame, curFrame, reassembleFrames, reassembleCount+1);&lt;BR&gt;&lt;BR&gt;            NmCloseHandle(InsRawFrame);&lt;BR&gt;        }&lt;BR&gt;    }&lt;BR&gt;&lt;BR&gt;    NmCloseHandle(ParsedFrame);&lt;BR&gt;    NmCloseHandle(InsRawFrame);&lt;BR&gt;}&lt;/PRE&gt;&lt;BR&gt;&lt;/DIV&gt;
&lt;P&gt;When doing reassembly you must add the Frame Number parameter. It must also be unique, so you have to remember to increment when adding and parsing the reassembled frames. The GetFragType uses NmGetFrameFragmentInfo API call to determine the fragment type and protocol. You can look at the full example below to see how it works in details, but those ancillary pieces are pretty straight forward.&lt;/P&gt;
&lt;H3&gt;Looking at an Example&lt;/H3&gt;
&lt;P&gt;Below is the partial output for an example capture. In my notation, the Frame# contains a number after the dash that shows when multiple iterations occur on a frame. The Reassem# is the frame number that would appear in a reassembled trace in the UI and is what is used to seed each frame with a unique frame number.&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: silver 1px solid; TEXT-ALIGN: left; BORDER-LEFT: silver 1px solid; PADDING-BOTTOM: 4px; LINE-HEIGHT: 12pt; BACKGROUND-COLOR: #f4f4f4; MARGIN: 20px 0px 10px; PADDING-LEFT: 4px; WIDTH: 97.5%; PADDING-RIGHT: 4px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; MAX-HEIGHT: 200px; FONT-SIZE: 8pt; OVERFLOW: auto; BORDER-TOP: silver 1px solid; CURSOR: text; BORDER-RIGHT: silver 1px solid; PADDING-TOP: 4px" id=codeSnippetWrapper&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" id=codeSnippet&gt;Frame# Reassem# FragType Description&lt;BR&gt;&lt;BR&gt;5-0: 5 TCP -1 HTTP:Response, HTTP/1.1, Status: Bad gateway,&lt;BR&gt;&lt;BR&gt;6-0: 6 TCP -2 TCP:[Continuation to #5]Flags=...A...., SrcPo&lt;BR&gt;&lt;BR&gt;7-0: 7 -0 TCP:Flags=...A...., SrcPort=49382, DstPort=HT&lt;BR&gt;&lt;BR&gt;8-0: 8 TCP -3 TCP:[Continuation to #5]Flags=...AP..., SrcPo&lt;BR&gt;&lt;BR&gt;8-1: 9 -0 HTTP:Response, HTTP/1.1, Status: Bad gateway,&lt;BR&gt;&lt;BR&gt;...&lt;BR&gt;&lt;/PRE&gt;&lt;BR&gt;&lt;/DIV&gt;
&lt;P&gt;In original frames 5-8, you can see a typical TCP fragmentation. Frame 5 is a TCP First fragment. Frame 6 is a middle fragment and frame 7 is traveling in the opposite direction so it's not part of this reassembly stream. Frame 8 is the last frame in the reassembled TCP payload which is marked as the &lt;I&gt;Last&lt;/I&gt; fragment. This is where the Inserted Raw Frame is valid and the recursive call to parse the frame would occur. Frame 8-1, is the parsed inserted frame which you can see matches the description of frame #5, but if you looked at it, there would be two differences.&lt;/P&gt;
&lt;P&gt;First, since it's an inserted frame it will have a PayloadHeader structure as its top protocol. This is a protocol we manufactured to take the place of the carrying protocol, in this case TCP. Having a duplicate TCP frame would confuse our parsers and perhaps the user as well. So this header takes it place and calls HTTP directly.&lt;/P&gt;
&lt;P&gt;Second, this frame will have a larger payload. It will consist of all the payload data from frame 5, 6, and 8.&lt;/P&gt;
&lt;H3&gt;Two Level Reassembly&lt;/H3&gt;
&lt;P&gt;In this next example, both TCP and HTTP has fragmented data.&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: silver 1px solid; TEXT-ALIGN: left; BORDER-LEFT: silver 1px solid; PADDING-BOTTOM: 4px; LINE-HEIGHT: 12pt; BACKGROUND-COLOR: #f4f4f4; MARGIN: 20px 0px 10px; PADDING-LEFT: 4px; WIDTH: 97.5%; PADDING-RIGHT: 4px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; MAX-HEIGHT: 200px; FONT-SIZE: 8pt; OVERFLOW: auto; BORDER-TOP: silver 1px solid; CURSOR: text; BORDER-RIGHT: silver 1px solid; PADDING-TOP: 4px" id=codeSnippetWrapper&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" id=codeSnippet&gt;...&lt;BR&gt;&lt;BR&gt;33-0: 36 TCP -1 HTTP:Response, HTTP/1.1, Status: Ok, URL: htt&lt;BR&gt;&lt;BR&gt;34-0: 37 TCP -2 TCP:[Continuation to #36]Flags=...A...., SrcP&lt;BR&gt;&lt;BR&gt;35-0: 38 -0 TCP:Flags=...A...., SrcPort=49384, DstPort=HT&lt;BR&gt;&lt;BR&gt;36-0: 39 TCP -3 TCP:[Continuation to #36]Flags=...AP..., SrcP&lt;BR&gt;&lt;BR&gt;36-1: 40 HTTP -1 HTTP:Response, HTTP/1.1, Status: Ok, URL: htt&lt;BR&gt;&lt;BR&gt;37-0: 41 TCP -1 HTTP:HTTP Payload, URL: http:&lt;SPAN style="COLOR: #008000"&gt;//www.google.com&lt;/SPAN&gt;&lt;BR&gt;&lt;BR&gt;38-0: 42 -0 TCP:Flags=...A...., SrcPort=49384, DstPort=HT&lt;BR&gt;&lt;BR&gt;39-0: 43 TCP -2 TCP:[Continuation to #41]Flags=...A...., SrcP&lt;BR&gt;&lt;BR&gt;40-0: 44 TCP -2 TCP:[Continuation to #41]Flags=...A...., SrcP&lt;BR&gt;&lt;BR&gt;41-0: 45 -0 TCP:Flags=...A...., SrcPort=49384, DstPort=HT&lt;BR&gt;&lt;BR&gt;42-0: 46 TCP -3 TCP:[Continuation to #41]Flags=...AP..., SrcP&lt;BR&gt;&lt;BR&gt;42-1: 47 HTTP -3 HTTP:HTTP Payload, URL: http:&lt;SPAN style="COLOR: #008000"&gt;//www.google.com&lt;/SPAN&gt;&lt;BR&gt;&lt;BR&gt;42-2: 48 -0 HTTP:Response, HTTP/1.1, Status: Ok, URL: htt&lt;BR&gt;&lt;BR&gt;...&lt;BR&gt;&lt;/PRE&gt;&lt;BR&gt;&lt;/DIV&gt;
&lt;P&gt;Frames 33-36 make up the first HTTP fragment. As you can see, the inserted frame at 36-1 is a &lt;I&gt;First&lt;/I&gt; fragment, but the protocol is now HTTP. Frames 37-42 make up the next HTTP fragment which is inserted at frame 42-1. This inserted frame is the HTTP &lt;I&gt;Last&lt;/I&gt; fragment so now there is yet another inserted raw frame that we must iterate through and parse. Frame 42-2 is the final reassembled frame and contains the original HTTP Response in its entirety. The description matches frame 33 because it the data starts with payload in that frame but it also includes the payloads from frames 34, 36, 37, 39, 40, and 42. However, from the engines point of view, it really collects the payloads from frame 36-1 and 42-1. But each of these is made up from the fragmented frames mentioned above.&lt;/P&gt;
&lt;H3&gt;The Whole Shebang&lt;/H3&gt;
&lt;P&gt;Below I've placed the entire source code for the example described in this blog. While it depends on which protocols you are interested in, having access to the reassembled data can provide you with the big picture especially when focusing on application layer traffic.&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: silver 1px solid; TEXT-ALIGN: left; BORDER-LEFT: silver 1px solid; PADDING-BOTTOM: 4px; LINE-HEIGHT: 12pt; BACKGROUND-COLOR: #f4f4f4; MARGIN: 20px 0px 10px; PADDING-LEFT: 4px; WIDTH: 97.5%; PADDING-RIGHT: 4px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; MAX-HEIGHT: 200px; FONT-SIZE: 8pt; OVERFLOW: auto; BORDER-TOP: silver 1px solid; CURSOR: text; BORDER-RIGHT: silver 1px solid; PADDING-TOP: 4px" id=codeSnippetWrapper&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" id=codeSnippet&gt;&lt;SPAN style="COLOR: #cc6633"&gt;#include&lt;/SPAN&gt; &lt;SPAN style="COLOR: #006080"&gt;"stdafx.h"&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="COLOR: #cc6633"&gt;#include&lt;/SPAN&gt; &lt;SPAN style="COLOR: #006080"&gt;"windows.h"&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="COLOR: #cc6633"&gt;#include&lt;/SPAN&gt; &lt;SPAN style="COLOR: #006080"&gt;"stdio.h"&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="COLOR: #cc6633"&gt;#include&lt;/SPAN&gt; &lt;SPAN style="COLOR: #006080"&gt;"stdlib.h"&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="COLOR: #cc6633"&gt;#include&lt;/SPAN&gt; &lt;SPAN style="COLOR: #006080"&gt;"objbase.h"&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="COLOR: #cc6633"&gt;#include&lt;/SPAN&gt; &lt;SPAN style="COLOR: #006080"&gt;"ntddndis.h"&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="COLOR: #cc6633"&gt;#include&lt;/SPAN&gt; &lt;SPAN style="COLOR: #006080"&gt;"NMApi.h"&lt;/SPAN&gt;&lt;BR&gt;&lt;BR&gt;HANDLE g_NplParser = INVALID_HANDLE_VALUE;&lt;BR&gt;HANDLE g_FrameParserConfig = INVALID_HANDLE_VALUE;&lt;BR&gt;&lt;BR&gt;ULONG g_DescPropID = 0;    &lt;SPAN style="COLOR: #008000"&gt;// Global Description Property ID.&lt;/SPAN&gt;&lt;BR&gt;&lt;BR&gt;&lt;SPAN style="COLOR: #008000"&gt;// Callback for parser building messages&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt; __stdcall&lt;BR&gt;MyParserBuild(PVOID Context, ULONG StatusCode, LPCWSTR lpDescription, ULONG ErrorType)&lt;BR&gt;{&lt;BR&gt;    wprintf(L&lt;SPAN style="COLOR: #006080"&gt;"%s\n"&lt;/SPAN&gt;, lpDescription);&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;&lt;SPAN style="COLOR: #008000"&gt;// Returns a frame parser with a filter and one data field.&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="COLOR: #008000"&gt;// INVALID_HANDLE_VALUE indicates failure.&lt;/SPAN&gt;&lt;BR&gt;HANDLE&lt;BR&gt;MyLoadNPL(&lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt;)&lt;BR&gt;{&lt;BR&gt;    HANDLE myFrameParser = INVALID_HANDLE_VALUE;&lt;BR&gt;    ULONG ret;&lt;BR&gt;&lt;BR&gt;    &lt;SPAN style="COLOR: #008000"&gt;// Use NULL to load default NPL set.&lt;/SPAN&gt;&lt;BR&gt;    ret = NmLoadNplParser(NULL, NmAppendRegisteredNplSets, MyParserBuild, 0, &amp;amp;g_NplParser);&lt;BR&gt;&lt;BR&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(ret == ERROR_SUCCESS){&lt;BR&gt;        ret = NmCreateFrameParserConfiguration(g_NplParser, MyParserBuild, 0, &amp;amp;g_FrameParserConfig);&lt;BR&gt;&lt;BR&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(ret == ERROR_SUCCESS)&lt;BR&gt;        {&lt;BR&gt;            &lt;SPAN style="COLOR: #008000"&gt;// Order is important here, must turn on Conversations before Reasembly.&lt;/SPAN&gt;&lt;BR&gt;            ret = NmConfigConversation(g_FrameParserConfig, NmConversationOptionNone , &lt;SPAN style="COLOR: #0000ff"&gt;TRUE&lt;/SPAN&gt;);&lt;BR&gt;            &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(ret != ERROR_SUCCESS)&lt;BR&gt;            {&lt;BR&gt;                wprintf(L&lt;SPAN style="COLOR: #006080"&gt;"Failed to config reassembly, error 0x%X\n"&lt;/SPAN&gt;, ret);&lt;BR&gt;            }&lt;BR&gt;&lt;BR&gt;            ret = NmConfigReassembly(g_FrameParserConfig, NmReassemblyOptionNone , &lt;SPAN style="COLOR: #0000ff"&gt;TRUE&lt;/SPAN&gt;);&lt;BR&gt;            &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(ret != ERROR_SUCCESS)&lt;BR&gt;            {&lt;BR&gt;                wprintf(L&lt;SPAN style="COLOR: #006080"&gt;"Failed to config reassembly, error 0x%X\n"&lt;/SPAN&gt;, ret);&lt;BR&gt;            }&lt;BR&gt;&lt;BR&gt;            &lt;SPAN style="COLOR: #008000"&gt;// Property so we can show the highest protocol description.&lt;/SPAN&gt;&lt;BR&gt;            ret = NmAddProperty(g_FrameParserConfig, L&lt;SPAN style="COLOR: #006080"&gt;"property.Description"&lt;/SPAN&gt;, &amp;amp;g_DescPropID);&lt;BR&gt;            &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(ret != ERROR_SUCCESS)&lt;BR&gt;            {&lt;BR&gt;                wprintf(L&lt;SPAN style="COLOR: #006080"&gt;"Failed to add field, error 0x%X\n"&lt;/SPAN&gt;, ret);&lt;BR&gt;            }&lt;BR&gt;&lt;BR&gt;            ret = NmCreateFrameParser(g_FrameParserConfig, &amp;amp;myFrameParser, NmParserOptimizeNone);&lt;BR&gt;&lt;BR&gt;            &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(ret != ERROR_SUCCESS)&lt;BR&gt;            {&lt;BR&gt;                wprintf(L&lt;SPAN style="COLOR: #006080"&gt;"Failed to create frame parser, error 0x%X\n"&lt;/SPAN&gt;, ret);&lt;BR&gt;                NmCloseHandle(g_FrameParserConfig);&lt;BR&gt;                NmCloseHandle(g_NplParser);&lt;BR&gt;                &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; INVALID_HANDLE_VALUE;&lt;BR&gt;            }&lt;BR&gt;        }&lt;BR&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt;&lt;BR&gt;        {&lt;BR&gt;            wprintf(L&lt;SPAN style="COLOR: #006080"&gt;"Unable to load parser config, error 0x%X\n"&lt;/SPAN&gt;, ret);&lt;BR&gt;            NmCloseHandle(g_NplParser);&lt;BR&gt;            &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; INVALID_HANDLE_VALUE;&lt;BR&gt;        }&lt;BR&gt;&lt;BR&gt;    }&lt;BR&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt;&lt;BR&gt;    {&lt;BR&gt;        wprintf(L&lt;SPAN style="COLOR: #006080"&gt;"Unable to load NPL\n"&lt;/SPAN&gt;);&lt;BR&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; INVALID_HANDLE_VALUE;&lt;BR&gt;    }&lt;BR&gt;&lt;BR&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt;(myFrameParser);&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;&lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt;&lt;BR&gt;UnLoadNPL(&lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt;)&lt;BR&gt;{&lt;BR&gt;    NmCloseHandle(g_NplParser);&lt;BR&gt;    NmCloseHandle(g_FrameParserConfig);&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;ULONG&lt;BR&gt;GetFragType(HANDLE parsedFrame, NM_FRAGMENTATION_INFO *FragInfo)&lt;BR&gt;{&lt;BR&gt;    ULONG ret;&lt;BR&gt;&lt;BR&gt;    FragInfo-&amp;gt;Size = &lt;SPAN style="COLOR: #0000ff"&gt;sizeof&lt;/SPAN&gt;(FragInfo);&lt;BR&gt;    ret = NmGetFrameFragmentInfo(parsedFrame, FragInfo);&lt;BR&gt;&lt;BR&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; ret;&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;PBYTE&lt;BR&gt;GetDescription(HANDLE frameParser)&lt;BR&gt;{&lt;BR&gt;    ULONG ret;&lt;BR&gt;    NM_PROPERTY_INFO PropInfo;&lt;BR&gt;&lt;BR&gt;    &lt;SPAN style="COLOR: #008000"&gt;// Find out the size of the description property so we can allocate a buffer.&lt;/SPAN&gt;&lt;BR&gt;    &lt;SPAN style="COLOR: #008000"&gt;// MUST intialize the size and name pointer or NmGetPropertyInfo will fail.&lt;/SPAN&gt;&lt;BR&gt;    PropInfo.Size = &lt;SPAN style="COLOR: #0000ff"&gt;sizeof&lt;/SPAN&gt;(PropInfo);&lt;BR&gt;    PropInfo.Name = NULL;&lt;BR&gt;    ret = NmGetPropertyInfo(frameParser, g_DescPropID, &amp;amp;PropInfo);&lt;BR&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(ret != ERROR_SUCCESS)&lt;BR&gt;    {&lt;BR&gt;        wprintf(L&lt;SPAN style="COLOR: #006080"&gt;"Error calling NmGetPropertyInfo, %d\n"&lt;/SPAN&gt;, ret);&lt;BR&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; NULL;&lt;BR&gt;    }&lt;BR&gt;&lt;BR&gt;    ULONG retlen = 0;&lt;BR&gt;    NmPropertyValueType propType;&lt;BR&gt;    &lt;SPAN style="COLOR: #008000"&gt;// Add size of WCHAR for null terminator&lt;/SPAN&gt;&lt;BR&gt;    PBYTE buf = (PBYTE)malloc(PropInfo.ValueSize + &lt;SPAN style="COLOR: #0000ff"&gt;sizeof&lt;/SPAN&gt;(WCHAR));&lt;BR&gt;    ret = NmGetPropertyValueById(frameParser, g_DescPropID, PropInfo.ValueSize, buf, &amp;amp;retlen, &amp;amp;propType);&lt;BR&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(ret != ERROR_SUCCESS)&lt;BR&gt;    {&lt;BR&gt;        wprintf(L&lt;SPAN style="COLOR: #006080"&gt;"Error calling NmGetPropertyValueById, %d\n"&lt;/SPAN&gt;, ret);&lt;BR&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; NULL;&lt;BR&gt;    }&lt;BR&gt;&lt;BR&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; buf;&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;&lt;SPAN style="COLOR: #008000"&gt;// Recursive Parsing routine.  If an inserted frame is found, the recusive routine is called again.  This&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="COLOR: #008000"&gt;// allows us to close our handles in the order there were created.&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt;&lt;BR&gt;MyParseFrame(HANDLE frameParser, HANDLE rawFrame, ULONG curFrame, PULONG reassembleFrames, &lt;SPAN style="COLOR: #0000ff"&gt;int&lt;/SPAN&gt; reassembleCount)&lt;BR&gt;{&lt;BR&gt;    ULONG ret;&lt;BR&gt;    HANDLE ParsedFrame = INVALID_HANDLE_VALUE;&lt;BR&gt;    HANDLE InsRawFrame = INVALID_HANDLE_VALUE;&lt;BR&gt;&lt;BR&gt;    &lt;SPAN style="COLOR: #008000"&gt;// NmUseFrameNumber and valid unique frame numbers are neccessary for Reassembly to work properly.&lt;/SPAN&gt;&lt;BR&gt;    ret = NmParseFrame(frameParser, rawFrame, curFrame + *reassembleFrames, NmFieldDisplayStringRequired | NmUseFrameNumberParameter, &amp;amp;ParsedFrame, &amp;amp;InsRawFrame); &lt;BR&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(ret == ERROR_SUCCESS)&lt;BR&gt;    {&lt;BR&gt;        &lt;SPAN style="COLOR: #008000"&gt;// Returns the highest level protocol description just to show which&lt;/SPAN&gt;&lt;BR&gt;        &lt;SPAN style="COLOR: #008000"&gt;// frame we are working on.&lt;/SPAN&gt;&lt;BR&gt;        PBYTE buf = GetDescription(frameParser);&lt;BR&gt;&lt;BR&gt;        &lt;SPAN style="COLOR: #008000"&gt;// Get the fragment information which helps understand what is happening,&lt;/SPAN&gt;&lt;BR&gt;        &lt;SPAN style="COLOR: #008000"&gt;// but not needed for reassembly to work.&lt;/SPAN&gt;&lt;BR&gt;        NM_FRAGMENTATION_INFO FragInfo;&lt;BR&gt;        GetFragType(ParsedFrame, &amp;amp;FragInfo);&lt;BR&gt;&lt;BR&gt;        wprintf(L&lt;SPAN style="COLOR: #006080"&gt;"%5d-%d: %5d      %-5.5s-%d    %-.45s\n"&lt;/SPAN&gt;, curFrame+1, reassembleCount, curFrame+(*reassembleFrames)+1, FragInfo.FragmentedProtocolName, FragInfo.FragmentType, buf);&lt;BR&gt;&lt;BR&gt;        free(buf);&lt;BR&gt;&lt;BR&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(InsRawFrame != INVALID_HANDLE_VALUE)&lt;BR&gt;        {&lt;BR&gt;            (*reassembleFrames)++;&lt;BR&gt;            MyParseFrame(frameParser, InsRawFrame, curFrame, reassembleFrames, reassembleCount+1);&lt;BR&gt;&lt;BR&gt;            NmCloseHandle(InsRawFrame);&lt;BR&gt;        }&lt;BR&gt;    }&lt;BR&gt;&lt;BR&gt;    NmCloseHandle(ParsedFrame);&lt;BR&gt;    NmCloseHandle(InsRawFrame);&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;&lt;SPAN style="COLOR: #0000ff"&gt;int&lt;/SPAN&gt; __cdecl wmain(&lt;SPAN style="COLOR: #0000ff"&gt;int&lt;/SPAN&gt; argc, WCHAR* argv[])&lt;BR&gt;{&lt;BR&gt;    ULONG ret = ERROR_SUCCESS;&lt;BR&gt;    &lt;SPAN style="COLOR: #008000"&gt;// The first paramryrt should be a file.&lt;/SPAN&gt;&lt;BR&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(argc &amp;lt;= 1){&lt;BR&gt;        wprintf(L&lt;SPAN style="COLOR: #006080"&gt;"Expect a file name as the only command line parameter\n"&lt;/SPAN&gt;);&lt;BR&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; -1;&lt;BR&gt;    }&lt;BR&gt;&lt;BR&gt;    &lt;SPAN style="COLOR: #008000"&gt;// Open the specified capture file.&lt;/SPAN&gt;&lt;BR&gt;    HANDLE myCaptureFile = INVALID_HANDLE_VALUE;&lt;BR&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(ERROR_SUCCESS == NmOpenCaptureFile(argv[1], &amp;amp;myCaptureFile))&lt;BR&gt;    {&lt;BR&gt;        &lt;SPAN style="COLOR: #008000"&gt;// Initialize the parser engine and return a frame parser.&lt;/SPAN&gt;&lt;BR&gt;        HANDLE myFrameParser = MyLoadNPL();&lt;BR&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(myFrameParser != INVALID_HANDLE_VALUE)&lt;BR&gt;        {&lt;BR&gt;            ULONG myFrameCount = 0;&lt;BR&gt;            ret = NmGetFrameCount(myCaptureFile, &amp;amp;myFrameCount); &lt;BR&gt;            &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(ret == ERROR_SUCCESS)&lt;BR&gt;            {&lt;BR&gt;                ULONG totReassembledFrames = 0;&lt;BR&gt;                HANDLE myRawFrame = INVALID_HANDLE_VALUE;&lt;BR&gt;&lt;BR&gt;                wprintf(L&lt;SPAN style="COLOR: #006080"&gt;"Frame#   Reassem#  FragType    Description\n"&lt;/SPAN&gt;);&lt;BR&gt;                &lt;SPAN style="COLOR: #0000ff"&gt;for&lt;/SPAN&gt;(ULONG i = 0; i &amp;lt; myFrameCount; i++)&lt;BR&gt;                {&lt;BR&gt;                    HANDLE myParsedFrame = INVALID_HANDLE_VALUE;&lt;BR&gt;                    ret = NmGetFrame(myCaptureFile, i, &amp;amp;myRawFrame); &lt;BR&gt;                    &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(ret == ERROR_SUCCESS)&lt;BR&gt;                    {&lt;BR&gt;                        MyParseFrame(myFrameParser, myRawFrame, i, &amp;amp;totReassembledFrames, 0);&lt;BR&gt;&lt;BR&gt;                        NmCloseHandle(myRawFrame);&lt;BR&gt;                    }&lt;BR&gt;                    &lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt;&lt;BR&gt;                    {&lt;BR&gt;                        &lt;SPAN style="COLOR: #008000"&gt;// Print an error, but continue to loop.&lt;/SPAN&gt;&lt;BR&gt;                        wprintf(L&lt;SPAN style="COLOR: #006080"&gt;"Errors getting raw frame %d\n"&lt;/SPAN&gt;, i+1);&lt;BR&gt;                    }&lt;BR&gt;                }&lt;BR&gt;            }&lt;BR&gt;&lt;BR&gt;            NmCloseHandle(myFrameParser);&lt;BR&gt;        }&lt;BR&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt;&lt;BR&gt;        {&lt;BR&gt;            wprintf(L&lt;SPAN style="COLOR: #006080"&gt;"Errors creating frame parser\n"&lt;/SPAN&gt;);&lt;BR&gt;        }&lt;BR&gt;&lt;BR&gt;        NmCloseHandle(myCaptureFile);&lt;BR&gt;    }&lt;BR&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt;&lt;BR&gt;    {&lt;BR&gt;        wprintf(L&lt;SPAN style="COLOR: #006080"&gt;"Errors openning capture file\n"&lt;/SPAN&gt;);&lt;BR&gt;    }&lt;BR&gt;&lt;BR&gt;    &lt;SPAN style="COLOR: #008000"&gt;// Release global handles.&lt;/SPAN&gt;&lt;BR&gt;    UnLoadNPL();&lt;BR&gt;&lt;BR&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; 0;&lt;BR&gt;}&lt;/PRE&gt;&lt;BR&gt;&lt;/DIV&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3286257" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/netmon/archive/tags/Experts/default.aspx">Experts</category></item><item><title>Network Monitor Videos on Channel 9</title><link>http://blogs.technet.com/netmon/archive/2009/10/12/network-monitor-videos-on-channel-9.aspx</link><pubDate>Mon, 12 Oct 2009 14:19:35 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3286195</guid><dc:creator>PaulELong</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/netmon/comments/3286195.aspx</comments><wfw:commentRss>http://blogs.technet.com/netmon/commentrss.aspx?PostID=3286195</wfw:commentRss><description>&lt;p&gt;We posted some videos to &lt;a href="http://channel9.msdn.com/tags/Netmon/"&gt;Channel 9&lt;/a&gt;&amp;#160; in the last 6 months or so, and I wanted to let everybody know about them.&lt;/p&gt;  &lt;p&gt;We have one set of video's that provide some insight into the Network Monitor API and process of creating experts. This series provides an overview of the API and dives deeply in to various aspects like Live Capturing, Parser Engine, and API Overview as well as a general Expert Story to understand the big picture. We plan to release a few more in the upcoming months so stay tuned.&lt;/p&gt;  &lt;p&gt;We also have some videos from our &lt;a href="http://www.microsoft.com/protocols/resources/plugfests-and-interop-labs/"&gt;Plug Fests&lt;/a&gt;, which is where we invite partners to get information on specific technologies to which they want to interoperate.&lt;/p&gt;  &lt;p&gt;So please visit the Channel9 (&lt;a href="http://channel9.msdn.com/tags/Netmon/"&gt;http://channel9.msdn.com/tags/Netmon/&lt;/a&gt;) site and learn more about Network Monitor.&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3286195" width="1" height="1"&gt;</description></item><item><title>Using NMAPI to Access TCP Payload</title><link>http://blogs.technet.com/netmon/archive/2009/10/07/using-nmapi-to-access-tcp-payload.aspx</link><pubDate>Wed, 07 Oct 2009 16:31:41 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3285271</guid><dc:creator>PaulELong</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/netmon/comments/3285271.aspx</comments><wfw:commentRss>http://blogs.technet.com/netmon/commentrss.aspx?PostID=3285271</wfw:commentRss><description>&lt;p&gt;The TCP Payload often carries data that you want to access directly using the Network Monitor API. Below I will detail how to do this using a simple C++ example and the NMAPI.&lt;/p&gt;  &lt;h3&gt;Why Not add a TCP.Payload Field?&lt;/h3&gt;  &lt;p&gt;The TCP Payload can carry all types of payloads depending on the protocol that rides on top of TCP. Most often these represent other protocols, but you might not care about the protocol and instead want to see the payload size or payload data directly. You might think that you could access TCP.Payload to access this data, as this is a valid data field. However, TCP.Payload is only instantiated when no other protocol consumes the data. And in most cases, our parsers are complete enough to attempt to parse the data further. This is a limitation of how NPL works, and means we need to find another way to get the payload data.&lt;/p&gt;  &lt;h3&gt;Why Not use Property.TCPPayload?&lt;/h3&gt;  &lt;p&gt;Now there is a property, &lt;a href="http://blogs.technet.com/netmon/archive/2006/10/17/into-to-filtering-with-network-monitor-3-0.aspx"&gt;see this blog for more info on properties&lt;/a&gt;, called Property.TCPPayload that you could potentially use. The limitation is that it only works with ASCII or UNICODE data. So for binary information the data does not read properly into the property.&lt;/p&gt;  &lt;h3&gt;The Solution&lt;/h3&gt;  &lt;p&gt;The solution is to find the TCP payload depending on the TCP header location and size. We can use Property.TCPPayloadLength to obtain the total length of the payload. And to get the offset into the frame we use the TCP header length (TCP.DataOffset.DataOffset). Finally to get the start of the TCP frame we use the offset of TCP.SrcPort which is the first field in a TCP frame. With these pieces of information, we can use NmGetPartialRawFrame API to grab the raw data from the frame.&lt;/p&gt;  &lt;p&gt;So here's the code snippet:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;br /&gt;GetFramePayload(HANDLE ParsedFrame, HANDLE FrameParser, HANDLE RawFrame)&lt;br /&gt;{&lt;br /&gt;    ULONG ret;&lt;br /&gt;    UINT32 PayloadLen = 0;&lt;br /&gt;    ULONG retlen;&lt;br /&gt;    NmPropertyValueType PropType;&lt;br /&gt;&lt;br /&gt;    UINT8 TCPHeaderSize;&lt;br /&gt;    ULONG TCPSrcOffset, TCPSrcSize;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #008000"&gt;// Get Payload Length&lt;/span&gt;&lt;br /&gt;    ret = NmGetPropertyValueById(FrameParser, TCPPayloadLengthID, &lt;span style="color: #0000ff"&gt;sizeof&lt;/span&gt;(PayloadLen), (PBYTE)&amp;amp;PayloadLen, &amp;amp;retlen, &amp;amp;PropType);&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt;(ret != ERROR_SUCCESS)&lt;br /&gt;    {&lt;br /&gt;        wprintf(L&lt;span style="color: #006080"&gt;&amp;quot;Error retrieving TCP Payload Length Property, err=%d\n&amp;quot;&lt;/span&gt;, ret);&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt;;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt;(PayloadLen &amp;gt; 0)&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color: #008000"&gt;// Get the Data Offset, used to determine the TCP header size&lt;/span&gt;&lt;br /&gt;        ret = NmGetFieldValueNumber8Bit(ParsedFrame, TCPDataOffsetID, &amp;amp;TCPHeaderSize);&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt;(ret != ERROR_SUCCESS)&lt;br /&gt;        {&lt;br /&gt;            wprintf(L&lt;span style="color: #006080"&gt;&amp;quot;Error retrieving TCP Header Length Field, err=%d\n&amp;quot;&lt;/span&gt;, ret);&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt;;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: #008000"&gt;// Get the Offset of TCP.SrcPort which is the first field in TCP.&lt;/span&gt;&lt;br /&gt;        ret = NmGetFieldOffsetAndSize(ParsedFrame, TCPSrcPortID, &amp;amp;TCPSrcOffset, &amp;amp;TCPSrcSize);&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt;(ret != ERROR_SUCCESS)&lt;br /&gt;        {&lt;br /&gt;            wprintf(L&lt;span style="color: #006080"&gt;&amp;quot;Error retrieving TCP SRC Header/Offset, err=%d\n&amp;quot;&lt;/span&gt;, ret);&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt;;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        wprintf(L&lt;span style="color: #006080"&gt;&amp;quot;Offset: %d, Length: %d, HeaderLen: %d\n&amp;quot;&lt;/span&gt;, TCPSrcOffset/8, PayloadLen, TCPHeaderSize*4);&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: #008000"&gt;// Allocate a buffer based on the Payload Length Property.&lt;/span&gt;&lt;br /&gt;        PBYTE buf = (PBYTE)malloc(PayloadLen);&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: #008000"&gt;// Read in the partial frame.  The Offset is in bits.  TCPHeaderSize is off by a factor of 4.&lt;/span&gt;&lt;br /&gt;        ret = NmGetPartialRawFrame(RawFrame, TCPSrcOffset/8 + TCPHeaderSize*4, PayloadLen, buf, &amp;amp;retlen);&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: #008000"&gt;// Do what ever you want with buf now.  I'll assume it's ASCII and print it.&lt;/span&gt;&lt;br /&gt;        wprintf(L&lt;span style="color: #006080"&gt;&amp;quot;%S&amp;quot;&lt;/span&gt;, buf);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;And here is the initialization code for each of our frame parser to see how each data field and property was added:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;HANDLE&lt;br /&gt;MyLoadNPL(&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;)&lt;br /&gt;{&lt;br /&gt;    HANDLE myFrameParser = INVALID_HANDLE_VALUE;&lt;br /&gt;    ULONG ret;&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #008000"&gt;// Use NULL to load default NPL set.&lt;/span&gt;&lt;br /&gt;    ret = NmLoadNplParser(NULL, NmAppendRegisteredNplSets, MyParserBuild, 0, &amp;amp;NplParser);&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt;(ret == ERROR_SUCCESS){&lt;br /&gt;        ret = NmCreateFrameParserConfiguration(NplParser, MyParserBuild, 0, &amp;amp;FrameParserConfig);&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt;(ret == ERROR_SUCCESS)&lt;br /&gt;        {&lt;br /&gt;&lt;br /&gt;            ret = NmAddProperty(FrameParserConfig, L&lt;span style="color: #006080"&gt;&amp;quot;Property.TCPPayloadLength&amp;quot;&lt;/span&gt;, &amp;amp;TCPPayloadLengthID);&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt;(ret != 0)&lt;br /&gt;            {&lt;br /&gt;                wprintf(L&lt;span style="color: #006080"&gt;&amp;quot;Failed to add Property.TCPPayloadLength, error 0x%X\n&amp;quot;&lt;/span&gt;, ret);&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            ret = NmAddField(FrameParserConfig, L&lt;span style="color: #006080"&gt;&amp;quot;TCP.SrcPort&amp;quot;&lt;/span&gt;, &amp;amp;TCPSrcPortID);&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt;(ret != ERROR_SUCCESS)&lt;br /&gt;            {&lt;br /&gt;                wprintf(L&lt;span style="color: #006080"&gt;&amp;quot;Failed to add field, TCP.SrcPort, error 0x%X\n&amp;quot;&lt;/span&gt;, ret);&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            ret = NmAddField(FrameParserConfig, L&lt;span style="color: #006080"&gt;&amp;quot;TCP.DataOffset.DataOffset&amp;quot;&lt;/span&gt;, &amp;amp;TCPDataOffsetID);&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt;(ret != ERROR_SUCCESS)&lt;br /&gt;            {&lt;br /&gt;                wprintf(L&lt;span style="color: #006080"&gt;&amp;quot;Failed to add field, TCP.DataOffset, error 0x%X\n&amp;quot;&lt;/span&gt;, ret);&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            ret = NmCreateFrameParser(FrameParserConfig, &amp;amp;myFrameParser);&lt;br /&gt;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt;(ret != ERROR_SUCCESS)&lt;br /&gt;            {&lt;br /&gt;                wprintf(L&lt;span style="color: #006080"&gt;&amp;quot;Failed to create frame parser, error 0x%X\n&amp;quot;&lt;/span&gt;, ret);&lt;br /&gt;                NmCloseHandle(FrameParserConfig);&lt;br /&gt;                NmCloseHandle(NplParser);&lt;br /&gt;                &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; INVALID_HANDLE_VALUE;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;&lt;br /&gt;        {&lt;br /&gt;            wprintf(L&lt;span style="color: #006080"&gt;&amp;quot;Unable to load parser config, error 0x%X\n&amp;quot;&lt;/span&gt;, ret);&lt;br /&gt;            NmCloseHandle(NplParser);&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; INVALID_HANDLE_VALUE;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;&lt;br /&gt;    {&lt;br /&gt;        wprintf(L&lt;span style="color: #006080"&gt;&amp;quot;Unable to load NPL\n&amp;quot;&lt;/span&gt;);&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; INVALID_HANDLE_VALUE;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt;(myFrameParser);&lt;br /&gt;}&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;By using TCP.SrcPort, we get rid of any dependency of the stack. This will work on IPv4, IPv6 or any tunneled protocols. Also the TCP.PayloadLength is computed by the parsers which again is agnostic to the carrying protocols.&lt;/p&gt;

&lt;h3&gt;Party on Your Payload&lt;/h3&gt;

&lt;p&gt;Now that you have your payload in a BYTE buffer, you can do what ever you want with it. For instance, if you wanted to create an expert to show each payload and response as text, you could simply take the frame number that is referenced and use that to determine the conversation key for the TCP conversation, i.e. using a property Conversation.ID.TCP. Then you can use this to filter all other packets in the same trace with the same TCP Conversation ID. This would give you a high level view of text based traffic like HTTP and FTP. Of course there is a little more work to deal with fragmented data, but the API gives you all the tools to accomplish this.&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3285271" width="1" height="1"&gt;</description></item><item><title>SMB Opportunistic Locking Behavior</title><link>http://blogs.technet.com/netmon/archive/2009/09/22/smb-opportunistic-locking-behavior.aspx</link><pubDate>Tue, 22 Sep 2009 17:10:28 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3282486</guid><dc:creator>PaulELong</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/netmon/comments/3282486.aspx</comments><wfw:commentRss>http://blogs.technet.com/netmon/commentrss.aspx?PostID=3282486</wfw:commentRss><description>&lt;p&gt;Behold the mysterious world of OpLocks (Opportunistic Locking). Often OpLocks will be disabled by a user or system administrator in order to help address a performance problem. And this practice might not always be the best course of action. Understanding how OpLocks behave in a trace can provide you more information so you can properly diagnose an OpLock issue.&lt;/p&gt;  &lt;h3&gt;What is an OpLock&lt;/h3&gt;  &lt;p&gt;OpLocks are used to enhance performance on a network where multiple people are accessing the same file. By the way these are somewhat different than the notion of &amp;quot;optimistic locking&amp;quot; in databases. Imagine that you are the only person editing a file on a server. Because nobody else has the file open, you could cache your changes locally for both read and writes. This would improve your performance because you wouldn't have to go over the network for any of this cached information.&lt;/p&gt;  &lt;p&gt;Now imagine somebody else opens the file after you do. If you have changes in your local cache, this new user won't see those changes. OpLocks, or more specifically a break of an OpLock in this case, is how your computer is told to flush its local cache.&lt;/p&gt;  &lt;p&gt;In general there are different levels of OpLocks, like Batch, Exclusive, and Level 2 which define how a file can be shared with respect to this local caching. But rather than go into a lot of detail about the specifics, let me point you to some references which do a good job of describing more detail.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Opportunistic_Locking"&gt;http://en.wikipedia.org/wiki/Opportunistic_Locking&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/openspecification/archive/2009/05/22/client-caching-features-oplock-vs-lease.aspx"&gt;http://blogs.msdn.com/openspecification/archive/2009/05/22/client-caching-features-oplock-vs-lease.aspx&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ee392367(PROT.10).aspx"&gt;File System Overview&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/cc246231(PROT.10).aspx"&gt;SMB&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/cc246482(PROT.10).aspx"&gt;SMB2&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;h3&gt;Example OpLocks in a Trace&lt;/h3&gt;  &lt;p&gt;In this example we have two clients - Windows XP (SMB) and Windows Vista (SMB2) viewing the same directory on a 3rd computer using explorer. As explorer reads the data, file collisions occur which cause various OpLock traffic. We will focus on a piece of this traffic and describe how the OpLock behavior is working. Once you see what normal traces look like, you can use this information to troubleshoot issues with OpLocks.&lt;/p&gt;  &lt;h3&gt;Setting up the Trace in Network Monitor&lt;/h3&gt;  &lt;p&gt;One nice feature I like to use is aliases. This gives me the ability to change IP addresses to something I can better recognize, especially when working with 3 machines as in this case. By right clicking on an address in the source or destination column, I can select &amp;quot;Create Alias for...&amp;quot; and then provide a friendly name. In my case I will call them SRV for the server, and Vista and XP for each client.&lt;/p&gt;  &lt;p&gt;The second thing I'll do is add the display filter &amp;quot;SMB or SMB2&amp;quot; so that I only see these protocols. This will get rid of any TCP or unrelated traffic for this demonstration.&lt;/p&gt;  &lt;p&gt;Finally, I also added comments to this particular trace. Comments are an easy way to document the traffic that occurs for others to learn from. By adding the &amp;quot;Comment Title&amp;quot; as a column, these comments show up and provide some commentary about what is going on. By the way, the # next to the frame number signifies which frames have a comment. Alternatively you can keep the comment tab open to see each comment as you click on frame. Using the latter method enabled you to see more detail in the description column.&lt;/p&gt;  &lt;h3&gt;Traffic Analysis&lt;/h3&gt;  &lt;p&gt;I copy and pasted the data from the Network Monitor summary view. Here is the traffic that occurs between the 3 machines: &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;   &lt;table border="1" cellspacing="0" cellpadding="0" width="753"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="65"&gt;           &lt;p&gt;&lt;b&gt;Frame Number&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="64"&gt;           &lt;p&gt;&lt;b&gt;Source&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="86"&gt;           &lt;p&gt;&lt;b&gt;Destination&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="329"&gt;           &lt;p&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="207"&gt;           &lt;p&gt;&lt;b&gt;Comment Title&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="65"&gt;           &lt;p&gt;&lt;b&gt;3110#&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="64"&gt;           &lt;p&gt;Vista&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="86"&gt;           &lt;p&gt;SRV&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="329"&gt;           &lt;p&gt;SMB2:C CREATE (0x5), Context=DHnQ,Create Durable Open Handle, Context=MxAc,Maximal Access, Context=QFid,Request Unique File ID , FileName = ...\Documents\desktop.ini@#3110&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="207"&gt;           &lt;p&gt;Vista Client Opens desktop.ini, request oplock batch&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="65"&gt;           &lt;p&gt;&lt;b&gt;3111&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="64"&gt;           &lt;p&gt;XP&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="86"&gt;           &lt;p&gt;SRV&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="329"&gt;           &lt;p&gt;SMB:C; Transact2, Query Path Info, Query File Basic Info, Pattern = \...\Documents\desktop.ini&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="207"&gt;&amp;#160;&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="65"&gt;           &lt;p&gt;&lt;b&gt;3112&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="64"&gt;           &lt;p&gt;SRV&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="86"&gt;           &lt;p&gt;XP&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="329"&gt;           &lt;p&gt;SMB:C; Locking Andx, FID = 0x400E (\...\Documents\desktop.ini@#2519)&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="207"&gt;&amp;#160;&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="65"&gt;           &lt;p&gt;&lt;b&gt;3113&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="64"&gt;           &lt;p&gt;SRV&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="86"&gt;           &lt;p&gt;XP&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="329"&gt;           &lt;p&gt;SMB:R; Transact2, Query Path Info, Query File Basic Info&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="207"&gt;&amp;#160;&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="65"&gt;           &lt;p&gt;&lt;b&gt;3114#&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="64"&gt;           &lt;p&gt;SRV&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="86"&gt;           &lt;p&gt;Vista&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="329"&gt;           &lt;p&gt;SMB2:R CREATE (0x5) Interim Response, FileName = ...\Documents\desktop.ini@#3110 &lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="207"&gt;           &lt;p&gt;Server response that this command is Pending&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="65"&gt;           &lt;p&gt;&lt;b&gt;3116#&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="64"&gt;           &lt;p&gt;XP&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="86"&gt;           &lt;p&gt;SRV&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="329"&gt;           &lt;p&gt;SMB:C; Close, FID = 0x400E , FileName=\...\Documents\desktop.ini@#2519 &lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="207"&gt;           &lt;p&gt;XP Client closes desktop.ini&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="65"&gt;           &lt;p&gt;&lt;b&gt;3117&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="64"&gt;           &lt;p&gt;SRV&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="86"&gt;           &lt;p&gt;XP&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="329"&gt;           &lt;p&gt;SMB:R; Close, FID = 0x400E , FileName=\...\Documents\desktop.ini@#2519 &lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="207"&gt;&amp;#160;&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="65"&gt;           &lt;p&gt;&lt;b&gt;3118#&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="64"&gt;           &lt;p&gt;SRV&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="86"&gt;           &lt;p&gt;Vista&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="329"&gt;           &lt;p&gt;SMB2:R CREATE (0x5), Context=MxAc,Maximal Access, Context=DHnQ,Create Durable Open Handle, Context=QFid,Request Unique File ID, FID=0xFFFFFFFF002000C5(...\Documents\desktop.ini@#3110) &lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="207"&gt;           &lt;p&gt;Server responds to the Vista client with batch oplock granted&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="65"&gt;           &lt;p&gt;&lt;b&gt;3119#&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="64"&gt;           &lt;p&gt;XP&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="86"&gt;           &lt;p&gt;SRV&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="329"&gt;           &lt;p&gt;SMB:C; Nt Create Andx, FileName = \...\Documents\desktop.ini&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="207"&gt;           &lt;p&gt;XP client wants to open desktop.ini again&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="65"&gt;           &lt;p&gt;&lt;b&gt;3120#&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="64"&gt;           &lt;p&gt;SRV&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="86"&gt;           &lt;p&gt;Vista&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="329"&gt;           &lt;p&gt;SMB2:N OPLOCK BREAK (0x12), Oplock Level II Notification, FID=0xFFFFFFFF002000C5,FileName=...\Documents\desktop.ini@#3110&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="207"&gt;           &lt;p&gt;Server send Oplock break to Level 2 Notification to Vista client&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="65"&gt;           &lt;p&gt;&lt;b&gt;3122&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="64"&gt;           &lt;p&gt;Vista&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="86"&gt;           &lt;p&gt;SRV&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="329"&gt;           &lt;p&gt;SMB2:C CREATE (0x5), Context=DHnQ,Create Durable Open Handle, Context=MxAc,Maximal Access, Context=QFid,Request Unique File ID , FileName = ...\Links@#3122&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="207"&gt;&amp;#160;&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="65"&gt;           &lt;p&gt;&lt;b&gt;3123&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="64"&gt;           &lt;p&gt;SRV&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="86"&gt;           &lt;p&gt;Vista&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="329"&gt;           &lt;p&gt;SMB2:R CREATE (0x5), Context=MxAc,Maximal Access, Context=QFid,Request Unique File ID, FID=0xFFFFFFFF002000CD(...\Links@#3122) &lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="207"&gt;&amp;#160;&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="65"&gt;           &lt;p&gt;&lt;b&gt;3124#&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="64"&gt;           &lt;p&gt;Vista&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="86"&gt;           &lt;p&gt;SRV&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="329"&gt;           &lt;p&gt;SMB2:A OPLOCK BREAK (0x12), Oplock Level II Acknowledgment, FID=0xFFFFFFFF002000C5,FileName=...\Documents\desktop.ini@#3110&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="207"&gt;           &lt;p&gt;Vista Client sends Oplock Level 2 Acknowledge to Server&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="65"&gt;           &lt;p&gt;&lt;b&gt;3125#&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="64"&gt;           &lt;p&gt;SRV&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="86"&gt;           &lt;p&gt;Vista&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="329"&gt;           &lt;p&gt;SMB2:R OPLOCK BREAK (0x12), Oplock Level II Response, FID=0xFFFFFFFF002000C5,FileName=...\Documents\desktop.ini@#3110&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="207"&gt;           &lt;p&gt;Server sends break OpLock break to Level 2 response&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="65"&gt;           &lt;p&gt;&lt;b&gt;3126&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="64"&gt;           &lt;p&gt;SRV&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="86"&gt;           &lt;p&gt;XP&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="329"&gt;           &lt;p&gt;SMB:R; Nt Create Andx, FID = 0x8008 (\...\Documents\desktop.ini@#3119)&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="207"&gt;&amp;#160;&lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;p&gt;As we start in frame 3110, we see that the Vista client opens desktop.ini and requests a Batch OpLock. Since the OpLock request is part of the SMB Create, the actual request is buried in the frame details.&lt;/p&gt;  &lt;p&gt;Frame: Number = 3110, Captured Frame Length = 386, MediaType = ETHERNET &lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;...&lt;br /&gt;&lt;br /&gt;+ SMBOverTCP: Length = 264&lt;br /&gt;&lt;br /&gt;- SMB2: C CREATE (0x5), Context=DHnQ,Create Durable Open Handle, Context=MxAc,Maximal Access, Context=QFid,Request Unique File ID , FileName = paullo\Documents\desktop.ini@#3110&lt;br /&gt;&lt;br /&gt;SMBIdentifier: SMB&lt;br /&gt;&lt;br /&gt;+ SMB2Header: C CREATE (0x5),TID=0x0009, MID=0x04F2, PID=0xFEFF, SID=0x0001&lt;br /&gt;&lt;br /&gt;- CCreate: 0x1&lt;br /&gt;&lt;br /&gt;StructureSize: 57 (0x39)&lt;br /&gt;&lt;br /&gt;SecurityFlags: 0 (0x0)&lt;br /&gt;&lt;br /&gt;RequestedOplockLevel: SMB2_OPLOCK_LEVEL_BATCH - A batch oplock &lt;span style="color: #0000ff"&gt;is&lt;/span&gt; requested.&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Frames 3111-3113 contain other traffic our XP client is doing which also happens to touch desktop.ini.&lt;/p&gt;

&lt;p&gt;In frame 3114 the server returns a STATUS_PENDING because the server is not yet ready to respond.&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;Frame: Number = 3114, Captured Frame Length = 194, MediaType = ETHERNET &lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;+ SMBOverTCP: Length = 73&lt;br /&gt;&lt;br /&gt;- SMB2: R CREATE (0x5) Interim Response, FileName = paullo\Documents\desktop.ini@#3110 &lt;br /&gt;&lt;br /&gt;SMBIdentifier: SMB&lt;br /&gt;&lt;br /&gt;- SMB2Header: R CREATE (0x5),TID=0x0000, MID=0x04F2, PID=0x0000, SID=0x0001&lt;br /&gt;&lt;br /&gt;StructureSize: 64 (0x40)&lt;br /&gt;&lt;br /&gt;Epoch: 0 (0x0)&lt;br /&gt;&lt;br /&gt;+ Status: 0x103, Facility = FACILITY_SYSTEM, Severity = STATUS_SEVERITY_SUCCESS, Code = (259) STATUS_PENDING&lt;br /&gt;&lt;br /&gt;Command: CREATE (0x5)&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;Frame: Number = 3114, Captured Frame Length = 194, MediaType = ETHERNET &lt;/p&gt;

&lt;p&gt;The XP Client is closing desktop.ini so the server will wait for that to complete first. This way it can grant the Batch OpLock the Vista client is requesting. If the XP client keeps the file open, the OpLock might have been denied. Once it completes, the SMB2 Create response is finally returned and the Batch OpLock is granted in frame 3118.&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;Frame: Number = 3118, Captured Frame Length = 394, MediaType = ETHERNET &lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;+ SMBOverTCP: Length = 272&lt;br /&gt;&lt;br /&gt;- SMB2: R CREATE (0x5), Context=MxAc,Maximal Access, Context=DHnQ,Create Durable Open Handle, Context=QFid,Request Unique File ID, FID=0xFFFFFFFF002000C5(paullo\Documents\desktop.ini@#3110) &lt;br /&gt;&lt;br /&gt;SMBIdentifier: SMB&lt;br /&gt;&lt;br /&gt;+ SMB2Header: R CREATE (0x5),TID=0x0000, MID=0x04F2, PID=0x0000, SID=0x0001&lt;br /&gt;&lt;br /&gt;- RCreate: 0x1&lt;br /&gt;&lt;br /&gt;StructureSize: 89 (0x59)&lt;br /&gt;&lt;br /&gt;OplockLevel: SMB2_OPLOCK_LEVEL_BATCH - A batch oplock was granted.&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;Frame: Number = 3118, Captured Frame Length = 394, MediaType = ETHERNET &lt;/p&gt;

&lt;p&gt;Next another create request for desktop.ini appears in frame 3119 as the XP client wants to reopen the file again. Since this is a second open of the same file, the server has to notify the Vista client to break its OpLock to Level 2 in frame 3120. &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;
  &lt;table border="1" cellspacing="0" cellpadding="0" width="783"&gt;&lt;tbody&gt;
      &lt;tr&gt;
        &lt;td valign="top" width="65"&gt;
          &lt;p&gt;&lt;strong&gt;3119#&lt;/strong&gt;&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="64"&gt;
          &lt;p&gt;XP&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="86"&gt;
          &lt;p&gt;SRV&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="262"&gt;
          &lt;p&gt;SMB:C; Nt Create Andx, FileName = \...\Documents\desktop.ini&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="304"&gt;
          &lt;p&gt;XP client wants to open desktop.ini again&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="top" width="65"&gt;
          &lt;p&gt;&lt;b&gt;3120#&lt;/b&gt;&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="64"&gt;
          &lt;p&gt;SRV&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="86"&gt;
          &lt;p&gt;Vista&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="262"&gt;
          &lt;p&gt;SMB2:N OPLOCK BREAK (0x12), Oplock Level II Notification, FID=0xFFFFFFFF002000C5,FileName=...\Documents\desktop.ini@#3110&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="304"&gt;
          &lt;p&gt;Server send Oplock break to Level 2 Notification to Vista client&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;&lt;/table&gt;
&lt;/p&gt;

&lt;p&gt;The exact algorithm for breaking an OpLock is explained in the system documents referenced above and is related to the file system, so I won't go over those specifics. But in general since two clients have the same file open, the local client caching algorithm has to change. The Vista client can no longer assume the file won't be changed and there for can't cache the file locally.&lt;/p&gt;

&lt;p&gt;In frame 3124, the &amp;quot;notify&amp;quot; is acknowledged and now the server can respond back to the Vista client in frame 3125 that the OpLock was broken to level 2. Finally Frame 3126 is the response back to the XP client that the open on desktop.ini has been completed. &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;
  &lt;table border="1" cellspacing="0" cellpadding="0" width="786"&gt;&lt;tbody&gt;
      &lt;tr&gt;
        &lt;td valign="top" width="65"&gt;
          &lt;p&gt;&lt;b&gt;3124#&lt;/b&gt;&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="64"&gt;
          &lt;p&gt;Vista&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="86"&gt;
          &lt;p&gt;SRV&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="252"&gt;
          &lt;p&gt;SMB2:A OPLOCK BREAK (0x12), Oplock Level II Acknowledgment, FID=0xFFFFFFFF002000C5,FileName=...\Documents\desktop.ini@#3110 &lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="317"&gt;
          &lt;p&gt;Vista Client sends Oplock Level 2 Acknowledge &lt;strong&gt;to Server&lt;/strong&gt;&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="top" width="65"&gt;
          &lt;p&gt;&lt;b&gt;3125#&lt;/b&gt;&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="64"&gt;
          &lt;p&gt;SRV&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="86"&gt;
          &lt;p&gt;Vista&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="252"&gt;
          &lt;p&gt;SMB2:R OPLOCK BREAK (0x12), Oplock Level II Response, FID=0xFFFFFFFF002000C5,FileName=...\Documents\desktop.ini@#3110&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="317"&gt;
          &lt;p&gt;Server sends break OpLock break to Level 2 response&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="top" width="65"&gt;
          &lt;p&gt;&lt;b&gt;3126&lt;/b&gt;&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="64"&gt;
          &lt;p&gt;SRV&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="86"&gt;
          &lt;p&gt;XP&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="252"&gt;
          &lt;p&gt;SMB:R; Nt Create Andx, FID = 0x8008 (\...\Documents\desktop.ini@#3119)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="317"&gt;&amp;#160;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;&lt;/table&gt;
&lt;/p&gt;

&lt;h3&gt;Troubleshooting Performance and OpLocks&lt;/h3&gt;

&lt;p&gt;The previous example worked smoothly as it usually does. But in some instances an OpLock request does not get a response in a timely fashion. In those cases you might see a 35 second delay which is the default timeout for an OpLock. This could cause application timeouts or what seems like a hanging application from the user’s perspective. Also this 35 second delay is a sure sign OpLocks are involved in a performance issue. Just remember that as shown in the example above, multiple clients are probably involved. And it's this type of interaction you must learn to recognize in order to troubleshoot a performance problem with OpLocks.&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3282486" width="1" height="1"&gt;</description></item><item><title>Delayed Write Failure Trace Study</title><link>http://blogs.technet.com/netmon/archive/2009/09/21/delayed-write-failure-trace-study.aspx</link><pubDate>Mon, 21 Sep 2009 18:01:24 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3282289</guid><dc:creator>PaulELong</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/netmon/comments/3282289.aspx</comments><wfw:commentRss>http://blogs.technet.com/netmon/commentrss.aspx?PostID=3282289</wfw:commentRss><description>&lt;p&gt;In this &amp;quot;Trace Study”, we'll look at a case where the customer is seeing delayed write failures logged in the event log. Delayed write failures are reported when a file being written over the network is inaccessible for a time. Based on a trace taken at the same time as the error was logged, we will determine the cause.&lt;/p&gt;  &lt;h3&gt;Zooming In&lt;/h3&gt;  &lt;p&gt;Since we know the file name reported in the event log error, we'll use that name to find where in the trace we are accessing this file. We start by building a filter that uses a property we set for any SMB frame which references a file.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Property.SMBFileName.Contains(&amp;quot;dir.txt&amp;quot;) &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This displays a bunch of frames that reference the &amp;quot;dir.txt&amp;quot; file, but this does not represent the entire conversation. To get the entire conversation, right click any frame and select Find Conversation-&amp;gt;SMB. Then remove your display filter and now you will see all the frames associated with this particular SMB conversation. An SMB conversation is usually all operations involving a single file.&lt;/p&gt;  &lt;p&gt;The next step is to look for an error of some kind. We do this by creating a color filter (http://blogs.technet.com/netmon/archive/2007/06/28/color-filtering-error-messages.aspx) to make SMB error frames stand out. We'll use this color filter:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;(smb.DOSError.Error != 0 AND smb.DOSError.Error != 22)&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;OR&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;(smb.NTStatus.Code != 0 &amp;amp;&amp;amp; smb.NTStatus.Code!= 22)&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I made my color filter have a red background and a white foreground, a color scheme I use to identify errors.&lt;/p&gt;  &lt;p&gt;With this color filter enabled, I simply scroll through the trace looking for a red frame to stand out. As they pop up you'll have to look at the specific error and see if it applies. In my case I see a STATUS_NETWORK_SESSION_EXPIRED. Following this traffic I see a Session Setup, and then continued SMB Writes before and after.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;   &lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="626"&gt;           &lt;p&gt;&lt;b&gt;SMB:C; Write Andx, FID = 0x400C (\files\dir.txt@#1644), 1 bytes at Offset 32780&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="626"&gt;           &lt;p&gt;&lt;b&gt;SMB:R; Write Andx, FID = 0x400C (\files\dir.txt@#1644), 1 bytes&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="626"&gt;           &lt;p&gt;&lt;b&gt;SMB:C; Transact2, Query File Info, Query File Standard Info, FID = 0x400C (\files\dir.txt@#1644)&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="626"&gt;           &lt;p&gt;&lt;b&gt;&lt;font color="#ff0000"&gt;SMB:R; Transact2, Query File Info, FID = 0x400C (\files\dir.txt@#1644) - NT Status: System - Error, Code = (860) STATUS_NETWORK_SESSION_EXPIRED&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="626"&gt;           &lt;p&gt;&lt;b&gt;SMB:C; Session Setup Andx, Krb5ApReq (0x100)&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="626"&gt;           &lt;p&gt;&lt;b&gt;SMB:R; Session Setup Andx, Krb5ApRep (0x200)&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="626"&gt;           &lt;p&gt;&lt;b&gt;SMB:C; Write Andx, FID = 0x400C (\files\dir.txt@#1644), 1 bytes at Offset 32780&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="626"&gt;           &lt;p&gt;&lt;b&gt;SMB:R; Write Andx, FID = 0x400C (\files\dir.txt@#1644), 1 bytes&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;p&gt;Obviously this is not normal traffic for SMB. Session Setups occur when you first make a connection to a share, but not in the middle of a file transfer. What caused this session to expire? &lt;/p&gt;  &lt;h3&gt;Zooming Out&lt;/h3&gt;  &lt;p&gt;When we used the &amp;quot;Find Conversation-&amp;gt;SMB&amp;quot; above, we narrowed down the traffic to just one SMB conversation. But something happened on another network conversation in between our Session Setup and the last error. To figure out where to go next, we'll have to zoom out and look at the rest of the traffic around the error in question. I'll select the error frame to keep my context and then click on &amp;quot;All Traffic&amp;quot; at the top of the conversation tree to remove the SMB conversation filter. When I do, I see the following traffic:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;   &lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="626"&gt;           &lt;p&gt;&lt;b&gt;SMB:C; Write Andx, FID = 0x400C (\files\dir.txt@#1644), 1 bytes at Offset 32780&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="626"&gt;           &lt;p&gt;&lt;b&gt;SMB:R; Write Andx, FID = 0x400C (\files\dir.txt@#1644), 1 bytes&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="626"&gt;           &lt;p&gt;&lt;b&gt;SMB:C; Transact2, Query File Info, Query File Standard Info, FID = 0x400C (\files\dir.txt@#1644)&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="626"&gt;           &lt;p&gt;&lt;b&gt;SMB:R; Transact2, Query File Info, FID = 0x400C (\files\dir.txt@#1644) - NT Status: System - Error, Code = (860) STATUS_NETWORK_SESSION_EXPIRED&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="626"&gt;           &lt;p&gt;&lt;b&gt;KerberosV5:TGS Request Realm: CORP1.LOCAL Sname: cifs/c01e3n01ads.corp1.local &lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="626"&gt;           &lt;p&gt;&lt;b&gt;TCP:Flags=...A...., SrcPort=1162, DstPort=Microsoft-DS(445), PayloadLen=0, Seq=1084491174, Ack=239237167, Win=4163&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="626"&gt;           &lt;p&gt;&lt;b&gt;KerberosV5:TGS Response Cname: Kevin &lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="626"&gt;           &lt;p&gt;&lt;b&gt;KerberosV5:TGS Request Realm: CORP1.LOCAL Sname: krbtgt/CORP1.LOCAL &lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="626"&gt;           &lt;p&gt;&lt;b&gt;KerberosV5:TGS Response Cname: Kevin &lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="626"&gt;           &lt;p&gt;&lt;b&gt;KerberosV5:AS Request Cname: Kevin Realm: CORP1.LOCAL Sname: krbtgt/CORP1.LOCAL &lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="626"&gt;           &lt;p&gt;&lt;b&gt;KerberosV5:AS Response Ticket[Realm: CORP1.LOCAL, Sname: krbtgt/CORP1.LOCAL] &lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="626"&gt;           &lt;p&gt;&lt;b&gt;KerberosV5:TGS Request Realm: CORP1.LOCAL Sname: krbtgt/CORP1.LOCAL &lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="626"&gt;           &lt;p&gt;&lt;b&gt;KerberosV5:TGS Response Cname: Kevin &lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="626"&gt;           &lt;p&gt;&lt;b&gt;SMB:C; Session Setup Andx, Krb5ApReq (0x100)&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;h3&gt;Kerberos Ticket Expired&lt;/h3&gt;  &lt;p&gt;Once the UI has completed updating the frame summary, my current selection remains on the SMB Error frame which keeps my place. But now some new Kerberos frames show up. This information together with the &amp;quot;Session Expired&amp;quot; message tells us the whole story.&lt;/p&gt;  &lt;p&gt;The expired SMB session means we need to re-authenticate. In this case the Kerberos ticket expired and a new ticket had to be issued to us by the server. If we had the original setup traffic, we would be able to see the initial Kerberos ticket with its expiration time. Once this Kerberos negotiation completes, the SMB session is reset using the new Kerberos ticket and the SMB traffic continues where it left off. This authentication interruption in the traffic is what caused our &amp;quot;Delayed Write Failure&amp;quot; event log error message in the first &lt;a&gt;place&lt;/a&gt;. &lt;/p&gt;  &lt;h3&gt;Getting to the Bottom of Things&lt;/h3&gt;  &lt;p&gt;In this case the Delay Write failure is easily explained. But there are many ways a delayed write failure can be triggered. You can use these same steps to zoom in and zoom out of a trace to understand this type of problem. Next time you see a Delay Write failure in your event log, I hope you can use these steps to figure out why it occurred.&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3282289" width="1" height="1"&gt;</description></item><item><title>Chained Captures and Stitching Them Back Together</title><link>http://blogs.technet.com/netmon/archive/2009/09/09/chained-captures-and-stitching-them-back-together.aspx</link><pubDate>Wed, 09 Sep 2009 17:49:08 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3280068</guid><dc:creator>PaulELong</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/netmon/comments/3280068.aspx</comments><wfw:commentRss>http://blogs.technet.com/netmon/commentrss.aspx?PostID=3280068</wfw:commentRss><description>&lt;p&gt;When you use NMCap to capture data you have an option to save the capture files as a chain. As the current capture file format has a limited size, this option allows you to continually capture the data in successive files. This also gives you some flexibility to limit the size. If you are sending files to another person for analysis you could &lt;a&gt;send only the files &lt;/a&gt;that relate to the time period where a problem occurred. After using this feature; however, it might be useful to filter and re-stitch these capture files back together.&lt;/p&gt;  &lt;h3&gt;Capturing Chained Files with NMCap&lt;/h3&gt;  &lt;p&gt;You can capture using chained files using NMCap by naming the file with a .chn extension. The resulting files are named .cap, but they'll be a &amp;quot;capfile(#).cap&amp;quot; for every chained capture file after the first one. So for instance using the following command:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;NMCap /network * /capture ipv4.address==1.2.3.4 /file foo.chn:1M&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Will produce capture files which are 1 meg in size and have the following names in this order: foo.cap, foo(1).cap, foo(2).cap and so on. I've also provided a capture filter to limit the traffic to just one address. However, for the best performance I would leave any filtering out.&lt;/p&gt;  &lt;h3&gt;Combining Captures with NMCap&lt;/h3&gt;  &lt;p&gt;Using NMCap, you can recombine these to create one large capture file. To do this use the /InputCapture option as follows:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;NMCap /InputCapture foo.cap foo(1).cap foo(2).cap /Capture /File out.cap&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;You could additionally add a filter to limit the information that gets transferred. For instance, say I only wanted to see port 80 traffic in the resulting trace. In that case the following NMCap will get the job done.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;NMCap /InputCapture foo.cap foo(1).cap foo(2).cap /Capture tcp.port==80 /File out.cap&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;Using a Script to Combine Many Capture Files&lt;/h3&gt;  &lt;p&gt;Now, this might get somewhat tedious the more files you have. We can solve this problem by using a simple CMD Script to create collect all the files for us. Just create a file using notepad called stitch.CMD and place in it these contents:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #008000"&gt;REM Usage: stitch InCapFileBaseName OutCapFile.cap [Filter]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;REM Creates flat output of capture files by date&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;dir /b /od %1*.cap &amp;gt; %TEMP%\captures.txt&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;REM Stores ordered file list in environment variable&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;SET&lt;/span&gt; INCAP=/InputCapture&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;for&lt;/span&gt; /f %%c &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; (%TEMP%\captures.txt) &lt;span style="color: #0000ff"&gt;do&lt;/span&gt; &lt;span style="color: #0000ff"&gt;call&lt;/span&gt; :addCap %%c&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;REM Calls NMCap to combine files&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;NMCap %INCAP% /capture%3 /file %2.chn:500M[MAH3]&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;goto&lt;/span&gt; :eof&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;REM Routine to append a file to the environment variable&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;:addCap&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;SET&lt;/span&gt; INCAP=%INCAP% %1&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;goto&lt;/span&gt; :eof&lt;br /&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;The CMD script file takes three parameters; the first is the original file name without the .cap extension. The second is the output capture file. Add the 3rd is the filter which is optional. You'll also want to run the script in the directory where all your captures are. Since it searches for *.cap, make sure there aren't any extraneous captures.&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3280068" width="1" height="1"&gt;</description></item><item><title>I Can't View My Windows Home Server at Home</title><link>http://blogs.technet.com/netmon/archive/2009/08/14/i-can-t-view-my-windows-home-server-at-home.aspx</link><pubDate>Fri, 14 Aug 2009 23:00:48 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3273648</guid><dc:creator>PaulELong</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.technet.com/netmon/comments/3273648.aspx</comments><wfw:commentRss>http://blogs.technet.com/netmon/commentrss.aspx?PostID=3273648</wfw:commentRss><description>&lt;p&gt;I have a friend who just received his Windows Home Server. Home Server allows you to access it remotely so you can share photos, Remote Desktop and backup documents. The provided documentation includes details on how to setup your router, open ports, and setup an external name like “myhomesrv. homeserver.com.” The problem was, when he went to test this out by typing the address in his web browser, he was shown his router's administrative web page instead of his Windows Home Server web page. Yet, I was able to access the web page fine from my work machine.&lt;/p&gt;  &lt;h3&gt;Collecting Evidence&lt;/h3&gt;  &lt;p&gt;I told my friend to download Network Monitor and get a trace. I also asked that he clear his local DNS cache by typing &amp;quot;ipconfig /flushdns&amp;quot;. This is important because if a name is already cached it won't try and resolve the name again. This step ensures the resolution traffic will be captured when we reproduce the problem. In just a few minutes he sent me the capture file, and I opened it up.&lt;/p&gt;  &lt;h3&gt;Filtering on the External Name&lt;/h3&gt;  &lt;p&gt;I start by opening the trace and looking for DNS traffic by applying the display filter &amp;quot;DNS&amp;quot;. In this particular trace there's a bunch of DNS traffic, but by looking at the summary line I can see the name my friend was trying to resolve.   &lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="71"&gt;           &lt;p&gt;192.168.2.2&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="75"&gt;           &lt;p&gt;192.168.2.1&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="492"&gt;           &lt;p&gt;DNS:QueryId = 0x847E, QUERY (Standard query), Query for &lt;b&gt;&lt;u&gt;myhomesrv.homeserver.com&lt;/u&gt;&lt;/b&gt; of type Host Addr on class Internet&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="71"&gt;           &lt;p&gt;192.168.2.1&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="75"&gt;           &lt;p&gt;192.168.2.2&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="492"&gt;           &lt;p&gt;DNS:QueryId = 0x847E, QUERY (Standard query), Response - Success, Array[&lt;b&gt;&lt;u&gt;xxx.143.174.204,yyy.46.154.126&lt;/u&gt;&lt;/b&gt;]&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;p&gt;I see the query for &amp;quot;myhomesrv.homeserver.com&amp;quot; and then look for the matching response. In this case it was the next frame, but if you had a lot of traffic you could do a search for a DNS frame with the matching Query ID. And if you didn't know how to create a filter for the QueryID, you could right click on it in the frame details and “add to display filter” to understand how it should look.&lt;/p&gt;  &lt;p&gt;Without even having to dig into the frame, you can see the response has all IP address info bubbled to the summary line. (By the way, I've obscured the address with xxx and yyy, but normally these would show as real numbers.) The proof I was looking for was to make sure the name, myhomesrv.homeserver.com, was being resolved to the external IP address of the router. Indeed the IP addresses matched, so I know that the name is resolving properly.&lt;/p&gt;  &lt;p&gt;Next, I looked for the TCP setup and HTTP request that should occur since we were trying to browse his personal page. This occurs right after the DNS traffic as well.   &lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="10"&gt;           &lt;h3&gt;192.168.2.2&lt;/h3&gt;         &lt;/td&gt;          &lt;td valign="top" width="180"&gt;           &lt;h3&gt;myhomesrv.homeserver.com&lt;/h3&gt;         &lt;/td&gt;          &lt;td valign="top" width="429"&gt;           &lt;h3&gt;TCP:Flags=......S., SrcPort=60824, DstPort=HTTP(80), PayloadLen=0, Seq=2533385604, Ack=0, Win=8192 ( Negotiating scale factor 0x2 ) = 8192&lt;/h3&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="10"&gt;           &lt;h3&gt;myhomesrv.homeserver.com&lt;/h3&gt;         &lt;/td&gt;          &lt;td valign="top" width="180"&gt;           &lt;h3&gt;192.168.2.2&lt;/h3&gt;         &lt;/td&gt;          &lt;td valign="top" width="429"&gt;           &lt;h3&gt;TCP:Flags=...A..S., SrcPort=HTTP(80), DstPort=60824, PayloadLen=0, Seq=113434048, Ack=2533385605, Win=5840 ( Negotiated scale factor 0x0 ) = 5840&lt;/h3&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="10"&gt;           &lt;h3&gt;192.168.2.2&lt;/h3&gt;         &lt;/td&gt;          &lt;td valign="top" width="180"&gt;           &lt;h3&gt;myhomesrv.homeserver.com&lt;/h3&gt;         &lt;/td&gt;          &lt;td valign="top" width="429"&gt;           &lt;h3&gt;TCP:Flags=...A...., SrcPort=60824, DstPort=HTTP(80), PayloadLen=0, Seq=2533385605, Ack=113434049, Win=16425 (scale factor 0x2) = 65700&lt;/h3&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="10"&gt;           &lt;h3&gt;192.168.2.2&lt;/h3&gt;         &lt;/td&gt;          &lt;td valign="top" width="180"&gt;           &lt;h3&gt;myhomesrv.homeserver.com&lt;/h3&gt;         &lt;/td&gt;          &lt;td valign="top" width="429"&gt;           &lt;h3&gt;HTTP:Request, GET / &lt;/h3&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="10"&gt;           &lt;h3&gt;mhomesrv.homeserver.com&lt;/h3&gt;         &lt;/td&gt;          &lt;td valign="top" width="180"&gt;           &lt;h3&gt;192.168.2.2&lt;/h3&gt;         &lt;/td&gt;          &lt;td valign="top" width="429"&gt;           &lt;h3&gt;TCP:Flags=...A...., SrcPort=HTTP(80), DstPort=60824, PayloadLen=0, Seq=113434049, Ack=2533386251, Win=7106 (scale factor 0x0) = 7106&lt;/h3&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="10"&gt;           &lt;h3&gt;mhomesrv.homeserver.com&lt;/h3&gt;         &lt;/td&gt;          &lt;td valign="top" width="180"&gt;           &lt;h3&gt;192.168.2.2&lt;/h3&gt;         &lt;/td&gt;          &lt;td valign="top" width="429"&gt;           &lt;h3&gt;HTTP:Response, HTTP/1.0, Status Code = 200, URL: / &lt;/h3&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;p&gt;We see that the client attaches to myhomesrv.homeserver.com, which is the same resolved name we saw picked up by DNS in the traffic before. The Network Monitor parsers will automatically resolve names for you when it sees name resolution traffic, but you can always add different columns or simply dig into the frame to verify the IP address.&lt;/p&gt;  &lt;p&gt;Now, we see that the traffic is going to the right address. It appears that the name resolution is working correctly and doing want we want. However, the response shows information that looks like my friend’s router’s web page.&lt;/p&gt;  &lt;p&gt;Of course this isn't a surprise because this is what we see in the browser as well. Then what happened? Why did the web page from his router appear instead of his home server?&lt;/p&gt;  &lt;h3&gt;Doing Some Homework&lt;/h3&gt;  &lt;p&gt;We've identified some strange behavior, what next? A trace from the ISP might give us more information. Personally, I can't even get my ISP to answer simple billing questions so asking for a trace would probably be fruitless. But maybe we can see if other people are experiencing the same problem. After doing some Bing searches, I came across this blog (http://www.myhomeserver.com/?page_id=67). In particular in Step 7 it mentions the &amp;quot;loopback issue&amp;quot;.&lt;/p&gt;  &lt;p&gt;It appears that some routers don't know what to do with an external address when sent from the inside. As we see, this matches the behavior in the trace. The DNS request returns the address we expect, and the following HTTP request is also sent to the right place. However, we see that the response from the router comes back with the router’s web page. Instead we should have seen the HTTP request get bounced to our Home Server’s internal address.&lt;/p&gt;  &lt;h3&gt;Buy a New Router?&lt;/h3&gt;  &lt;p&gt;Well maybe that's extreme. I would suggest checking for a firmware upgrade first. A less expensive simple solution is to use the Home Server machine name in these circumstances. In any case my friend is now able to access his Home Server’s website internally by using http://myhomesrv and externally with the address http://myhomesrv.homeserver.com.&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3273648" width="1" height="1"&gt;</description></item><item><title>TCP Analyzer Expert: Make Your Network Run Faster</title><link>http://blogs.technet.com/netmon/archive/2009/06/30/tcp-analyzer-expert-make-your-network-run-faster.aspx</link><pubDate>Wed, 01 Jul 2009 00:24:51 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3260134</guid><dc:creator>PaulELong</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/netmon/comments/3260134.aspx</comments><wfw:commentRss>http://blogs.technet.com/netmon/commentrss.aspx?PostID=3260134</wfw:commentRss><description>&lt;p&gt;Performance problems suck...time! But years of &amp;quot;Where's Waldo&amp;quot; has trained our brains in preparation for this moment. The TCP Analyzer expert, available from our Experts Download Page[ http://go.microsoft.com/fwlink/?LinkID=133950] takes advantage of that training by graphically representing TCP traffic. By looking at normal traffic or comparing the presented picture graph to some known TCP issues you can easily diagnose performance problems.&lt;/p&gt;  &lt;p&gt;With the TCP Analyzer Expert you can load a trace, use the conversation tree to locate a TCP stream, and run the expert. If you don't have anything selected, the expert will use the first TCP conversation in the trace. Once it's run it presents you with a UI which will allow you to graph the TCP traffic, Analyzer Round Trip Time, and do some high level diagnosis based on some known issues.&lt;/p&gt;  &lt;h3&gt;How to Analyze Traffic&lt;/h3&gt;  &lt;p&gt;Say you suspect a problem or want to analyze some traffic. The first thing you need to do is collect a trace using Network Monitor. TCP Analyzer can try to &amp;quot;guess&amp;quot; the general problem and describe the issue. But for this to work properly you will need to take the trace from the machine initiating the connection. Also it helps to have the entire TCP connection as the window size is negotiated during the TCP 3-way handshake.&lt;/p&gt;  &lt;p&gt;Once you start a trace, you then reproduce the performance test and stop the capture. Then save the capture, as Experts can only be run on saved traces. Go back to the start page where you'll see the file you just saved in the recent capture list and open it up.&lt;/p&gt;  &lt;h3&gt;Finding the TCP Conversation&lt;/h3&gt;  &lt;p&gt;The next trick is locating which TCP stream you want to run the expert on. In this case I copied a file using explorer and I knew then name of the file I copied. So I created the following filter.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;ContainsBin(FrameData, UTF16BE, &amp;quot;myfile&amp;quot;)&lt;/strong&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;It could have potentially been ASCII as well, but with SMB I knew it would probably occur as Unicode. BTW, UTF16BE stands for Unicode 16 Big Endian. These days Unicode has many flavors, but UTF16BE is the most common one for Windows machines.&lt;/p&gt;  &lt;p&gt;This filter located a bunch of SMB frames which meant I was on the right track. I right clicked a frame, selected Find Conversation, and choose TCP. This locates all other frames in the same conversation which the TCP Analyzer will use to determine which stream to use when it runs. Remember, to see the full stream in Network Monitor, remove the display filter you used to find the frame originally.&lt;/p&gt;  &lt;p&gt;Now with the correct conversation selected, I run the TCP Analyzer Expert form the Experts menu. This runs the expert, but in order to get a graph to show up I have to press the graphing button from the toolbar.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/TCPAnalyzerExpertMakeYourNetworkRunFaste_F4DF/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 10px 10px 0px 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/TCPAnalyzerExpertMakeYourNetworkRunFaste_F4DF/image_thumb.png" width="660" height="486" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Since there is traffic flowing in both directions, you need to determine which you want to concentrate on. You can use the port or IP address to figure this part out. Once you make this determination click the graph. This will display the graph in the main window allowing to you zoom in/out with the mouse wheel and you can drag the main graph around as well to pan.&lt;/p&gt;  &lt;p&gt;You can also analyze the Round Trip Time, which is the graph in the middle. However there are some restrictions that have to be met before any information will be available. We won't cover RTT in this blog, but you can see the help for the expert for more information.&lt;/p&gt;  &lt;h3&gt;Decoding the Graph&lt;/h3&gt;  &lt;h4&gt;The Axis&lt;/h4&gt;  &lt;p&gt;The Y axis shows the sequence numbers for the given direction. These are defined by TCP when a session initializes. Each sequence number represents the number of bytes transmitted. So sequence 1000-2000 represents 1000 bytes.&lt;/p&gt;  &lt;p&gt;The X axis is time and is measure in (ms). This matches the offset as displayed in Network Monitor. &lt;/p&gt;  &lt;h4&gt;Legend Details &lt;/h4&gt;  &lt;p&gt;On the time-sequence graphs there are various symbols which can occur. Here's a list of what they &lt;a&gt;mean&lt;/a&gt;. &lt;a href="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/TCPAnalyzerExpertMakeYourNetworkRunFaste_F4DF/image_24.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="image" border="0" alt="image" align="right" src="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/TCPAnalyzerExpertMakeYourNetworkRunFaste_F4DF/image_thumb_11.png" width="134" height="177" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt; ·&amp;#160; Receiver Window - Receiver is telling the sender it is currently willing to receive up to this point in the data stream. &lt;/p&gt;  &lt;p&gt;·&amp;#160; Acknowledged - Receiver is telling the sender it has successfully received all the data up to this point in the data stream. &lt;/p&gt;  &lt;p&gt;· Data - The point in the data stream the sender is currently sending. &lt;/p&gt;  &lt;p&gt;· SYN - The SYNcronize packet sent at the start of the connection. &lt;/p&gt;  &lt;p&gt;· FIN - The FINish packet sent at the end of the connection. &lt;/p&gt;  &lt;p&gt;· Discontinuity - Any break in the data stream where the data in the indicated packet doesn't sequentially follow the data in the previous packet. Out-of-order, lost, or retransmitted packets can all cause discontinuities, as can gaps in the capture. &lt;/p&gt;  &lt;p&gt;· Presumed Lost - A packet that was later retransmitted (if a sequential group of packets are all later retransmitted, only the first one will be indicated this way). &lt;/p&gt;  &lt;p&gt;· Retransmission - A packet that is a retransmission of another packet in the capture. &lt;/p&gt;  &lt;h3&gt;Understanding Bandwidth-Delay Product&lt;/h3&gt;  &lt;p&gt;The speed at which you can send data in TCP is dependent on both the bandwidth of your network and the delay. The bandwidth is often referred to in terms like 10Mbps or 100Mbps, which is in bits per second. The delay is how long it takes for data to travel from one place to another and back. While this is related to the speed of light, other things like routers and the computers that are communicating can increase this delay as it takes time to process packets.&lt;/p&gt;  &lt;p&gt;By multiplying bandwidth and delay together, we get the maximum amount of data that be &amp;quot;in flight&amp;quot; over one connection between two computers. As you'll see, whether this maximum is utilized depends on how well TCP is tuned. It's important to understand as the delay gets longer it becomes more important to fill the available window.&lt;/p&gt;  &lt;h3&gt;Pictures of Wrong Behavior&lt;/h3&gt;  &lt;p&gt;In TCP there are some typical problems that creep up over and over. Sometimes these are configuration issues with the client/server TCP stack or application. And in some cases, the problems can be easily fixed by adjusting the application or TCP window size. Of course, this may also be caused by your network which may require more drastic measures.&lt;/p&gt;  &lt;p&gt;The best way to understand right from wrong is to base-line your network when it is working properly. This way you can look at the bandwidth numbers alone and understand if you have degraded. But in absence of this data, you can use the following pictures as a reference in order to identify some common problems.&lt;/p&gt;  &lt;h4&gt;Bandwidth Limited:&lt;/h4&gt;  &lt;h4&gt;&lt;a href="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/TCPAnalyzerExpertMakeYourNetworkRunFaste_F4DF/image_4.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/TCPAnalyzerExpertMakeYourNetworkRunFaste_F4DF/image_thumb_1.png" width="660" height="370" /&gt;&lt;/a&gt; &lt;/h4&gt;  &lt;p&gt;In this case you see that the sent data fills up the window as the data packets (blue X) approach the receive window (red X). The packets are sent at a regular interval, so the only thing limiting your through put is the available bandwidth. This is normally what you want to see as your throughput will always be limited by something.&lt;/p&gt;  &lt;h4&gt;Receiver Limited:&lt;/h4&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/TCPAnalyzerExpertMakeYourNetworkRunFaste_F4DF/image_6.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/TCPAnalyzerExpertMakeYourNetworkRunFaste_F4DF/image_thumb_2.png" width="660" height="370" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The packets fill the receiver window, but they go out in bursts as fresh acknowledgement packets arrive and open up the window. This burstiness is an indicator that the window is smaller than the delay-bandwidth product, and thus the protocol can't keep the data stream flowing smoothly.&lt;/p&gt;  &lt;h4&gt;Sender Limited:&lt;/h4&gt;  &lt;h4&gt;&lt;a href="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/TCPAnalyzerExpertMakeYourNetworkRunFaste_F4DF/image_8.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/TCPAnalyzerExpertMakeYourNetworkRunFaste_F4DF/image_thumb_3.png" width="660" height="371" /&gt;&lt;/a&gt; &lt;/h4&gt;  &lt;p&gt;This indicates that one end's window size is less than the bandwidth-delay product. However, unlike the receiver-limited case above, the data packets fall well short of filling the receiver's advertised window. This is a good indicator that the sender's window was the limiting factor. In some cases this is because the application doesn't fill the window completely. As this often does not show up under low latency, a developer might not detect this type of problem in testing.&lt;/p&gt;  &lt;h4&gt;Congested Limited:&lt;/h4&gt;  &lt;h4&gt;&lt;a href="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/TCPAnalyzerExpertMakeYourNetworkRunFaste_F4DF/image_10.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/TCPAnalyzerExpertMakeYourNetworkRunFaste_F4DF/image_thumb_4.png" width="660" height="368" /&gt;&lt;/a&gt; &lt;/h4&gt;  &lt;p&gt;The earlier data points (lower left) look like a bandwidth-limited connection, until two lost packets cause TCP to severely limit the sender's congestion window after recovering from the losses. Note that the last data points (upper right) show the data packets aren't filling the receiver's advertised window as TCP is limiting the sender to a smaller congestion window.&lt;/p&gt;  &lt;p&gt;It's important to note that the pictures were created in test environments. Real word applications tend to be more conversational and you'll often have to narrow down the part of the picture you need to focus on. For instance when you start a file copy with explorer, there's a lot of traffic that goes back and forth as you browse for the folder, select the file and then finally drag and drop it on the destination folder. You'll have to learn how to differentiate the actually transfer part from the rest of the traffic.&lt;/p&gt;  &lt;h3&gt;Power of the Picture&lt;/h3&gt;  &lt;p&gt;TCP Analyzer does an awesome job of taking a lot of information and summarizing in a picture that can be used to give a good overview of your network’s performance. It can take practice to learn how to read as you understand these scenarios that were presented as well as others. But as you learn you'll find that this is a powerful tool in your tool belt.&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3260134" width="1" height="1"&gt;</description></item><item><title>Circling In Shark Waters</title><link>http://blogs.technet.com/netmon/archive/2009/06/25/circling-in-shark-waters.aspx</link><pubDate>Thu, 25 Jun 2009 22:42:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3258721</guid><dc:creator>PaulELong</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/netmon/comments/3258721.aspx</comments><wfw:commentRss>http://blogs.technet.com/netmon/commentrss.aspx?PostID=3258721</wfw:commentRss><description>&lt;P&gt;Last week I attended Sharkfest 09 at Stanford CA and I had a wonderful time. It was great to talk to other network geeks like me to better understand this community and see how various tools can be used to illuminate the cloaked world that is your network.&lt;/P&gt;
&lt;P&gt;Each day started with a keynote and then there were 3 tracks: Developer, Basic, and Advanced. The Developer track focused on parser development and capturing. For the most part I stuck to the Basic/Advanced tracks, but I did attend the Developer session on creating parsers (or dissectors as they call them). This gave me some insight into alternate ways protocol parsers can be architected. It was also great to hear from the master brain, chief Wireshark architect, Gerald Combs.&lt;/P&gt;
&lt;P&gt;The SSL session by &lt;A href="http://www.lovemytool.com/blog/sake_blok.html" mce_href="http://www.lovemytool.com/blog/sake_blok.html"&gt;Sake Blok&lt;/A&gt; was interesting because it exposed the details of a protocol I've had little experience with. It's obvious this is a very important skill moving forward as the world moves to protect its information on the wire. He also provides some cases to explain where things might go wrong.&lt;/P&gt;
&lt;P&gt;I found the case study sessions the most useful for me. I love to see how different people attack a problem and what features of a tool they use to get the important information. Especially enlightening were the presentations by Hansang Bae and &lt;A href="http://laurachappell.blogspot.com/" mce_href="http://laurachappell.blogspot.com"&gt;Laura Chappell&lt;/A&gt;.&amp;nbsp; In each case they tackled real world problems with real traces and provided details of how they troubleshoot network issues using a protocol analyzer. Laura was especially entertaining as she described her "Butt Ugly Color Filter" techniques and real world experiences with networking.&lt;/P&gt;
&lt;P&gt;While there's no equivalent to being there in person, most of the presentations are available on http://www.cacetech.com/sharkfest.09/. Some of them include traces, which is great for learning on your own.&lt;/P&gt;
&lt;P&gt;As I roamed beautiful Stanford, and roaming is what you do on such a vast campus, I thought about all the cool people I met and things I learned. I hope I will be there next year and encourage you to attend if you want to hone your networking skills. Whether you are a developer, beginner or advanced user there's always something to be learned.&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3258721" width="1" height="1"&gt;</description></item><item><title>Windows 7 and ISA Remote Windows Sockets Parsers Available</title><link>http://blogs.technet.com/netmon/archive/2009/06/04/windows-7-and-isa-remote-windows-sockets-parsers-available.aspx</link><pubDate>Thu, 04 Jun 2009 19:17:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3250416</guid><dc:creator>PaulELong</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.technet.com/netmon/comments/3250416.aspx</comments><wfw:commentRss>http://blogs.technet.com/netmon/commentrss.aspx?PostID=3250416</wfw:commentRss><description>&lt;P&gt;If you don't already know, we have been updating the our parsers for Network Monitor on &lt;A title="http://www.CodePlex.com/NMParsers " href="http://www.codeplex.com/NMParsers" mce_href="http://www.CodePlex.com/NMParsers"&gt;http://www.CodePlex.com/NMParsers&lt;/A&gt; every month. Most recently we have updated the Windows parser set to support Windows 7 protocol updates. In the June parser release on CodePlex we have support for Remote Windows Sockets (RWS) protocol, which is used to proxy TCP and UDP traffic from Winsock applications. So now with the new parser set you can decode this traffic into the upper level protocols that ride on top of RWS.&lt;/P&gt;
&lt;P&gt;These parsers rely on Network Monitor 3.3, so please &lt;A href="http://go.microsoft.com/fwlink/?LinkID=103158&amp;amp;clcid=0x409" mce_href="http://go.microsoft.com/fwlink/?LinkID=103158&amp;amp;clcid=0x409"&gt;upgrade&lt;/A&gt; first if you haven't already. Please visit &lt;A href="http://www.codeplex.com/NMParsers" mce_href="http://www.CodePlex.com/NMParsers"&gt;NMParsers on CodePlex&lt;/A&gt; and download the last parser set so you can get the most up to date parsing experience. Enjoy!&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3250416" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/netmon/archive/tags/Release/default.aspx">Release</category><category domain="http://blogs.technet.com/netmon/archive/tags/NPL/default.aspx">NPL</category></item><item><title>Event Tracing for Windows and Network Monitor</title><link>http://blogs.technet.com/netmon/archive/2009/05/13/event-tracing-for-windows-and-network-monitor.aspx</link><pubDate>Wed, 13 May 2009 19:44:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3240373</guid><dc:creator>PaulELong</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.technet.com/netmon/comments/3240373.aspx</comments><wfw:commentRss>http://blogs.technet.com/netmon/commentrss.aspx?PostID=3240373</wfw:commentRss><description>&lt;P&gt;Event Tracing for Windows, (ETW), has been around for quite a while now as it was introduced in Windows 2000. It's basically instrumented logging that describes what a component is doing. Conceptually, it’s something like the proverbial &lt;I&gt;printf("here1") &lt;/I&gt;concept used by programmers, but it is present in retail builds&lt;I&gt;. &lt;/I&gt;When you enable logging in a component the result is an ETL (Event Trace Log) file. What’s new is that that Network Monitor can read any ETL file. And with the supplied parsers many network oriented ETW providers can be decoded.&lt;/P&gt;
&lt;H3&gt;How ETW Works&lt;/H3&gt;
&lt;P&gt;The idea was to standardize tracing so that it could be turned on for any component with a consistent interface. Before ETW, it was common practice to place DEBUG statements that would output to the debugger. But this often required checked builds of the binaries, special registry entries, and super secret knowledge that sometimes required code access. Now the consumer/provider model with built in enumeration advances and standardizes logging.&lt;/P&gt;
&lt;P&gt;Unfortunately, it's not all perfect. As the OS has evolved, so has the story for collecting the ETW data. But the great news is that in Windows 7, you can collect data by scenarios and even include the raw network traffic data, all using ETW tracing.&lt;/P&gt;
&lt;H3&gt;Subscribing to a Provider&lt;/H3&gt;
&lt;P&gt;ETW uses a subscription model. Subscribing tools provide a GUID or provider name to receive the logging from that component. Network Monitor is not a subscriber at this point, so we'll have to use other tools to gather the ETW data.&lt;/P&gt;
&lt;P&gt;Various operating systems contain different ways of getting ETW traces, but one that seems to work on most Windows operating systems is Logman.exe (&lt;A href="http://technet.microsoft.com/en-us/library/bb490956.aspx" mce_href="http://technet.microsoft.com/en-us/library/bb490956.aspx"&gt;http://technet.microsoft.com/en-us/library/bb490956.aspx&lt;/A&gt;). When you run Logman, you supply a GUID which identifies a particular provider. To list the providers you can use the /query command.&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: silver 1px solid; TEXT-ALIGN: left; BORDER-LEFT: silver 1px solid; PADDING-BOTTOM: 4px; LINE-HEIGHT: 12pt; BACKGROUND-COLOR: #f4f4f4; MARGIN: 20px 0px 10px; PADDING-LEFT: 4px; WIDTH: 97.5%; PADDING-RIGHT: 4px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; MAX-HEIGHT: 200px; FONT-SIZE: 8pt; OVERFLOW: auto; BORDER-TOP: silver 1px solid; CURSOR: text; BORDER-RIGHT: silver 1px solid; PADDING-TOP: 4px" id=codeSnippetWrapper&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" id=codeSnippet&gt;]]logman query providers&lt;BR&gt;Provider GUID&lt;BR&gt;-------------------------------------------------------------------------------&lt;BR&gt;.NET Common Language Runtime {E13C0D23-CCBC-4E12-931B-D9CC2EEE27E4}&lt;BR&gt;ACPI Driver Trace Provider {DAB01D4D-2D48-477D-B1C3-DAAD0CE6F06B}&lt;BR&gt;Active Directory Domain Services: SAM {8E598056-8993-11D2-819E-0000F875A064}&lt;BR&gt;Active Directory: Kerberos Client {BBA3ADD2-C229-4CDB-AE2B-57EB6966B0C4}&lt;BR&gt;Active Directory: NetLogon {F33959B4-DBEC-11D2-895B-00C04F79AB69}&lt;BR&gt;...&lt;BR&gt;Microsoft-Windows-Winsock-AFD {E53C6823-7BB8-44BB-90DC-3F86090D48A6}&lt;BR&gt;Microsoft-Windows-Winsock-WS2HELP {D5C25F9A-4D47-493E-9184-40DD397A004D}&lt;BR&gt;...&lt;BR&gt;&lt;/PRE&gt;&lt;BR&gt;&lt;/DIV&gt;
&lt;P&gt;see many providers listed, but we only provide ETW parsers for a subset of these. This is mainly because our focus for this feature is Windows 7 network troubleshooting. As we extend the parser set on &lt;A href="http://www.codeplex.com/nmparsers" mce_href="http://www.codeplex.com/nmparsers"&gt;http://www.codeplex.com/nmparsers&lt;/A&gt;, we will add new support for providers. In fact as we speak we are looking to publish an ETW parser for USB 2.0.&lt;/P&gt;
&lt;H3&gt;Capturing an ETW Trace with Logman&lt;/H3&gt;
&lt;P&gt;To capture ETW data, use Logman along with the GUID or provider name and some other parameters. Winsock is the layer that applications use to communicate over TCP. Let's capture all Winsock related ETW events.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;logman start my_winsock_log -p Microsoft-Windows-Winsock-AFD -ets&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;We send it the start command and the name of our session and log file my_winsock_log. We pass it the name of the provider with -p. Alternatively, we could use the {GUID} instead. Finally we pass "-ets" which says to start logging now.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;logman stop my_winsock_log -ets&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This command will stop the logging, again based on the name you specified when you started. When this command completes you should have a my_winsock_log.etl file that we can be opened with Network Monitor 3.3 or 3.2.&lt;/P&gt;
&lt;H3&gt;Windows 7 Scenario based ETW Tracing&lt;/H3&gt;
&lt;P&gt;The story for ETW becomes much more interesting in the Windows 7 and Server2008 R2 world. While Logman still works, Netsh becomes the tool of choice for collecting ETW traces. Also incredibly useful is the addition of tracing by &lt;EM&gt;scenario&lt;/EM&gt; and the &lt;EM&gt;ability to capture network traffic via NDIS&lt;/EM&gt; with ETW tracing. But more on this a little later.&lt;/P&gt;
&lt;H3&gt;Netsh to Collect an ETW Trace. &lt;/H3&gt;
&lt;P&gt;Netsh used to be component centric with regards to tracing. But now tracing is a top level command that you can use to start and stop tracing. So here's an example that works like our previous Logman example.&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: silver 1px solid; TEXT-ALIGN: left; BORDER-LEFT: silver 1px solid; PADDING-BOTTOM: 4px; LINE-HEIGHT: 12pt; BACKGROUND-COLOR: #f4f4f4; MARGIN: 20px 0px 10px; PADDING-LEFT: 4px; WIDTH: 97.5%; PADDING-RIGHT: 4px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; MAX-HEIGHT: 200px; FONT-SIZE: 8pt; OVERFLOW: auto; BORDER-TOP: silver 1px solid; CURSOR: text; BORDER-RIGHT: silver 1px solid; PADDING-TOP: 4px" id=codeSnippetWrapper&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" id=codeSnippet&gt;]] netsh trace start provider=Microsoft-Windows-Winsock-AFD TraceFile=my_winsock_log2.etl&lt;BR&gt;&lt;BR&gt;Trace configuration:&lt;BR&gt;&lt;BR&gt;-------------------------------------------------------------------&lt;BR&gt;&lt;BR&gt;Status: Running&lt;BR&gt;&lt;BR&gt;Trace File: my_winsock_log2&lt;BR&gt;&lt;BR&gt;Append: Off&lt;BR&gt;&lt;BR&gt;Circular: On&lt;BR&gt;&lt;BR&gt;Max Size: 250 MB&lt;BR&gt;&lt;BR&gt;Report: Off&lt;BR&gt;&lt;BR&gt;]] netsh trace stop&lt;BR&gt;&lt;BR&gt;Correlating traces ... done&lt;BR&gt;&lt;BR&gt;Generating data collection ... done&lt;BR&gt;&lt;BR&gt;...&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;/PRE&gt;&lt;BR&gt;&lt;/DIV&gt;
&lt;H2&gt;Netsh and Scenarios&lt;/H2&gt;
&lt;P&gt;Scenarios are things like "InternetClient" or "AddressAcquisition". A tracing scenario is defined as a collection of selected event providers. Providers are the individual components of the network protocol stack, such as WinSock, TCP/IP, Windows Filtering Platform and Firewall, Wireless LAN Services, or NDIS.&lt;/P&gt;
&lt;P&gt;One of the primary goals for improved network tracing is to allow collection of all relevant information in one step, and then easily view all events associated with a specific action across the network stack. Network tracing provides a quick method for collecting information and diagnosing networking issues by logging events from all providers in the scenario, and then correlating these events by activity.&amp;nbsp; In other words, related events &amp;amp; network packets are grouped together for given activity across different components in the networking stack, from Winsock down to NDIS.&lt;/P&gt;
&lt;P&gt;Let's look at a list of possibilities for Windows 7.&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: silver 1px solid; TEXT-ALIGN: left; BORDER-LEFT: silver 1px solid; PADDING-BOTTOM: 4px; LINE-HEIGHT: 12pt; BACKGROUND-COLOR: #f4f4f4; MARGIN: 20px 0px 10px; PADDING-LEFT: 4px; WIDTH: 97.5%; PADDING-RIGHT: 4px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; MAX-HEIGHT: 200px; FONT-SIZE: 8pt; OVERFLOW: auto; BORDER-TOP: silver 1px solid; CURSOR: text; BORDER-RIGHT: silver 1px solid; PADDING-TOP: 4px" id=codeSnippetWrapper&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" id=codeSnippet&gt;]] netsh trace show scenarios&lt;BR&gt;&lt;BR&gt;Available scenarios (18):&lt;BR&gt;&lt;BR&gt;-------------------------------------------------------------------&lt;BR&gt;&lt;BR&gt;AddressAcquisition : Troubleshoot address acquisition-related issues&lt;BR&gt;&lt;BR&gt;DirectAccess : Troubleshoot DirectAccess related issues&lt;BR&gt;&lt;BR&gt;FileSharing : Troubleshoot common file and printer sharing problems&lt;BR&gt;&lt;BR&gt;InternetClient : Diagnose web connectivity issues&lt;BR&gt;&lt;BR&gt;InternetServer : Troubleshoot server-side web connectivity issues&lt;BR&gt;&lt;BR&gt;L2SEC : Troubleshoot layer 2 authentication related issues&lt;BR&gt;&lt;BR&gt;LAN : Troubleshoot wired LAN related issues&lt;BR&gt;&lt;BR&gt;Layer2 : Troubleshoot layer 2 connectivity related issues&lt;BR&gt;&lt;BR&gt;MBN : Troubleshoot mobile broadband related issues&lt;BR&gt;&lt;BR&gt;NDIS : Troubleshoot network adapter related issues&lt;BR&gt;&lt;BR&gt;NetConnection : Troubleshoot issues with network connections&lt;BR&gt;&lt;BR&gt;P2P-Grouping : Troubleshoot Peer-to-Peer Grouping related issues&lt;BR&gt;&lt;BR&gt;P2P-PNRP : Troubleshoot Peer Name Resolution Protocol (PNRP) related issues&lt;BR&gt;&lt;BR&gt;RemoteAssistance : Troubleshoot Windows Remote Assistance related issues&lt;BR&gt;&lt;BR&gt;RPC : Troubleshoot issues related to RPC framework&lt;BR&gt;&lt;BR&gt;WCN : Troubleshoot Windows Connect Now related issues&lt;BR&gt;&lt;BR&gt;WFP-IPsec : Troubleshoot Windows Filtering Platform and IPsec related issues&lt;BR&gt;&lt;BR&gt;WLAN : Troubleshoot wireless LAN related issues&lt;BR&gt;&lt;/PRE&gt;&lt;BR&gt;&lt;/DIV&gt;
&lt;P&gt;To enable a scenario and stop it you type the following commands:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;netsh trace start scenario=InternetClient&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;netsh trace stop&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Again, an ETW trace file is created but now there are multiple providers within the same trace file. This can help you correlate tracing from multiple places as the problem moves from one component to another.&lt;/P&gt;
&lt;H3&gt;Icing is "capture=yes"&lt;/H3&gt;
&lt;P&gt;One of the coolest parts of this new tracing in Windows 7 is that you can capture NDIS network traffic using Netsh. By enabling the capture parameter, you capture network traffic. Not only is this useful for correlating to other component events, but it provides another way to get a network capture.&lt;/P&gt;
&lt;P&gt;Since Netsh is remote-able, you could also use this to start a capture on another machine! And using the persistent=yes parameter, you can enable logging during boot to troubleshoot those nagging start up issues.&lt;/P&gt;
&lt;P&gt;By adding the capture=yes parameter to any scenario or specific provider collection, network traffic is captured, as well. To get a simple trace, use this command:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;netsh trace start capture=yes&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The resulting trace contains TCP, IPv4, Ethernet, ...etc. just like a trace taken from the network interface. However the data has extra headers on the front. If you have other provider information mixed in, and the latest parsers form http://www.CodePlex.com/nmparsers, a simple filter to show you just the network traffic is as follows:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;NDISPacCap_MicrosoftWindowsNDISPacketCapture&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;We also update the standard filters on &lt;A href="http://www.codeplex.com/nmparsers" mce_href="http://www.codeplex.com/nmparsers"&gt;http://www.codeplex.com/nmparsers&lt;/A&gt;. As new requests and ideas for standard filters come up, we'll add to the current set.&lt;/P&gt;
&lt;H3&gt;Netsh Reference&lt;/H3&gt;
&lt;P&gt;Here's a small table to summarize the Netsh commands referenced: 
&lt;TABLE border=1 cellSpacing=0 cellPadding=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=187&gt;
&lt;P&gt;Start&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=276&gt;
&lt;P&gt;Starts a trace session&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=187&gt;
&lt;P&gt;Stop&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=276&gt;
&lt;P&gt;Stops a trace session&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=187&gt;
&lt;P&gt;Capture=yes&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=276&gt;
&lt;P&gt;Turns on raw network capture from NDIS&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=187&gt;
&lt;P&gt;Provider=ProviderName&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=276&gt;
&lt;P&gt;Enables tracing for a specific provider&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=187&gt;
&lt;P&gt;Show Providers&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=276&gt;
&lt;P&gt;Shows a list of providers&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=187&gt;
&lt;P&gt;Scenario=ScenarioName&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=276&gt;
&lt;P&gt;Enables tracing for a specific scenario&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=187&gt;
&lt;P&gt;Show Scenarios&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=276&gt;
&lt;P&gt;Shows a list of scenarios&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/P&gt;
&lt;H3&gt;Conversations and Built-in Standard Filters&lt;/H3&gt;
&lt;P&gt;We've extended the idea of conversations to ETW logs. The conversation tree is populated with activities and providers under that which will help you narrow down interesting traffic. We also provide some standard filters to help you do some basic searches. And as usual, we try to propagate the important information to top of the &lt;A&gt;tree&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/EventTracingforWindowsandNetworkMonitor_B165/ETW_2.png" mce_href="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/EventTracingforWindowsandNetworkMonitor_B165/ETW_2.png"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=ETW border=0 alt=ETW src="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/EventTracingforWindowsandNetworkMonitor_B165/ETW_thumb.png" width=644 height=360 mce_src="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/EventTracingforWindowsandNetworkMonitor_B165/ETW_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;And finally the default columns that show up in Network Monitor 3.3 are different when you open an ETW trace. We add a "UT Process Name" column, which stands for Unified Tracing, which displays possibly the process name, as well as the process ID. This replaces the "Process Name" column that shows up when you open capture files.&lt;/P&gt;
&lt;H4&gt;Where to Go Next?&lt;/H4&gt;
&lt;P&gt;When assisted support or further troubleshooting is necessary, the improved network trace logs can enable developers and support professionals to quickly isolate network activities and view the combined event data and packet captures in a single file, grouped by a network task and the related network activity.&lt;/P&gt;
&lt;P&gt;On MSDN there's a great reference that discusses Win7 troubleshooting with Event Tracing (&lt;A title=http://go.microsoft.com/fwlink/?LinkID=145404 href="http://go.microsoft.com/fwlink/?LinkID=145404" mce_href="http://go.microsoft.com/fwlink/?LinkID=145404"&gt;http://go.microsoft.com/fwlink/?LinkID=145404&lt;/A&gt;). This resource explains in greater detail how to troubleshoot problems, create filters, and use conversations with ETW tracing and Network Monitor. And while it's Windows 7 specific, there is still some applicability to older operating systems. And Network Monitor can read any ETL file. While we don't necessarily have parsers for every provider, that doesn't mean a parser can't be written. &lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3240373" width="1" height="1"&gt;</description></item><item><title>Network Monitor Forum on TechNet</title><link>http://blogs.technet.com/netmon/archive/2009/05/11/network-monitor-forum-on-technet.aspx</link><pubDate>Tue, 12 May 2009 00:52:39 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3239235</guid><dc:creator>PaulELong</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/netmon/comments/3239235.aspx</comments><wfw:commentRss>http://blogs.technet.com/netmon/commentrss.aspx?PostID=3239235</wfw:commentRss><description>&lt;p&gt;We'd like to announce that we are opening a &lt;a href="http://social.technet.microsoft.com/Forums/en/netmon"&gt;Network Monitor forum on TechNet&lt;/a&gt;. We also have forums hosted on Connect.Microsoft.com, but these are focused on our betas. We'll answer questions about filtering, using the Network Monitor API, writing parsers with NPL, the UI, reassembly, capturing, and anything else you want to discuss.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://social.technet.microsoft.com/Forums/en/netmon"&gt;http://social.technet.microsoft.com/Forums/en/netmon&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Please visit if you have a question.&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3239235" width="1" height="1"&gt;</description></item><item><title>Top Users Expert for Network Monitor 3.3</title><link>http://blogs.technet.com/netmon/archive/2009/04/30/top-users-expert-for-network-monitor-3-3.aspx</link><pubDate>Fri, 01 May 2009 00:48:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3233754</guid><dc:creator>PaulELong</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.technet.com/netmon/comments/3233754.aspx</comments><wfw:commentRss>http://blogs.technet.com/netmon/commentrss.aspx?PostID=3233754</wfw:commentRss><description>&lt;P&gt;One of the major new features in Network Monitor 3.3 is the ability to run experts directly from the UI. And now NMTopUsers is available from our &lt;A href="http://www.codeplex.com/NMExperts" mce_href="http://www.codeplex.com/NMExperts"&gt;Experts Portal&lt;/A&gt;.&amp;nbsp; Plus as it's a CodePlex project, we have opened the source code as well. It's a fairly simple C# project which uses the NMAPI to access data from a trace. You can view and download the source code if you are interested in more details.&lt;/P&gt;
&lt;H3&gt;What Does NMTopUsers Do?&lt;/H3&gt;
&lt;P&gt;The problem we are trying to solve is a way to quickly identify the heaviest users of network traffic. For instance you might want to understand if there's a computer on your network that is hogging all the bandwidth. You might also want to identify a chatty machine which could be an indication that it has been infected with a virus or adware.&lt;/P&gt;
&lt;P&gt;There are actually two experts in one here. The Endpoint version shows traffic for each machine address, IPv4, or IPv6 address on your network. The Conversation version, on the other hand, shows traffic based on a pair of machines, IPv4, or IPv6 addresses so you can understand the traffic involved between machines.&lt;/P&gt;
&lt;H3&gt;How Does NMTopUsers Work?&lt;/H3&gt;
&lt;P&gt;Once you've installed the expert by running the MSI, "Top Users by Endpoint" and/or "Top Users by Conversation" will appear in the experts menu. Once you run the expert a new window will show up and display a data grid. The data will depend on any display filters applied or conversation tree nodes you might have selected. The data grid contains a list of nodes or conversations and then statics on the frames and bytes that have been sent and/or received.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/TopUsersExpertforNetworkMonitor3.3_FA67/TopUsers_4.jpg" mce_href="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/TopUsersExpertforNetworkMonitor3.3_FA67/TopUsers_4.jpg"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=TopUsers border=0 alt=TopUsers src="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/TopUsersExpertforNetworkMonitor3.3_FA67/TopUsers_thumb_1.jpg" width=660 height=323 mce_src="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/TopUsersExpertforNetworkMonitor3.3_FA67/TopUsers_thumb_1.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;By default the data is sorted by Total Bytes. But you can click on any column header to sort by that column.&lt;/P&gt;
&lt;P&gt;The Address Type drop-down lets you select which types of addresses you want to see. By default we only show IPv4 addresses, but you can add Machine addresses and IPv6 addresses as well.&lt;/P&gt;
&lt;P&gt;The Tree View allows you to see the IPv4 and IPv6 address as they relate to the Machine addresses that they belong too. But as you can imagine this option is only available if you've enabled the Machine address type. Also if you've re-sorted on a different column in the Tree View, you can reset to the original order by using the Reset Tree button.&lt;/P&gt;
&lt;P&gt;Finally you can create a Pie or Bar chart of the information. While sometimes this can be cluttered due to the number of addresses, it can give you a high level overview of the usage. Keep in mind that the Bar chart can't display if you have Machine Addresses selected and multiple IPv4 or IPv6 addresses for a single machine address. This is because the bar chart attempts to line up each IPv4/IPv6 address with its matching Machine address and this doesn't make sense with multiple IP addresses.&lt;/P&gt;
&lt;H3&gt;Give it a Run&lt;/H3&gt;
&lt;P&gt;Please go to the &lt;A href="http://www.codeplex.com/NMExperts" mce_href="http://www.codeplex.com/NMExperts"&gt;Experts Portal&lt;/A&gt; and download both Top Users for Conversations and Endpoint. Try it out!&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3233754" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/netmon/archive/tags/Release/default.aspx">Release</category><category domain="http://blogs.technet.com/netmon/archive/tags/Experts/default.aspx">Experts</category><category domain="http://blogs.technet.com/netmon/archive/tags/tshoot/default.aspx">tshoot</category></item><item><title>Network Monitor 3.3 has arrived!</title><link>http://blogs.technet.com/netmon/archive/2009/04/22/network-monitor-3-3-has-arrived.aspx</link><pubDate>Wed, 22 Apr 2009 06:17:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3228983</guid><dc:creator>PaulELong</dc:creator><slash:comments>14</slash:comments><comments>http://blogs.technet.com/netmon/comments/3228983.aspx</comments><wfw:commentRss>http://blogs.technet.com/netmon/commentrss.aspx?PostID=3228983</wfw:commentRss><description>&lt;P&gt;&lt;I&gt;Guest blog by Tawanda Sibanda, Lead Program Manager for Network Monitor&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;Ladies and gentlemen … the Microsoft Network monitor team is excited to announce the release of Network Monitor 3.3. A record 7 months after version 3.2 this is our quickest release ever, but also one of our most functionality-rich. We have added some innovative features that will simplify your network troubleshooting needs. As always, we have also continued to fix bugs and improve the product in those little but important ways. &lt;/P&gt;
&lt;P&gt;Let’s take a quick tour of Network Monitor 3.3. &lt;/P&gt;
&lt;H3&gt;Where are the bits?&lt;/H3&gt;
&lt;P&gt;Network Monitor 3.3 is available here &lt;A title=http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=983b941d-06cb-4658-b7f6-3088333d062f href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=983b941d-06cb-4658-b7f6-3088333d062f" mce_href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=983b941d-06cb-4658-b7f6-3088333d062f"&gt;http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=983b941d-06cb-4658-b7f6-3088333d062f&lt;/A&gt; on Microsoft.com&lt;/P&gt;
&lt;P&gt;Network Monitor 3.3 will also be offered as an optional feature package in the next few weeks via Microsoft Update if you have a previous version of Network Monitor 3.x installed. To check for updates, click on &lt;B&gt;Help&amp;gt;Check for Updates&lt;/B&gt; from the product menu (versions 3.1 and higher) or visit the site &lt;A href="http://update.microsoft.com/microsoftupdate" mce_href="http://update.microsoft.com/microsoftupdate"&gt;http://update.microsoft.com/microsoftupdate&lt;/A&gt;&lt;/P&gt;
&lt;H3&gt;What’s New in Network Monitor 3.3&lt;/H3&gt;
&lt;P&gt;· Ability to capture WWAN (mobile broadband) and Tunnel traffic on &lt;A href="http://www.microsoft.com/windows/windows-7/" mce_href="http://www.microsoft.com/windows/windows-7/"&gt;Windows 7&lt;/A&gt;. &lt;B&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;· Full Hyper-V support on Windows Server 2008&lt;B&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;· &lt;B&gt;Right-click-add-to-alias&lt;/B&gt;: Right-click a frame in the Frame Summary window with an IPv4, IPv6 or MAC address to add that address as a new alias. This is one of those little things that simplifies your work-flow.&lt;B&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/NetworkMonitor3.3hasarrived_122A3/clip_image002_2.jpg" mce_href="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/NetworkMonitor3.3hasarrived_122A3/clip_image002_2.jpg"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; MARGIN: 10px 10px 0px 30px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=clip_image002 border=0 alt=clip_image002 src="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/NetworkMonitor3.3hasarrived_122A3/clip_image002_thumb.jpg" width=660 height=192 mce_src="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/NetworkMonitor3.3hasarrived_122A3/clip_image002_thumb.jpg"&gt;&lt;/A&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;· &lt;B&gt;Right-click-go-to-definition&lt;/B&gt;: Have you ever wondered where and how the protocols fields you see in the Frame Details are defined in our in-built parsers? Wonder no more. Introducing right-click-go-to-definition: right-click a field in the Frame Details window and select Go To Data Field Definition or Go To Data Type Definition to see where the field is defined in the NPL parsers.&lt;B&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;· &lt;B&gt;Autoscroll:&lt;/B&gt; Another one of those little, but priceless things … auto-scroll. See the most recent traffic as it comes in. In a live capture, click the AutoScroll button on the main toolbar to have the Frame Summary window automatically scroll down to display the most recent frames as they come in. Click Autoscroll again to freeze the view in its present location. &lt;B&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;· &lt;B&gt;Core Parser Set:&lt;/B&gt; We heard your concerns about our parsing performance, and created an optimized Core parser set that only contains 32 protocol parsers for network layer and transport protocols (e.g., Ethernet, IP, and TCP). This parser set can increase your parsing performance by up to 200% depending on the data you are viewing. To enable the Core parser set, go to Tools &amp;gt; Options from the main menu, and click on the Parser tab. Click on the Common folder and click the stubs button to load stub parsers for this folder. Do the same thing for the Windows folder. Your final set up should be as follows:&lt;B&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;A href="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/NetworkMonitor3.3hasarrived_122A3/clip_image004_2.jpg" mce_href="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/NetworkMonitor3.3hasarrived_122A3/clip_image004_2.jpg"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; MARGIN: 10px 10px 0px 30px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=clip_image004 border=0 alt=clip_image004 src="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/NetworkMonitor3.3hasarrived_122A3/clip_image004_thumb.jpg" width=589 height=500 mce_src="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/NetworkMonitor3.3hasarrived_122A3/clip_image004_thumb.jpg"&gt;&lt;/A&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;· &lt;B&gt;ETL Support:&lt;/B&gt; Network Monitor 3.3 can open and correlate information in ETL files generated by &lt;A href="http://msdn.microsoft.com/en-us/library/dd569136(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd569136(VS.85).aspx"&gt;Network Tracing in Windows 7.&lt;/A&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;And now for the main event … two of our most exciting features that will revolutionize how you analyze your traces:&lt;/P&gt;
&lt;P&gt;· &lt;B&gt;Frame Commenting:&lt;/B&gt; Read all about this feature in &lt;A href="http://blogs.technet.com/netmon/archive/2009/03/20/frame-commenting-is-here.aspx" mce_href="http://blogs.technet.com/netmon/archive/2009/03/20/frame-commenting-is-here.aspx"&gt;our previous blog article&lt;/A&gt;. Briefly, Frame Commenting lets you attach comments to frames in a saved capture file. Select the Frame Comments tab in the lower-right window to add, view, edit, or delete comments. With this feature you can annotate a trace with your comments and observations and store that metadata directly with the capture file itself!&lt;/P&gt;
&lt;P&gt;· &lt;B&gt;Experts:&lt;/B&gt; Experts are stand-alone applications that analyze Network Monitor capture data. In Network Monitor 3.3 we provide a simple interface for registering experts with the product and invoking them on a saved capture file. We have made some initial experts available online at &lt;A href="http://go.microsoft.com/fwlink/?LinkID=133950" mce_href="http://go.microsoft.com/fwlink/?LinkID=133950"&gt;http://go.microsoft.com/fwlink/?LinkID=133950&lt;/A&gt;. Simply install the experts and run them directly from the UI on a capture file. Better yet, why not create your own expert! We provide a rich API that allows you to filter and parse capture data. We also have a sample SDK on the same experts portal to get you started on creating an installable expert that you can share with others. If you are interested in creating an expert we would love to hear from you. Leave a comment on the blog and Paul will get back to you.&lt;/P&gt;
&lt;H3&gt;Let us know what you think&lt;/H3&gt;
&lt;P&gt;We live for feedback, negative or positive. Go to &lt;A href="http://go.microsoft.com/fwlink/?LinkID=142458" mce_href="http://go.microsoft.com/fwlink/?LinkID=142458"&gt;http://go.microsoft.com/fwlink/?LinkID=142458&lt;/A&gt; and let your opinion be heard. The survey requires you to log on with your Windows Live ID.&lt;/P&gt;
&lt;P&gt;Enjoy!&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/NetworkMonitor3.3hasarrived_122A3/TeamPicComp7_2.jpg" mce_href="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/NetworkMonitor3.3hasarrived_122A3/TeamPicComp7_2.jpg"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; MARGIN: 10px 10px 0px 30px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=TeamPicComp7 border=0 alt=TeamPicComp7 src="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/NetworkMonitor3.3hasarrived_122A3/TeamPicComp7_thumb.jpg" width=637 height=500 mce_src="http://blogs.technet.com/blogfiles/netmon/WindowsLiveWriter/NetworkMonitor3.3hasarrived_122A3/TeamPicComp7_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Microsoft Network Monitor Team&lt;/P&gt;
&lt;P&gt;Left-&amp;gt;Right: Xumin Sun, Jin Feng, Darren Fisher, Jim Huang, Ralph Case, Michael Hawker, Paul Long, Saurabh Verma, Ashish Panday, Dave MacDonald, Ning Yang, Fred Wurden, Kathy Snow, Xin Shen, cow, Gi youl Kim, Sean Spratt, Lin Zhong, Tawanda Sibanda&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3228983" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/netmon/archive/tags/Release/default.aspx">Release</category></item></channel></rss>