Winsock
Encyclopedia
In computing
Computer
A computer is a programmable machine designed to sequentially and automatically carry out a sequence of arithmetic or logical operations. The particular sequence of operations can be changed readily, allowing the computer to solve more than one kind of problem...

, the Windows Sockets API (WSA), which was later shortened to Winsock, is a technical specification that defines how Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 network
Computer network
A computer network, often simply referred to as a network, is a collection of hardware components and computers interconnected by communication channels that allow sharing of resources and information....

 software
Computer software
Computer software, or just software, is a collection of computer programs and related data that provide the instructions for telling a computer what to do and how to do it....

 should access network service
Protocol stack
The protocol stack is an implementation of a computer networking protocol suite. The terms are often used interchangeably. Strictly speaking, the suite is the definition of the protocols, and the stack is the software implementation of them....

s, especially TCP/IP. It defines a standard interface between a Windows TCP/IP client application (such as an FTP client or a web browser
Web browser
A web browser is a software application for retrieving, presenting, and traversing information resources on the World Wide Web. An information resource is identified by a Uniform Resource Identifier and may be a web page, image, video, or other piece of content...

) and the underlying TCP/IP protocol stack
Protocol stack
The protocol stack is an implementation of a computer networking protocol suite. The terms are often used interchangeably. Strictly speaking, the suite is the definition of the protocols, and the stack is the software implementation of them....

. The nomenclature is based on the Berkeley sockets
Berkeley sockets
The Berkeley sockets application programming interface comprises a library for developing applications in the C programming language that perform inter-process communication, most commonly for communications across a computer network....

 API model used in BSD
Berkeley Software Distribution
Berkeley Software Distribution is a Unix operating system derivative developed and distributed by the Computer Systems Research Group of the University of California, Berkeley, from 1977 to 1995...

 for communications between programs. Initially, all the participating developers resisted the shortening of the name to Winsock for a long time, 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 DLL file was present on a system would provide full TCP/IP protocol support.

Background

Early Microsoft operating systems, both MS-DOS and Microsoft Windows, offered limited networking capability, chiefly based on NetBIOS
NetBIOS
NetBIOS is an acronym for Network Basic Input/Output System. It provides services related to the session layer of the OSI model allowing applications on separate computers to communicate over a local area network. As strictly an API, NetBIOS is not a networking protocol...

.

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
Sun Microsystems
Sun Microsystems, Inc. was a company that sold :computers, computer components, :computer software, and :information technology services. Sun was founded on February 24, 1982...

, Ungermann-Bass
Ungermann-Bass
Ungermann-Bass, also known as UB and UB Networks, was a computer networking company in the 1980s to 1990s. Located in Santa Clara, California, in Silicon Valley, UB was the first large networking company independent of any computer manufacturer. UB was founded by Ralph Ungermann and Charlie Bass...

, and Excelan
Excelan
Excelan was a computer networking company founded in 1982 by Kanwal Rekhi. Excelan was a manufacturer of smart Ethernet cards, until the company merged with, and was acquired by Novell in 1989. The company offered a line of Ethernet "front end processor" boards for Multibus, VMEbus, Q-Bus, Unibus,...

, introduced TCP/IP products for MS-DOS, often as part of a hardware/software bundle.

When Microsoft Windows 2.0 was released, these vendors were joined by others such as Distinct and NetManage
NetManage
NetManage Inc. was a software company based in Cupertino, California, founded in 1990 by Zvi Alon, an Israeli engineer . The company’s development centre was located at the MATAM technology park, in Haifa, Israel...

 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 in to a single vendor and it became clear that some standardization was needed.

The Windows Sockets API was proposed by Martin Hall of JSB Software (later Stardust Technologies) in a BoF (Birds of a Feather
Birds of a Feather (computing)
In computing, BoF can refer to:* An informal discussion group. Unlike special interest groups or working groups, BoFs are informal and often formed in an ad-hoc manner...

) discussion on the CompuServe
CompuServe
CompuServe was the first major commercial online service in the United States. It dominated the field during the 1980s and remained a major player through the mid-1990s, when it was sidelined by the rise of services such as AOL with monthly subscriptions rather than hourly rates...

 BBS
Bulletin board system
A Bulletin Board System, or BBS, is a computer system running software that allows users to connect and log in to the system using a terminal program. Once logged in, a user can perform functions such as uploading and downloading software and data, reading news and bulletins, and exchanging...

 network in October 1991. The first edition of the specification was authored by Martin Hall, Mark Towfiq of Microdyne (later Sun Microsystems
Sun Microsystems
Sun Microsystems, Inc. was a company that sold :computers, computer components, :computer software, and :information technology services. Sun was founded on February 24, 1982...

), Geoff Arnold of Sun Microsystems
Sun Microsystems
Sun Microsystems, Inc. was a company that sold :computers, computer components, :computer software, and :information technology services. Sun was founded on February 24, 1982...

, and Henry Sanders and J Allard
J Allard
J Allard was "Chief Experience Officer" and Chief Technology Officer for the Entertainment and Devices Division at Microsoft...

 of Microsoft
Microsoft
Microsoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...

, 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 five authors as (unaffiliated) individuals.

Technology

The Windows Sockets API specification defines two interfaces: the API
Application programming interface
An application programming interface is a source code based specification intended to be used as an interface by software components to communicate with each other...

 used by application
Application software
Application software, also known as an application or an "app", is computer software designed to help the user to perform specific tasks. Examples include enterprise software, accounting software, office suites, graphics software and media players. Many application programs deal principally with...

 developers, and the SPI
Service provider interface
Service Provider Interface is a software mechanism to support replaceable components.It is the implementer-side equivalent of an API; a set of hooks that can or must be overridden....

, 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
Service provider interface
Service Provider Interface is a software mechanism to support replaceable components.It is the implementer-side equivalent of an API; a set of hooks that can or must be overridden....

 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 Windows Sockets was first released, as 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
IPX/SPX
IPX/SPX stands for Internetwork Packet Exchange/Sequenced Packet Exchange. IPX and SPX are networking protocols used primarily on networks using the Novell NetWare operating systems.-Protocol Layers:...

, but no commercial application is known to exist which utilises this transport, since the protocol was all but obsolete already at the time WSA 2.0 shipped. Microsoft
Microsoft
Microsoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...

 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 BSD sockets
Berkeley sockets
The Berkeley sockets application programming interface comprises a library for developing applications in the C programming language that perform inter-process communication, most commonly for communications across a computer network....

, but provides additional functionality to allow the API to comply with the standard Windows programming model. The Windows Sockets API covered almost all the features of the BSD sockets
Berkeley sockets
The Berkeley sockets application programming interface comprises a library for developing applications in the C programming language that perform inter-process communication, most commonly for communications across a computer network....

 API, but there were some unavoidable obstacles which mostly arose out of fundamental differences between Windows and Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

 (though to be fair Windows Sockets differed less from BSD sockets
Berkeley sockets
The Berkeley sockets application programming interface comprises a library for developing applications in the C programming language that perform inter-process communication, most commonly for communications across a computer network....

 than the latter did from STREAMS
STREAMS
In computer networking, STREAMS is the native framework in Unix System V for implementing character devices.STREAMS was designed as a modular architecture for implementing full-duplex I/O between kernel or user space processes and device drivers. Its most frequent uses have been in developing...

). All function calls in the API begin with the moniker WSA, e.g. 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
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

 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
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

 applications were able to use the same errno variable
Error code
In computer programming, error codes are enumerated messages that correspond to faults in a specific software application. They are typically used to identify faulty hardware, software, or incorrect user input in programming languages that lack exception handling, although they are sometimes also...

 to record both networking errors and errors detected within standard C library
C standard library
The C Standard Library is the standard library for the programming language C, as specified in the ANSI C standard.. It was developed at the same time as the C POSIX library, which is basically a superset of it...

 functions. Since this was not possible in Windows, Windows Sockets introduced a dedicated function, 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
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

, such as pseudo terminal
Pseudo terminal
In some operating systems, including Unix, a pseudo terminal is a pseudo-device pair that provides a text terminal interface without an associated device, such as a virtual console, computer terminal or serial port...

s and the fork system call
Fork (operating system)
In computing, when a process forks, it creates a copy of itself. More generally, a fork in a multithreading environment means that a thread of execution is duplicated, creating a child thread from the parent thread....

, 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 DEC
Digital Equipment Corporation
Digital Equipment Corporation was a major American company in the computer industry and a leading vendor of computer systems, software and peripherals from the 1960s to the 1990s...

 included DECNet
DECnet
DECnet is a suite of network protocols created by Digital Equipment Corporation, originally released in 1975 in order to connect two PDP-11 minicomputers. It evolved into one of the first peer-to-peer network architectures, thus transforming DEC into a networking powerhouse in the 1980s...

 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 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
    Multicast
    In computer networking, multicast is the delivery of a message or information to a group of destination computers simultaneously in a single transmission from the source creating copies automatically in other network elements, such as routers, only when the topology of the network requires...

    ing, and quality of service
    Quality of service
    The quality of service refers to several related aspects of telephony and computer networks that allow the transport of traffic with special requirements...

    . It also formalized support for multiple protocols, including IPX/SPX
    IPX/SPX
    IPX/SPX stands for Internetwork Packet Exchange/Sequenced Packet Exchange. IPX and SPX are networking protocols used primarily on networks using the Novell NetWare operating systems.-Protocol Layers:...

     and DECnet
    DECnet
    DECnet is a suite of network protocols created by Digital Equipment Corporation, originally released in 1975 in order to connect two PDP-11 minicomputers. It evolved into one of the first peer-to-peer network architectures, thus transforming DEC into a networking powerhouse in the 1980s...

    . 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
    Layered Service Provider
    Layered Service Provider is a feature of the Microsoft Windows Winsock 2 Service Provider Interface . A Layered Service Provider is a DLL that uses Winsock APIs to insert itself into the TCP/IP protocol stack. Once in the stack, a Layered Service Provider can intercept and modify inbound and...

    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
    IPv6
    Internet Protocol version 6 is a version of the Internet Protocol . It is designed to succeed the Internet Protocol version 4...

     Technical Preview for Windows 2000
    Windows 2000
    Windows 2000 is a line of operating systems produced by Microsoft for use on personal computers, business desktops, laptops, and servers. Windows 2000 was released to manufacturing on 15 December 1999 and launched to retail on 17 February 2000. It is the successor to Windows NT 4.0, and is the...

     (December 2000) saw the first implementation of RFC 2553 (March 1999, later obsoleted by RFC 3493), a protocol-independent API for name resolution, which would become part of Winsock in Windows XP
    Windows XP
    Windows XP is an operating system produced by Microsoft for use on personal computers, including home and business desktops, laptops and media centers. First released to computer manufacturers on August 24, 2001, it is the second most popular version of Windows, based on installed user base...

    .

Updates in Windows 8

Windows 8 includes the "RIO" (Registered IO) extensions for Winsock.
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.

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
    Windows NT
    Windows NT is a family of operating systems produced by Microsoft, the first version of which was released in July 1993. It was a powerful high-level-language-based, processor-independent, multiprocessing, multiuser operating system with features comparable to Unix. It was intended to complement...

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

  • Version 2.1 of Winsock was supplied in an add-on package for Windows 95. It was an integral component of Windows 98
    Windows 98
    Windows 98 is a graphical operating system by Microsoft. It is the second major release in the Windows 9x line of operating systems. It was released to manufacturing on 15 May 1998 and to retail on 25 June 1998. Windows 98 is the successor to Windows 95. Like its predecessor, it is a hybrid...

    , Windows NT 4.0
    Windows NT 4.0
    Windows NT 4.0 is a preemptive, graphical and business-oriented operating system designed to work with either uniprocessor or symmetric multi-processor computers. It was the next release of Microsoft's Windows NT line of operating systems and was released to manufacturing on 31 July 1996...

    , 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
    Layered Service Provider
    Layered Service Provider is a feature of the Microsoft Windows Winsock 2 Service Provider Interface . A Layered Service Provider is a DLL that uses Winsock APIs to insert itself into the TCP/IP protocol stack. Once in the stack, a Layered Service Provider can intercept and modify inbound and...

     (LSP). Winsock LSPs are available for a wide range of useful purposes, including Internet parental controls, web content filtering, QoS
    Quality of service
    The quality of service refers to several related aspects of telephony and computer networks that allow the transport of traffic with special requirements...

     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
    3Com
    3Com was a pioneering digital electronics manufacturer best known for its computer network infrastructure products. The company was co-founded in 1979 by Robert Metcalfe, Howard Charney, Bruce Borden, and Greg Shaw...

    , Beame & Whiteside, DEC, Distinct, FTP Software
    FTP Software
    FTP Software was a software company incorporated in 1986 by James van Bokkelen, John Romkey , Nancy Connor, Roxanne van Bokkelen , Dave Bridgham and several other founding shareholders. It was the first of many companies to name themselves after an Internet protocol...

    , Frontier, IBM
    IBM
    International Business Machines Corporation or IBM is an American multinational technology and consulting corporation headquartered in Armonk, New York, United States. IBM manufactures and sells computer hardware and software, and it offers infrastructure, hosting and consulting services in areas...

    , Microdyne, NetManage
    NetManage
    NetManage Inc. was a software company based in Cupertino, California, founded in 1990 by Zvi Alon, an Israeli engineer . The company’s development centre was located at the MATAM technology park, in Haifa, Israel...

    , Novell
    Novell
    Novell, Inc. is a multinational software and services company. It is a wholly owned subsidiary of The Attachmate Group. It specializes in network operating systems, such as Novell NetWare; systems management solutions, such as Novell ZENworks; and collaboration solutions, such as Novell Groupwise...

    , Sun Microsystems
    Sun Microsystems
    Sun Microsystems, Inc. was a company that sold :computers, computer components, :computer software, and :information technology services. Sun was founded on February 24, 1982...

     and Trumpet Software International.

  • Trumpet Winsock was one of the few Winsock 1.0 implementations that could be installed under Windows 3.0
    Windows 3.0
    Windows 3.0, a graphical environment, is the third major release of Microsoft Windows, and was released on 22 May 1990. It became the first widely successful version of Windows and a rival to Apple Macintosh and the Commodore Amiga on the GUI front...

    , which had no built-in support for Winsock. Trumpet was also the most popular shareware
    Shareware
    The term shareware is a proprietary software that is provided to users without payment on a trial basis and is often limited by any combination of functionality, availability, or convenience. Shareware is often offered as a download from an Internet website or as a compact disc included with a...

     implementation of Winsock for Windows 3.x. Trumpet Winsock 5.0 is available for Windows 95
    Windows 95
    Windows 95 is a consumer-oriented graphical user interface-based operating system. It was released on August 24, 1995 by Microsoft, and was a significant progression from the company's previous Windows products...

    /98
    Windows 98
    Windows 98 is a graphical operating system by Microsoft. It is the second major release in the Windows 9x line of operating systems. It was released to manufacturing on 15 May 1998 and to retail on 25 June 1998. Windows 98 is the successor to Windows 95. Like its predecessor, it is a hybrid...

     and Windows NT
    Windows NT
    Windows NT is a family of operating systems produced by Microsoft, the first version of which was released in July 1993. It was a powerful high-level-language-based, processor-independent, multiprocessing, multiuser operating system with features comparable to Unix. It was intended to complement...

     and includes a Winsock 1.1 compliant IPv6 stack for these operating systems.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK