Application Layer: A Note On The Use of These PPT Slides
Application Layer: A Note On The Use of These PPT Slides
Application Layer: A Note On The Use of These PPT Slides
Application Layer
2: Application Layer 2
Chapter 2: Application Layer
Our goals: learn about protocols
conceptual, by examining popular
implementation application-level
aspects of network protocols
application protocols HTTP
transport-layer FTP
service models SMTP / POP3 / IMAP
DNS
client-server
2: Application Layer 3
Some network apps
e-mail voice over IP
web real-time video
instant messaging conferencing
remote login grid computing
P2P file sharing
multi-user network
games
streaming stored video
clips
2: Application Layer 4
Creating a network app application
transport
network
data link
2: Application Layer 6
Application architectures
Client-server
Peer-to-peer (P2P)
Hybrid of client-server and P2P
2: Application Layer 7
Client-server architecture
server:
always-on host
permanent IP address
server farms for
scaling
clients:
client/server communicate with server
may be intermittently
connected
may have dynamic IP
addresses
do not communicate
directly with each other
2: Application Layer 8
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 9
Hybrid of client-server and P2P
Skype
voice-over-IP P2P application
centralized server: finding address of remote
party:
client-client connection: direct (not through
server)
Instant messaging
chatting between two users is P2P
centralized service: client presence
detection/location
• user registers its IP address with central
server when it comes online
• user contacts central server to find IP
addresses of buddies
2: Application Layer 10
Processes communicating
Process: program running Client process: process
within a host. that initiates
within same host, two
communication
processes communicate Server process: process
using inter-process that waits to be
communication (defined contacted
by OS).
processes in different Note: applications with
hosts communicate by P2P architectures have
exchanging messages client processes &
server processes
2: Application Layer 11
Sockets
process sends/receives
host or host or
server server
messages to/from its
socket controlled by
app developer
socket analogous to door process process
2: Application Layer 13
Addressing processes
to receive messages, identifier includes both
process must have IP address and port
identifier numbers associated with
host device has unique process on host.
32-bit IP address Example port numbers:
Q: does IP address of HTTP server: 80
host on which process Mail server: 25
runs suffice for to send HTTP message
identifying the to gaia.cs.umass.edu web
process? server:
A: No, many IP address: 128.119.245.12
processes can be Port number: 80
running on same host more shortly…
2: Application Layer 14
App-layer protocol defines
Types of messages Public-domain protocols:
exchanged, defined in RFCs
e.g., request, response allows for
Message syntax: interoperability
what fields in messages &
e.g., HTTP, SMTP
how fields are delineated
Proprietary protocols:
Message semantics
meaning of information in
e.g., Skype
fields
Rules for when and how
processes send &
respond to messages
2: Application Layer 15
What transport service does an app need?
Data loss Throughput
some apps (e.g., audio) can some apps (e.g.,
tolerate some loss multimedia) require
other apps (e.g., file minimum amount of
transfer, telnet) require throughput to be
100% reliable data “effective”
transfer
other apps (“elastic apps”)
Timing make use of whatever
some apps (e.g., throughput they get
Internet telephony,
interactive games) Security
require low delay to be Encryption, data
“effective” integrity, …
2: Application Layer 16
Transport service requirements of common apps
2: Application Layer 17
Internet transport protocols services
Application Underlying
Application layer protocol transport protocol
2: Application Layer 19
Chapter 2: Application layer
2.1 Principles of 2.6 P2P applications
network applications 2.7 Socket programming
2.2 Web and HTTP with TCP
2.3 FTP 2.8 Socket programming
2.4 Electronic Mail with UDP
SMTP, POP3, IMAP 2.9 Building a Web
2.5 DNS server
2: Application Layer 20
DNS: Domain Name System
2: Application Layer 21
DNS
DNS services Why not centralize DNS?
hostname to IP single point of failure
address translation traffic volume
host aliasing distant centralized
Canonical, alias names database
mail server aliasing maintenance
load distribution
replicated Web doesn’t scale!
servers: set of IP
addresses for one
canonical name
2: Application Layer 22
Distributed, Hierarchical Database
Root DNS Servers
13 root name
servers worldwide
b USC-ISI Marina del Rey, CA
l ICANN Los Angeles, CA
2: Application Layer 24
TLD and Authoritative Servers
Top-level domain (TLD) servers:
responsible for com, org, net, edu, etc, and all
top-level country domains uk, fr, ca, jp.
Network Solutions maintains servers for com TLD
Educause for edu TLD
Authoritative DNS servers:
organization’s DNS servers, providing
authoritative hostname to IP mappings for
organization’s servers (e.g., Web, mail).
can be maintained by organization or service
provider
2: Application Layer 25
Local Name Server
does not strictly belong to hierarchy
each ISP (residential ISP, company,
university) has one.
also called “default name server”
when host makes DNS query, query is sent
to its local DNS server
acts as proxy, forwards query into hierarchy
2: Application Layer 26
DNS name root DNS server
resolution example
2
Host at cis.poly.edu 3
TLD DNS server
wants IP address for 4
gaia.cs.umass.edu 5
gaia.cs.umass.edu
2: Application Layer 27
DNS name
resolution example root DNS server
recursive query: 2 3
puts burden of name 6
7
resolution on
TLD DNS server
contacted name
server
heavy load? local DNS server
dns.poly.edu 5 4
1 8
gaia.cs.umass.edu
2: Application Layer 28
DNS: caching and updating records
once (any) name server learns mapping, it caches
mapping
cache entries timeout (disappear) after some
time
TLD servers typically cached in local name
servers
• Thus root name servers not often visited
update/notify mechanisms under design by IETF
RFC 2136
http://www.ietf.org/html.charters/dnsind-charter.html
2: Application Layer 29
DNS records
DNS: distributed db storing resource records (RR)
RR format: (name, value, type, ttl)
Type=A Type=CNAME
name is hostname name is alias name for some
value is IP address “canonical” (the real) name
www.ibm.com is really
Type=NS
servereast.backup2.ibm.com
name is domain (e.g.
value is canonical name
foo.com)
value is hostname of
Type=MX
authoritative name
value is name of mailserver
server for this domain
associated with name
2: Application Layer 30
DNS protocol, messages
DNS protocol : query and reply messages, both with
same message format
msg header
identification: 16 bit #
for query, reply to query
uses same #
flags:
query or reply
recursion desired
recursion available
reply is authoritative
2: Application Layer 31
DNS protocol, messages
RRs in response
to query
records for
authoritative servers
additional “helpful”
info that may be used
2: Application Layer 32
Inserting records into DNS
example: new startup “Network Utopia”
register name networkuptopia.com at DNS registrar
(e.g., Network Solutions)
provide names, IP addresses of authoritative name server
(primary and secondary)
registrar inserts two RRs into com TLD server:
2: Application Layer 33