A network socket is a communication endpoint provided by the operating system that lets a program exchange data with another program over a network. It is identified by an IP address and a port number and operates on top of a transport protocol such as TCP or UDP. The Berkeley sockets API, introduced in BSD Unix in 1983, became the de facto standard.
A program communicates by creating a socket, either connecting to a peer or listening for connections, and then reading from and writing to that socket. Almost all network communication, including web servers and browsers, API calls, and database connections, runs on sockets, and network isolation for containers and sandboxes is usually implemented by blocking socket creation or outbound connections.