Download presentation
Presentation is loading. Please wait.
1
Windows sockets Iveta LenčiauskaitE
2
Definition Windows sockets (Winsock) is an application programming interface (API) that allows communication between Windows network software and network services, such as Transmission Control Protocol/Internet Protocol (TCP/IP).
3
It is written in C programming language and is designed for C/C++ programmers.
It's called Winsock because it's an adaptation for Windows of the Berkeley UNIX sockets interface. API was released in 1992 FActs
4
Communication diagram
5
Client/server scheme
6
WinSock2 is a newer version of Winsock mechanism
WinSock2 is a newer version of Winsock mechanism. It has a bunch of arrangements, solved issues, using descriptions and recommendations. 16bit programs are no longer supported in WinSock2. Winsock has a Layered Service Provider(LSP) tool. It is an expansion pack of „parental control“ such as internet content filtering, managing network traffic by priority (QoS method). Added functionality and supporting of other protocols, not just TCP/IP. Winsock2
7
Efficiency of windows socket application
Windows is capable of serving 200,000 TCP connections at a time. In the SPECWeb96 trial of Internet Information Server, Windows has served more than 25,000 HTTP requests per second. Windows has achieved a transfer rate of more than 750Mbps on an interconnected Gigabit network of 10 hops.
8
Windows socket efficiency
Network programs are initiated quickly without delay No need to wait until the network closes A fast user interface response is ensured Network errors are being verified The application determines its operating time. Reduced cost of protocols in terms of time and systems. Windows socket efficiency
9
Windows sockets programming
Windows Sockets is oriented towards C / C ++ programmers. Windows Sockets is oriented for Windows programming. WinSock opens up advanced network capabilities such as multicast and service monitoring (QoS). WinSock uses the WOSA (Windows Open System Architecture) model, i.e. defines a standard interface between APIs and protocols. The WinSock API is accessed through the ws2_32.lib library #include <winsock2.h>
10
Winsock functions Command Purpose WSAStartup()
Initiates use of WS2_32.DLL by a process getaddrinfo() Provides protocol-independent translation from an ANSI host name to an address. socket() Creates a socket that is bound to a specific service provider. bind() Associates a local address with a socket. listen() Places a socket a state where it is listening for an incoming connection. accept() Permits an incoming connection attempt on a socket. send() Sends data on a connected socket. closesocket() Closes an existing socket. WSACleanup() Terminates use of the Ws2_32.DLL.
11
Ports 7 - ping 13 - time 15 - netstat 22 - SSH 23 - Telnet
One of the most important aspects when programming sockets is porting. Some of the most commonly used dedicated ports are: Ports 7 - ping 13 - time 15 - netstat 22 - SSH 23 - Telnet 25 - SMTP ( Forwarding) 43 - Whois (Query information) 79 - Finger (Query server information) 80 - HTTP (web pages) 110- POP (receipt of ) 119 - NNTP 513 - CLOGIN (Used for IP spoofing)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.