WWW HTTP DNS
WWW HTTP DNS
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
https://www.geeksforgeeks.org/http-non-persistent-persistent-connection/
www.example.com/faculty/index.htm
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
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
https://www.geeksforgeeks.org/http-non-persistent-persistent-connection/
Introducing the concept of “keep-alive” connections, that allow clients to reuse TCP
connections
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.
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.
Source: https://www.cloudns.net/wiki/article/40/