0% found this document useful (0 votes)
28 views6 pages

Computer Networks Huge Assignment (S-IV)

Uploaded by

ali46892589
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views6 pages

Computer Networks Huge Assignment (S-IV)

Uploaded by

ali46892589
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

1. What is DNS? Why we need DNS? Describe the operation of DNS.

DNS, or Domain Name System, is a system that translates human-readable domain names into IP
addresses used by computers to identify each other on a network. It acts like a phone book for the
internet, making it easier for users to access websites without needing to remember numerical IP
addresses.
Need of DNS:
DNS is essential for several reasons:
Human-Readable Addresses:
People find it easier to remember domain names than numerical IP addresses. DNS translates
these names into IP addresses, making the internet more user-friendly.
Internet Navigation: DNS enables users to navigate the internet by providing a way to access
websites using familiar names. Without DNS, users would have to remember and input numerical
IP addresses for each site.
Dynamic IP Addresses:
Many websites and services have dynamic IP addresses that may change. DNS allows these
changes to happen transparently to users, as the domain name remains the same.
Load Balancing:
DNS can be used for load balancing, distributing incoming traffic across multiple servers to
ensure optimal performance and prevent server overloads.
Redundancy and Failover:
DNS can be configured to provide redundancy and failover. If one server is unavailable, DNS can
redirect traffic to an alternative server, improving overall system reliability.

In summary, DNS simplifies internet usage, enhances accessibility, and contributes to the stability
and efficiency of online services.

Operation Of DNS:
The Domain Name System (DNS) operates as follows:

Hostname Resolution Request: When a user enters a domain name in a web browser, the system
initiates a DNS resolution request to find the corresponding IP address.

Local DNS Resolver:


The request first reaches a local DNS resolver, typically provided by the Internet Service Provider
(ISP) or a designated DNS server. This resolver may have the IP address cached from previous
requests, speeding up the process.
Recursive DNS Query:
If the local resolver doesn’t have the requested IP address in its cache, it becomes a recursive
resolver. It queries the root DNS servers to find the authoritative DNS server responsible for the
top-level domain (TLD) of the requested domain (e.g., “.com”).

TLD DNS Server:


The root DNS server responds with the IP address of the TLD DNS server for the requested
domain (e.g., the “.com” DNS server).

Authoritative DNS Server:


The recursive resolver then queries the TLD DNS server, which responds with the IP address of
the authoritative DNS server for the second-level domain (e.g., “example.com”).

Final Resolution:
The recursive resolver sends a query to the authoritative DNS server, which provides the IP
address associated with the specific domain name.

Caching:
The resolver caches the IP address locally for a specified time (TTL – Time to Live) to speed up
future requests for the same domain.

User Access:
Finally, the IP address is returned to the user’s device, allowing it to establish a connection with
the web server hosting the requested content.

This process ensures efficient and distributed resolution of domain names to IP addresses,
facilitating seamless navigation on the internet.

2. What is the purpose of HTTP?


HTTP, or Hypertext Transfer Protocol, serves as the foundation for data communication on the
World Wide Web. Its main purposes include:

Data Communication:
HTTP enables the transfer of various types of data, including text, images, videos, and other
multimedia content, between a client (such as a web browser) and a server. This communication
is fundamental to the functionality of the web.

Client-Server Interaction:
It establishes a client-server model where a client (e.g., a web browser) sends requests to a
server, and the server responds with the requested data. This interaction forms the basis for how
users access and interact with content on the internet.

Stateless Protocol:
HTTP is stateless, meaning each request from a client to a server is independent, and the server
does not retain information about the client’s previous requests. To maintain continuity and
manage user sessions, technologies like cookies and sessions are often employed in conjunction
with HTTP.

Uniform Resource Identification: HTTP uses URLs (Uniform Resource Locators) to identify and
locate resources on the web. URLs specify the protocol (HTTP), the server’s address, and the
path to the specific resource.

Simple and Extensible:


HTTP is designed to be simple, making it easy to implement and understand. Additionally, it is
extensible, allowing for the incorporation of additional features and functionalities as needed.
In summary, HTTP facilitates the transfer of information between clients and servers on the
internet, forming the basis for web communication and enabling the retrieval of web pages and
other resources.

3. Explain http messenge format.


HTTP messages consist of requests from clients to servers and responses from servers to clients.
Each message has a specific format, which can be broadly categorized into two types: HTTP
request and HTTP response.

HTTP Request Format:

Request Line:
Specifies the HTTP method (e.g., GET, POST), the target resource (Uniform Resource Identifier
– URI), and the HTTP version.

Example:
GET /path/to/resource HTTP/1.1

Headers:
Additional information about the request, such as the type of data the client can accept, the type
of data being sent (Content-Type), and more.

Example:
Host: www.example.com
Accept: text/html

Body (Optional):
This is where the client can include data, often used with methods like POST. It is not present in
all types of requests.

Example:
Name=John&age=25

HTTP Response Format:

Status Line:
Indicates the HTTP version, a status code indicating the outcome of the request, and a short
description of the status.

Example:
HTTP/1.1 200 OK

Headers:
Similar to request headers, providing additional information about the response, such as the
content type, server information, and more.

Example:
Content-Type: text/html
Server: Apache

4. What do you mean by HTTP conditional request?


Explain with help of example.

HTTP conditional requests allow clients to make a request for a resource only if certain
conditions are met, reducing unnecessary data transfer and improving efficiency. Two common
conditional request headers are If-Match and If-None-Match.

Example using If-None-Match:

Client makes a GET request:


GET /example-resource HTTP/1.1
Host: www.example.com

Server responds with ETag in the header:

HTTP/1.1 200 OK
ETag: “abc123”
Content-Length: 123
Content-Type: text/plain

This is the content of the resource.

Client caches the resource and its ETag. Next time, it sends a conditional request:

GET /example-resource HTTP/1.1


Host: www.example.com
If-None-Match: “abc123”

Server checks If-None-Match header and responds accordingly:

If the resource has not changed (ETag still “abc123”):

HTTP/1.1 304 Not Modified


ETag: “abc123”
In this case, the server indicates that the resource has not been modified, and the client can use its
cached copy.
If the resource has changed (new ETag, say “xyz789”):

HTTP/1.1 200 OK
ETag: “xyz789”
Content-Length: 134
Content-Type: text/plain

This is the updated content of the resource.


The server sends the updated resource with a new ETag, and the client can replace its cached
copy.
This mechanism allows the server to inform the client whether it needs to send the entire resource
again or if the cached copy is still valid. It helps in optimizing data transfer and reduces
unnecessary server load.

5. Differentiate between HTTP1.0, HTTP1.1, HTTP2, and HTTP3.

Here’s a brief differentiation between HTTP/1.0, HTTP/1.1, HTTP/2, and HTTP/3:

HTTP/1.0:

Connection Handling: Each request/response typically requires a separate connection, leading to


higher latency.
Header Handling: Headers are sent with every request and response, contributing to increased
overhead.
Parallel Requests: Limited support for parallel requests, often resulting in a slower user
experience.

HTTP/1.1:

Persistent Connections: Supports persistent connections, reducing latency by allowing multiple


requests and responses to be sent over a single connection.
Chunked Transfer Encoding: Introduces chunked transfer encoding, enabling the server to send
data in chunks, allowing for better streaming of content.
Host Header: Allows multiple websites to be served from the same IP address using the Host
header.

HTTP/2:

Multiplexing: Supports multiple concurrent requests and responses on the same connection,
improving efficiency.
Header Compression: Introduces header compression to reduce overhead.
Server Push: Allows the server to push additional resources to the client before they are
explicitly requested.
Binary Protocol: Uses a binary protocol instead of plain text, enhancing performance.

HTTP/3:

Transport Protocol: Uses QUIC (Quick UDP Internet Connections) as the underlying transport
protocol, providing better performance than TCP.
Multiplexing: Similar to HTTP/2, it supports multiplexing for concurrent requests and responses.
Improved Security: Built on top of UDP with integrated encryption, improving security.
Reduced Latency: Aims to further reduce latency compared to previous versions, especially in
scenarios with high packet loss.
Each version brings improvements in terms of performance, efficiency, and additional features,
with HTTP/3 being the latest evolution in the series, emphasizing reduced latency and enhanced
security. The choice of which version to use depends on factors such as server and client support
and specific performance requirements.

You might also like