<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.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>Windows Core Networking : WSK</title><link>http://blogs.msdn.com/wndp/archive/tags/WSK/default.aspx</link><description>Tags: WSK</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Creating IP Agnostic Applications - Part 2 (Dual Mode Sockets)</title><link>http://blogs.msdn.com/wndp/archive/2006/10/24/creating-ip-agnostic-applications-part-2-dual-mode-sockets.aspx</link><pubDate>Tue, 24 Oct 2006 20:59:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:869873</guid><dc:creator>wndpteam</dc:creator><slash:comments>16</slash:comments><comments>http://blogs.msdn.com/wndp/comments/869873.aspx</comments><wfw:commentRss>http://blogs.msdn.com/wndp/commentrss.aspx?PostID=869873</wfw:commentRss><description>&lt;P&gt;In a previous post I wrote about how on Windows Vista and Windows Server "Longhorn," IPv6 is installed and enabled by default and that&amp;nbsp;when both IPv4 and IPv6 are enabled, the TCP/IP stack prefers to use IPv6 over IPv4.&amp;nbsp; With the growth of IPv6, applications must now&amp;nbsp;work seamlessly over both protocols (IPv4 &amp;amp; IPv6).&amp;nbsp; The remainder of this post discusses one way to make handling both protocols easier by using a single socket that works with IPv4 &amp;amp; IPv6.&amp;nbsp; No longer do you need to create two sockets to make your application IPv4 &amp;amp; IPv6 aware :).&lt;/P&gt;
&lt;P&gt;Windows Vista and Windows Server Longhorn includes a new TCP/IP stack which&amp;nbsp;includes common TCP &amp;amp; UDP layers on top of the IPv4 and IPv6 layers.&amp;nbsp; This new architecture has made it possible for a single IPv6 socket to work with both IPv6 and IPv4.&amp;nbsp; For example, using a single IPv6 socket one can now accept BOTH IPv4 and IPv6 traffic.&amp;nbsp; Such a socket is typically dubbed a "dual mode" socket.&amp;nbsp; Dual mode sockets are usable by managed code sockets (ie. &lt;A href="http://search.msdn.microsoft.com/search/Redirect.aspx?title=Socket+Class+(System.Net.Sockets)+&amp;amp;url=http://msdn2.microsoft.com/en-us/library/system.net.sockets.socket.aspx" mce_href="http://search.msdn.microsoft.com/search/Redirect.aspx?title=Socket+Class+(System.Net.Sockets)+&amp;amp;url=http://msdn2.microsoft.com/en-us/library/system.net.sockets.socket.aspx"&gt;System.Net.Sockets.Socket&lt;/A&gt;), native &lt;A href="http://search.msdn.microsoft.com/search/Redirect.aspx?title=Winsock+Reference+%5bWinsock%5d&amp;amp;url=http://msdn.microsoft.com/library/en-us/winsock/winsock/winsock_reference.asp" mce_href="http://search.msdn.microsoft.com/search/Redirect.aspx?title=Winsock+Reference+%5bWinsock%5d&amp;amp;url=http://msdn.microsoft.com/library/en-us/winsock/winsock/winsock_reference.asp"&gt;Winsock&lt;/A&gt; sockets as well as &lt;A href="http://blogs.msdn.com/wndp/archive/2006/02/24/538746.aspx" mce_href="http://blogs.msdn.com/wndp/archive/2006/02/24/538746.aspx"&gt;Winsock Kernel (WSK)&lt;/A&gt;&amp;nbsp;sockets.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To create a "dual mode" socket, the following steps are&amp;nbsp;needed:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Create an IPv6 socket 
&lt;LI&gt;Set the IPV6_V6ONLY socket option to false&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Once you have created the socket and set the appropriate option,&amp;nbsp;the socket can be used to accept&amp;nbsp;incoming IPv4/v6 connections or connect to an IPv4/v6 destination.&amp;nbsp; The snippets below outline&amp;nbsp;accepting incoming connections over both protocols&amp;nbsp;in native and managed code:&lt;/P&gt;
&lt;P&gt;Note: The code is meant as demonstration code; error code checking and exception handling have been left off the&amp;nbsp;code&amp;nbsp;snippets to keep them as concise as possible.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;.NET (C#)&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;P&gt;Socket sock = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp);&lt;/P&gt;
&lt;P&gt;// 27 is equivalent to IPV6_V6ONLY socket option in the winsock snippet below&lt;BR&gt;sock.SetSocketOption(SocketOptionLevel.IPv6, (SocketOptionName)27, 0);&lt;BR&gt;sock.Bind(new IPEndPoint(IPAddress.IPv6Any, 8000));&lt;BR&gt;sock.Listen(5);&lt;BR&gt;Socket client = sock.Accept();&lt;BR&gt;// send / receive data on 'client' socket 
&lt;/P&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;Winsock&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;P&gt;WSADATA wsaData;&lt;BR&gt;SOCKET lsock = INVALID_SOCKET;&lt;BR&gt;SOCKET csock = INVALID_SOCKET;&lt;BR&gt;SOCKADDR_STORAGE serverAddr = {0};&lt;BR&gt;SOCKADDR_STORAGE clientAddr = {0};&lt;BR&gt;int off = 0;&lt;BR&gt;int port = 8000;&lt;BR&gt;int clientAddrLen = sizeof(clientAddr);&lt;BR&gt;WSAStartup(MAKEWORD(2,2), &amp;amp;wsaData); 
&lt;P&gt;serverAddr.ss_family = AF_INET6;&lt;BR&gt;INETADDR_SETANY((SOCKADDR *)&amp;amp;serverAddr);&lt;BR&gt;SS_PORT(&amp;amp;serverAddr) = htons(port);&lt;BR&gt;lsock = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP)&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;//make the socket a dual mode socket&lt;BR&gt;setsockopt(lsock,IPPROTO_IPV6,IPV6_V6ONLY,(char *)&amp;amp;off, sizeof(off));&lt;BR&gt;bind(lsock, (SOCKADDR *)&amp;amp;serverAddr, (int)INET_SOCKADDR_LENGTH(serverAddr.ss_family));&lt;BR&gt;listen(lsock, 5);&lt;BR&gt;csock = accept(lsock, (SOCKADDR *)&amp;amp;clientAddr, &amp;amp;clientAddrLen); &lt;/P&gt;
&lt;P&gt;... 
&lt;P&gt;... 
&lt;P&gt;WSACleanup(); 
&lt;/P&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;When using a dual mode socket, it is important to remember the socket is&amp;nbsp;at&amp;nbsp;root an IPv6 socket.&lt;/STRONG&gt;&amp;nbsp; Since this is the case, when specifying an IPv4 address to such a socket (ie. connect to IPv4 endpoint using a dual mode socket) one must format the IPv4 address as an &lt;A href="http://en.wikipedia.org/wiki/IPv4_mapped_address" mce_href="http://en.wikipedia.org/wiki/IPv4_mapped_address"&gt;IPv4 mapped address&lt;/A&gt; prior to passing the address to a socket function.&amp;nbsp; Fortunately,&amp;nbsp;one can use IN6ADDR_SETV4MAPPED(...), defined in mstcpip.h to simplify this task. 
&lt;P&gt;The following shows&amp;nbsp;an example of what this looks like in Winsock: &lt;PRE&gt;&lt;P&gt;WSADATA wsaData;&lt;BR&gt;SOCKET csock = INVALID_SOCKET;&lt;BR&gt;SOCKADDR_STORAGE addrLoopback4 = {0}; 
&lt;P&gt;int port = 8000;&lt;BR&gt;int off = 0; 
&lt;P&gt;addrLoopback4.ss_family = AF_INET;&lt;BR&gt;INETADDR_SETLOOPBACK((SOCKADDR*)&amp;amp;addrLoopback4);&lt;BR&gt;SS_PORT(&amp;amp;addrLoopback4) = htons(port); 
&lt;P&gt;WSAStartup(MAKEWORD(2,2), &amp;amp;wsaData);&lt;BR&gt;if((csock = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP)) == INVALID_SOCKET)&lt;/P&gt;&lt;P&gt;{&lt;BR&gt;     //error creating the listening socket&lt;BR&gt;     WSACleanup();&lt;BR&gt;     return 1;&lt;BR&gt;} &lt;/P&gt;
&lt;P&gt;//make the socket a dual mode socket&lt;BR&gt;setsockopt(csock,IPPROTO_IPV6,IPV6_V6ONLY,(char *)&amp;amp;off, sizeof(off)); 
&lt;P&gt;// format the address as a v4 mapped address if needed&lt;BR&gt;ConvertToV4MappedAddressIfNeeded((SOCKADDR *) &amp;amp;addrLoopback4);&lt;BR&gt;// connect&lt;BR&gt;connect(csock, (SOCKADDR *)&amp;amp;addrLoopback4, sizeof(addrLoopback4)); &lt;BR&gt;printf("Connect complete"); 
&lt;P&gt;closesocket(csock); 
&lt;P&gt;WSACleanup();&lt;BR&gt;return 0; 
&lt;P&gt;&amp;nbsp; 
&lt;P&gt;
&lt;P&gt;
&lt;P&gt;void ConvertToV4MappedAddressIfNeeded(PSOCKADDR pAddr)&lt;BR&gt;{&lt;BR&gt;    // if v4 address, convert to v4 mapped v6 address&lt;BR&gt;    if (AF_INET == pAddr-&amp;gt;sa_family)&lt;BR&gt;    {&lt;BR&gt;        IN_ADDR In4addr;    &lt;BR&gt;        SCOPE_ID scope = INETADDR_SCOPE_ID(pAddr);&lt;BR&gt;        USHORT port = INETADDR_PORT(pAddr);&lt;BR&gt;        In4addr = *(IN_ADDR*)INETADDR_ADDRESS(pAddr);&lt;BR&gt;        ZeroMemory(pAddr, sizeof(SOCKADDR_STORAGE));&lt;BR&gt;        IN6ADDR_SETV4MAPPED(&lt;BR&gt;             (PSOCKADDR_IN6)pAddr,&lt;BR&gt;             &amp;amp;In4addr,&lt;BR&gt;             scope,&lt;BR&gt;             port&lt;BR&gt;             ); 
&lt;P&gt;    }&lt;BR&gt;} 
&lt;/P&gt;&lt;/PRE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers, 
&lt;P&gt;-- Mike Flasko&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=869873" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/wndp/archive/tags/Winsock/default.aspx">Winsock</category><category domain="http://blogs.msdn.com/wndp/archive/tags/System.Net/default.aspx">System.Net</category><category domain="http://blogs.msdn.com/wndp/archive/tags/networking/default.aspx">networking</category><category domain="http://blogs.msdn.com/wndp/archive/tags/WSK/default.aspx">WSK</category></item><item><title>TDI Client to Winsock Kernel (WSK)  Porting Survey</title><link>http://blogs.msdn.com/wndp/archive/2006/10/19/tdi-client-to-winsock-kernel-wsk-porting-survey.aspx</link><pubDate>Thu, 19 Oct 2006 19:19:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:844783</guid><dc:creator>wndpteam</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/wndp/comments/844783.aspx</comments><wfw:commentRss>http://blogs.msdn.com/wndp/commentrss.aspx?PostID=844783</wfw:commentRss><description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;As you know per &lt;a href="http://blogs.msdn.com/wndp/archive/2006/02/24/538746.aspx"&gt;previous posts on this blog&lt;/a&gt;, Winsock Kernel, a new transport-independent kernel mode Network Programming Interface (NPI), is available on Windows Vista and Windows Server Longhorn platforms.&amp;nbsp; On Windows Vista &amp;amp; Windows Server Longhorn, TDI is still supported for compatibility reasons; however, it has been implemented using a translation layer and thus its performance is sub-optimal resulting in performance degradation for TDI clients.&amp;nbsp; For this reason, as well as others (TDI on path to deprecation, etc -- see resource links below), drivers should opt to use WSK whenever possible.&amp;nbsp; &amp;nbsp; &lt;p&gt;&lt;b&gt;To help us understand how we can best make WSK adoption and porting from TDI to WSK straightforward, we would appreciate it if you could respond to the following questions. Responses can be sent to &lt;i&gt;&lt;font color="#008000" size="2"&gt;wskapi at microsoft.com&lt;/font&gt;&lt;/i&gt;&lt;/b&gt; &lt;p&gt;&lt;i&gt;If you have an existing TDI Client driver:&lt;/i&gt; &lt;p&gt;1)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Which operating systems does your TDI client support (Windows XP and/or Windows Server 2003, etc)? &lt;p&gt;2)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do you plan to port your TDI client to WSK on Windows Vista / Windows Longhorn server OR do you plan to continue to use your TDI-based driver on Windows Vista / Windows Longhorn Server? &lt;p&gt;a.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If WSK was also supported on Windows XP and/or Windows Server 2003, would your answer to question #2 above change?&amp;nbsp; If so, how?  &lt;p&gt;&lt;i&gt;&lt;/i&gt; &lt;p&gt;&lt;i&gt;&lt;/i&gt;&amp;nbsp; &lt;p&gt;&lt;i&gt;If you are working on a new project which requires a kernel mode driver with network capabilities:&lt;/i&gt; &lt;p&gt;3)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do you plan to support Windows XP / Windows 2003 with the project deliverable?&amp;nbsp; If so, would you use WSK for the project if it was available on these platforms? &lt;p&gt;&lt;i&gt;&lt;/i&gt; &lt;p&gt;&lt;i&gt;&lt;/i&gt;&amp;nbsp; &lt;p&gt;&lt;i&gt;Additional Requirements:&lt;/i&gt; &lt;p&gt;4)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do you have any requirements (performance, etc) that would need to be met by WSK (on pre Windows Vista platforms) in order for WSK to be an option on such platforms? &amp;nbsp;&amp;nbsp; &lt;p&gt;&lt;b&gt;WSK Resources&lt;/b&gt; &lt;p&gt;Overview of WSK: &lt;a href="http://blogs.msdn.com/wndp/archive/2006/02/24/538746.aspx"&gt;http://blogs.msdn.com/wndp/archive/2006/02/24/538746.aspx&lt;/a&gt; &lt;p&gt;Network Programming with Winsock Kernel: &lt;a href="http://blogs.msdn.com/wndp/archive/2006/05/04/Winhec-blog-wsk.aspx"&gt;http://blogs.msdn.com/wndp/archive/2006/05/04/Winhec-blog-wsk.aspx&lt;/a&gt; &lt;p&gt;WSK MSDN Documentation: &lt;a href="http://msdn.microsoft.com/library/en-us/NetLH_d/hh/NetLH_d/wsk_2bb30f2b-db42-465a-9abd-61a7a7515273.xml.asp?frame=true"&gt;http://msdn.microsoft.com/library/en-us/NetLH_d/hh/NetLH_d/wsk_2bb30f2b-db42-465a-9abd-61a7a7515273.xml.asp?frame=true&lt;/a&gt; &lt;p&gt;WDK RC1 Download: See &lt;a href="http://connect.microsoft.com/"&gt;http://connect.microsoft.com&lt;/a&gt;, Windows Driver Kit Program, Downloads Section &lt;p&gt;If you have any further comments or questions, please feel free to contact us at &lt;em&gt;wskapi at microsoft.com&lt;/em&gt;. &lt;p&gt;We look forward to your feedback. &lt;p&gt;--Mike Flasko&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=844783" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/wndp/archive/tags/networking/default.aspx">networking</category><category domain="http://blogs.msdn.com/wndp/archive/tags/TCP_2F00_IP/default.aspx">TCP/IP</category><category domain="http://blogs.msdn.com/wndp/archive/tags/WSK/default.aspx">WSK</category></item><item><title>Network Programming with Winsock Kernel (WSK)</title><link>http://blogs.msdn.com/wndp/archive/2006/05/04/Winhec-blog-wsk.aspx</link><pubDate>Thu, 04 May 2006 16:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:588861</guid><dc:creator>wndpteam</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/wndp/comments/588861.aspx</comments><wfw:commentRss>http://blogs.msdn.com/wndp/commentrss.aspx?PostID=588861</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Verdana size=2&gt;Winsock Kernel (WSK) is the latest network programming interface introduced by the WNDP team in Windows Vista. As evident by its name, WSK can be used by kernel-mode drivers for sending and receiving data over the network. But less evident to many developers, WSK is not an interface for performing network “filtering”. Hence, to clarify a common misconception up front, if all you want is to perform some form of network traffic filtering or interception, then you are strongly advised to look at the Windows Filtering Platform (WFP) interface first. WFP is the one-stop shop for network filtering in Windows Vista.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Verdana size=2&gt;As we have first presented in last year’s Driver DevCon and WinHEC 2005, our main goal with WSK is to provide a programming interface which is easier-to-use and has higher performance relative to its predecessor Transport Driver Interface (TDI) for kernel-mode network applications. Since last year, we have considerably improved the WSK documentation in the Windows Driver Kit (WDK), and have also added a WSK sample driver to the WDK. A preview version of the pre-Beta2 WSK documents and sample is available as described in a previous blog on this site by Mike Flasko. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=2&gt;&lt;FONT face=Verdana&gt;In WinHEC 2006, the session on WSK will be geared more towards the guidelines and best practices to follow in WSK to achieve optimal performance and stability. For those of you planning to attend the WSK session in WinHEC 2006, we encourage you to get familiar with the available WSK documents and the sample prior to the session to get the most out of the presentation. We have identified a number of areas in WSK over the past year based on feedback from both external and internal WSK clients that require more explanation and guidance. These include how to start and stop using WSK (WSK registration and deregistration), IRP handling, building and processing WSK_BUFs, when to use socket callbacks, how to achieve optimal throughput when sending stream data, how transport address security works, and how to use a single IPv6 socket for both IPv6 and IPv4 traffic. We will discuss all of these areas in depth in the WSK session in WinHEC 2006.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Verdana size=2&gt;An important question I would like to address here is &lt;I style="mso-bidi-font-style: normal"&gt;when&lt;/I&gt; to use WSK. Let’s look at this starting with a Winsock2 application in user-mode. If your Winsock2 application is working fine in the user-mode land, then you have no reason to consider a WSK-based implementation for that application. An important misconception here is to assume that a kernel-mode implementation will automatically provide much better performance than a user-mode implementation, which is not true. Remember also that kernel-mode programming has much stricter requirements in order to ensure a high degree of system stability and robustness; if your kernel-mode code is not rock solid, then moving your application into the kernel will cause more grief than good. Lastly, user-mode Winsock2 interface is a richer higher-level interface while, even though we have made it relatively simple and easy-to-use, WSK is still quite a low-level interface which sometimes requires an intimate familiarity of protocol-specific behavior from its clients to avoid pitfalls. To give a few concrete examples, Winsock2 does have dedicated routines for complex tasks like transmitting a file or connecting by name to remote peers whereas WSK doesn’t. Also as another less obvious example, Winsock2 performs buffering in the send direction, which allows even simple applications using blocking send requests to achieve decent throughput whereas WSK does not perform any “socket-level” buffering, hence requires the application to know about and account for things like Nagling, delayed-ack, bandwidth-delay product, etc to achieve decent throughput.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Verdana size=2&gt;My personal guidance on implementing anything in kernel is to ask this question first: Is there a significant performance, stability, robustness, or security benefit in a kernel-mode implementation for a given functionality that can not otherwise be achieved by a user-mode implementation? This guidance may sound a bit abstract without a concrete example. So, let’s take a look at a real example. The HTTP.sys component in Windows Vista implements a kernel-mode HTTP stack by using the WSK interface. Prior to HTTP.sys, HTTP applications like Internet Information Services (IIS) used to use Winsock2 directly. The move to the HTTP.sys model was driven by several important factors. First, multiple HTTP applications running on the same system often needed to share a single TCP port (e.g. 80). Implementation of this sharing by keeping a clean and secure isolation between multiple HTTP application instances was not straight-forward via Winsock2 in user-mode. HTTP.sys has brought a robust solution to this problem by taking on the responsibility of managing multiple HTTP connections in kernel over a single WSK socket. This allowed applications like IIS to support multiple 3&lt;SUP&gt;rd&lt;/SUP&gt; party plug-ins running in user-mode, in isolation, and with least-privilege in order to achieve better system stability and security. Second, HTTP.sys has a kernel-mode cache implementation that allows it to satisfy incoming HTTP requests directly in the kernel without making a user-mode transition. A kernel-mode cache for HTTP.sys makes sense due to the static nature of HTTP content. The full benefit of this cache is made possible by receiving and sending data over a WSK socket in kernel directly. This boosts the overall performance. However, note that this performance factor alone can not be the sole reason for implementing an HTTP stack in kernel without the former factor. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Verdana size=2&gt;I hope what was stated so far above gives you a pretty good idea about when to use WSK. As for &lt;I style="mso-bidi-font-style: normal"&gt;how&lt;/I&gt; to use WSK in the best possible way, we will address that topic in the WSK session in WinHEC 2006. We hope to see all of you there!&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Verdana size=2&gt;-Osman N. Ertugay&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=588861" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/wndp/archive/tags/Http.sys/default.aspx">Http.sys</category><category domain="http://blogs.msdn.com/wndp/archive/tags/WinHEC/default.aspx">WinHEC</category><category domain="http://blogs.msdn.com/wndp/archive/tags/networking/default.aspx">networking</category><category domain="http://blogs.msdn.com/wndp/archive/tags/WSK/default.aspx">WSK</category></item></channel></rss>