[go: up one dir, main page]

0% found this document useful (0 votes)
14 views86 pages

Session 2

The document provides an overview of web development, detailing the history and evolution of the Internet from its inception in the 1960s to the rise of Web 2.0, which emphasizes user interaction and collaboration. It discusses key technologies, standards, and protocols that have shaped the web, including HTML, HTTP, and TCP/IP, as well as the roles of various organizations like W3C and ICANN. Additionally, it covers the differences between static and dynamic web pages, the architecture of web applications, and the importance of web browsers in rendering content.

Uploaded by

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

Session 2

The document provides an overview of web development, detailing the history and evolution of the Internet from its inception in the 1960s to the rise of Web 2.0, which emphasizes user interaction and collaboration. It discusses key technologies, standards, and protocols that have shaped the web, including HTML, HTTP, and TCP/IP, as well as the roles of various organizations like W3C and ICANN. Additionally, it covers the differences between static and dynamic web pages, the architecture of web applications, and the importance of web browsers in rendering content.

Uploaded by

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

Web Development

Introduction

Vinaya Sathyanarayana
Internet

The interconnected network of computer networks that spans the globe.


HTML
- How to share
documentations?
Beginning - In 1989, Berners-Lee wrote a
- In 1960s, the U.S. military tried proposal - an Internet-based
to find a stable and fault- hypertext system.
tolerant communication - He is also the director of W3C
method. (Word-Wide Web Consortium).

History of the 1980s 1993

Internet 1960s 1989

Internet First Web Brower


The term “Internet” was coined NCSA’s Mosaic came out in
in the 1980s after the invention 1993.
of Transmission Control
Protocol/ Internet Protocol
(TCP/IP).
Interconnected computer
network.
History of the
Internet
- More browsers appeared:

- dotcom boom: dotcom


companies were getting richer and
richer in the stock market by the
end of the millenium....
Web 2.0 (cont'd)

• Before web 2.0, web was a warehouse of


static pages
• Platform of collaboration
• Web 1.0?
• Crowdsourcing: Users are co-developers
• World is no longer described by the Web.
The Web is becoming the world
itself
Web 2.0 • Web 1.0: • Web 2.0

(cont'd) • Static websites • Blogs


• Emails • Social Networking
• Forums • Wikis
• Basic search engines • Audio/Video Sharing
• Groups • RSS
• Newsletters • Webcast/Podcast
Web 2.0 (cont'd)
Before web 2.0, web was a warehouse of static pages

Platform of collaboration

Web 1.0?

Crowdsourcing: Users are co-developers

World is no longer described by the Web. The Web


is becoming the world itself
Removal of the ban on commercial activity

Development of the World Wide Web


by Tim Berners-Lee at CERN
Reasons for
Development of Mosaic,
Internet Growth the first graphics-based web browser at NCSA
in the 1990s
Personal computers were increasingly available
and affordable

Online service providers offered low-cost


connections to the Internet
Convergence
of
Technologies
The World Wide Web
The graphical user interface to information
stored on computers running web servers connected to the
Internet.
Internet Standards & Coordination (1 of 2)

The principal body engaged in the


IETF – Internet Engineering Task
development of new Internet
Force
protocol standard specifications.

RFC – Requests for Comments


IAB – Internet Architecture Board
A formal document from the IETF
Provides guidance and broad
that is drafted by a committee and
direction to the IETF. Responsible for
subsequently reviewed by interested
publications for RFCs.
parties
Internet Standards &
Coordination (2 of 2)
• ICANN - The Internet Corporation for Assigned Numbers &
Names
• Non-profit organization
• Main function is to coordinate the assignment of:
• Internet domain names
• IP address numbers
• Protocol parameters
• Protocol port numbers.
Source:
Growth of the Internet http://www.internetworldstats
.com/emarketing.htm

Year Percentage of Global Population Using the Internet


1995 0.4%

2000 5.8%

2005 15.7%

2010 28.10%

2015 45%

2018 55.1%

2019 56.1%
Intranet & Extranets
Intranet
• A private network contained within an organization or
business used to share information and resources among
coworkers.
Extranet
• A private network that securely shares part of an
organization’s information or operations with external
partners
Web Standards and the W3C Consortium
• W3C – World Wide Web Consortium
• Develops recommendations and prototype technologies related to the Web
• Produces specifications, called Recommendations, in an effort to standardize
web technologies
• WAI – Web Accessibility Initiative
Circuit Switched Networks
Circuit switching in early
networking
● In the past, telephone calls
were routed through operators
who physically connected the
caller and the receiver by
connecting a wire to a
switchboard to complete a
circuit.
● Inefficient use of bandwidth
● Difficult to scale
Packet Switched Networks
Packet switching came later, does
not require a continuous
connection
● 1960s ARPANET
● 1974 X.25
● 1979 USENET
● 1981 TCP/IP was introduced to
unify disparate networks
On January 1, 1983, TCP/IP was
adopted across all of ARPANET
Sr. Tim Berners-Lee publishes the main
features of the web we know today on
1992.
• A Uniform Resource Locator (URL) to uniquely
identify a resource on the WWW.
The Birth of the • The Hypertext Transfer Protocol (HTTP) to describe
Web how requests and responses operate
• A software program (web server software) that can
respond to HTTP requests.
• Hypertext Markup Language (HTML) to publish
documents.
• A program (a browser) that can make HTTP requests
to URLs and that can display the HTML it receives.
Web Applications in Comparison
to Desktop Applications (1 of 2)
• Advantages

• They can be accessed from any Internet-enabled computer.


• They can be used with different operating systems and
browser applications.
• They are easier to roll out program updates since only
software on the server needs to be updated as opposed to
every computer in the organization using the software.
• They have a centralized storage on the server, which means
fewer security concerns about local storage (which is
important for sensitive information such as health care
data).
Web Applications in Comparison
to Desktop Applications (2 of 2)
• Disadvantages

• Requirement to have an active Internet connection


• Security concerns about sensitive private data being
transmitted over the Internet.
• Concerns over the storage, licensing, and use of uploaded
data.
• Problems with certain websites not having an identical
appearance across all browsers.
• Restrictions on software from being installed and hardware
from being accessed (like Adobe Flash on iOS).
• additional plugins might interfere with JavaScript, cookies,
or advertisements.
From Static to Dynamic (and Back to
Static)
In the earliest days of the
web, users could read the
pages of a static website
From Static to Dynamic (and Back to
Static) ii
Later, programs running on
web servers let websites
generate content
dynamically. This type of
website is called a dynamic
server-side website
Web 2.0
• Web 2.0 referred to an interactive experience where users could
contribute and consume web content, thus creating a more user-
driven web experience.
• For software developers, Web 2.0 also referred to a change in the
paradigm. Programming logic, which previously existed only on the
server, began to migrate more and more to the browser, which
required learning JavaScript
Server Types
• Web servers.
• Application servers.
• Database servers.
• Mail servers.
• Media servers.
• Authentication servers.
Real World Server Installations
• Not one server, but a cluster of multiple machines working
together.

• Server Farm
• Load Balancers
• Failover Redundancy
• Server Racks
• Data Centers
• Cloud Services
Hypothetical data center
Many additional considerations
can be handled at a data center
including:

● Fire suppression,
● Biometric security,
● Failover data
● Redundant power
● and more!
Cloud Servers
Instead of spending too much
or spending too little to handle
peak loads, cloud providers
offer elastic provisioning of
virtual servers, which scales
costs and hardware to the
demand
Where Is the Internet?
It is quite common for the Internet to be visually represented as a
cloud

Actually implemented via millions of miles of copper wires and fiber


optic cables connecting millions of server computers and other
networked devices!
The broadband modem is a bridge between the
network hardware outside the house and the
network hardware inside the

From the
Computer to house. These devices are often supplied by the

Outside the ISP.

Home
The wireless router is perhaps the most visible
manifestation of the Internet in one’s home. At its
simplest, a router is a hardware device that
forwards data packets from one network to
another network.
From the
Home to the
Ocean’s Edge
From the
Home to the
Ocean’s Edge
(2)
How the Internet Is Organized Today
When someone talks about
the “Internet Backbone” they
are talking about Tier 1
networks.

Tier 1 Networks make use of


very fast fiber optic cable.

Regional networks have


traditionally used less speedy
infrastructure, though this is
rapidly changing as prices of
optical hardware
decreases.
The components of a web application

Desktop Web Server


Computer
The
Internet

Tablet Smart Phone


The architecture of the Internet

LAN LAN LAN LAN

LAN LAN
WAN WAN
IXP

IXP IXP

WAN WAN
LAN LAN

LAN LAN LAN LAN


How a web server processes a static web page

HTTP request
HTML
file
HTTP response
(with HTML)

Client
Web Server
(web browser)
How a web server processes a dynamic web page
HTTP request

HTTP response
(with HTML)

Client
Web Server Application Server Database Server
(web browser)

Murach's HTML5 and CSS3 (3rd Ed.), C1 © 2015, Mike Murach & Associates, Inc.
Slide 36
Web browsers
• Chrome
• Internet Explorer
• Firefox
• Safari
• Opera

Murach's HTML5 and CSS3 (3rd Ed.), C1 © 2015, Mike Murach & Associates, Inc.
Slide 37
Web Client

CONNECTED TO THE INTERNET USUALLY RUNS WEB BROWSER USES HTTP (HYPERTEXT REQUESTS WEB PAGES FROM RECEIVES WEB PAGES AND
WHEN NEEDED (CLIENT) SOFTWARE TRANSFER PROTOCOL) OR SERVER FILES FROM SERVER
(SUCH AS MICROSOFT EDGE OR HTTPS
GOOGLE CHROME)
Continually connected to the Internet

Runs web server software


(such as Apache or Internet Information Server)

Uses HTTP (Hypertext Transfer Protocol) or


Web Server HTTPS

Receives request for the web page

Responds to request and transmits status code,


web page, and associated files
Browser Marketshare

https://gs.statcounter.com/browser-market-share
Web Browsers
• The user experience for a website is unlike the user experience for traditional
desktop software.

• Users do not download software; they visit a URL, which results in a web page
being displayed.

• Although a typical web developer might not build a browser, or develop a plugin,
they must understand the browser’s crucial role in web development.
Web Browsers (Fetching a web page)
• Seeing a single web page is facilitated by the browser, which
– requests the initial HTML page, then
– parses the returned HTML to find all the resources referenced from within it
(like images, style sheets, and scripts).

• Only when all the files have been retrieved is the page fully loaded for the user

• A single web page can reference dozens of files and requires many HTTP requests
and responses.
Fetching a web page diagram
Browser Rendering
• The algorithms within browsers to download, parse, layout, fetch assets, and
create the final interactive page for the user are commonly referred to collectively
as the rendering of the page

• We will focus on the browser-rendering process through a user-centric lens where


measures are categorized around perceived loading performance, interactivity,
and visual stability
Browser Rendering (ii)
• The algorithms within browsers to download, parse, layout, fetch assets, and
create the final interactive page for the user are commonly referred to collectively
as the rendering of the page

• We will focus on the browser-rendering process through a user-centric lens where


measures are categorized around perceived loading performance, interactivity,
and visual stability
Browser Rendering Performance
• Time to First Byte (TTFB)

• First Paint (FP)

• First Contentful Paint (FCP)

• First Meaningful Paint (FMP)

• Largest Contentful Paint (LCP)

• Time to Interactive (TTI)

• On Load

• Cumulative Layout Shift (CLS)


Browser Caching
• Once a webpage has been downloaded from the server, it’s possible that the user,
a short time later, wants to see the same web page and refreshes the browser or
rerequests the URL.

• Although some content might have changed, the majority of the referenced files
are likely to be unchanged, so they needn’t be redownloaded.

• Browser caching has a significant impact in reducing network traffic and will be
come up gain in greater detail later
Network Overview
Network
two or more computers connected together for the purpose
of communicating and sharing resources
Common
components
of a network
LAN – Local Area Network

Usually confined to a single building or group of


buildings

Networks
WAN – Wide Area Network

Usually uses some form of public or commercial


communications network to connect computers
is widely dispersed geographical areas.
Internet Infrastructure

Internet Backbone Maps of the Internet Backbone


A high capacity communication link that carries http://www.google.com/search?q=global+intern
data gathered from smaller links that et+backbone+map+images
interconnect with it.
A protocol is a set of rules that partners use when they
communicate.

Internet TCP/IP, is an essential internet protocol!


protocols

These protocols have been implemented in every operating


system and make fast web development possible. If web
developers had to keep track of packet routing, transmission
details, domain resolution, checksums, and more, it would
be hard to get around to the matter of actually building
websites.
Knowledge of how the web works, from
low-level protocol to high-level JavaScript
library, creates better web developers

Note
There is a trend in web development to
encourage web developers and designers
to embrace this blending of roles as part
of a holistic DevOps approach
A Layered Architecture

• The TCP/IP Internet protocols were


originally abstracted as a four-layer stack

• Later abstractions subdivide it further


into five or seven layers

• Since we focus on the top layer, we will


use the earliest and simplest four-layer
network model.
The link layer is the lowest layer, responsible
for both the physical transmission of data
across media and establishing logical links.

It handles issues like packet creation,


Link Layer transmission, reception, error detection,
collisions, line sharing, and more.

One term that is sometimes used in the


Internet context is that of MAC (media access
control) addresses.
The Internet layer (sometimes also called the IP Layer)
routes packets between communication partners across
networks.

It provides “best effort” communication. It sends out a


message to its destination but expects no reply and
provides no guarantee the message will arrive intact, or at
all.
Internet Layer The Internet uses the Internet Protocol (IP) addresses,
which are numeric codes that uniquely identify destinations
on the Internet.

Every device connected to the Internet has such an IP


address.
IP Addresses (cont)
There are two types of IP addresses: IPv4
and IPv6.

• In IPv4, four 8-bit integers separated by


. encode the address.

• IPv6 uses eight 16-bit integers and has


over a billion billion times the number
in IPv4
Port Address Translation (PAT)
The IPv4 address space was depleted in 2011, but the number of computers
connected to the Internet continued to grow.

• Port Address Translation (PAT), allows multiple, unrelated networks to make use of
the same IP address

• When you join a wireless network in a coffee shop, home, office or university, it is
quite likely you are making use of PAT.

• For future growth, IPv6 will be necessary.


The transport layer ensures transmissions arrive in
order and without error.

First, the data is broken into packets formatted


according to the Transmission Control Protocol (TCP).
• Each data packet has a header that includes a sequence number,
Transport Layer so the receiver can put the original message back in order
• Each packet acknowledges its successful arrival back to the
sender (ACK).
• In the event of a lost packet (since no ACK arrived for that
packetthe packet will be retransmitted.

This means you have a guarantee that messages sent


will arrive and will be in order.
Transport Layer (example)
User Datagram Protocol (UDP)
PROTIP

Sometimes we do not want guaranteed transmission of packets.

Consider a live multicast of a soccer game, for example. Millions of subscribers


may be streaming the game, and the broadcaster can’t afford to track and
retransmit every lost packet. A small loss of data in the feed is acceptable, and
the customers will still see the game.

An Internet protocol called User Datagram Protocol (UDP) is used in these


scenarios in lieu of TCP. Other examples of UDP services include Voice Over IP
(VoIP), many online games, and Domain Name System (DNS).
Application Layer
• The application layer is the level of • HTTP. The Hypertext Transfer Protocol is used
protocols familiar to most web for web communication.
developers. • SSH. The Secure Shell Protocol allows remote
command-line connections to servers.
• Application layer protocols • FTP. The File Transfer Protocol is used for
implement process-to-process transferring files between computers.
communication. • POP/IMAP/SMTP. Email-related protocols for
transferring and storing email.
• There are many application layer • DNS. The Domain Name System protocol
protocols. A few that are useful to used for resolving domain names to IP
web developers include: addresses.
Domain Name System
• As elegant as IP addresses may be, human beings do not enjoy having to recall long
strings of numbers.

• Even as far back as the days of ARPANET, researchers assigned domain names to IP
addresses

• In those early days, the number of Internet hosts was small, so a list of a domains
and associated IP addresses could be downloaded as needed as a hosts file (see Pro
Tip p51).

• As the number of computers on the Internet grew, this hosts file had to be replaced
with a better, more scalable, and distributed system. This system is called the
Domain Name System (DNS)
DNS Overview
• The DNS system maps resolves domain names to
IP addresses.

• By separating the domain name of a server from


its IP address, a site can move to a different host
without changing its name.

• Since the entire request-response cycle can take


less than a second, it is easy to forget that DNS
requests are happening in all.

• The actual process is more complex (more on that


later) DNS overview (simplified)
Name Levels
• A domain name can be broken
down into several parts, which
describe a hierarchy.

• All domain names have at least a


top-level domain (TLD) name and a
second-level domain (SLD) name
Name Levels (Top Level)
The rightmost portion of the domain name (to the right of the rightmost period) is
called the top-level domain. For the top level of a domain, we are limited to two broad
categories, plus a third reserved for other use.

1. Generic top-level domain (gTLD)

2. Country code top-level domain (ccTLD)

3. .arpa (used for reverse DNS lookups)


Generic top-level domain (gTLD)
Generic top-level domains (gTLD) include the famous .com and ,org. There
are 3 subtypes of gTLD.
• Unrestricted. TLDs include .com, .net, .org, and .info.

• Sponsored. TLDs including .gov, .mil, .edu, and others

• New. Starting in June 2012, ICANN invited companies to launch new TLDs in order
to provide more choice. Since then over 1000 new TLD have been created including
.art, .cash, .cool, .jobs, .tax and so on
Country code top-level domain
Country code top-level domain (ccTLD) are under the control of the countries which they represent, which is why
each is administered differently.

• In the United Kingdom, for example, businesses must register subdomains to co.uk rather than second-level
domains directly whereas in Canada, .ca domains can be obtained by any person, company, or organization
living or doing business in Canada.

• Other countries have peculiar extensions with commercial viability (such as .tv for Tuvalu) and have begun
allowing unrestricted use to generate revenue.

• Internationalized top-level domain name (IDN) allows domains to use non-ascii characters and has been
deployed since 2009. There are over 9 million IDN domains
Name Registration
• Q: How then are domain names assigned?

• A: Special organizations or companies called domain name registrars manage the


registration of domain names. These domain name registrars are given permission
to do so by the appropriate generic top-level domain (gTLD) registry and/or a
country code top-level domain (ccTLD) registry.

• The nonprofit Internet Corporation for Assigned Names and Numbers (ICANN)—
oversees the management of toplevel domains, accredits registrars, and
coordinates other aspects of DNS.
Domain name registration process
1. Registrant searches for domain, typically using web
portal of Registrar or Reseller.
2. Registrar queries the relevant TLD Registry
Operator to see if requested domain is available.
3. If domain is available, then Registrant will pay for
the domain and provide the necessary WHOIS
information
4. Registrar pushes WHOIS information about new
domain to TLD Registry Operator
5. Registry operator adds WHOIS information for new
domain to its authoritative list
6. Registry operator will push DNS 5 information for
new domain out to its name servers for the TLD.
Address Resolution
1. Client makes request for domain

2. Client computer checks local DNS Cache

3. If requested domain is not in the local cache, the


computer requests the IP address for the domain
from its primary DNS server

4. If the primary DNS Server doesn’t have a record


for the requested domain in its cache, it sends
out the request to the Root Name Server

5. The Root Name Server returns the address of the


relevant Top-Level Domain (TLD) Server.
Address Resolution (cont)
6. The DNS Server requests the DNS record
information from the provided TLD Server.

7. The TLD Name Server returns with the IP


addresses of the Authoritative DNS Servers for
the requested domain.

8. The DNS Server requests the IP address for the


originally requested domain from one of the
site’s Authoritative DNS Servers.

9. The DNS Server returns the IP address of the


requested domain.

10. The client computer can finally make its request


of the domain.
Uniform Resource Locators
Uniform Resource Locators (URL) allow clients to request particular resources (files)
from the server.

URL’s consist of two required components:

1. the protocol used to connect and

2. the domain (or IP address) to connect to.


Uniform Resource Locators (optional)
Optional components of the URL are:

• the path (which identifies a file or directory to access on that server),

• the port to connect to,

• a query string, and

• a fragment identifier
Port (URL)
• A port is a type of software connection point used by the underlying TCP/IP
protocol and the connecting computer.

• Although the port attribute is not commonly used in production sites, it can be
used to route requests to a test server, to perform a stress test, or even to
circumvent Internet filters.

• If no port is specified, the protocol determines which port to use. For instance, port
80 is the default port for web-related HTTP requests.

• Syntax is to add a colon after the domain, then specify an integer port number.
http://funwebdev.com:8080/ would connect on port 8080
Path (URL)
• The path is an important concept to anyone who has ever used a computer file
system.

• The root of a web server corresponds to a folder somewhere on that server.On


many Linux servers that path is /var/www/html/ or something similar (for Windows
it is often /inetpub/wwwroot/).

• The path is optional. However, when requesting a folder or the top-level page of a
domain, the web server will decide which file to send you.
Query String (URL)
Query strings will be covered in depth when we learn more about HTML forms and
server-side programming. They are a critical way of passing information, such as user
form input, from the client to the server.

• In URLs, they are encoded as key-value pairs delimited by & symbols and preceded
by the ? Symbol

• An example query string for passing name and password is shown


Fragment (URL)
• The last part of a URL is the optional fragment.

• This is used as a way of requesting a portion of a page.

• Browsers will see the fragment in the URL (denoted by #), seek out the fragment
tag anchor in the HTML, and scroll the website down to it.

• “back to top” links are a common use of fragments.


Hypertext Transfer Protocol
• HTTP is an essential part of the web.

• HTTP establishes a TCP connection on


port 80 (by default). The server waits
for the request, and then responds
with a
– Headers,
– Response code,
– an optional message (which can
include files)
HTTP Headers
Headers are sent in the request from the client and received in the response from the
server. Headers are one of the most powerful aspects of HTTP and unfortunately, few
developers spend any time learning about them.

• Request headers include data about the client machine


– Host, User-Agent, Cache settings and more

• Response headers have information about the server answering the request and
the data being sent
– Server, Last Modified, Content Type, Encoding,
HTTP Request Methods
• The most common requests are the GET and POST request, along with the HEAD
request

• We make use of the PUT and DELETE requests when using an API.

• Other HTTP verbs such as CONNECT, TRACE, and OPTIONS are less commonly used.
GET Request
• The most common type of HTTP request is the GET request.

• One is asking for a resource located at a specified URL to be retrieved.

• Whenever you click on a link, type in a URL in your browser, or click on a bookmark,
you are usually making a GET request.

• Data can be transmitted through a GET request, with a query string


POST Request
• The other common request method is the POST request.

• This method is normally used to transmit data to the server using an HTML form
Response Codes
• Response codes are integer values returned by the server as part of the response
header.

• These codes describe the state of the request, including whether it was successful,
had errors, requires permission, and more.

• The codes use the first digit to indicate the category of response.
– 2## codes are for successful responses,
– 3## are for redirection-related responses,
– 4## codes are client errors, while
– 5## codes are server errors.
HTTP Response Codes
Code Description
200: OK The request was successful.

301: Moved Permanently Tells the client that the requested resource has permanently moved.

304: Not Modified If the client requested a resource with appropriate Cache-Control headers, the
response might say that the resource on the server is no newer than the one in
the client cache.
401: Unauthorized Some web resources are protected and require the user to provide credentials
to access the resource.
404: Not found 404 codes are one of the only ones known to web users. Many browsers will
display an HTML page with the 404 code to them when the requested resource
was not found.
414: Request URI too long A 414 response code likely means too much data is likely trying to be
submitted via the URL.
500: Internal server error This error provides almost no information to the client except to say the server
has encountered an error.
Thank You

You might also like