Lec1 - Overview
Lec1 - Overview
Lec1 - Overview
Term 2020-2
1
1
Reasonable Questions
1
Web ¹ Internet
• Internet : a physical network connecting millions of computers using the same protocols for
sharing/transmitting information (TCP/IP)
§ in reality, the Internet is a network of smaller networks
• World Wide Web: a collection of interlinked multimedia documents that are stored on the
Internet and accessed using a common protocol (HTTP)
3
3
4
4
2
The Internet
• Technical origin
§ One of earliest attempts to network heterogeneous, geographically dispersed
computers
§ Email first available on ARPANET in 1972 (and quickly very popular!)
5
5
The Internet
• Open-access networks
§ Regional university networks (e.g., SURAnet)
§ CSNET for CS departments not on ARPANET
• NSFNET (1985-1995)
§ Primary purpose: connect supercomputer centers
§ Secondary purpose: provide backbone to connect regional networks
3
Internet Growth
• throughout the 70's, the size of the ARPANET doubled every year
§ first ARPANET e-mail sent in 1971
§ decentralization mades adding new computers easy
§ TCP/IP developed in the mid 1970s for more efficient packet routing
§ migration of ARPANET to TCP/IP completed 1 January, 1983
§ ~1000 military & academic host computers connected by 1984
4
Internet users in Vietnam
From dammio
9
9
10
10
5
History of the Web (cont.)
• the Web was an obscure, European research tool until 1993
• in 1993, Marc Andreessen and Eric Bina (at the National Center for
Supercomputing Applications, a unit of the University of Illinois) developed
Mosaic, one of the early graphical Web browsers that popularized the WWW for
the general public (Erwise was the first one, ViolaWWW the second)
§ the intuitive, clickable interface helped make hypertext accessible to the masses
§ made the integration of multimedia (images, video, sound, …) much easier
§ Andreessen left NCSA to found Netscape in 1994
cheap/free browser further popularized the Web (75% market share in 1996)
12
12
6
Popular websites in Vietnam
From dammio
13
13
• The Web is the collection of machines (Web servers) on the Internet that
provide information, particularly HTML documents, via HTTP.
• Machines that access information on the Web are known as Web clients.
A Web browser is software used by an end user to access the Web.
14
14
7
Hypertext Transport Protocol (HTTP)
15
15
HTTP
16
16
8
HTTP Request
17
17
HTTP Request
18
18
9
HTTP Request
Start line
§ Example: GET / HTTP/1.1
Three space-separated parts:
§ HTTP request method
§ Request-URI (Uniform Resource Identifier)
§ HTTP version
19
19
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
20
20
10
HTTP Request
Start line
§ Example: GET / HTTP/1.1
Three space-separated parts:
§ HTTP request method
§ Request-URI
§ HTTP version
21
21
HTTP Request
Ex: in http://www.example.com/
§ Request-URI is the portion of the requested URI that follows the host name (which is
supplied by the required Host header field)
Ex: / is Request-URI portion of http://www.example.com/
22
22
11
URI
23
23
HTTP Response
24
24
12
HTTP Response
25
25
HTTP Response
Status line
§ Example: HTTP/1.1 200 OK
Three space-separated parts:
§ HTTP version
§ status code
§ reason phrase (intended for human use)
26
26
13
HTTP Response
Status code
§ Three-digit number
§ First digit is class of the status code:
1=Informational
2=Success
3=Redirection (alternate URL is supplied)
4=Client Error
5=Server Error
§ Other two digits provide additional information
§ See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
27
27
HTTP Response
28
28
14
HTTP Response
29
29
Receive
Response
{ HTTP/1.1 200 OK
Date: Thu, 09 Oct 2003
20:30:49 GMT
…
30
30
15
Web Browsers
31
31
Web Browsers
32
32
16
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
33
33
• as the Web continues to move towards more and more online services and e-
commerce continues to grow, Web pages must also provide dynamic content
§ pages can be fluid, changeable (e.g., rotating banners)
§ must be able to react to the user's actions, request and process info, tailor services
e.g., amazon.com
34
34
17
Web server/client
Client Server
Browser Web
Server
35
35
Client Caching
Client Server
Browser Web
Server
3. Store image
Cache
36
36
18
Client Caching
Client Server
Browser Web
I need that Server
image
again…
Cache
37
37
Client Caching
Client Server
This…
Cache
38
38
19
Client Caching
Client Server
Browser Web
Server
I need that
image
again…
Get … or this
image
Cache
39
39
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)
40
40
20
Web Clients
41
41
Web Servers
Basic functionality:
§ Receive HTTP request via TCP
§ Map host header (domain name) 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
§ Map type of resource to appropriate MIME type and use to set
Content-Type header in HTTP response
§ Log information about the request and response
42
42
21
Web Servers
43
43
Client-Side Programming
• can download program with Web page, execute on client machine
§ simple, generic, but sometimes insecure
• JavaScript
§ a scripting language for Web pages, developed by Netscape in 1995
§ uses a C++/Java-like syntax, so familiar to programmers, but simpler
§ good for adding dynamic features to Web page, controlling forms and GUI
§ requires users to have this technology enabled on their browsers
§ see http://www.w3schools.com/js/
• Java applets
§ can define small, special-purpose programs in Java called applets
§ provides (almost) full expressive power of Java (but with more overhead)
§ good for more complex tasks or data heavy tasks, such as graphics
§ see http://java.sun.com/applets/
44
44
22
Server-Side Programming
• can store and execute program on Web server, link from Web page
§ more complex, requires server privileges, but can still be (mostly) secure
• Active Server Pages (ASP), Java Servlets, PHP, Server Side Includes, Ajax
§ some of these are vendor-specific alternatives to CGI (such as Microsoft’s ASP)
§ provide many of the same capabilities as CGI programs but using HTML-like tags
§ some of these technologies might require functionality to be enabled in the client’s browser
(e.g. Ajax generally requires the use of Javascript combined with PHP or some other server-
based programming component)
45
45
email: chungdt@soict.hust.edu.vn
Q&A
46
46
23