[go: up one dir, main page]

0% found this document useful (0 votes)
36 views46 pages

Lec2

Chapter 2 of 'Fundamentals of Web Development' covers essential components of how the web works, including Internet protocols, the Domain Name System (DNS), Uniform Resource Locators (URLs), and the Hypertext Transfer Protocol (HTTP). It explains the layered architecture of networking, the role of web browsers and servers, and the importance of various application protocols for web communication. Key terms and concepts are summarized to aid understanding of web development fundamentals.

Uploaded by

kasperkey106
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)
36 views46 pages

Lec2

Chapter 2 of 'Fundamentals of Web Development' covers essential components of how the web works, including Internet protocols, the Domain Name System (DNS), Uniform Resource Locators (URLs), and the Hypertext Transfer Protocol (HTTP). It explains the layered architecture of networking, the role of web browsers and servers, and the importance of various application protocols for web communication. Key terms and concepts are summarized to aid understanding of web development fundamentals.

Uploaded by

kasperkey106
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/ 46

How the Web Works

Chapter 2

Naseebah Maqtary
2024

Randy Connolly and Ricardo Hoar Fundamentals of Web Development


© 2017 Pearson
Fundamentals of Web Development - 2nd Ed. Randy C onnolly and Ricardo Hoar
http://www.funwebdev.com
Chapter 2
1 Internet
Protocols 2 Domain Name
System

3 4
Uniform Resource Hypertext Transfer
Locators Protocol

5 Web Browsers
6 Web Servers

7
Summary

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Chapter 2
1 Internet
Protocols 2 Domain Name
System

3 4
Uniform Resource Hypertext Transfer
Locators Protocol

5 Web Browsers
6 Web Servers

7
Summary

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Internet Protocols
A Layered Architecture

TCP/IP.
These protocols have been implemented in every operating
system, and make fast web development possible.

Networking is it’s own entire discipline.

Web developer needs general awareness of what the suite of


Internet protocols does

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Internet Protocols
A Layered Architecture

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Internet Protocols
Link Layer

• Responsible for
• physical transmission of data across media (both wired and
wireless) and
• Establishing logical links.

It handles issues like packet creation, transmission,


reception, error detection, collisions, line sharing, and
more.

Much more to learn in Networking courses outside of


web development.

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Internet Protocols
Internet Layer

The Internet layer provides “best effort”


communication.

Makes use of IP addresses

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Internet Protocols
IP addresses

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Internet Protocols
Transport Layer (TCP)

• Ensures transmissions arrive in order and without error

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Internet Protocols
Application Layer

There are many application layer protocols. Web developers


should be aware of :
• HTTP. The Hypertext Transfer Protocol is used for web
communication.
• SSH. The Secure Shell Protocol allows remote command-
line connections to servers.
• FTP. The File Transfer Protocol is used for transferring files
between computers.
• POP/IMAP/SMTP. Email-related protocols for transferring
and storing email.
• DNS. The Domain Name System protocol used for
resolving domain names to IP addresses.

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Chapter 2
1 Internet
Protocols 2 Domain Name
System

3 4
Uniform Resource Hypertext Transfer
Locators Protocol

5 Web Browsers
6 Web Servers

7
Summary

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Domain Name System
Name Levels

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Domain Name System
Name Levels

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Domain Name System
Types of Top Level Domains

• Generic top-level domain (gTLD)


• Unrestricted. TLDs include .com, .net, .org, and .info.
• Sponsored. TLDs including .gov, .mil, .edu, and others.
• New TLDs.
• Country code top-level domain (ccTLD)
• TLDs include .us , .ca , .uk , and .au.
• Internationalized Domain Names
• arpa

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Domain Name System
Address Resolution

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Chapter 2
1 Internet
Protocols 2 Domain Name
System

3 4
Uniform Resource Hypertext Transfer
Locators Protocol

5 Web Browsers
6 Web Servers

7
Summary

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Uniform Resource Locators
Overview

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Uniform Resource Locators
Protocol

Recall that in Section 2.1, we listed several application layer


protocols on the TCP/IP stack. FTP, SSH, HTTP, POP, IMAP,
DNS, …
Requesting
• ftp://example.com/abc.txt → sends out an FTP request
on port 21, while
• http://example.com/abc.txt → transmits an HTTP request
on port 80.

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Uniform Resource Locators
Domain

• The domain identifies the server from which we are


requesting resources.
• Since the DNS system is case insensitive, this part of the
URL is case insensitive.
• Alternatively, an IP address can be used for the domain

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Uniform Resource Locators
Port

• The optional port attribute allows us to specify


connections to ports other than the defaults

• Add a colon after the domain, then specify an integer port


number.

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Uniform Resource Locators
Path

Familiar 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/
• On Windows IIS machines it is often /inetpub/wwwroot/

The path is optional. However, when requesting a folder or


the top-level page, the web server will decide which file to
send you.

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Uniform Resource Locators
Query String

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Uniform Resource Locators
Fragment

A way of requesting a portion of a page.

• Browsers will see the fragment in the URL, seek out the
tag anchor in the HTML, and scroll the website to it.

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Chapter 2
1 Internet
Protocols 2 Domain Name
System

3 4
Uniform Resource Hypertext Transfer
Locators Protocol

5 Web Browsers
6 Web Servers

7
Summary

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Hypertext Transfer Protocol
Headers

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Hypertext Transfer Protocol
Headers

Request headers include data about the client machine. •


Response headers have information about the server •
answering the request and the data being sent

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Hypertext Transfer Protocol
Request Methods

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Hypertext Transfer Protocol
Response Codes

• 2## codes are for successful responses,


• 3## are for redirection-related responses,
• 4## codes are client errors,
• 5## codes are server errors.

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Chapter 2
1 Internet
Protocols 2 Domain Name
System

3 4
Uniform Resource Hypertext Transfer
Locators Protocol

5 Web Browsers
6 Web Servers

7
Summary

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Web Browsers
Fetching a Web Pag e

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Web Browsers
Fetching a Web Page – Load Times and Cascades

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Web Browsers
Browser Rendering

• Interpreting the entire HTML markup together with the


image and other assets into a grid of pixels for display
within the browser window is called rendering the
webpage.
• Implemented differently for each browser (Firefox,
Chrome, Safari, Explorer, and Opera)

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Web Browsers
Browser Caching

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Web Browsers
Browser Features

• search engine integration,


• URL autocompletion,
• Form autocompletion,
• cloud caching of user history/bookmarks,
• phishing website detection,
• secure connection visualization,

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Web Browsers
Browser Extensions

Can change what is shown to the end user. Newer challenge


for web developers.
For developers, extensions like
• Firebug and
• Yslow
For the general public:
• Adblock
• Third Party Plugins

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Chapter 2
1 Internet
Protocols 2 Domain Name
System

3 4
Uniform Resource Hypertext Transfer
Locators Protocol

5 Web Browsers
6 Web Servers

7
Summary

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Web Servers
Operating Systems

• A web server is nothing more than a computer that


responds to HTTP requests.
• Real-world web servers are often more powerful than
your own desktop computer
• Webservers must choose an application stack to run a
website. This application stack will include an
• operating system,
• web server software,
• a database,
• and a scripting language for dynamic requests

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Web Servers
Application Stacks

We will rely on the LAMP software stack ,which refers to


• L inux operating system,
• A pache web server,
• M ySQL database, and
• P HP scripting language

Other stacks include WAMP, WISA, MEAN, …

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Web Servers
Operating Systems

• Linux
• Windows

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Web Servers
Web Server Software

• Apache
• Nginx
• IIS

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Web Servers
Database Software

• MySQL
• PostgreSQL
• Sqlite
• Oracle
• IBM DB2
• Microsoft SQL Server
• MongoDB

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Web Servers
Scripting Software

• PHP
• ASP.NET
• Python
• Node.js
• …

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Chapter 2
1 Internet
Protocols 2 Domain Name
System

3 4
Uniform Resource Hypertext Transfer
Locators Protocol

5 Web Browsers
6 Web Servers

7
Summary

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Summary
Key Terms

address resolution GET request link layer


Apache HTTP MAC addresses
Application stack Internet Corporation for MEAN software stack
application layer Assigned Names and packet
country code top-level Numbers (ICANN) protocol
domain (ccTLD) Internet Assigned port
DNS resolver Numbers Authority POST request
DNS server (IANA) protocol
domain names internationalized top-level request
domain name registrars domain name (IDN) request headers
Domain Name System Internet layer response codes
(DNS) Internet Protocol (IP) response headers
FTP IP address reverse DNS lookups
four-layer network model IPv4 root name server
generic top-level domain IPv6 second-level domain
(gTLD) LAMP software stack SFTP

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Summary
Key Terms (Continued)

SSH Transmission Control Uniform Resource


subdomain Protocol (TCP) Locator (URL)
TCP/IP (Transmission top-level domain (TLD) web server
Control Protocol/ TLD name server WISA software stack
Internet Protocol) User Datagram
transport layer Protocol (UDP)

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.
Questions?

Randy Connolly and Ricardo Hoar Fundamentals of Web Development - 2nd Ed.

You might also like