Winsock
|
In computing, Winsock (also Windows Sockets) is a specification that defines how Windows network software should access network services, especially TCP/IP.
Contents |
Background
Early Microsoft operating systems, both MS-DOS and Windows, offered limited networking capability, chiefly based on NetBIOS (a technology that Microsoft adopted from Intel). In particular, Microsoft completely ignored the TCP/IP protocol stack. 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 Microsoft Windows was released, these vendors were joined by others such as Distinct and Netmanage in offering TCP/IP for Windows. Even Microsoft offered a limited-function product.
The drawback faced by all of these vendors was that each of them used their own API. Without a single standard programming model, it was difficult to persuade independent software developers to create networking applications, and end users were wary of getting locked in to a single vendor.
There had been a number of successful standardization efforts in the PC networking area over the years. The first of these was a program sponsored by the US Air Force to develop RFC1001/1002, a NetBIOS implementation running over TCP/IP. A second was the Crynwr packet driver (http://www.crynwr.com/) effort led by Russ Nelson (http://russnelson.com/).
Winsock was proposed by Martin Hall of JSB Software at the Interop in October 1991 during a "Birds of a Feather" session. The initial work was done by Martin Hall of JSB, Geoff Arnold of Sun Microsystems, Mark Towfiq of Microdyne and FTP Software, and Henry Sanders of Microsoft. David Treadwell of Microsoft joined the team for version 1.1 of the specification, published in January 1993.
Technology
Winsock provides a single API to which both application developers and network software vendors should conform. For any particular version of Microsoft Windows, Winsock defines a binary interface (ABI) that guarantees an application conforming to the Winsock API will function in concert with any similarly conformant protocol implementation released by any network software vendor. (Although this was important when Winsock was first released, it is now of only academic interest. Microsoft has shipped a high-quality TCP/IP stack with all recent versions of Windows, and there are no significant independent alternatives.)
Winsock is based on BSD sockets, but provides additional functionality to allow the API to comply with the standard Windows programming model.
The Winsock API covered almost all the features of the BSD sockets API, but there were some unavoidable obstacles which mostly arose out of fundamental differences between Windows and Unix (though to be fair Winsock differed less from BSD sockets than the latter did from STREAMS).
Firstly, Unix was able to use the same errno variable to record both networking errors and errors detected within standard C library functions, while Winsock had to use a dedicated function, WSAGetLastError(), to report problems. Secondly, many traditional TCP/IP applications were implemented by using system features specific to Unix, for example pseudo terminals and the fork system call. This made porting Unix networking software possible but often difficult.
Implementations
Windows Sockets has been supported by every version of Microsoft's operating system since Windows 3.0.
- Version 1.1 of Winsock was supplied with Windows 95 and Windows NT.
- Version 2 of Winsock was supplied as an add-on to Windows 95, and natively with Windows 98, Windows NT 4.0, and all subsequent Windows operating systems. It provided functions that allowed a greater number of supported protocols, asynchronous notification of network events, multicasting and quality of service functionality. In addition to TCP/IP, the specification includes IPX/SPX and DEC's DECNet (DEC offers an implementation of the aforementioned protocol).
Among the vendors offering Winsock-compliant TCP/IP stacks were (alphabetically) Beame & Whiteside, Distinct, FTP Software, Frontier, Microsoft, Novell, Inc., Sun Microsystems and Trumpet.
Source
Originally adapted from: Aboba, Bernard D., comp.protocols.tcp-ip.ibmpc, Frequently Asked Questions, 1993. Usenet: news:news.answers. Thanks to http://www.foldoc.org.
External Links
- The Windows Sockets API (http://msdn.microsoft.com/library/en-us/winsock/winsock/winsock_reference.asp)