Concepts / Ports, sockets and UDP

Ports, sockets and UDP

Socket

Also called listening, ss -tln, 0.0.0.0, four-tuple

An address plus a port; a connection is named by both ends' sockets.

A connection is named by the sockets at both ends
A connection is named by the sockets at both ends

A socket is an address plus a port. Two connections to the same server port are still different connections, because the client's port differs: all four numbers together are the name.

A socket is one end of a network conversation: an IP address plus a port. A server listens on one: 0.0.0.0:80 is port 80 on every address, 127.0.0.1:8080 on loopback only. A connection is named by the sockets at both ends, four numbers: source address and port, destination address and port. ss -tln lists the listening TCP sockets.

See it on real machines

Read next

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab