Concepts / Ports, sockets and UDP

Ports, sockets and UDP

Port

Also called port number, well-known port

A 16-bit number that picks the program on a device: web 80 and 443, DNS 53, SSH 22.

The address finds the machine, the port finds the program
The address finds the machine, the port finds the program

One machine runs many programs, each listening on its own port number: 22 for SSH, 53 for DNS, 443 for HTTPS. The destination address gets the packet to the machine, and the destination port in the TCP or UDP header says which program gets it.

A port is a 16-bit number (0 to 65535) in the TCP or UDP header that names a program on a device. IP gets a packet to the device; the destination port gets it to the program. Servers listen on known ports, such as 443 for HTTPS, and clients use ephemeral ports picked by their kernel.

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