8: Transport and Application Layers

8.1 Transport layer protocols (TCP and UDP)

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).

Image1734.JPGTable 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.

Image1743.JPG 

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.

Image1750.JPGFigure 8.1: the TCP header

9902.jpgFigure 8.2: the UDP header

8.2 Application layer protocols

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,

Telnet:

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:

SSH uses TCP port 22. It is the secured version of the telnet.

FTP (File Transfer Protocol):

FTP uses TCP port 21. It is used to transfer files. (E.g. downloading any file from a web server)

TFTP (Trivial FTP):

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.

SMTP (Simple Mail Transfer Protocol):

The SMTP uses TCP port 25. It is used to send e-mails.

DNS (Domain Name System):

DNS uses TCP port 53, and UDP port 53. It resolves hostnames into IPs.

HTTP (Hypertext Transfer Protocol):

HTTP uses TCP port 80. It is used to browse the internet.

HTTPS (HTTP Secure):

HTTPS uses TCP port 443. It is the secured version of the HTTP.