- The service's well-known port number is for establishing
a connection.
- The server gets another port number for communication of actual
requests and responses, and sends it to the client.
- The client and server exchange messages on this connection
using a well-defined communication protocol.
- For HTTP and other central internet services, the protocol is
documented by the Internet Engineering Task Force. E.g. for the
HTTP protocol.