Opentopia Directory Encyclopedia Tools

Winsock

Encyclopedia : W : WI : WIN : Winsock


Winsock 2 logo
Enlarge
Winsock 2 logo

In computing, Winsock (short for Windows Sockets) is a specification that defines how Windows network software should access network services, especially TCP/IP.

Background

Early Microsoft operating systems, both MS-DOS and Windows, offered limited networking capability, chiefly based on NetBIOS (a technology that Microsoft adopted from IBM). 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] effort initiated by FTP Software and led by Russ Nelson.

Winsock was proposed by Martin Hall of JSB Software (later Stardust Technologies) at the Interop in October 1991, during a "Birds of a Feather" session. 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 of Microsoft, with assistance from many others. 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 four authors as (unaffiliated) individuals.

Technology

The Winsock specification defines two interfaces: the API used by application developers, and the 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 conformant protocol implementation from any network software vendor. The SPI contract guarantees that a conforming protocol module may be added to Windows and will thereby be usable by an API-conformant application. Although these contracts were important when Winsock was first released, they are 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. Nor has there been significant interest in implementing protocols other than TCP/IP.

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).

However it was a design goal of Winsock 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, Winsock included a number of elements which were designed to facilitate porting. For example, Unix applications were able to use the same errno variable to record both networking errors and errors detected within standard C library functions. Since this was not possible in Windows, Winsock introduced a dedicated function, WSAGetLastError(), to retrieve error information. Such mechanisms were helpful, but application porting remained extremely complex. Many "traditional" TCP/IP applications had been implemented by using system features specific to Unix, such as pseudo terminals and the 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

Winsock 1.1 logo
Winsock 1.1 logo

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 DEC included DECNet support as well.

Implementations

Microsoft implementations

Other implementations

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.

See also

External links

 


From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.

Search Titles
0123456789
ABCDEFGHIJ
KLMNOPQRST
UVWXYZ?

E-mail this article to:

Personal Message: