Introduction
The goal of Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) is to pass information between end applications, for example, from a web client to a web server, mail client to a mail server, and so on. This is done by providing identification to end applications and forwarding packets between them. These identifications are called port numbers, and a port number with its IP address is called a socket. In the following diagram you can see what happens when you open a connection from your browser to a web server. The web server listens on port 80 and you will open a connection, for example, from port 1024.
So, the server is listening to requests on port 80 and will send responses to you on port 1024.

While TCP is a reliable, connection-oriented protocol, UDP does not support connectivity and reliability, but simply transfers datagrams between two end processes.
Tip
There is an additional layer-4 protocol, which is called SCTP (Stream Control Transmission Protocol...