Connected: An Internet Encyclopedia
Sockets and Ports

Up: Connected: An Internet Encyclopedia
Up: Programmed Instruction Course
Up: Section 4 - The TCP Protocol
Prev: Sliding Window
Next: TCP Operation

Sockets and Ports

Sockets and Ports TCP multiplexes multiple connections to a single Internet host using sockets and ports.


A socket is a network communications endpoint. The analogy is to a wire (the network data connection) being plugged into a socket.

Sockets come in two primary flavors. An active socket is connected to a remote active socket via an open data connection. Closing the connection destroys the active sockets at each endpoint. A passive socket is not connected, but rather awaits an incoming connection, which will spawn a new active socket.

A socket is not a port, though there is a close relationship between them. A socket is associated with a port, though this is a many-to-one relationship. Each port can have a single passive socket, awaiting incoming connections, and multiple active sockets, each corresponding to an open connection on the port.


Next: TCP Operation

Connected: An Internet Encyclopedia
Sockets and Ports