WebEssentials 31012024
WebEssentials 31012024
2
The Internet
Open-access networks
Regional university networks (e.g., SURAnet- Southeastern
Universities Research Association Network )
CSNET for CS departments not on ARPANET
NSFNET ( National Science Foundation Network)
(1985-1995)
Primary purpose: connect supercomputer centers
Secondary purpose: provide backbone to connect regional
networks
3
The Internet
4
The Internet
5
The Internet
6
Internet Protocols
7
Internet Protocol (IP)
Source
Network 1
Gateway
Destination
Gateway
Network 2 Network 3
10
IP
Source
LAN 1
Gateway
Destination
Gateway
11
Transmission Control Protocol
(TCP)
Limitations of IP:
No guarantee of packet delivery (packets can be
dropped)
Communication is one-way (source to destination)
TCP adds concept of a connection on top of
IP
Provides guarantee that packets delivered.
Provide two-way (full duplex) communication
12
TCP
Establish
connection.
{ Can I talk to you?
OK.
{
Here’s a packet.
Send packet
Source Destination
with Got it.
acknowledgment.
Here’s a packet.
{
Resend packet if
no (or delayed) Here’s a resent packet.
acknowledgment.
Got it.
13
TCP
14
TCP
15
User Datagram Protocol (UDP)
16
Domain Name Service (DNS)
DNS is the “phone book” for the Internet
Map between host names and IP addresses
DNS often uses UDP for communication
Host names
Labels separated by dots, e.g., www.example.org
Final label is top-level domain
Generic:.com, .org, etc.
Country-code: .us, .il, etc.
17
DNS
Domains are divided into second-level domains,
which can be further divided into subdomains, etc.
E.g., in www.example.com, example is a
second-level domain
A host name plus domain name information is
called the fully qualified domain name (FQDN) of
the computer
Above, www is the host name, www.example.com
is the FQDN
18
DNS
19
DNS
20
Analogy to Telephone Network
21
Higher-level Protocols
22
2. World Wide Web
Originally, one of several systems for
organizing Internet-based information.
Competitors: WAIS(Wide Area Information Server),
Gopher, ARCHIE
Distinctive feature of Web: support for
hypertext (text containing links)
Communication via Hypertext Transport Protocol
(HTTP)
Document representation using Hypertext Markup
Language (HTML)
23
World Wide Web
26
HTTP
27
HTTP
Connect { $ telnet www.example.org 80
Trying 192.0.34.166...
Connected to www.example.com
(192.0.34.166).
Escape character is ’^]’.
{
Send GET / HTTP/1.1
Request Host: www.example.org
{
HTTP/1.1 200 OK
Receive
Date: Thu, 09 Oct 2003 20:30:49 GMT
Response
…
28
3. HTTP Request
29
HTTP Request
30
HTTP Request
Start line
Example: GET / HTTP/1.1
Three space-separated parts:
HTTP request method
Request-URI (Uniform Resource Identifier)
HTTP version
31
HTTP Request
Start line
Example: GET / HTTP/1.1
Three space-separated parts:
HTTP request method
Request-URI
HTTP version
We will cover 1.1, in which version part of start line
must be exactly as shown
32
HTTP Request
Start line
Example: GET / HTTP/1.1
Three space-separated parts:
HTTP request method
Request-URI
HTTP version
33
HTTP Request
34
URI
Start line
Example: GET / HTTP/1.1
Three space-separated parts:
HTTP request method
Request-URI
HTTP version
36
HTTP Request
37
HTTP Request
38
HTTP Request
Header field structure:
field name : field value
Syntax
Field name is not case sensitive.
Field value may continue on multiple lines by starting
continuation lines with white space
Field values may contain MIME (Multipurpose Internet
Mail Extensions) types, quality values, and wildcard
characters (*’s)
39
Multipurpose Internet Mail
Extensions (MIME)
Convention for specifying content type of a
message.
In HTTP, typically used to specify content type
of the body of the response
MIME content type syntax:
top-level type / subtype
Examples: text/html, image/jpeg
40
HTTP Quality Values and
Wildcards
Example header field with quality values:
accept:
text/xml,text/html;q=0.9,
text/plain;q=0.8, image/jpeg,
image/gif;q=0.2,*/*;q=0.1
Quality value applies to all preceding items.
Higher the value, higher the preference.
Note use of wildcards to specify quality 0.1 for
any MIME type not specified earlier.
41
HTTP Request
42
4. HTTP Response
43
HTTP Response
44
HTTP Response
Status line
Example: HTTP/1.1 200 OK
Three space-separated parts:
HTTP version
status code – (200)
reason phrase (intended for human use)
45
HTTP Response
Status code
Three-digit number
First digit is class of the status code:
1=Informational
2=Success
4=Client Error
5=Server Error
46
HTTP Response
47
HTTP Response
48
Client Caching
49
Client Client Caching Server
Browser Web
Server
3. Store image
Cache
50
Client Client Caching Server
Browser Web
Server
I need that
image
again…
Cache
51
Client Client Caching Server
This…
Cache
52
Client Client Caching Server
Browser Web
Server
I need that
image
again…
Get … or this
image
Cache
53
Client Caching
Cache advantages
(Much) faster than HTTP request/response
Less network traffic
Less load on server
Cache disadvantage
Cached copy of resource may be invalid
(inconsistent with remote version)
54
Client Caching
55
Character Sets
56
Character Sets
58
5. Web Clients
59
Web Browsers
First graphical browser running on general-
purpose platforms: Mosaic (1993)
60
Web Browsers
61
Web Browsers
Primary tasks:
Convert web addresses (URL’s) to HTTP
requests
Communicate with web servers via HTTP
Render (appropriately display) documents
returned by a server.
62
HTTP URL’s
http://www.example.org:56789/a/b/c.txt?t=win&s=chess#para5
authority Request-URI
64
Web Browsers
Additional functionality:
Execution of scripts (e.g., drop-down menus)
Event handling (e.g., mouse clicks)
GUI for controls (e.g., buttons)
Secure communication with servers.
Display of non-HTML documents (e.g., PDF)
via plug-ins.
65
Web Servers
Basic functionality:
Receive HTTP request via TCP
Map Host header to specific virtual host (one of many host
names sharing an IP address)
Map Request-URI to specific resource associated with the
virtual host
File: Return file in HTTP response
Program: Run program and return output in HTTP response
66
Web Servers
67
Web Servers
68
Web Servers
69
Tomcat Web Server
70
Tomcat Web Server
71
Tomcat Web Server
72
Tomcat Web Server
73
Tomcat Web Server
74
Tomcat Web Server
75
Tomcat Web Server
76
Tomcat Web Server
77
Tomcat Web Server
78
Tomcat Web Server
79
Tomcat Web Server
80
Tomcat Web Server
Access control:
Password protection (e.g., admin pages)
Users
and roles defined in
conf/tomcat-users.xml
Deny access to machines
Useful for denying access to certain users by denying access
from the machines they use
List of denied machines maintained in RemoteHostValve
81
Secure Servers
82
Secure Servers
I’d like to talk securely to you (over port 443)
83
Secure Servers
Man-in-the-Middle Attack
Fake Fake
DNS www.example.org
Server 100.1.1.1
What’s IP
address for 100.1.1.1 My credit card number is…
www.example.org?
Real
Browser www.example.org
84
Secure Servers
Preventing Man-in-the-Middle
Fake Fake
DNS www.example.org
Server 100.1.1.1
What’s IP
address for 100.1.1.1 Send me a certificate of identity
www.example.org?
Real
Browser www.example.org
85