3rd Edition: Chapter 2

Download Report

Transcript 3rd Edition: Chapter 2

1DT066
Distributed Information Systems
Application Layer
1
2: Application Layer
Chapter 2
2: Application Layer
Q: What’s your Most Favorite Internet
Application?
2
SOME NETWORK APPS
voice over IP
 real-time video
conferencing

2: Application Layer
e-mail
 web
 instant messaging
 remote login
 P2P file sharing
 multi-user network
games
 streaming stored
video clips

3
CHAPTER 2: APPLICATION LAYER

2.1 Principles of network applications
Application architecture
 Application requirements

2: Application Layer
2.2 Web and HTTP
 2.3 DNS
 2.4 P2P applications

4
APPLICATION ARCHITECTURES
Client-server
 Peer-to-peer (P2P)
 Hybrid of client-server and P2P

2: Application Layer
5
CLIENT-SERVER ARCHITECTURE
server:
always-on host
 permanent IP address
 server farms for scaling

2: Application Layer
clients:

client/server



communicate with server
may be intermittently
connected
may have dynamic IP
addresses
do not communicate directly
with each other
6
PURE P2P ARCHITECTURE
no always-on server
 arbitrary end systems
directly communicate peer-peer
 peers are intermittently
connected and change IP
addresses

2: Application Layer
Highly scalable but
difficult to manage
7
HYBRID OF CLIENT-SERVER AND P2P
Instant messaging
chatting between two users is P2P
 centralized service: client presence detection/location

2: Application Layer
user registers its IP address with central
server when it comes online
 user contacts central server to find IP
addresses of buddies

8
PROCESSES COMMUNICATING
process
controlled by
app developer
2: Application Layer
process sends/receives
messages to/from its
socket
 API: (1) choice of
transport protocol;
(2) ability to fix a few
parameters
(lots more on this later)

host or
server
host or
server
process
socket
socket
TCP with
buffers,
variables
Internet
TCP with
buffers,
variables
controlled
by OS
9
ADDRESSING PROCESSES
to receive messages,
process must have
identifier
 host device has unique 32bit IP address
 Q: does IP address of host
suffice for identifying the
process?

2: Application Layer
10
ADDRESSING PROCESSES



identifier includes both IP
address and port
numbers associated with
process on host.
Example port numbers:


2: Application Layer
to receive messages,
process must have
identifier
 host device has unique
32-bit IP address
 Q: does IP address of
host on which process
runs suffice for
identifying the process?

HTTP server: 80
Mail server: 25
A: No, many processes
can be running on same
host
11
WHAT TRANSPORT SERVICE DOES AN
APP NEED?
Throughput
 some apps (e.g.,
multimedia) require
minimum amount of
throughput to be
“effective”
 other apps (“elastic
apps”) make use of
whatever throughput they
get
Security
 Encryption, data
12
integrity, …
2: Application Layer
Data loss
 some apps (e.g., audio) can
tolerate some loss
 other apps (e.g., file
transfer, telnet) require
100% reliable data
transfer
Timing
 some apps (e.g.,
Internet telephony,
interactive games)
require low delay to be
“effective”
TRANSPORT SERVICE REQUIREMENTS OF
COMMON APPS
Application
stored audio/video
interactive games
instant messaging
no loss
Time Sensitive
(yes / no)
no
elastic
elastic
elastic
audio: 5kbps-1Mbps
video:10kbps-5Mbps
same as above
few kbps up
elastic
2: Application Layer
file transfer
e-mail
Web documents
real-time audio/video
Data loss
(no loss /
loss-tolerant) Throughput
13
TRANSPORT SERVICE REQUIREMENTS OF
COMMON APPS
Throughput
Time Sensitive
file transfer
e-mail
Web documents
real-time audio/video
no loss
no loss
no loss
loss-tolerant
no
no
no
yes, 100’s
msec
stored audio/video
interactive games
instant messaging
loss-tolerant
loss-tolerant
no loss
elastic
elastic
elastic
audio: 5kbps-1Mbps
video:10kbps-5Mbps
same as above
few kbps up
elastic
2: Application Layer
Data loss
Application
yes, few secs
yes, 100’s
msec
yes and no
14
TRANSPORT LAYER
PROTOCOLS
2: Application Layer
TCP VS. UDP ?
15
INTERNET TRANSPORT
PROTOCOLS SERVICES
TCP service:






unreliable data transfer
between sending and
receiving process
does not provide:
connection setup,
reliability, flow control,
congestion control, timing,
throughput guarantee, or
security
2: Application Layer

connection-oriented: setup
required between client and
server processes
reliable transport between
sending and receiving process
flow control: sender won’t
overwhelm receiver
congestion control: throttle
sender when network
overloaded
does not provide: timing,
minimum throughput
guarantees, security
UDP service:
Q: why bother? Why is there
a UDP?
16
INTERNET APPS: APPLICATION, TRANSPORT
PROTOCOLS
Application
Transport protocol
(TCP / UDP)
2: Application Layer
e-mail
remote terminal access
Web
file transfer
streaming multimedia
Application
layer protocol
Internet telephony
17
INTERNET APPS: APPLICATION, TRANSPORT
PROTOCOLS
Application
Internet telephony
Underlying
transport protocol
SMTP [RFC 2821]
Telnet [RFC 854]
HTTP [RFC 2616]
FTP [RFC 959]
HTTP (eg Youtube),
RTP [RFC 1889]
SIP, RTP, proprietary
(e.g., Skype)
TCP
TCP
TCP
TCP
TCP or UDP
2: Application Layer
e-mail
remote terminal access
Web
file transfer
streaming multimedia
Application
layer protocol
typically UDP
18
CHAPTER 2: APPLICATION LAYER

2.1 Principles of
network applications

app architectures
app requirements
2.2 Web and HTTP
 2.3 DNS
 2.4 P2P applications

2: Application Layer

19
WEB AND HTTP
host name
path name
2: Application Layer
First some jargon
 Web page consists of objects
 Object can be HTML file, JPEG image, Java
applet, audio file,…
 Web page consists of base HTML-file which
includes several referenced objects
 Each object is addressable by a URL
 Example URL:
www.someschool.edu/someDept/pic.gif
20
HTTP OVERVIEW
HTTP: hypertext
transfer protocol

Web’s application layer
protocol
client/server model
 client: browser that
requests, receives,
“displays” Web objects
 server: Web server
sends objects in
response to requests
PC running
Explorer
2: Application Layer

Server
running
Apache Web
server
Mac running
Navigator
21
USER-SERVER
STATE: COOKIES
HTTP is “stateless”
server maintains no
information about past
client requests
1) cookie header line of
HTTP response
message
2) cookie header line in
HTTP request message
3) cookie file kept on
user’s host, managed
by user’s browser
4) back-end database at
Web site
2: Application Layer

Many major Web sites
use cookies
Four components:
22
COOKIES: KEEPING “STATE”
(CONT.)
client
ebay 8734
ebay 8734
amazon 1678
usual http request msg
usual http response
Set-cookie: 1678
usual http request msg
cookie: 1678
one week later:
ebay 8734
amazon 1678
usual http response msg
usual http request msg
cookie: 1678
usual http response msg
Amazon server
creates ID
1678 for user create
entry
cookiespecific
action
access
access
cookiespectific
action
2: Application Layer
cookie file
server
backend
database
23
WEB CACHES (PROXY SERVER)
Goal: satisfy client request without involving origin server
origin
server


object in cache: cache
returns object
else cache requests
object from origin server,
then returns object to
client
client
client
Proxy
server
2: Application Layer
user sets browser: Web
accesses via cache
 browser sends all
HTTP requests to
cache

origin
server
24
MORE ABOUT WEB CACHING
Why Web caching?
2: Application Layer
cache acts as both
client and server
 typically cache is
installed by ISP
(university, company,
residential ISP)

25
MORE ABOUT WEB CACHING
Why Web caching?



reduce response time for
client request
reduce traffic on an
institution’s access link.
Internet dense with
caches: enables “poor”
content providers to
effectively deliver
content (but so does P2P
file sharing)
2: Application Layer
cache acts as both
client and server
 typically cache is
installed by ISP
(university, company,
residential ISP)

26
CHAPTER 2: APPLICATION LAYER
2.1 Principles of
network applications
 2.2 Web and HTTP
 2.3 DNS
 2.4 P2P applications

2: Application Layer
27
DNS: DOMAIN NAME SYSTEM
People: many
identifiers:
SSN, name, passport #
Internet hosts, routers:



IP address (32 bit) used for addressing
datagrams
“name”, e.g.,
ww.yahoo.com - used by
humans

distributed database
implemented in hierarchy of
many name servers
application-layer protocol host,
routers, name servers to
communicate to resolve names
(address/name translation)
2: Application Layer

Domain Name System:
28
DNS

Canonical, alias names
mail server aliasing
 load distribution


replicated Web servers:
set of IP addresses for
one canonical name
Why not centralize DNS?
single point of failure
 traffic volume
 distant centralized
database
 maintenance

2: Application Layer
DNS services
 hostname to IP address
translation
 host aliasing
doesn’t scale!
29
DISTRIBUTED, HIERARCHICAL DATABASE
Root DNS Servers
yahoo.com
amazon.com
DNS servers DNS servers
org DNS servers
pbs.org
DNS servers
edu DNS servers
2: Application Layer
com DNS servers
poly.edu
umass.edu
DNS serversDNS servers
Client wants IP for www.amazon.com; 1st approx:
 client queries a root server to find com DNS server
 client queries com DNS server to get amazon.com
DNS server
 client queries amazon.com DNS server to get IP
address for www.amazon.com
30
DNS NAME
root DNS server
RESOLUTION EXAMPLE
2

Host at cis.poly.edu
wants IP address for
gaia.cs.umass.edu
 contacted server
replies with name of
server to contact
 “I don’t know this
name, but ask this
server”
TLD DNS server
4
5
local DNS server
dns.poly.edu
1
8
requesting host
7
6
2: Application Layer
iterated query:
3
authoritative DNS server
dns.cs.umass.edu
cis.poly.edu
gaia.cs.umass.edu
32
DNS NAME
root DNS server
RESOLUTION EXAMPLE
recursive query:
2
resolution on
contacted name
server
 heavy load?
7
6
2: Application Layer
 puts burden of name
3
TLD DNS server
local DNS server
dns.poly.edu
1
5
4
8
requesting host
authoritative DNS server
dns.cs.umass.edu
cis.poly.edu
gaia.cs.umass.edu
33
CHAPTER 2: APPLICATION LAYER

2.1 Principles of
network applications

app architectures
app requirements
2.2 Web and HTTP
 2.4 Electronic Mail



2.6 P2P applications
2: Application Layer


SMTP, POP3, IMAP
2.5 DNS
34
PURE P2P ARCHITECTURE
no always-on server
 arbitrary end systems
directly communicate peer-peer
 peers are intermittently
connected and change IP
addresses

2: Application Layer

Three topics:



File distribution
Searching for information
Case Study: Skype
35
FILE DISTRIBUTION
2: Application Layer
Server-Client vs P2P ?
36
FILE DISTRIBUTION: SERVER-CLIENT VS P2P
Question : How much time to distribute file from one
server to N peers?
Server
us
File, size F
dN
uN
u1
d1
u2
2: Application Layer
us: server upload
bandwidth
ui: peer i upload
bandwidth
d2
di: peer i download
bandwidth
Network (with
abundant bandwidth)
37
FILE DISTRIBUTION TIME: SERVER-CLIENT
Server

server sequentially
sends N copies:

NF/us time
client i takes F/di time
to download
us
dN
u1 d1 u2
d2
2: Application Layer

F
Network (with
abundant bandwidth)
uN
Time to distribute F
to N clients using = dcs = max { NF/us, F/min(di) }
i
client/server approach
increases linearly in N
(for large N)
38
FILE DISTRIBUTION TIME: P2P
Server
server must send one
F
u1 d1 u2
d2
copy: F/us time
us
 client i takes F/di time to
Network (with
dN
download
abundant bandwidth)
uN
 NF bits must be
downloaded (aggregate)
 fastest possible upload rate: us + Sui

i
2: Application Layer
dP2P = max { F/us, F/min(di) , NF/(us + Sui) }
39
Server-client vs. P2P: example
Client upload rate = u, F/u = 1 hour, us = 10u, dmin ≥ us
40
P2P
Client-Server
3
2: Application Layer
Minimum Distribution Time
3.5
2.5
2
1.5
1
0.5
0
0
5
10
15
20
N
25
30
35
CHAPTER 2: SUMMARY
our study of network apps now complete!

application architectures

application service
requirements:


client-server
P2P
hybrid
reliability, bandwidth, delay
Internet transport service
model
2: Application Layer



 specific protocols:
 HTTP
 FTP
 SMTP, POP, IMAP
 DNS
 P2P: BitTorrent, Skype
connection-oriented, reliable:
TCP
 unreliable, datagrams: UDP

45