Unit 5 Application Layer in OSI Model
Unit 5 Application Layer in OSI Model
Types of Domain
There are various kinds of domain:
1. Generic domains: .com(commercial), .edu(educational),
.mil(military), .org(nonprofit organization), .net(similar to
commercial) all these are generic domains.
2. Country domain: .in (India) .us .uk
3. Inverse domain: if we want to know what is the domain name of
the website. Ip to domain name mapping. So DNS can provide
both the mapping for example to find the IP addresses of
geeksforgeeks.org then we have to type
Name-to-Address Resolution
The host requests the DNS name server to resolve the domain
name. And the name server returns the IP address corresponding to
that domain name to the host so that the host can future connect to
that IP address.
FTP Session
When an FTP session is started between a client and a server, the
client initiates a control TCP connection with the server side. The
client sends control information over this. When the server receives
this, it initiates a data connection to the client side. But the control
connection remains active throughout the user session. As we know
HTTP is stateless . But FTP needs to maintain a state about its user
throughout the session.
FTP Clients
FTP works on a client-server model. The FTP client is a program
that runs on the user’s computer to enable the user to talk to and get
files from remote computers. It is a set of commands that establishes
the connection between two hosts, helps to transfer the files, and
then closes the connection.
Simple Mail Transfer Protocol (SMTP)
Email is emerging as one of the most valuable services on the
internet today. Most internet systems use SMTP as a method to
transfer mail from one user to another. SMTP is a push protocol and
is used to send the mail whereas POP (post office
protocol) or IMAP (internet message access protocol) is used to
retrieve those emails at the receiver’s side
SMTP is an application layer protocol. The client who wants to send
the mail opens a TCP connection to the SMTP server and then
sends the mail across the connection. The SMTP server is an
always-on listening mode. As soon as it listens for a TCP connection
from any client, the SMTP process initiates a connection through
port 25. After successfully establishing a TCP connection the client
process sends the mail instantly.
SMTP Protocol
The SMTP model is of two types:
End-to-End Method
Store-and-Forward Method
The end-to-end model is used to communicate between different
organizations whereas the store and forward method is used within
an organization. An SMTP client who wants to send the mail will
contact the destination’s host SMTP directly, to send the mail to the
destination. The SMTP server will keep the mail to itself until it is
successfully copied to the receiver’s SMTP.
The client SMTP is the one that initiates the session so let us call it
the client-SMTP and the server SMTP is the one that responds to
the session request so let us call it receiver-SMTP. The client-SMTP
will start the session and the receiver SMTP will respond to the
request.
Components of SMTP
Mail User Agent (MUA): It is a computer application that helps
you in sending and retrieving mail. It is responsible for creating
email messages for transfer to the mail transfer agent(MTA).
Mail Submission Agent (MSA): It is a computer program that
receives mail from a Mail User Agent(MUA) and interacts with the
Mail Transfer Agent(MTA) for the transfer of the mail.
Mail Transfer Agent (MTA): It is software that has the work to
transfer mail from one system to another with the help of SMTP.
Mail Delivery Agent (MDA): A mail Delivery agent or Local
Delivery Agent is basically a system that helps in the delivery of
mail to the local system.
Working of SMTP
Below mentioned are the steps of the working of SMTP [Simple Mail
Transfer Protocol].
Communication between the sender and the receiver: The
sender’s user agent prepares the message and sends it to the
MTA. The MTA’s responsibility is to transfer the mail across the
network to the receiver’s MTA. To send mail, a system must have
a client MTA, and to receive mail, a system must have a server
MTA.
Sending Emails: Mail is sent by a series of request and
response messages between the client and the server. The
message which is sent across consists of a header and a body. A
null line is used to terminate the mail header and everything after
the null line is considered the body of the message, which is a
sequence of ASCII characters. The message body contains the
actual information read by the receipt.
Receiving Emails: The user agent on the server-side checks the
mailboxes at a particular time of intervals. If any information is
received, it informs the user about the mail. When the user tries to
read the mail it displays a list of emails with a short description of
each mail in the mailbox. By selecting any of the mail users can
view its contents on the terminal.
Some SMTP Commands
HELO: Identifies the client to the server, fully qualified domain
name, only sent once per session
MAIL: Initiate a message transfer, the fully qualified domain of
the originator
RCPT: Follows MAIL, identifies an addressee, typically the fully
qualified name of the addressee, and for multiple addressees use
one RCPT for each addressee
DATA: Send data line by line
HTTP
HTTP stands for HyperText Transfer Protocol. Tim Berner invents
it. HyperText is the type of text that is specially coded with the help
of some standard coding language called HyperText Markup
Language (HTML). HTTP/2 is the new version of HTTP. HTTP/3 is
the latest version of HTTP, which is published in 2022.
The protocol used to transfer hypertext between two computers is
known as HyperText Transfer Protocol.
HTTP provides a standard between a web browser and a web server
to establish communication. It is a set of rules for transferring data
from one computer to another. Data such as text, images, and other
multimedia files are shared on the World Wide Web. Whenever a
web user opens their web browser, the user indirectly uses HTTP. It
is an application protocol that is used for distributed, collaborative,
hypermedia information systems.
First of all, whenever we want to open any website we first open a
web browser after that we will type the URL of that website (e.g.,
www.facebook.com ). This URL is now sent to the Domain Name
Server (DNS). Then DNS first checks records for this URL in their
database, and then DNS will return the IP address to the web
browser corresponding to this URL. Now the browser is able to send
requests to the actual server.
After the server sends data to the client, the connection will be
closed. If we want something else from the server we should have to
re-establish the connection between the client and the server.
HTTP request is simply termed as the information or data that is
needed by Internet browsers for loading a website. This is simply
known as HTTP Request.
There is some common information that is generally present in all
HTTP requests. These are mentioned below.
HTTP Version
URL
HTTP Method
HTTP Request Headers
HTTP Body
HTTP Request Headers
HTTP Request Headers generally store information in the form of
key-value and must be present in each HTTP Request. The use of
this Request Header is to provide core information about the client’s
information, etc.
HTTP Request Body
HTTP Request Body simply contains the information that has to be
transferred. HTTP Request has the information or data to be sent to
these browsers.
HTTP Method
HTTP Methods are simply HTTP Verb. In spite of being present so
many HTTP Methods, the most common HTTP Methods are HTTP
GET and HTTP POST. These two are generally used in HTTP
cases. In HTTP GET, the information is received in the form of a
website.
For more, refer to the Difference Between HTTP GET and HTTP
POST.
What is HTTP Response?
HTTP Response is simply the answer to what a Server gets when
the request is raised. There are various things contained in HTTP
Response, some of them are listed below.
HTTP Status Code
HTTP Headers
HTTP Body
HTTP Response Headers
HTTP Response headers are simply like an HTTP Request where it
has that work to send some important files and data to the HTTP
Response Body.
HTTP Response Body
HTTP Responses are the responses that are received successfully
upon the request. Generally, it comes under the requests generated
by the web. In most cases, the request is to transfer the HTML data
into a webpage.
HTTP Status Codes are the 3-digit codes that tell the message or
simply tell us about the HTTP Request whether it has been
completed or not. There are simply 5 types of status codes.
Informational
Successful
Re-directional
Client-Error
Server-Error