Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Winsock
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Technical specification for how Windows software should behave over TCP/IP}} {{Distinguish|Windsock}} {{More citations needed|date=July 2010}} {{Use dmy dates|date=June 2020}} In [[computer|computing]], the '''Windows Sockets API''' ('''WSA'''), later shortened to '''Winsock''', is an [[application programming interface]] (API) that defines how [[Microsoft Windows|Windows]] network [[application software]] should access network services, especially [[TCP/IP]]. It defines a standard interface between a Windows TCP/IP client application (such as an [[FTP client]] or a [[web browser]]) and the underlying TCP/IP [[protocol stack]]. The nomenclature is based on the [[Berkeley sockets]] API used in [[Berkeley Software Distribution|BSD]] for communications between programs. ==Background== Early Microsoft operating systems, both MS-DOS and Microsoft Windows, offered limited networking capability, chiefly based on [[NetBIOS]]. In particular, Microsoft did not offer support for the TCP/IP protocol stack at that time. A number of university groups and commercial vendors, including the PC/IP group at [[MIT]], [[FTP Software]], [[Sun Microsystems]], [[Ungermann-Bass]], and [[Excelan]], introduced TCP/IP products for MS-DOS, often as part of a hardware/software bundle. When [[Windows 2.0]] was released, these vendors were joined by others such as Distinct and [[NetManage]] in offering TCP/IP for Windows. The drawback faced by all of these vendors was that each of them used their own API (Application Programming Interface). Without a single standard programming model, it was difficult to persuade independent software developers to create networking applications which would work with any vendor's underlying TCP/IP implementation. Add to this the fact that end users were wary of getting locked into a single vendor and it became clear that some standardization was needed. The Windows Sockets project had its origins in a Birds of a Feather session held at Interop '91 in San Jose on October 10, 1991.<ref>{{cite web |title=Winsock Version 1.0 Rev.A |url=https://www-user.tu-chemnitz.de/~heha/hsn/winsock.zip/WINSOCK.DOC?auto=TXT |access-date=8 October 2020}}</ref> It is based on socket specifications created by NetManage and which it put into public domain at this meeting. At the time the NetManage socket was the only 100% [[dynamic-link library|DLL]]-based, [[multi-threaded]] product for [[Windows 3.0]] available. The first edition of the specification was authored by Martin Hall, Mark Towfiq of Microdyne (later [[Sun Microsystems]]), Geoff Arnold of [[Sun Microsystems]], and Henry Sanders and [[J Allard]] of [[Microsoft]], with assistance from many others.{{citation needed|date=February 2017}} There was some discussion about how best to address the copyright, intellectual property, and potential anti-trust issues, and consideration was given to working through the [[IETF]] or establishing a non-profit foundation. In the end, it was decided that the specification would simply be copyrighted by the five authors as (unaffiliated) individuals. All the participating developers resisted the shortening of the name to simple Winsock for a long time,{{citation needed|date=February 2017}} since there was much confusion among users between the API and the DLL library file (winsock.dll) which only exposed the common WSA interfaces to applications above it. Users would commonly believe that only making sure the [[Dynamic Link Library|DLL]] file was present on a system would provide full TCP/IP protocol support.{{citation needed|date=February 2017}} ==Technology== The Windows Sockets API specification defines two interfaces: the [[Application programming interface|API]] used by [[application software|application]] developers, and the [[Service provider interface|SPI]], which provides a means for network software developers to add new protocol modules to the system. Each interface represents a contract. The API guarantees that a conforming application will function correctly with a conforming protocol implementation from any network software vendor. The [[Service Provider Interface|SPI]] contract guarantees that a conforming protocol module may be added to Windows and will thereby be usable by an API-compliant application. Although these contracts were important when Windows Sockets was first released, since network environments required multi-protocol support (see above) they are now of only academic interest. Included in the Windows Sockets API version 2.0 are functions to use [[IPX/SPX]], although the protocol was all but obsolete already at the time WSA 2.0 shipped. [[Microsoft]] has shipped the [[TCP/IP]] protocol stack with all recent versions of Windows, and there are no significant independent alternatives. Nor has there been significant interest in implementing protocols other than TCP/IP. Windows Sockets code and design are based on [[Berkeley sockets|BSD sockets]], but provides additional functionality to allow the API to comply with the regular Windows programming model. The Windows Sockets API covered almost all the features of the [[Berkeley sockets|BSD sockets]] API, but there were some unavoidable obstacles which mostly arose out of fundamental differences between Windows and [[Unix]] (though Windows Sockets differed less from [[Berkeley sockets|BSD sockets]] than the latter did from [[STREAMS]]). All function calls in the API begin with the [[moniker]] {{mono|WSA}}, e.g. {{mono|WSASend()}} for sending data on a connected socket. However it was a design goal of Windows Sockets that it should be relatively easy for developers to port socket-based applications from [[Unix]] to Windows. It was not considered sufficient to create an API which was only useful for newly written Windows programs. For this reason, Windows Sockets included a number of elements which were designed to facilitate porting. For example, [[Unix]] applications were able to use the same [[Error code|{{mono|errno}} variable]] to record both networking errors and errors detected within [[C standard library|standard C library]] functions. Since this was not possible in Windows, Windows Sockets introduced a dedicated function, {{mono|WSAGetLastError()}}, to retrieve error information. Such mechanisms were helpful, but application porting remained extremely complex. Many original [[TCP/IP]] applications had been implemented by using system features specific to [[Unix]], such as [[pseudo terminal]]s and the [[Fork (system call)|fork system call]], and reproducing such functionality in Windows was problematic. Within a relatively short time, porting gave way to the development of dedicated Windows applications. == Specifications == * Version 1.0 (June 1992) defined the basic operation of Winsock. It was kept very close to the existing interface of Berkeley sockets to simplify porting of existing applications. A few Windows-specific extensions were added, mainly for asynchronous operations with message-based notifications. : Although the document didn't limit support to TCP/IP, TCP and UDP were the only protocols explicitly mentioned. Most vendors only delivered TCP/IP support, although Winsock from [[Digital Equipment Corporation|DEC]] included [[DECNet]] support as well. * Version 1.1 (January 1993) made many minor corrections and clarifications of the specification. The most significant change was the inclusion of the {{mono|gethostname()}} function. * Winsock 2 was a [[backwards-compatible]] extension of Winsock 1.1. It added support for protocol-independent name resolution, asynchronous operations with event-based notifications and completion routines, layered protocol implementations, [[multicast]]ing, and [[quality of service]]. It also formalized support for multiple protocols, including [[IPX/SPX]] and [[DECnet]]. The new specification allowed sockets to be optionally shared between processes, incoming connection requests to be conditionally accepted, and certain operations to be performed on socket groups rather than individual sockets. Although the new specification differed substantially from Winsock 1, it provided source- and binary-level compatibility with the Winsock 1.1 API. One of the lesser known additions was the Service Provider Interface (SPI) API and [[Layered Service Provider]]s. * Versions 2.0.x (May 1994 onwards) had internal draft status, and were not announced as public standards. * Version 2.1.0 (January 1996) was the first public release of the Winsock 2 specification. * Version 2.2.0 (May 1996) included many minor corrections, clarifications, and usage recommendations. It was also the first version to remove support for 16-bit Windows applications. * Version 2.2.1 (May 1997) and Version 2.2.2 (August 1997) introduced minor functionality enhancements. Mechanisms were added for querying and receiving notification of changes in network and system configuration. * The [[IPv6]] Technical Preview for [[Windows 2000]] (December 2000) saw the first implementation of [[RFC:2553|RFC 2553]] (March 1999, later obsoleted by [[RFC:3493|RFC 3493]]), a protocol-independent API for name resolution, which would become part of Winsock in [[Windows XP]]. == Updates in Windows 8 == [[Windows 8]] includes the "RIO" (Registered IO) extensions for Winsock.<ref>{{cite web|url=http://channel9.msdn.com/Events/BUILD/BUILD2011/SAC-593T|title=New techniques to develop low-latency network apps|website=Channel 9}}</ref> These extensions are designed to reduce the overhead of the user to kernel mode transition for the network data path and the notification path, but use the rest of the regular Windows TCP and UDP stack (and uses existing network cards). The setup path (for example, the "connect" function) is unchanged from the regular Winsock path. == Implementations == === Microsoft implementations === * Microsoft did not supply an implementation of Winsock 1.0. * Version 1.1 of Winsock was supplied in an add-on package (called Wolverine) for Windows for Workgroups (code named '''Snowball'''). It was an integral component of Windows 95 and [[Windows NT]] from versions 3.5 and onwards (the initial commercially available version of Windows NT, version 3.1, included only a proprietary and quite incomplete implementation of TCP/IP based on the AT&T UNIX System V "STREAMS" API {{Citation needed|date=March 2011}}). * Version 2.1 of Winsock was supplied in an add-on package for Windows 95. It was an integral component of [[Windows 98]], [[Windows NT 4.0]], and all subsequent Windows releases. (Microsoft did not supply implementations of Winsock 2 for Windows 3.x or Windows NT 3.x.) * Recent versions of Winsock 2.x have been delivered with new Windows releases or as part of service packs. * Winsock 2 is extensible by a mechanism known as a [[Layered Service Provider]] (LSP). Winsock LSPs are available for a wide range of useful purposes, including Internet parental controls, web content filtering, [[Quality of service|QoS]] etc. The layering order of all providers is kept in the Winsock Catalog. In previous versions of Windows, removing a buggy LSP could result in corruption of the Winsock catalog in the registry, potentially resulting in a loss of ''all network connectivity''. Winsock in Windows XP Service Pack 2, Windows Server 2003 Service Pack 1 and all later Windows operating systems has the ability to self-heal after a user uninstalls such an LSP. ===Other implementations=== *Among the other vendors offering Winsock-compliant TCP/IP and UDP/IP stacks were (alphabetically) [[3Com]], Beame & Whiteside, DEC, Distinct, Frontier, [[FTP Software]], [[IBM]], Microdyne, [[NetManage]], [[Novell]], [[Sun Microsystems]] and Trumpet Software International. *[[Trumpet Winsock]] by Peter Tattam was one of the few Winsock 1.0 implementations that could be installed under [[Windows 3.0]], which had no built-in support for Winsock.<ref>{{cite web|url=https://www.theregister.co.uk/2013/04/26/mosaic_20_anniversary/|title=Mosaic turns 20: Let's fire up the old girl, show her the web today|website=theregister.co.uk}}</ref><ref>{{cite web|url=https://www.fastcompany.com/3053173/the-legacy-of-1995/what-it-was-like-to-build-a-website-in-1995|title=What It Was Like To Build A World Wide Web Site In 1995|date=18 November 2015|website=fastcompany.com}}</ref> Trumpet was also the most popular [[shareware]] implementation of Winsock for Windows 3.x. Trumpet Winsock 5.0 is available for [[Windows 95]]/[[Windows 98|98]] and [[Windows NT]] and includes a Winsock 1.1 compliant IPv6 stack for these operating systems.<ref>{{cite web|url=http://www.trumpet.com.au/index.php/downloads.html|title=Downloads|website=www.trumpet.com.au}}</ref> *The [[Wine (software)|Wine project]] contains a source and binary compatible reimplementation of Winsock on top of the [[Berkeley sockets|BSD sockets]] API. ==See also== *[[Berkeley sockets]] *[[Layered Service Provider]] (Winsock LSP) ==References== {{Reflist}} == External links == * [https://learn.microsoft.com/en-us/windows/win32/winsock/what-s-new-for-windows-sockets-2 MSDN - Windows Socket 2 What's New Reference] * [https://learn.microsoft.com/en-us/windows/win32/winsock/windows-sockets-start-page-2 MSDN - Windows Socket 2 Start page] * [http://www.faqs.org/faqs/windows/winsock-faq Sockets FAQ] - Windows Sockets FAQ * {{webarchive |url=https://web.archive.org/web/20160303165026id_/http://devmentor.org/articles/network/Socket%20Programming(v2).pdf |date=March 3, 2016 |title=Client / Server Programming with TCP/IP Sockets}} - Winsock C++ Programming * [http://msdn2.microsoft.com/en-us/library/ms740096.aspx Porting Berkeley Socket programs to Winsock] * [http://blogs.msdn.com/wndp/ Windows Network Development blog] β Microsoft developer blog covering Winsock, WSK, WinINet, Http.sys, WinHttp, QoS and System.Net, with a focus on features being introduced in [[Windows Vista]] * [http://www.microsoft.com/misc/features/features_flshbk.htm Brief History of Microsoft on the Web] * [http://www.sockets.com/ WinSock Development Information] * [http://tangentsoft.net/wskfaq/ Winsock Programmer's FAQ] {{Microsoft APIs}} {{Authority control}} [[Category:Network socket]] [[Category:History of the Internet]] [[Category:1992 software]] [[Category:Windows communication and services]] [[Category:Microsoft application programming interfaces]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Authority control
(
edit
)
Template:Citation needed
(
edit
)
Template:Cite web
(
edit
)
Template:Distinguish
(
edit
)
Template:Microsoft APIs
(
edit
)
Template:Mono
(
edit
)
Template:More citations needed
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Use dmy dates
(
edit
)
Template:Webarchive
(
edit
)