Lecture_2_Appliction_Layer-1
Lecture_2_Appliction_Layer-1
•HTTP (Hypertext Transfer Protocol) is used across the world wide web (www)
for data transfer and is one of the most used application protocols.
•HTTP specifies a request/response protocol. When a client, typically a web
browser, sends a request message to a server, the HTTP protocol defines the
message types the client uses to request the web page and the message types
the server uses to respond
• The three common message types are:
■ GET
■ POST
■ PUT
Application Layer Protocol: HTTP (c o n
t .)
GET: It is a client request for data. A web browser sends the GET message to
request pages from a web server. As shown in Figure, when the server receives the
GET request, it responds with a status line, such as HTTP/1.1 200 OK, and a
message of its own, the body of which can be the requested file, an error
message, or some other information.
Application Layer Protocol: HTTP (c o n
t .)
• POST and PUT are used to send messages that upload data to the web server.
• For example, when the user enters data into a form embedded in a web page,
POST includes
the data in the message sent to the server.
• PUT uploads resources or content to the web server.
Application Layer Protocol: HTTP
runs on TC P
The transfer protocol used throughout the World Wide Web is HTTP (Hyper
Text Transfer Protocol). TCP provides a reliable data transfer service to HTTP,
using TCP port 80. This implies that each HTTP request message emitted by a
client process eventually arrives in tact at the server; similarly, each HTTP
response message emitted by the server process eventually arrives in tact at
the client. HTTP need not worry about lost data, or the details of how TCP
recovers from loss or reordering of data within the network. That is the job of
TCP and the protocols in the lower layers of the protocol stack
Application Layer Protocol: D N S
1. Root name servers: A root server contains information about the root and top-level
domains, When a local name server cannot immediately satisfy a query from a host
(because it does not have a record for the hostname being requested), the local name
server behaves as a DNS client and queries one of the root name servers.
where site is the site name authorized by the central authority, local is the
part of a name controlled by the site, and (".") is a delimiter used to separate
them.
adding a group subdivision to names already partitioned by site produces the
following name syntax:
local. group. site
Internet Domain Names (cont .)
Example: cs .purdue . edu
contains three labels: cs, purdue, and edu. Any suffix of a label in a domain name is also called a
domain. In the above example the lowest level domain is cs .purdue. edu, (the domain name for
the Computer Science Department at Purdue University), the second level domain is purdue.
edu (the domain name for Purdue University), and the top-level domain is edu (the domain
name for educational institutions). As the example shows, domain names are written with
the local label first and the top domain last.
DNS: How it works?
Example: Hannah want to connect at www.fredsco.com
4. The example.com DNS repeats the name resolution request, now sending the
request to the DNS server at Fredsco (199.1.1.3).
5. The Fredsco DNS gets the request, and it knows the name and IP address. It
sends a reply to
the requesting host, namely, example.com's DNS server.
6.Finally, the example.com DNS server replies to Hannah, telling her that
www.fredsco.com resolves to IP address 199.1.1.2.
D N S: How it works? (cont.)
Different types of D N S queries
Fig: A query chain with iterative Fig: A query chain with recursive
queries. queries.
References