UNInT-I - WP - Notes Biks

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 34

UNIT-I

Web Programming

Prepared by
Keerthana R
AP/CSE
KSRCE
DNS-Domain Name Systems
• The Domain Name System (DNS) is like the internet’s phone book. It helps you
find websites by translating easy-to-remember names (like www.example.com)
into the numerical IP addresses (like 192.0.2.1) that computers use to locate each
other on the internet.
• Without DNS, you would have to remember long strings of numbers to visit your
favorite websites.
• Domain Name System (DNS) is a hostname used for IP address translation
services.
• DNS is a distributed database implemented in a hierarchy of name servers. It is an
application layer protocol for message exchange between clients and servers.
• It is required for the functioning of the Internet.
What is the Need for DNS?

• Every host is identified by the IP address but remembering numbers is


very difficult for people also the IP addresses are not static therefore a
mapping is required to change the domain name to the IP address.

• So DNS is used to convert the domain name of the websites to their


numerical IP address.
Types of Domain

There are various kinds of domains:


• Generic
Domains: .com(commercial), .edu(educational), .mil(military), .org(nonprofit
organization), .net(similar to commercial) all these are generic domains.
• Country Domain: .in (India) .us .uk
• 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 google.com then we have to type
• nslookup google.com
Types of DNS
Inverse Domain:Example
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.
cont
• Hierarchy of Name Servers Root Name Servers:
• It is contacted by name servers that can not resolve the name. It contacts the
authoritative name server if name mapping is not known. It then gets the mapping
and returns the IP address to the host.
• Top-level Domain (TLD) Server: It is responsible for com, org, edu, etc, and
all top-level country domains like uk, fr, ca, in, etc. They have info about
authoritative domain servers and know the names and IP addresses of each
authoritative name server for the second-level domains.
• Authoritative Name Servers are the organization’s DNS servers, providing
authoritative hostnames to IP mapping for organization servers. It can be
maintained by an organization or service provider.
• In order to reach cse.dtu.in we have to ask the root DNS server, then it will point
out to the top-level domain server and then to the authoritative domain name
server which actually contains the IP address.
Domain Name Server

• The client machine sends a request to the local name server, which, if
the root does not find the address in its database, sends a request to the
root name server, which in turn, will route the query to a top-level
domain (TLD) or authoritative name server.
• The root name server can also contain some hostName to IP address
mappings. The Top-level domain (TLD) server always knows who the
authoritative name server is.
• So finally the IP address is returned to the local name server which in
turn returns the IP address to the host.
cont
URL
• URL is the abbreviation of Uniform Resource Locator. It is the
resource address on the internet. The URL (Uniform Resource
Locator) is created by Tim Berners-Lee and the Internet Engineering
working group in 1994. URL is the character string (address) which is
used to access data from the internet. The URL is the type of URI
(Uniform Resource Identifier).
Cont.
• A URL contains the following information which is listed below:
• Protocol name
• A colon followed by double forward-slash (://)
• Hostname (domain name) or IP address
• A colon followed by port number (optional – unless specified otherwise, “:80” is
the default when using HTTP, and “:443” is the default when using HTTPS)
• Path of the file
Syntax of the URL:
• Protocol://hostname/filename
WWW
• The World Wide Web (WWW) is a system of interconnected documents and
resources, like websites and web pages, that can be accessed via the internet.
Here's a simple breakdown:
• Webpages: These are the documents or files you see online. They can contain
text, images, videos, and more.
• Websites: A collection of related web pages, often all part of the same domain
(like "example.com").
• Browser: A software application like Chrome, Firefox, or Safari that you use
to view web pages.
• Links: Clickable text or images that take you from one webpage to another.
• In short, the WWW allows people to navigate between pages on the internet
using web browsers and links. It is part of the internet but specifically refers to
the collection of linked documents accessible through web browsers.
Cont..
• Web Protocols: The WWW uses specific rules called protocols to allow
computers to communicate. The main one is HTTP (Hypertext Transfer Protocol),
which enables web browsers and servers to talk to each other. There's also
HTTPS, which adds a layer of security for encrypted data transmission.
• URL (Uniform Resource Locator): This is the address of a webpage (like "
https://www.example.com"). It tells the browser where to find the page on the
internet.
• HTML (Hypertext Markup Language): The language used to structure web
pages. It tells your browser how to display text, images, links, and other content.
• Servers and Clients: When you type a URL into a browser and hit enter, your
computer (the client) sends a request to a web server. The server processes the
request and sends back the webpage, which your browser then displays.
HTTP:Request
• An HTTP (Hypertext Transfer Protocol) request is a fundamental part of web
communications, forming the basis of data exchange on the internet. It’s a
protocol used for fetching resources, such as HTML documents, images, and other
files, from web servers. The communication between a client (like a web browser)
and a server occurs through these HTTP requests.
Working:
• Request Line: An HTTP request starts with a request line, which includes the
following:
• Method: This indicates the action to be performed on the resource. Common
methods include GET (retrieve a resource), POST (submit data to the server), PUT
(update a resource), DELETE (remove a resource), and others.
• Request URL: The URL of the resource being requested.
• HTTP Version: The version of the HTTP protocol being used.
• Request Headers: Following the request line are headers, which provide additional
information about the request. This can include details about the client’s browser,
the types of responses that the client will accept, cookies, and more.
• Blank Line: A blank line indicates the end of the headers section.
• Request Body (Optional): Not all requests have a body. Bodies are typically included
in POST or PUT requests, where you’re sending data to the server (like form inputs
or file uploads). The body contains the data being sent.
The structure of HTTP requests
HTTP response

• An HTTP response is what a server sends back to the client after receiving and
processing an HTTP request. It is a key part of the data exchange in web
communications, essentially being the server’s answer to the client’s request.
Here’s a breakdown of the components of an HTTP response:
Working:
• Status Line: This is the first line of the response and includes:

• HTTP Version: Indicates the HTTP protocol version used (e.g., HTTP/1.1).

• Status Code: A three-digit number that indicates the outcome of the request.
Common status codes include 200 (OK, request succeeded), 404 (Not Found, the
resource can’t be found), 500 (Internal Server Error), etc.

• Status Text: A brief, human-readable explanation of the status code (e.g., OK, Not
Found, Internal Server Error).
Cont..
• Response Headers: These are key-value pairs providing additional information
about the response. They can include details such as the server type, content
type, content length, caching policies, set cookies, and other metadata.

• Blank Line: A blank line signifies the end of the header section.

• Response Body: This part of the response contains the actual data or resource that
the client requested. For example, it could be an HTML file, JSON data, an image,
etc. In some cases, particularly when the response indicates an error (like a 404),
the body might contain a message explaining the error.
Web Clients and Web Servers:
• A Web client is an application installed on the user’s device that they can use to
surf the internet. Web clients request computer servers for a webpage but don’t
store them.
• Without these clients, an ordinary user can’t use the internet. When you search for
a particular webpage through your browser, it retrieves the page from the
appropriate server and displays the result. The client and server communicate via
HTTP(Hypertext Transfer Protocol).
• You can think of the HTTP protocol as the language of the web. It enables
networked devices to send and receive traffic using a set of simple rules.
However, there’re other types of protocols, such as SSH(Secure Shell), FTP(File
Transfer Protocol) and SMTP(Simple Mail Transfer Protocol).
Features of Web Clients

• These days, all web browsers offer some standard features which aim to make
internet browsing easier for us. In short, your choice of web client should feature
some of the following.
• Support for private/incognito browsing.
• VPN or Proxy support.
• Multiple tabs or windows.
• Back/Previous and Forward buttons.
• Home, Refresh, Stop buttons.
• Address bar for URL.
• History and bookmark.
Example:
• Some popular examples of web clients include Google Chrome,
Microsoft Edge, Safari, Tor, etc. So all types of internet browsers are
client software. However, there’re other types of clients that many
people use for everyday tasks. Video calling solutions like Zoom or
Jitsi are one example of such clients. And so are SSH clients such as
PuTTY or WinSCP. They allow users to connect to a different
machine over the web.
• Another example of web clients includes email applications. If you
have got an email app like Gmail or Microsoft Outlook, those are also
a type of web(email) client.
What is a Web Server?

• Web Servers are systems that are connected to the internet and store web pages.
In addition it sends out requested data over the web using HTTP. In nutshell, like
Apache– the Web Servers are just like libraries for web pages. They store, process
and deliver the web resources to the client software.
• Servers can also use other data transfer protocols such as SMTP and FTP. Mail
servers use SMTP for transferring emails from one user to another. Additionally
FTP server is used for high speed file transfer operations.
Features of Web Servers:

• As the powerhouse of the internet, the web server is responsible for


hosting documents and processing them. Modern web servers feature
the following common functionalities:
• Support for standard protocols like HTTP, FTP, SMTP, and SSH.
• Can serve static content as requested.
• Also they can deliver dynamic content on demand.
• Logging client information and requests.
• Support for virtual hosting.
• Ability to authorize or deny website path traversal.
• Support for large files, bandwidth throttling, and custom error pages.
Example:
• There are different types of server software for delivering web content
to end users. Some popular web servers include Apache, Microsoft IIS
(Internet Information Services), lighttpd, and Nginx.
• Apart from these few, there’re also some other choices. However,
when choosing a web server software for your website, try to stick
with the popular ones.
• It’ll help you maintain a stable and secure website in the long run.
Plus, finding support will also be easier.
Case Study title:
• "Analyzing the Role of DNS in Client-Server Communication: A Case Study on Website Accessibility"
• "Implementing a Client-Server Model Using TCP/IP: A Practical Exploration of Web Request and
Response Cycles"
• "Designing a Simple Web Application: A Study of HTTP Requests, Responses, and the Role of Web
Servers"
• "Case Study on URL Structuring and Its Impact on Web Resource Navigation and Client Requests"
• "Understanding Web Server-Client Interactions: A Hands-on Case Study with HTTP Protocols and
Status Codes"
• "DNS Resolution and Its Impact on Web Performance: A Comparative Case Study"
• "Building a Custom Web Client to Communicate with Web Servers: A Deep Dive into TCP/IP and
HTTP Protocols"
• "Simulating a Web Server Environment: A Case Study of Request-Response Cycles in a Real-Time
Application"
• "Exploring Security in Client-Server Communication: A Case Study of HTTP vs HTTPS in Web
Transactions"
• "Developing a URL Shortening Service: A Case Study on URL Parsing, Redirection, and Web Client
Interactions"
UNIT-2
• HTML is a markup language used by the browser to manipulate text, images, and
other content, in order to display it in the required format. HTML was created by
Tim Berners-Lee in 1991. The first-ever version of HTML was HTML 1.0, but
the first standard version was HTML 2.0, published in 1995.
• Currently, we are using HTML5, which is the latest and most recent version of
HTML
Cont.
• Advantages of HTML
• HTML is used to build websites.
• It is supported by all browsers.
• It can be integrated with other languages like CSS, JavaScript, etc.
• Disadvantages of HTML
• HTML can only create static web pages. For dynamic web pages, other
languages have to be used.
• A large amount of code has to be written to create a simple web page.
• The security feature is not good.
What is HTML?

• HTML stands for HyperText Markup Language and it is used to create webpages. It
uses HTML tags and attributes to describe the structure and formatting of a web page.
• HTML consists of various elements, that are responsible for telling search engines how to
display page content. For example, headings, lists, images, links, and more.
• HTML Example
• <!DOCTYPE html>
• <html>
• <head>
• <title>First HTML Code</title>
• </head>
• <body>
• <h2>Welcome To GFG</h2>
• <p>Hello Geeks</p>
• </body>
• </html>
Features of HTML

• It is easy to learn and easy to use.


• It is platform-independent.
• Images, videos, and audio can be added to a web page.
• Hypertext can be added to the text.
• It is a markup language.
HTML Elements and Tags

• HTML uses predefined tags and elements that instruct the browser on
how to display the content.
• HTML elements include an opening tag, some content, and a closing
tag. It’s important to remember to include closing tags. If omitted, the
browser applies the effect of the opening tag until the end of the page.
HTML Page Structure

• The basic structure of an HTML page is shown below. It contains the essential
building-block elements (i.e. doctype declaration, HTML, head, title, and body
elements) upon which all web pages are created.
Cont..
• An HTML document can be created using an HTML text editor. Save the text
file using the “.html” or “.htm” extension. Once saved as an HTML document,
the file can be opened as a webpage in the browser.
• Note: Basic/built-in text editors are Notepad (Windows) and TextEdit (MacOS).
Other advanced text editors include Sublime Text, Visual Studio Code, Froala,
etc.

You might also like