Chapter7 ApplicationLayer
Chapter7 ApplicationLayer
Chapter 7
Revised: August
2011
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
The Application Layer
Application
Uses transport services to build
Transport
distributed applications
Network
Link
Physical
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
DNS – Domain Name System
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
The DNS Name Space (1)
DNS namespace is hierarchical from the root down
• Different parts delegated to different organizations
• Can register under multiple top-level domains
• Absolute domain names always end in a period, relative domain names do not
– Relative names have to be interpreted in a context to uniquely determine their meaning
250+ Top
Level
Domains:
1. Gene
ric
2. Coun
tries Second Level
Generic The computer robot.cs.washington.edu
Domains run by Registrars
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
appointed by ICANN
The DNS Name Space (2)
To create a new domain, permission is required of the domain in which it will be included.
Naming follows organizational boundaries, not physical networks.
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Domain Resource Records (1)
Every domain (all levels) has its own DNS database that is comprised of Resource
Records.
Each Resource Record is a 5 tuple: Domain_Name, TTL, Class, Type, Value (page 616)
The key resource records in the namespace are IP addresses
(A/AAAA) and name servers (NS), but there are others too (e.g.,
MX)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Domain Resource Records (2)
Name server
IP addresses
of
computers
CNAME
and PTR
are aliases; CNAME
allows the same IP
address to have multiple
names; PTR enables
reverse lookups
Mail gateways
One zone
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Name Servers (2)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Electronic Mail
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Architecture and Services (1)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Architecture and Services (2)
Envelope
Message
(= header
and
body)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
The User Agent
What users see – interface elements of a typical user agent
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Message Formats (1)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Message Formats (2)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Message Formats (3)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Message Formats (4)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Message Formats (5)
One part
(HTML)
Another
(audio)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Message Transfer (1)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Message Transfer (2)
Sending a message:
• From Alice to Bob
• SMTP commands
are marked [pink]
. . . (rest of message) . . .
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Message Transfer (3)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Final Delivery (1)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
The World Wide Web
• Architectural overview »
• Static Web pages »
• Dynamic pages and Web applications »
• HTTP – HyperText Transfer Protocol »
• The mobile Web »
• Web search »
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Architectural Overview (1)
HTTP transfers pages from servers to browsers
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Architectural Overview (2)
Pages are named with URLs (Uniform Resource Locators)
• Example: http://www.phdcomics.com/comics.php
Protocol Server
Page on server
Our
focus
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Architectural Overview (5)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Architectural Overview (6)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Architectural Overview (7)
Examples of cookies
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Static Web Pages (1)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Static Web Pages (2)
Progression of features through HTML 5.0
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Dynamic Pages & Web Applications (1)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Dynamic Pages & Web Applications (2)
PHP calls
PHP server program
that creates a
custom Web page
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Dynamic Pages & Web Applications (3)
JavaScript program
produces result
page in the browser
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Dynamic Pages & Web Applications (4)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Dynamic Pages & Web Applications (5)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Dynamic Pages & Web Applications (6)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Dynamic Pages & Web Applications (7)
XML captures document structure, not presentation like
HTML. Ex:
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Dynamic Pages & Web Applications (8)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
HTTP (1)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
HTTP (2)
HTTP uses persistent connections to improve performance
Fetch a page
Used to send
input data to a
server program
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
HTTP (4)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
HTTP (5)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
HTTP (6)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
The Mobile Web
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Web Search
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Streaming Audio and Video
• Digital audio »
• Digital video »
• Streaming stored media »
• Streaming live media »
• Real-time conferencing »
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Digital Audio (1)
ADC (Analog-to-Digital Converter) produces digital
audio from a microphone
• Telephone: 8000 8-bit samples/second (64 Kbps);
computer audio is usually better quality (e.g., 16 bit)
ADC
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Digital Audio (2)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Digital Video (1)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Digital Video (2)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Digital Video (3)
Step 1: Pixels are mapped to luminance/chrominance
(YCbCr) color space and chrominance is sub-sampled
• The eye is less sensitive to chrominance
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Digital Video (4)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Digital Video (5)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Digital Video (6)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Digital Video (7)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Streaming Stored Media (1)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Streaming Stored Media (2)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Streaming Stored Media (3)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Streaming Stored Media (4)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Streaming Stored Media (5)
Packet
stream
Media
samples
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Streaming Stored Media (6)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Streaming Stored Media (7)
RTSP commands
• Sent from player to server to adjust streaming
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Streaming Live Media (1)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Streaming Live Media (2)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Streaming Live Media (2)
As before
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Real-Time Conferencing (1)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Real-Time Conferencing (2)
Internet/PSTN
VoIP
call
Internet
Gatekeeper controls
calls for LAN hosts
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Real-Time Conferencing (3)
H.323 protocol stack:
• Call is digital audio/video over RTP/UDP/IP
• Call setup is handled by other protocols (Q.931 etc.)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Real-Time Conferencing (4)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Real-Time Conferencing (5)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Real-Time Conferencing (6)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Real-Time Conferencing (7)
Corrected
by
YES Instructor
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Content and Internet Traffic
Internet traffic:
1. Shifts seismically (emailFTPWebP2Pvideo)
2. Has many small/unpopular and few large/popular
flows – mice and elephants
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Server Farms and Web Proxies (1)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Server Farms and Web Proxies (2)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
CDNs – Content Delivery Networks (1)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Content Delivery Networks (2)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Content Delivery Networks (3)
Origin server rewrites pages to serve content via CDN
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Peer-to-Peer Networks (1)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Peer-to-Peer Networks (2)
BitTorrent lets peers download torrents
– Peers find each other via Tracker in torrent file
– Peers swap chunks (parts of content) with partners,
preferring those who send most quickly [2]
– Many peers speed download; preference helps
uploads [3]
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Peer-to-Peer Networks (3)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Peer-to-Peer Networks (3)
A Chord ring of 32 identifiers. Finger tables [at right, and as
arcs] are used to navigate the ring.
• Example: path to look up 16 from 1 is 1 12 15
Identifier
values are
stored at
predecessor
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
End
Chapter 7
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011