Professional Documents
Culture Documents
Marcin Bienkowski
Institute of Computer Science
University of Wrocaw
Lecture 7
1 / 23
FTP
HTTP
DNS
BSD sockets interface
UDP
IP
TCP
ICMP
ARP / RARP
2
Ethernet
Lecture 7
2 / 23
Outlook
FTP
HTTP
Protocol description
Proxy servers
Lecture 7
3 / 23
FTP
FTP
Lecture 7
4 / 23
FTP
FTP
Lecture 7
5 / 23
FTP
Active mode
FTP client chooses a port, informs server about it and starts
listening on that port.
FTP server connects to this port and sends the data to it.
Problematic if the client is behind a firewall.
Passive mode
Client requests that the server should choose a port
Server picks a port, informs the client about it and starts to listen.
Client connects to this port and receives data from it.
Lecture 7
6 / 23
HTTP
HTTP
Lecture 7
7 / 23
HTTP
Protocol description
Lecture 7
8 / 23
HTTP
Protocol description
Examples:
http://www.ii.uni.wroc.pl/index.html
http://pl.wikipedia.org/wiki/URL
ftp://ftp.kernel.org/pub/index.html
mailto:jan.kowalski@serwer.com
Lecture 7
9 / 23
HTTP
Protocol description
URL (2)
URL for schemes http, ftp
Part after colon:
//
domain name
optionally :port
/
resource identifier within a server
Example:
http://www.ii.uni.wroc.pl:80/mbi/dyd/sieciw_10s/
Note:
/ in the identifier for denoting hierarchical structure.
Resource identifier is not necessarily a path to the file!
Computer networks (II UWr)
Lecture 7
10 / 23
HTTP
Protocol description
URL (2)
URL for schemes http, ftp
Part after colon:
//
domain name
optionally :port
/
resource identifier within a server
Example:
http://www.ii.uni.wroc.pl:80/mbi/dyd/sieciw_10s/
Note:
/ in the identifier for denoting hierarchical structure.
Resource identifier is not necessarily a path to the file!
Computer networks (II UWr)
Lecture 7
10 / 23
HTTP
Protocol description
Lecture 7
11 / 23
HTTP
Protocol description
Keep-alive connections
Lecture 7
12 / 23
HTTP
Protocol description
MIME type
For every file sent, the HTTP server should set Content-type field
appropriately. Examples:
text/plain text file
text/html HTML page
image/jpeg JPEG picture
video/mpeg MPEG video
application/msword DOC document
application/pdf PDF document
application/octet-stream sequence of bytes without an
interpretation.
Lecture 7
13 / 23
HTTP
Protocol description
HTTP replies
Lecture 7
14 / 23
HTTP
Protocol description
HTML
Lecture 7
15 / 23
HTTP
Protocol description
HTML versions
Quick look into history
HTML 1.0, 2.0, mainly academic usage, content is most important.
HTML 3.0, 3.2, 4.0, the emphasis is shifted to presentation (mixed
with content)
HTML 4.01 also known as everything is allowed, many sloppily
written webpages the webbrowser has to cope not only with the
complicated standard but also with dozens deviations from it.
XHTML 1.0, based on XML, rigid structure, separates content and
structure (HTML) from the presentation (CSS styles)
rigid format = easier processing
automatic processing of data on the webpage
one HTML, many CSS = different versions for different recipients
(PDA, phones, visibility impaired, ...)
Lecture 7
16 / 23
HTTP
Protocol description
Dynamic WWW
Client-side dynamics
Javascript: simple object-oriented interpreted language, code
embedded in the HTML.
Java applets, Flash, Silverlight application execution by
different web browser plugins.
Server-side dynamics
URI may point to the program, whose output is HTML (+ HTTP
header)
CGI (Common Gateway Interface): standard allowing for execution
of an arbitrary external program.
Mechanisms integrated with the webserver (PHP, JSP, ASP,
mod_perl, ...)
Lecture 7
17 / 23
HTTP
Protocol description
Dynamic WWW
Client-side dynamics
Javascript: simple object-oriented interpreted language, code
embedded in the HTML.
Java applets, Flash, Silverlight application execution by
different web browser plugins.
Server-side dynamics
URI may point to the program, whose output is HTML (+ HTTP
header)
CGI (Common Gateway Interface): standard allowing for execution
of an arbitrary external program.
Mechanisms integrated with the webserver (PHP, JSP, ASP,
mod_perl, ...)
Lecture 7
17 / 23
HTTP
Protocol description
Lecture 7
18 / 23
HTTP
Proxy servers
Proxy servers
Lecture 7
19 / 23
HTTP
Proxy servers
Note: proxy server usually means WWW proxy, but other services also
have proxy servers (ARP, DNS, DHCP, whois programming task!)
Lecture 7
20 / 23
HTTP
Proxy servers
Note: proxy server usually means WWW proxy, but other services also
have proxy servers (ARP, DNS, DHCP, whois programming task!)
Lecture 7
20 / 23
HTTP
Proxy servers
Proxy server
How it works:
It listens usually on port 8080.
If its cache does not contain the requested page or if it is
outdated, then
proxy connects to a given page,
stores the reply in the cache.
Lecture 7
21 / 23
HTTP
Proxy servers
Proxy server
How it works:
It listens usually on port 8080.
If its cache does not contain the requested page or if it is
outdated, then
proxy connects to a given page,
stores the reply in the cache.
Lecture 7
21 / 23
HTTP
Proxy servers
Lecture 7
22 / 23
HTTP
Proxy servers
Normal proxy server adds its own fields to our HTTP request, e.g.,
X-Forwarded-For: (our IP address)
Via: (proxy IP address)
There are anonymous proxy server which do not add these headers
presentation.
Lecture 7
23 / 23