100% found this document useful (1 vote)
47 views

WWW HTTP DNS

The document discusses the HTTP protocol which is used to transfer data over the World Wide Web. It covers the basic request-response model used by HTTP as well as different connection types like non-persistent and persistent connections. Persistent connections allow for pipelining which can reduce the number of round trips needed to request multiple resources from a server. HTTP/1.1 introduced keep-alive connections and streams to further improve performance.

Uploaded by

Mohd Shifan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
47 views

WWW HTTP DNS

The document discusses the HTTP protocol which is used to transfer data over the World Wide Web. It covers the basic request-response model used by HTTP as well as different connection types like non-persistent and persistent connections. Persistent connections allow for pipelining which can reduce the number of round trips needed to request multiple resources from a server. HTTP/1.1 introduced keep-alive connections and streams to further improve performance.

Uploaded by

Mohd Shifan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

http://www.example.

com/dir1
 The World Wide Web (WWW, The Web) is
combination of all resources and users on the
Internet that are using the Hypertext Transfer
Protocol (HTTP).
 The World Wide Web is an information space where
documents and other web resources are identified
by Uniform Resource Locators (URLs), interlinked
by hypertext links, and can be accessed via
the Internet.
 Tim Berners-Lee invented the World Wide Web in
1989

Source: https://en.wikipedia.org/wiki/World_Wide_Web
 World Wide Web (WWW) use classical client / server
architecture
• Hyper Text Transfer Protocol is text-based
request-response protocol
Server running
Client running a Web Server
Web Browser Software (IIS,
Apache, etc.)
HTTP
Page request

HTTP
Server response
Internet->WWW

 The Web client and the Web server are application


programs
 Application layer programs do useful work like
retrieving Web pages, sending and receiving email or
transferring files
 Lower layers take care of the communication details
 The client and server send messages and data without
knowing anything about the communication network
 The most common transfer protocol used on the Internet
is the Hypertext Transfer Protocol (HTTP).

 HTTP (Hypertext Transfer Protocol) is the set of rules that


the computers use to move files from one computer to
another on the World Wide Web.

 The rules governing the conversation between a Web


client and a Web server

 HTTP is an application protocol that runs on top of


the TCP/IP suite of protocols

 HTTP versions : HTTP/1.0 (1996), HTTP/1.1(1997),


HTTP/2.0 (2015), HTTP/3.0 (HTTP over *QUIC, upcoming)
*QUIC is a transport layer network protocol developed initially
by Google
 The basic structure of HTTP communication
follows what is known as a request–response
model.
 Whenever we enter a URL in the address box
of the browser, the browser translates the
URL into a request message according to the
specified protocol and sends the request
message to the server.
 The server is then expected to generate a
response message.
 HTTP implementations send these messages
using TCP.
 Enter http://www.example.com in the Address bar
 When Enter key is pressed after typing this
address, the browser created a message
conforming to the HTTP protocol, used DNS to
obtain an IP address for www.example.com
 Created a TCP connection with the machine at the
IP address obtained,
 Sent the HTTP message over this TCP connection,
and received back a message containing the
information that is shown displayed in the client
area of the browser
 HTTP is “stateless protocol”, server maintains
no information about past client requests.

 HTTP connection types are:


1. Non-persistent HTTP
2. Persistent HTTP
 A non-persistent connection is closed after
the server sends the requested object to the
client.
 The connection is used exactly for one
request and one response.
 For downloading multiple objects it required
multiple connections.
 Non-persistent connections are the default
mode for HTTP/1.0.

https://www.geeksforgeeks.org/http-non-persistent-persistent-connection/
www.example.com/faculty/index.htm

1a. HTTP client initiates TCP connection to


HTTP server (process) at 1b. HTTP server at host
www.example.com on port 80 www.example.com waiting for TCP
connection at port 80. “accepts”
connection, notifying client
2. HTTP client sends HTTP request
message (containing URL) into TCP
3. HTTP server receives request
connection socket. Message
message, forms response message
indicates that client wants object containing requested object, and
faculty/index.htm sends message into its socket

4. HTTP server closes TCP connection.


5. HTTP client receives response message
containing html file, displays html. Parsing
html file, finds 5 referenced jpeg objects

6. Steps 1-5 repeated for each of 5


jpeg objects Time
 Server leaves the TCP connection open after
sending responses.
 Subsequent HTTP messages between same client
and server sent over the same open connection.
 The server closes the connection only when it is
not used for a certain configurable amount of
time.
 It requires as little as one round-trip time (RTT)
for all the referenced objects.
 With persistent connections, the performance is
improved by 20%.
 Persistent connections are the default mode for
HTTP/1.1.
/
https://www.geeksforgeeks.org/http-non-persistent-persistent-connection
 There are two versions of persistent
connections: without pipelining and with
pipelining.
 For the version without pipelining, the client
issues a new request only when the previous
response has been received
 In this case, each of the referenced objects
experiences one RTT in order to request and
receive the object.
 Although this is an improvement over non-
persistent's two RTTs, the RTT delay can be
further reduced with pipelining.

https://www.geeksforgeeks.org/http-non-persistent-persistent-connection/
 The default mode of HTTP/1.1 uses persistent
connections with pipelining.
 In this case, the HTTP client issues a request as
soon as it encounters a reference.
 Thus the HTTP client can make back-to-back
requests for the referenced objects. When the
server receives the requests, it can send the
objects back-to-back.
 If all the requests are sent back-to-back and all
the responses are sent back-to-back, then only
one RTT is expended for all the referenced
objects (rather than one RTT per referenced
object when pipelining isn't used).

https://www.geeksforgeeks.org/http-non-persistent-persistent-connection/
https://www.geeksforgeeks.org/http-non-persistent-persistent-connection/
 Four possible cases:
◦ Non-Persistent without Parallel connection
◦ Non-Persistent with Parallel connection
◦ Persistent without Pipeline
◦ Persistent with Pipeline

 2RTT is the initial required connection one for


TCP connection and one for HTML base file

Total time = 2RTT + transmit time

https://www.geeksforgeeks.org/http-non-persistent-persistent-connection/
Problem: Send one base HTML file with 10 reference objects. Find out
the RTT required in the following:
1. Non-Persistent without parallel connections
2. Non-Persistent with 5 parallel connections
3. Persistent connections without pipeline
4. Persistent connection with pipeline

1. Total Time = 2 RTT + 2 * (10 RTT) = 22 RTT

2. Total Time = 2 RTT + 2 * (10/5 RTT) = 6 RTT

3. Total Time = 2 RTT + 10 RTT = 12 RTT

4. Total Time = 2 RTT + 1RTT = 3 RTT

https://www.geeksforgeeks.org/http-non-persistent-persistent-connection/
Introducing the concept of “keep-alive” connections, that allow clients to reuse TCP
connections

Introduced the concept of HTTP “streams”: an abstraction that allows HTTP


implementations to concurrently multiplex different HTTP exchanges onto the
same TCP connection

Source : https://blog.cloudflare.com/http3-the-past-present-and-future/
Source : https://blog.cloudflare.com/http3-the-past-present-and-future/
 Two types:
1. Request Message
2. Response Message
 A request line to get a required resource, for
example a request GET /content/page1.html is
requesting a resource called
/content/page1.html from the server.
 Headers (Example – Accept-Language: EN).
 An empty line.
 A message body which is optional.

(Note:All the lines should end with a carriage return


and line feed. The empty line should only contains
carriage return and line feed without any spaces.)

https://www.webconfs.com/http-header-check.php
 Its in ASCII format which means in human-readable
format.
 HTTP request message consist three part:
1. Request line
2. Header line
3. Carriage return carriage return character
line-feed character
request line
(GET, POST, GET /index.html HTTP/1.1\r\n
HEAD commands) Host: www-example.com\r\n
User-Agent: Firefox/3.6.10\r\n
Accept: text/html,application/xhtml+xml\r\n
header
Accept-Language: en-us,en;q=0.5\r\n
lines Accept-Encoding: gzip,deflate\r\n
Accept-Charset: ISO-8859-1,utf-8;q=0.7\r\n
carriage return, Keep-Alive: 115\r\n
line feed at start Connection: keep-alive\r\n
\r\n
of line indicates
end of header lines
 The request line has three fields: Method field,
URL field, and HTTP version field.
 The method field can take on several different
values, including GET, POST, HEAD, PUT, and
DELETE.
 In above figure, the browser is requesting the
object /faculty/index.htm and version is self-
explanatory; in this example, the browser
implements version HTTP/1.1.
 The header line Host: www.example.com
specifies the host on which the object resides.
 HTTP Status Code (For example HTTP/1.1
301 Moved Permanently, means the
requested resource was permanently moved
and redirecting to some other resource).
 Headers (Example – Content-Type: html)
 An empty line.
 A message body which is optional.

(Note: All the lines in the server response should end with a
carriage return and line feed. Similar to request, the empty
line in a response also should only have carriage return and
line feed without any spaces.)
 HTTP response message consist of three part:
1. Status line
2. Header line
3. Data (Entity body)
status line
(protocol HTTP/1.1 200 OK\r\n
Date: Sun, 26 Sep 2018 20:09:20 GMT\r\n
status code Server: Apache/2.0.52 (CentOS)\r\n
status Last-Modified: Tue, 30 Oct 2018 17:00:02
phrase) GMT\r\n
header ETag: "17dc6-a5c-bf716880"\r\n
lines Accept-Ranges: bytes\r\n
Content-Length: 2652\r\n
Keep-Alive: timeout=10, max=100\r\n
Connection: Keep-Alive\r\n
Content-Type: text/html; charset=ISO-8859-
data, e.g., 1\r\n
requested \r\n
HTML file data data data data data ...
 The status line has three fields: protocol version field,
status code and corresponding status message.
 In above figure, the status line indicates that the server is
using HTTP/1.1 and that everything is OK.
 Date: header line indicates the time and date when the
HTTP response was created and sent by the server.
 Server: header line indicates that the message was
generated by an Apache Web server.
 Last-Modified: header line indicates the time and date
when the object was created or last modified.
 Content-Length: header line indicates the number of bytes
in the object being sent.
 Content-Type: header line indicates that the object in the
entity body is HTML text.
The HTTP status codes are developed as per
the Internet standards defined by Internet
Engineering Task Force (IETF). They are
classified into five different categories as
below:
 1xx series – Informational Message
 2xx – Success Message
 3xx – Redirection Message
 4xx – Error Messages Related to Client
 5xx – Error Messages Related to Server
 A status code appears in 1st line in server-to-
client response message.
 Some sample codes:
◦ 200 OK
 request succeeded
◦ 301 Moved Permanently
 requested object moved, new location specified later in this
message(Location)
◦ 400 Bad Request
 request message not understood by server
◦ 404 Not Found
 requested document not found on this server
◦ 505 HTTP Version Not Supported
 HTTP Status Code 200 - OK
 HTTP Status Code 301 - Permanent Redirect
 HTTP Status Code 302 - Temporary Redirect
 HTTP Status Code 404 - Not Found
 HTTP Status Code 410 - Gone
 HTTP Status Code 500 - Internal Server Error
 HTTP Status Code 503 - Service Unavailable
 It is an internet service that translates domain
names into IP addresses.
 It is application-layer protocol.
 DNS service must translate the domain name
into the corresponding IP address.
 In DNS system, If one DNS server doesn't
know how to translate a particular domain
name, it asks another one, and so on, until
the correct IP address is returned.
Jamiahamdard.edu

admissions.jamiahamdard.edu

Host1.admissions.jamiahamdard.edu.

FQDN
 Distributed database design is more preferred over
centralized design to implement DNS in the Internet.
 A single point of failure: If the DNS server crashes then the
entire Internet will not stop.
 Traffic volume: With millions of device and users accessing its
services from whole globe at the same time.
 A Single DNS Server cannot handle huge DNS traffic but with
distributed system its distributed and reduce overload on
server.
 Distant centralized database: A single DNS server cannot be
“close to” all the querying clients.
 If it is in New York City, then all queries from Australia must
travel to the other side of the globe, perhaps over slow and
congested links cause significant delays.
 Maintenance: To keep records for all Internet hosts. it would
have to be updated frequently to account for every new host.
 DNS client wants to determine the IP address for the
hostname www.amazon.com
 The client first contacts one of the root servers, which returns
IP addresses for TLD servers - top-level domain .com.
 Then contacts TLD servers, which returns the IP address of an
authoritative server for www.amazon.com
 Finally, contacts one of the authoritative servers for
www.amazon.com, which returns the IP address for the
hostname www.amazon.com.

Source: https://electronicspost.com/dns-servers/
 Top-level domain (TLD) servers:
◦ It is responsible for com, org, net, edu, aero, jobs,
museums, and all top-level country domains, e.g.: uk, fr,
ca, jp
◦ Network Solutions maintains servers for .com TLD
◦ Education for .edu TLD
 Authoritative DNS servers:
◦ To organization’s own DNS servers, providing
authoritative hostname to IP mappings for organization’s
named hosts.
◦ It can be maintained by organization or service provider.
 Local DNS name servers:
◦ It does not strictly belong to hierarchy
◦ when host makes DNS query, query is sent to its local
DNS server.
 It acts as proxy, forwards query into hierarchy.

Source: https://electronicspost.com/dns-servers/
 Step 1: Request information
 Step 2: Ask the recursive DNS servers
 Step 3: Ask the root name servers
 Step 4: Ask the TLD name servers
 Step 5: Ask the authoritative DNS servers
 Step 6: Retrieve the record
 Step 7: Receive the answer

Source :https://dyn.com/blog/dns-why-its-important-how-it-works/
 Step 1: Request information
◦ Ask client computer to resolve a hostname
◦ The first place the client computer looks for the
corresponding IP address is its local DNS cache,
which stores information that client computer has
recently retrieved
◦ If your computer doesn’t already know the answer,
it needs to perform a DNS query to find out

Source :https://dyn.com/blog/dns-why-its-important-how-it-works/
 Step 2: Ask the recursive DNS servers
◦ If the information is not stored locally, client
computer queries the recursive DNS servers
(resolvers) from our internet service provider (ISP).
◦ Resolvers have their own caches, and given that
many of the ISP’s customers are using the same
resolvers, there is a reasonable chance that popular
domains will already be cached.
◦ If found, the process usually ends here and the
information is returned to the user.
◦ Otherwise it will provide negative response

Source :https://dyn.com/blog/dns-why-its-important-how-it-works/
 Step 3: Ask the root name servers
◦ If the recursive servers don’t have the answer, they
query the root name servers.
◦ They don’t know the answer, but they can direct
DNS queries to someone that knows where to find it
 Step 4: Ask the TLD name servers
◦ The root name servers will look at the first part of
our request, reading from right to left —it direct
our query to the top-level domain (TLD)
name servers for desired TLD (e.g, .com. )
◦ These servers don’t have the information we need,
but they can refer us directly to the servers that do
have the information

Source :https://dyn.com/blog/dns-why-its-important-how-it-works/
 Step 5: Ask the authoritative DNS servers
◦ The TLD name servers review the next part of our
request — www.example.com — and direct our
query to the name servers responsible for this
specific domain.
◦ These authoritative name servers are responsible
for knowing all the information about a specific
domain, which is stored in DNS records.

Source :https://dyn.com/blog/dns-why-its-important-how-it-works/
 Step 6: Retrieve the record
◦ The recursive server retrieves the A record for
example.com from the authoritative name servers and
stores the record in its local cache.
◦ All records have a time-to-live value, which is like an
expiration date. After a while, the recursive server will
need to ask for a new copy of the record to make sure
the information doesn’t become out-of-date.
 Step 7: Receive the answer
◦ Recursive server returns the A record back to client
computer.
◦ Client computer stores the record in its cache, reads the
IP address from the record, then passes this information
to client browser.

Source :https://dyn.com/blog/dns-why-its-important-how-it-works/
Source: https://umbrella.cisco.com/blog/difference-authoritative-recursive-dns-nameservers
 DNS also provides a reverse lookup process, in which
clients use a known IP address and look up a computer
name based on its address
 TLD : .arpa (Address and Routing Parameter Area)
 A special domain, the in-addr.arpa domain, was defined
in the DNS standards and reserved in the Internet DNS
namespace to provide a practical and reliable way to
perform reverse queries
 To create the reverse namespace, subdomains within
the in-addr.arpa domain are formed, using the reverse
ordering of the numbers in the dotted-decimal notation
of IP addresses.
 The in-addr.arpa domain tree, as it is built into DNS,
requires an additional resource record type—the pointer
(PTR) resource record—to be defined. This resource
record creates a mapping in the reverse lookup zone
 PTR record type is used to store reverse DNS entries
 Reverse DNS lookup will try to locate PTR record for IP
 Name of PTR record is the IP address with the segment
reversed+”.in-addr.arpa”.

172.16.80.10  host1.sest.jamiahamdard.edu
The reverse query process follows these steps:

 The client queries the DNS server for a pointer (PTR) resource
record that maps to the IP address of 172.16.80.10 for host1.
 Because the query is for pointer (PTR) resource records, the
resolver reverses the address and appends the in-addr.arpa
domain to the end of the reverse address.
 This forms the fully qualified domain name
(FQDN) (10.80.16.172.in-addr.arpa.) to be searched in a reverse
lookup zone.

 After it is located, the authoritative DNS server for


10.80.16.172.in-addr.arpa can respond with the pointer (PTR)
resource record information. This includes the DNS domain name
for host1, which completes the reverse lookup process.
 PTR records provides trust that the given
hostname or a domain are connected to the
IP address. The PTR records are must have for
outgoing mail servers, because most of the
mail providers reject or mark as spam
messages received by mail servers without
valid reverse DNS configuration (missing PTR
or mismatch A record for the hostname).

Source: https://www.cloudns.net/wiki/article/40/

You might also like