Tag: Application Layer Protocols

DNS | SMTP Vs POP3 | HTTP Vs FTP

Application Layer Protocols-

 

Important application layer protocols are-

 

 

  1. Domain Name Service (DNS)
  2. Hyper Text Transfer Protocol (HTTP)
  3. Simple Mail Transfer Protocol (SMTP)
  4. Post Office Protocol (POP)
  5. File Transfer Protocol (FTP)

 

In this article, we will compare all these application layer protocols.

 

Comparison of Application Layer Protocols-

 

The following table compares all the important application layer protocols-

 

DNS HTTP SMTP POP FTP
Stateful / Stateless Stateless Stateless Stateless Stateful Stateful
Transport Protocol Used UDP TCP TCP TCP TCP
Connectionless / Connection Oriented Connectionless Connectionless Connection Oriented Connection Oriented Connection Oriented
Persistent / Non-persistent Non-persistent HTTP 1.0 is non-persistent.

HTTP 1.1 is persistent.

Persistent Persistent Control connection is persistent.

Data connection is non-persistent.

Port Number Used 53 80 25 110 20 for data connection.

21 for control connection.

In band / Out-of-band In band In band In band In band Out-of-band

 

Next Article- Cryptography and Network Security

 

Get more notes and other study material of Computer Networks.

Watch video lectures by visiting our YouTube channel LearnVidFun.

File Transfer Protocol | FTP Protocol

Application Layer Protocols-

 

Important application layer protocols are-

 

 

  1. Domain Name Service (DNS)
  2. Hyper Text Transfer Protocol (HTTP)
  3. Simple Mail Transfer Protocol (SMTP)
  4. Post Office Protocol (POP)
  5. File Transfer Protocol (FTP)

 

In this article, we will discuss about File Transfer Protocol (FTP).

 

File Transfer Protocol-

 

  • FTP is short for File Transfer Protocol.
  • It is an application layer protocol.

 

Purpose-

 

  • It is used for exchanging files over the internet.
  • It enables the users to upload and download the files from the internet.

 

Working-

 

FTP establishes two TCP connections between the client and the server.

  • One connection is used for transferring data.
  • Other connection is used for transferring control information.

 

 

Characteristics of FTP-

 

  • FTP uses TCP at the transport layer.
  • FTP uses port number 21 for control connection.
  • FTP uses port number 20 for data connection.
  • FTP uses persistent TCP connections for control connection.
  • FTP uses non-persistent connections for data connection.
  • FTP is a connection oriented protocol.
  • FTP is an out-of-band protocol as data and control information flow over different connections.
  • SMTP is a stateful protocol.

 

Important Notes-

 

Note-01:

 

Emails can’t be sent using FTP.

 

This is because-

  • FTP requires the connection establishment between the client and server before transferring the files.
  • So, both have to be online at the same time.
  • That is why, emails are not sent using FTP.

 

Note-02:

 

FTP can transfer one file at a time.

 

  • FTP is used for transferring one file at a time in either direction between the client and the server.

 

Note-03:

 

FTP is a stateful protocol.

 

This is because-

  • The client establishes control connection for the duration of an FTP session.
  • It typically spans multiple data transfers.
  • So, FTP is a stateful protocol.

 

To gain better understanding about File Transfer Protocol,

Watch this Video Lecture

 

Next Article- Comparison of Application Layer Protocols

 

Get more notes and other study material of Computer Networks.

Watch video lectures by visiting our YouTube channel LearnVidFun.

POP Protocol | IMAP Protocol | POP Vs IMAP

Application Layer Protocols-

 

Important application layer protocols are-

 

 

  1. Domain Name Service (DNS)
  2. Hyper Text Transfer Protocol (HTTP)
  3. Simple Mail Transfer Protocol (SMTP)
  4. Post Office Protocol (POP)
  5. File Transfer Protocol (FTP)

 

In this article, we will discuss about Post Office Protocol (POP).

 

Post Office Protocol-

 

  • POP is short for Post Office Protocol.
  • It is an application layer protocol.

 

Purpose-

 

  • It is a message access protocol.
  • It enables the clients to receive or download the emails from their remote mail server.
  • POP version 3 (POP3) is the most popularly used version.

 

Working-

 

To retrieve a message from the mail server-

  • Client establishes a TCP connection using port 110.
  • Client identifies itself to the server.
  • Client issues a series of POP3 commands.

 

 

Characteristics of POP-

 

  • POP is a pull protocol.
  • POP uses TCP at the transport layer.
  • POP uses port number 110.
  • POP uses persistent TCP connections.
  • POP is a connection oriented protocol.
  • POP is an in-band protocol.
  • POP is a stateful protocol until the mail is downloaded as well as stateless across sessions.

 

Internet Message Access Protocol-

 

  • IMAP is short for Internet Message Access Protocol.
  • It is an application layer protocol.
  • It also enables the clients to receive or download the emails from their remote mail server.

 

POP has been largely superseded by Internet Message Access Protocol (IMAP).

 

Characteristics of IMAP-

 

  • IMAP is a pull protocol.
  • IMAP uses TCP at the transport layer.
  • IMAP uses port number 143.
  • IMAP uses persistent TCP connections.
  • IMAP is a connection oriented protocol.
  • IMAP is an in-band protocol.
  • IMAP is a stateful protocol.
  • IMAP distributes mail boxes across multiple servers.

 

POP Vs IMAP-

 

The following table lists the differences between POP and IMAP-

 

Post Office Protocol Internet Message Access Protocol
POP allows you to read the mail only after downloading it. IMAP allows you to check the mail content before downloading.

So, with IMAP you can choose to download your messages or just delete them.

The email message is downloaded to the local computer and the copy at the server is deleted. The email message is stored on the mail server itself.
The user can not organize mails in the mail box of the mail server. The user can organize mails on the server.
Mails can only be accessed from a single device. Mails can be accessed from multiple devices which is the biggest advantage.
In POP, the mail server and client’s mail account are not synced.

So, changes made in the client’s mail account are not visible on the web mail inbox.

 

Example-

 

If you are using POP and marks a mail as read, it does not get marked as read in the web mail inbox because the mails are downloaded to the computer and so the changes won’t be visible on the server.

In IMAP, the mail server and the client’s mail account are synced.

So, changes made in the client’s mail account are instantly visible on the web mail inbox.

 

Example-

 

If you are using IMAP and marks a mail as read, it gets marked as read in the web mail inbox too because the changes are taking place on the server.

POP is a stateful protocol until the mail is downloaded as well as stateless across sessions. IMAP is a stateful protocol because the IMAP server has to maintain a folder hierarchy for each of its users.
POP is a better choice for those who hardly checks their mail on any other computer. IMAP is a better choice for those who frequently check their mails on other computers.

 

To gain better understanding about POP Protocol and IMAP Protocol,

Watch this Video Lecture

 

Next Article- File Transfer Protocol | FTP

 

Get more notes and other study material of Computer Networks.

Watch video lectures by visiting our YouTube channel LearnVidFun.

Simple Mail Transfer Protocol | SMTP Protocol

Application Layer Protocols-

 

Important application layer protocols are-

 

 

  1. Domain Name Service (DNS)
  2. Hyper Text Transfer Protocol (HTTP)
  3. Simple Mail Transfer Protocol (SMTP)
  4. Post Office Protocol (POP)
  5. File Transfer Protocol (FTP)

 

In this article, we will discuss about Simple Mail Transfer Protocol (SMTP).

 

Simple Mail Transfer Protocol-

 

  • SMTP is short for Simple Mail Transfer Protocol.
  • It is an application layer protocol.
  • It is used for sending the emails efficiently and reliably over the internet.

 

Working-

 

  • SMTP server is always on a listening mode.
  • Client initiates a TCP connection with the SMTP server.
  • SMTP server listens for a connection and initiates a connection on that port.
  • The connection is established.
  • Client informs the SMTP server that it would like to send a mail.
  • Assuming the server is OK, client sends the mail to its mail server.
  • Client’s mail server use DNS to get the IP Address of receiver’s mail server.
  • Then, SMTP transfers the mail from sender’s mail server to the receiver’s mail server.

 

 

While sending the mail, SMTP is used two times-

  1. Between the sender and the sender’s mail server
  2. Between the sender’s mail server and the receiver’s mail server

 

NOTE-

 

To receive or download the email,

  • Another protocol is needed between the receiver’s mail server and the receiver.
  • The most commonly used protocols are POP3 and IMAP.

 

Characteristics of SMTP-

 

  • SMTP is a push protocol.
  • SMTP uses TCP at the transport layer.
  • SMTP uses port number 25.
  • SMTP uses persistent TCP connections, so it can send multiple emails at once.
  • SMTP is a connection oriented protocol.
  • SMTP is an in-band protocol.
  • SMTP is a stateless protocol.

 

Important Points-

 

Note-01:

 

SMTP is a pure text based protocol.

 

  • SMTP can only handle the messages containing 7 bit ASCII text.
  • SMTP can not transfer other types of data like images, video, audio etc.
  • SMTP can not transfer executable files and binary objects.
  • SMTP can not transfer the text data of other languages like French, Japanese, Chinese etc.

(since they are represented in 8 bit codes)

 

Note-02:

 

MIME extends the limited capabilities of email.

 

As the name suggests,

  • Multipurpose Internet Email Extension (MIME) is an extension to the internet email protocol.
  • It extends the limited capabilities of email by enabling the users to send and receive graphics, audio files, video files etc in the message.
  • MIME was specially designed for SMTP.

 

Note-03:

 

SMTP is a stateless protocol.

 

This is because-

  • It does not maintain the state of its clients.
  • If an email is asked to be sent twice, then SMTP server resends it without saying that the email has already been sent.

 

Note-04:

 

We can not use SMTP at the receiver’s side.

 

This is because-

  • SMTP is a push protocol.
  • At receiver’s side, a pull protocol like POP3, IMAP is needed.
  • Receiver periodically checks if he has any mail from his mail server.

 

Note-05:

 

Sender and receiver can not run SMTP between their machines.

 

This is because-

  • Machines can not always be ON.
  • So, the functionality has been divided between the client and the mail server.
  • The mail server receives the mail on behalf of its client and manages the mail box of the client.

 

Note-06:

 

SMTP is not suitable for client authentication.

 

This is because-

  • SMTP does not require authentication.
  • It allows anyone on the Internet to send emails to anyone or even to a large group of people.
  • SMTP Auth short for SMTP Authentication has been provided for authentication.

 

To gain better understanding about SMTP Protocol,

Watch this Video Lecture

 

Next Article- Post Office Protocol | POP

 

Get more notes and other study material of Computer Networks.

Watch video lectures by visiting our YouTube channel LearnVidFun.

HyperText Transfer Protocol | HTTP Tutorial

Application Layer Protocols-

 

Important application layer protocols are-

 

 

  1. Domain Name Service (DNS)
  2. Hyper Text Transfer Protocol (HTTP)
  3. Simple Mail Transfer Protocol (SMTP)
  4. Post Office Protocol (POP)
  5. File Transfer Protocol (FTP)

 

In this article, we will discuss about Hyper Text Transfer Protocol (HTTP).

 

Hyper Text Transfer Protocol-

 

  • HTTP is short for Hyper Text Transfer Protocol.
  • It is an application layer protocol.

 

Purpose-

 

  • It is mainly used for the retrieval of data from websites throughout the internet.
  • It works on the top of TCP/IP suite of protocols.

 

Working-

 

HTTP uses a client-server model where-

  • Web browser is the client.
  • Client communicates with the web server hosting the website.

 

 

Whenever a client requests some information (say clicks on a hyperlink) to the website server.

The browser sends a request message to the HTTP server for the requested objects.

 

Then-

  • HTTP opens a connection between the client and server through TCP.
  • HTTP sends a request to the server which collects the requested data.
  • HTTP sends the response with the objects back to the client.
  • HTTP closes the connection.

 

HTTP Connections-

 

HTTP connections can be of two types-

  1. Non-persistent HTTP connection
  2. Persistent HTTP connection

 

 

Non-persistent HTTP connection Persistent HTTP connection
Non-persistent HTTP connection is one that is used for serving exactly one request and sending one response. Persistent HTTP connection is one that can be used for serving multiple requests.
HTTP server closes the TCP connection automatically after sending a HTTP response. HTTP server closes the TCP connection only when it is not used for a certain configurable amount of time.
A new separate TCP connection is used for each object. A single TCP connection is used for sending multiple objects one after the other.
HTTP 1.0 supports non-persistent connections by default. HTTP 1.1 supports persistent connections by default.

Example-

 

Suppose a request has been made for a HTML page that contains 10 images (called objects).

Then,

With non-persistent connection, all the 11 objects (1 page + 10 images) will be sent one by one.

For getting each object, a new separate connection will be opened and used.

Example-

 

Suppose a request has been made for a HTML page that contains 10 images (called objects).

Then,

With persistent connection, all the 11 objects (1 page + 10 images) will be sent one after the other using a single TCP connection.

 

 

Important Notes-

 

Note-01:

 

HTTP uses TCP at the transport layer.

 

This is because-

  • Unlike UDP, it guarantees the delivery of data via a Three-way handshake.
  • It ensures the re transmission of lost packets.
  • HTTP does not have any inbuilt facility for providing reliability.
  • So, if HTTP uses UDP, then it will have to maintain or handle the session on its own.
  • For example- If a packet gets lost, then HTTP will have to re-transmit the packet.

 

Note-02:

 

It is important to know-

  • Any service which does not use TCP should have the inbuilt facility for providing reliability.

 

Note-03:

 

HTTP uses port number 80.

 

  • HTTP clients uses port 80 to send and receive requested web pages from a HTTP server.
  • Similarly, HTTP server responds to all the requests at port 80.

 

Note-04:

 

HTTP 1.0 is non-persistent and HTTP 1.1 is persistent.

 

  • Already discussed in the above table.
  • Persistent connections improve the performance by 20%.

 

Note-05:

 

HTTP 1.0 is a connectionless protocol.

 

This is because-

  • After serving the single HTTP request, the connection is closed and it is not used again.
  • So, HTTP 1.0 without connection keep alive is connectionless.

 

Note-06:

 

HTTP is an in-band protocol.

 

This is because-

  • HTTP passes the control data (commands) and main data over the same connection.
  • Both control data and main data are processed in the same way without any distinction.
  • No high priority is given to the control data (commands).

 

Note-07:

 

HTTP is a stateless protocol.

 

This is because-

  • HTTP server does not maintain any state.
  • It forgets about the client after sending the response.
  • It treats every new request independently.
  • HTTP closes the connection automatically after generating the response for each request.
  • This ensures that no client can engage connection with web server for a long time.

 

What If HTTP Is Stateful Protocol?

 

If HTTP is a stateful protocol, then-

  • It will give a chance to the browser window to engage the connection with the web server for a long time.
  • This may unnecessarily create a situation of reaching to maximum connections of a web server even though most of the connections are idle.

 

To gain better understanding about HTTP Protocol,

Watch this Video Lecture

 

Next Article- Simple Mail Transfer Protocol | SMTP

 

Get more notes and other study material of Computer Networks.

Watch video lectures by visiting our YouTube channel LearnVidFun.