EEC-484/584 Computer Networks
Lecture 20
Wenbing Zhao wenbing@ieee.org
(Lecture nodes are based on materials supplied by Dr. Louise Moser at UCSB and Prentice-Hall)
2
Outline
Midterm #2 results
Review of lecture 19
World Wide Web
20 November 2005 EEC484/584
3
Wenbing Zhao
0.00 0
0 0
0 0
0 0 0
64.44 58
0 0
8 10 6
10 24
65.56 59
0 0
5 10 10 10 24
70.00 63
0 0
9 10 10 14 20
78.89 71
0 10 8
7 10 14 22
83.33 75
10 10
7 10 10 12 16
85.56 77
0 6
9 10 10 18 24
85.56 77
0 10 9
10 10 16 22
87.78 79
0 10 10
10 9
18 22
88.89 80
0 10 8
10 10 16 26
Total (normalized) Total
P7 P6
P5 P4
P3 P2 P1
EEC484 Midterm#2 Results
A
B+
A-
B B-
C F
20 November 2005 EEC484/584
4
Wenbing Zhao
EEC584 Midterm#2 Results
75 0
4 9
10 10
18 24
75 0
5 8
10 10
16 26
76 10
0 7
10 7
16 26
77 10
0 5
10 10
20 22
78 10
0 6
10 10
16 26
80 5
6 9
10 10
16 24
80 10
0 6
10 10
16 28
81 10
0 9
10 10
18 24
84 10
6 6
10 10
14 28
86 10
5 5
10 10
16 30
87 10
3 6
10 10
20 28
Total P7
P6 P5
P4 P3
P2 P1
A-
A
20 November 2005 EEC484/584
5
Wenbing Zhao
EEC584 Midterm#2 Results
62 0
0 6
10 10
14 22
64 0
0 8
10 10
12 24
65 0
0 9
10 10
14 22
65 0
0 9
10 10
14 22
67 0
0 7
10 10
16 24
67 0
0 9
10 10
12 26
68 3
5 8
10 10
10 22
69 10
0 9
10 2
14 24
69 0
0 7
10 10
14 28
71 10
0 4
7 10
18 22
71 10
5 8
0 10
14 24
72 0
5 9
10 10
18 20
72 3
5 9
10 9
14 22
73 10
0 6
10 9
14 24
73 9
6 8
0 10
14 26
74 3
5 10
10 10
12 24
74 10
0 9
10 9
12 24
B+
B
6
62.7 32.6
58 42
9.5 10
6.5
62.8 32.7
59 52
0 10
10
75.9 39.5
63 67
9.5 10
7
78.2 40.7
77 57.5
10 10
7
79.1 41.1
75 65
9 10
6
87.3 45.4
71 81
10 10
9
88.0 45.8
80 90
0 10
10
94.1 48.9
77 90
9 12
8.5
96.2 50.0
79 94
9.5 12.5
7
Total (normalized) Total
(52%) MT2
MT1 HW3
HW2 HW1
EEC484 Accumulated Credit
A A- B+
C
20 November 2005 EEC484/584
7
Wenbing Zhao
EEC584 Accumulated Credit
78.8 41
81 64
10 10
10
79.2 41.2
67 81
10 10
9
80.8 42
72 78
10 10
10
81.2 42.2
86 65
10 10
10
81.5 42.4
76 79
8.5 10
10
83.8 43.6
72 91
8.5 10
9
83.8 43.6
73 87
9 10
10
84.0 43.7
69 89.5
10 10
10
85.0 44.2
77 85
9.5 10
10
85.8 44.6
84 79
10 10
10
87.3 45.4
75 94
9 10
10
87.7 45.6
75 95
9 10
10
87.7 45.6
80 90
10 10
9
88.7 46.1
87 84.5
9.5 10
10
Total (normalized) Total (52%)
MT2 MT1
HW3 HW2
HW1
A A-
20 November 2005 EEC484/584
8
Wenbing Zhao
EEC584 Accumulated Credit
66.5 34.6
65 54
8 10
9
66.9 34.8
62 54
10 10
9
70.4 36.6
64 62
10 10
8.5
71.5 37.2
80 49
9 10
9.5
72.7 37.8
78 55
9 10
9
73.5 38.2
71 67
6.5 10
10
73.5 38.2
65 76
7 10
8
75.8 39.4
68 70
10 10
9.5
76.2 39.6
74 64
10 10
10
76.2 39.6
69 75
9 10
8
76.7 39.9
73 66.5
10 10
10
76.9 40
74 72
8 10
9
77.3 40.2
67 75
9.5 10
10
78.1 40.6
71 78
7 10
10
A- B+
B
20 November 2005 EEC484/584
9
Wenbing Zhao
DNS – The Domain Name System
Hierarchical domain-based naming scheme and distributed database system for implementing it
Maps symbolic names (ASCII strings) to network addresses, i.e., maps hostnames and email
addresses to IP addresses
10
The DNS Name Space
Each domain is named by the path upward from it to the unnamed root. E.g., eng.sun.com.
Domain names can be absolute (end with period), or relative
Domain names are case insentive. Component names <= 63 chars. Full path names <= 255 chars
20 November 2005 EEC484/584
11
Wenbing Zhao
Resource Records
Every domain has set of resource records
Resolver returns set of resource record
¾ Domain-name, Time_to_live, Type, Class, Value
20 November 2005 EEC484/584
12
Wenbing Zhao
Electronic Mail
Two subsystems
¾
User agents – allow users to read and send email.
− They are local programs that provide command-based, menu-based, or graphics for interacting with email system
− User agent builds message, passes it to message transfer agent, which uses header fields to construct envelop
¾
Message transfer agents – move messages from source to destination
− They are system daemons (software that runs in background) that move email through systems
20 November 2005 EEC484/584
13
Wenbing Zhao
MIME –
Multipurpose Internet Mail Extensions
Problems with international languages:
¾ Languages with accents (French, German)
¾ Languages in non-Latin alphabets (Hebrew, Russian)
¾ Languages without alphabets (Chinese, Japanese)
¾ Messages not containing text at all (audio or images)
Solutions
¾ Add structure to message body
¾ Define encoding rules for non-ASCII messages
14
MIME – Encoding Binary Messages
Base64 encoding or ASCII armor:
¾ Groups of 24 bits are broken up into four 6-bit units, with each unit being sent as a legal ASCII character
¾ The coding is ''A'' for 0, ''B'' for 1, and so on, followed by the 26 lower- case letters, the ten digits, and finally + and / for 62 and 63, respectively
¾ The == and = sequences indicate that the last group contained only 8 or 16 bits, respectively
¾ Carriage returns and line feeds are ignored,
Quoted-printable encoding: For messages that are almost entirely ASCII but with a few non-ASCII characters
This is just 7-bit ASCII, with all the characters above 127 encoded as an
20 November 2005 EEC484/584
15
Wenbing Zhao
SMTP
Source machine (client) establishes TCP connection to port 25 of destination machine
¾ Email daemon listens to this port, accepts incoming connections, copies messages from them into appropriate mailboxes
¾ Error report returned to sender if message can’t be delivered
¾ Source machine waits for destination machine to reply
Destination machine (server) sends line of text, giving its identity and telling whether or not it can receive mail
If not, client releases connection and tries again later.
If so, client announces users at source and destination machines. If user exists at destination machine, server tells client to send message
Client sends, server acks
Connection is released
20 November 2005 EEC484/584
16
Wenbing Zhao
Email Gateways
Required when two machines use different transport protocols or different message formats
¾
E.g., SMTP vs. X.400
Gateway does conversion
20 November 2005 EEC484/584
17
Wenbing Zhao
Final Delivery
Sending and reading mail when the receiver has a permanent Internet connection and the user agent runs on the same machine as the message transfer agent
Reading e-mail when the receiver has a dial-up connection to an ISP
18
POP3 – Post Office Protocol
Fetch email from
remote mailbox, store in user’s local machine to be read later
¾
Example: using POP3 to
fetch three messages
20 November 2005 EEC484/584
19
Wenbing Zhao
IMAP –
Interactive Mail Access Protocol
For users who use multiple machines
Email server maintains central repository that can be accessed from any machine
Unlike POP3, IMAP does not copy email to user’s machines
20 November 2005 EEC484/584
20
Wenbing Zhao
A Comparison of POP3 and IMAP
20 November 2005 EEC484/584
21
Wenbing Zhao
Email Spoofing
Email spoofing: the forgery of an e-mail header so that the message appears to have originated from someone or somewhere other than the actual source
E-mail spoofing is possible because Simple Mail Transfer Protocol does not include an authentication mechanism
¾ To send spoofed e-mail, senders insert commands in headers that will alter message information.
¾ It is possible to send a message that appears to be from anyone, anywhere, saying whatever the sender wants it to say
Open Replay Problem
22
An open relay is an SMTP email server that allows third-party relay of e-mail messages.
By processing mail that is neither for nor from a local user, an open relay makes it possible for an
unscrupulous sender to route large volumes of spam
20 November 2005 EEC484/584
23
Wenbing Zhao
Relayed Mail Scenario
Step 1 -- Source Host to Relay Host
¾ R: 220 USC-ISIE.ARPA Simple Mail Transfer Service Ready
¾ S: HELO MIT-AI.ARPA
¾ R: 250 USC-ISIE.ARPA
¾ S: MAIL FROM:<JQP@MIT-AI.ARPA>
¾ R: 250 OK
¾ S: RCPT TO:<@USC-ISIE.ARPA:Jones@BBN-VAX.ARPA>
¾ R: 250 OK
¾ S: DATA
¾ R: 354 Start mail input; end with <CRLF>.<CRLF>
¾ S: Date: 2 Nov 81 22:33:44
¾ S: From: John Q. Public <JQP@MIT-AI.ARPA>
¾ S: Subject: The Next Meeting of the Board
¾ S: To: Jones@BBN-Vax.ARPA
¾ S:
¾ S: Bill:
¾ S: The next meeting of the board of directors will be on Tuesday. John.
¾ S: .
¾ R: 250 OK
¾ S: QUIT
¾ R: 221 USC-ISIE.ARPA Service closing transmission channel
20 November 2005 EEC484/584
24
Wenbing Zhao
Relayed Mail Scenario
Step 2 -- Relay Host to Destination Host
¾ R: 220 BBN-VAX.ARPA Simple Mail Transfer Service Ready
¾ S: HELO USC-ISIE.ARPA
¾ R: 250 BBN-VAX.ARPA
¾ S: MAIL FROM:<@USC-ISIE.ARPA:JQP@MIT-AI.ARPA>
¾ R: 250 OK
¾ S: RCPT TO:<Jones@BBN-VAX.ARPA>
¾ R: 250 OK
¾ S: DATA
¾ R: 354 Start mail input; end with <CRLF>.<CRLF>
¾ S: Received: from MIT-AI.ARPA by USC-ISIE.ARPA ; 2 Nov 81 22:40:10 UT
¾ S: Date: 2 Nov 81 22:33:44
¾ S: From: John Q. Public <JQP@MIT-AI.ARPA>
¾ S: Subject: The Next Meeting of the Board
¾ S: To: Jones@BBN-Vax.ARPA
¾ S:
¾ S: Bill:
¾ S: The next meeting of the board of directors will be on Tuesday. John.
¾ S: .
¾ R: 250 OK
¾ S: QUIT
¾ R: 221 USC-ISIE.ARPA Service closing transmission channel
20 November 2005 EEC484/584
25
Wenbing Zhao
The World Wide Web
Creation of Tim Berners-Lee, in 1989 CERN nuclear physics research
Mosaic – first graphical interface, creation of Marc Andersson (and others), precursor to Netscape
How does WWW work inside?
¾ To host a web browser, a machine must be directly on Internet, or have a connection to router or machine on Internet
¾ To fetch a Web page, browser establishes TCP connection to the machine where the page is and sends a message over the connection asking for the page
26
The World Wide Web
Architectural Overview
Static Web Documents
Dynamic Web Documents
HTTP – The HyperText Transfer Protocol
Performance Enhancements
The Wireless Web (not required)
20 November 2005 EEC484/584
27
Wenbing Zhao
Architectural Overview
WWW consists of a vast collection of documents or Web pages
Each page may contain links to other pages. Users can follow a link by clicking on it, which then takes them to the page pointed to
The idea of having one page point to another is called hypertext
¾ Invented by Vannevar Bush, a MIT EE professor, in 1945
Browser – program used to view Web pages
Hyperlinks – strings of text that are links to other pages
20 November 2005 EEC484/584
28
Wenbing Zhao
Architectural Overview
A Web page
The page reached by clicking on Department of Animal Psychology
Architectural Overview
Every Web site has server process listening to TCP port 80 for incoming connections from clients (browsers)
After connection is established, client sends request and server sends reply
Then connection is released
The Client Side
Plug-in: a code module that the browser fetches from a special directory on the disk and installs as an
extension to itself
Helper application: a complete program, running as
a separate process. It accepts the name of a scratch
file where the content file has been stored, opens the
file, and displays the contents
20 November 2005 EEC484/584
31
Wenbing Zhao
The Server Side
Steps the server performs in its main loop (to a first approximation):
¾
Accept a TCP connection from a client (a browser)
¾
Get the name of the file requested
¾
Get the file (from disk)
¾
Return the file to the client
¾
Release the TCP connection
20 November 2005 EEC484/584
32
Wenbing Zhao
The Server Side
Steps the server performs in its main loop (more realistic)
¾ Resolve the name of the Web page requested
¾ Authenticate the client
¾ Perform access control on the client
¾ Check the cache
¾ Fetch the requested page from disk
¾ Determine the MIME type to include in the response
¾ Take care of miscellaneous odds and ends (e.g., building user profile or gathering certain statistics)
¾ Return the reply to the client
¾ Make an entry in the server log
20 November 2005 EEC484/584
33
Wenbing Zhao
The Server Side
A multithreaded Web server with a front end and processing modules
34
The Server Side
A server farm
20 November 2005 EEC484/584
35
Wenbing Zhao
The Server Side
Normal request-reply message sequence
Sequence when TCP handoff is used
20 November 2005 EEC484/584
36
Wenbing Zhao
URLs – Uniform Resource Locaters
URL – Uniform Resource Locator
URL encodes three types of information
¾
What is the page called – local name uniquely indicating the specific page
¾
Where is the page located – DNS name of the server on which the page is located
¾
How can the page be accessed – protocol, e.g.,
http, ftp
20 November 2005 EEC484/584
37
Wenbing Zhao
Some Common URLs
38
Statelessness and Cookies
HTTP is basically stateless
Sometimes, it is necessary to have stateful Web client/server communications
Cookies: name derives from ancient programmer slang in which a program calls a procedure and gets something back that it may need to present later to get some work done
¾ Some examples of cookies
20 November 2005 EEC484/584
39
Wenbing Zhao
HTML – HyperText Markup Language
(b)
The HTML for a sample Web page The formatted page
20 November 2005 EEC484/584
40
Wenbing Zhao
Common HTML Tags
Tables
An HTML table
A possible rendition of this table
Forms
(a) The HTML for an order form
(b) The formatted page
20 November 2005 EEC484/584
43
Wenbing Zhao
Forms
A possible response from the browser to the server with information filled in by the user:
20 November 2005 EEC484/584
44
Wenbing Zhao
XML and XSL
Drawback of HTML
¾
Mixes content with formatting
¾
Does not provide structure to Web pages
XML: eXtensible Markup Language
¾
Describes Web content in a structured way
XSL: eXtensible Style Language
¾
Describes the formatting independently of the
content
20 November 2005 EEC484/584
45
Wenbing Zhao
A Simple Web Page in XML
46
A Style Sheet in XSL
20 November 2005 EEC484/584
47
Wenbing Zhao
Dynamic Web Documents
Server-side dynamic Web page generation
¾
CGI – Common Gateway Interface
− Standard interface to allow Web servers to talk to back- end programs and scripts that can accept input and generate HTML pages in response
¾
PHP – PHP: Hypertext Preprocessor
− PHP scripts embeded inside HTML pages and have them be executed by the server itself to generate response page
¾
JSP - Java Server Pages
¾
ASP – Active Server Pages
20 November 2005 EEC484/584
48
Wenbing Zhao
Server-Side Dynamic Web Page Generation
Steps in processing the information from an HTML form
20 November 2005 EEC484/584
49
Wenbing Zhao
Server-Side Dynamic Web Page Generation
A Web page containing a form
A PHP script for handling the output of the form
Output from the PHP script when
the inputs are "Barbara" and 24 respectively
Client-Side Dynamic Web Page Generation
50
Use of
JavaScript for
processing a
form.
20 November 2005 EEC484/584
51
Wenbing Zhao
Client-Side Dynamic Web Page Generation
Server-side scripting with PHP Client-side scripting with JavaScript
20 November 2005 EEC484/584
52
Wenbing Zhao
Client-Side Dynamic Web Page Generation
The various ways to generate and display content
20 November 2005 EEC484/584
53
Wenbing Zhao
HyperText Transfer Protocol
HTTP – HyperText Transfer Protocol
¾ It specifies what messages clients may send to servers and what responses they get back in return
¾ Each interaction consists of one ASCII request, followed by one RFC 822 MIME-like response
¾ Defined in RFC 2616
HTTP
¾ Connection
− In HTTP 1.0: make connection, sends a request, gets a response, tears down connection
− In HTTP 2.0: connection can be reused
¾ Methods: had some provision for object-oriented programming
¾ Message header
54
HTTP Methods
The built-in HTTP request methods
¾
Method names are case sensitive!
20 November 2005 EEC484/584
55
Wenbing Zhao
HTTP Methods
The status code response groups
20 November 2005 EEC484/584
56
Wenbing Zhao
HTTP Message Headers
Redirection
Example HTTP Usage
Content of the log file
>telnet www.ietf.org 80 >log
>GET /rfc.html HTTP/1.1
>Host: www.ietf.org
>
>close
58
Performance Enhancement
Caching
¾ Save pages that have been requested in case they are used again
¾ Client-side technique
Server replication
¾ Replicate server’s contents at multiple locations
¾ Sometimes called mirroring
Content delivery networks
¾ Deliver contents for their providers to end users efficiently for a fee
¾ Whole process starts with URL replacement so all contents point to a CDN server
20 November 2005 EEC484/584
59
Wenbing Zhao
Caching
Hierarchical caching with three proxies
20 November 2005 EEC484/584
60
Wenbing Zhao
Content Delivery Networks
Original Web page
Same page after transformation
20 November 2005 EEC484/584
61
Wenbing Zhao
Content Delivery Networks
Steps in looking up a URL when a CDN is used
WAP –
62The Wireless Application Protocol
The WAP protocol stack
20 November 2005 EEC484/584
63
Wenbing Zhao
WAP
The WAP architecture
20 November 2005 EEC484/584
64
Wenbing Zhao
I-Mode
Structure of the i-mode data network showing
the transport protocols
20 November 2005 EEC484/584
65
Wenbing Zhao
I-Mode
Structure of the i-mode software
66
I-Mode
An example of cHTML file.
20 November 2005 EEC484/584
67
Wenbing Zhao
Second-Generation Wireless Web
Comparison of 1st-generation WAP and i-mode
20 November 2005 EEC484/584
68
Wenbing Zhao
Second-Generation Wireless Web
New features of WAP 2.0
Push model as well as pull model
Support for integrating telephony into apps
Multimedia messaging
Inclusion of 264 pictograms
Interface to a storage device
Support for plug-ins in the browser
20 November 2005 EEC484/584
69
Wenbing Zhao
Second-Generation Wireless Web
WAP 2.0 supports two protocol stacks
70