Ports, briefly
A port number tells a server which program a connection is for: 443 for the web server, 22 for SSH, 3306 for MySQL. Ports 0 to 1023 are the well-known ports, assigned by IANA to standard services; 1024 to 49151 are registered ports; the rest are used for the client side of connections.
TCP and UDP have separate port numbers. DNS, for example, uses both TCP 53 and UDP 53.