Most real-life applications are built on top of the UDP and TCP transport protocols. UDP, which stands for User Datagram Protocol, provides the capability of delivering individual messages from one computer to another. However, these messages might be lost or can arrive out of order.
Why would someone want to use such a protocol? One example application might be video streaming, in which we don't care that much if a packet was lost, and if the video has kept playing, we're not going to go back and show an old frame which has arrived late. While UDP has its place for some speci?c applications, by far the most used transport protocol is TCP (Transmission Control Protocol). TCP provides a connection with reliable, in-order delivery of a
stream of bytes, so the application programmer doesn't have to worry very much about dropped packets, packets which arrive out of order, or the details of network message boundaries. Notice that maybe the most important feature provided by transport protocols is the possibility of performing process-to-process communication. This capability means that not only can we send messages from one machine to another, but from a speci?c process in the origin machine to a speci?c process in the destination machine. In addition to the IP addresses, we also use the port numbers, which are endpoint sub-addresses, visible to the application layer. If we think of IP addresses as analogous to "building numbers", we can interpret ports as analogous to "apartment numbers".