As you remember, the transport layer function is to determine the destination application using the port number, and to make error detection and correction, and data segmentation and reassembling.
There are two main protocols that are used in the transport layer, they are the ‘TCP’ and the ‘UDP’.
The difference between the two protocols is summarized in table (8.1).
Table 8.1: the difference between the TCP and the UDP
To understand the terminologies stated in table (8.1) let us study the following,
Suppose that we have two computers, a source, and a destination.
Connection oriented, the source establishes a session with the destination before sending any data.
Acknowledgement, the source waits for the destination acknowledgement about receiving the sent segments before sending the new segments.
Sequencing, the source gives a sequence number for every segment it sends, in order to be correctly reassembled at the destination.
Flow control, the destination can control the flow of the data that comes from the source.
Because the TCP can use the above-mentioned characteristics, it is a reliable protocol.
Because the UDP can’t use the above mentioned characteristics, it is an unreliable protocol
TCP has high overhead, this means that its header size is big. Therefore, it consumes a lot from the network BW.
UDP has low overhead: this means that its header size is small. Therefore, it does not consume a lot from network BW.
As seen in the figures (8.1) and (8.2), we can see that the header of the TCP is larger than the header of the UDP.
Figure 8.1: the TCP header
Figure 8.2: the UDP header
As you remember, the function of the application layer is that, it is an interface between the TCP/IP protocol stack and the programs and services.
Every protocol of the application layer protocols uses either TCP or UDP, and it uses a certain port number.
The following are examples of the protocols that are used in the application layer,
The telnet uses the TCP port 23. It is used to remotely access and control the network resources. It allows telnet client to access the resources of the telnet server.
SSH uses TCP port 22. It is the secured version of the telnet.
FTP uses TCP port 21. It is used to transfer files. (E.g. downloading any file from a web server)
TFTP uses UDP port 69. It is a stripped down version of the FTP. It is faster than the FTP, but it is not as reliable as FTP, this is because that it uses UDP.
The SMTP uses TCP port 25. It is used to send e-mails.
DNS uses TCP port 53, and UDP port 53. It resolves hostnames into IPs.
HTTP uses TCP port 80. It is used to browse the internet.
HTTPS uses TCP port 443. It is the secured version of the HTTP.