Socket is a communication endpoint used to exchange data and messages. Sockets are managed by the respective operating system and can exchange data between programs both within a computer system and across networks
. In the area of client-server architectures, sockets are the standard means by which servers distribute any services to a large number of clients. Communication
; for example, the client makes arequest for a website and receives an HTTP response
thatcontains status information as well as
.In the OSI model, sockets are located in the transport layer (layer 4), which is why they form the basis for the communication control layer
. A socket
isthe logical end point of a connection and is defined by the data structure, the port, the IP address and the transport protocol - TCP
isdefined in the Protocol
Control Block (PCB).A socket is the address combination of IP address and port number
withwhich a specific application on a specific computer can be addressed. The IP address is used to determine the network and the computer, and the port number is used to select the application.
originated at Bekeley, sockets are not dependent on the operating system. Well-known applications that use a socketinterface
are Telnet, HTTP, the File Transfer Protocol (FTP), and Sun's Network File System (NFS).