Professional Documents
Culture Documents
Lecture 5
Lecture 5
Lecture 5
Lecture 5
OSI
TCP/IP
MODEL
APPLICATION
7 APPLICATION
TRANSPORT
TRANSPORT
4 Tranmission Control Protocol (TCP)
User Datagram Protocol (UDP)
INTERNETWORKING
NETWORK
3 Internet Protocol (IP)
Internet Control Message Protocol (ICMP)
NETWORK INTERFACE
DATA LINK
&
2
HARDWARE
CONNECTIONS
PHYSICAL
LAN: Ethernet, Token Ring, FDDI, ATM...
1
WAN: SLIP/PPP, X.25, Frame Relay...
P2
1
Chapter 2
Application Layer
2
Cookies: keeping “state” (cont.)
client server
ebay 8734
usual http request msg Amazon server
cookie file creates ID
usual http response
1678 for user create backend
ebay 8734
set-cookie: 1678 entry database
amazon 1678
usual http request msg
cookie: 1678 cookie- access
specific
usual http response msg action
Cookies (continued)
aside
what cookies can be used cookies and privacy:
for: cookies permit sites to
authorization learn a lot about you
shopping carts
you may supply name and
recommendations
e-mail to sites
user session state (Web
e-mail)
3
Web caches (proxy server)
goal: satisfy client request without involving origin server
user sets browser: Web
accesses via cache
browser sends all HTTP proxy
requests to cache server
object in cache: cache client
origin
returns object server
else cache requests
object from origin
server, then returns
object to client
client origin
server
4
Caching example:
assumptions:
avg object size: 100K bits origin
avg request rate from browsers to servers
origin servers:15/sec public
avg data rate to browsers: 1.50 Mbps Internet
RTT from institutional router to any
origin server: 2 sec
access link rate: 1.54 Mbps 1.54 Mbps
consequences: access link
5
Caching example: install local cache
assumptions:
avg object size: 100K bits origin
avg request rate from browsers to servers
origin servers:15/sec public
avg data rate to browsers: 1.50 Mbps Internet
RTT from institutional router to any
origin server: 2 sec
access link rate: 1.54 Mbps 1.54 Mbps
consequences: access link
6
Conditional GET
client server
Goal: don’t send object if
cache has up-to-date
cached version HTTP request msg
object
If-modified-since: <date>
no object transmission not
delay modified
lower link utilization HTTP response
before
HTTP/1.0
cache: specify date of 304 Not Modified <date>
cached copy in HTTP
request
If-modified-since:
<date> HTTP request msg
server: response contains If-modified-since: <date> object
modified
no object if cached copy after
HTTP response
is up-to-date: HTTP/1.0 200 OK <date>
HTTP/1.0 304 Not <data>
Modified
Application Layer 2-13
Chapter 2: outline
2.1 principles of network 2.6 P2P applications
applications 2.7 socket programming
app architectures with UDP and TCP
app requirements
2.2 Web and HTTP
2.3 FTP
2.4 electronic mail
SMTP, POP3, IMAP
2.5 DNS
7
FTP: the file transfer protocol
file transfer
FTP FTP FTP
user client server
interface
user
at host remote file
local file system
system
8
FTP commands, responses
sample commands: sample return codes
sent as ASCII text over status code and phrase (as
control channel in HTTP)
USER username 331 Username OK,
PASS password password required
LIST return list of file in 125 data
current directory connection
already open;
RETR filename transfer starting
retrieves (gets) file 425 Can’t open
STOR filename stores data connection
(puts) file onto remote 452 Error writing
host file