Overview

A network socket is an internal endpoint for sending or receiving data at a single node in a computer network. It is uniquely identified by the tuple: (Protocol, Local IP, Local Port, Remote IP, Remote Port).

How it Works

When an application wants to communicate over the network, it opens a socket. For example, a web server might 'listen' on a socket bound to IP 0.0.0.0 and port 80.

Types

  • Stream Sockets: Use TCP for reliable communication.
  • Datagram Sockets: Use UDP for fast, unreliable communication.

Related Terms