2: Application Layer
1
Chapter 2�Application Layer
Jaringan Komputer
Departemen Informatika
Universitas Diponegoro
Chapter 2: Application layer
2: Application Layer
2
Electronic Mail
Three major components:
User Agent
2: Application Layer
3
user mailbox
outgoing
message queue
server
user
agent
user
agent
user
agent
server
user
agent
user
agent
server
user
agent
SMTP
SMTP
SMTP
Electronic Mail: mail servers
Mail Servers
2: Application Layer
4
server
user
agent
user
agent
user
agent
server
user
agent
user
agent
server
user
agent
SMTP
SMTP
SMTP
Electronic Mail: SMTP [RFC 5321]
2: Application Layer
5
Scenario: Alice sends message to Bob
1) Alice uses UA to compose message and “to” bob@someschool.edu
2) Alice’s UA sends message to her mail server; message placed in message queue
3) Client side of SMTP opens TCP connection with Bob’s mail server
4) SMTP client sends Alice’s message over the TCP connection
5) Bob’s mail server places the message in Bob’s mailbox
6) Bob invokes his user agent to read message
2: Application Layer
6
user
agent
server
server
user
agent
1
2
3
4
5
6
Sample SMTP interaction
2: Application Layer
7
S: 220 hamburger.edu
C: HELO crepes.fr
S: 250 Hello crepes.fr, pleased to meet you
C: MAIL FROM: <alice@crepes.fr>
S: 250 alice@crepes.fr... Sender ok
C: RCPT TO: <bob@hamburger.edu>
S: 250 bob@hamburger.edu ... Recipient ok
C: DATA
S: 354 Enter mail, end with "." on a line by itself
C: Do you like ketchup?
C: How about pickles?
C: .
S: 250 Message accepted for delivery
C: QUIT
S: 221 hamburger.edu closing connection
Try SMTP interaction for yourself:
above lets you send email without using email client (reader)
2: Application Layer
8
SMTP: final words
Comparison with HTTP:
2: Application Layer
9
Mail message format
SMTP: protocol for exchanging email msgs
RFC 822: standard for text message format:
different from SMTP commands!
2: Application Layer
10
header
body
blank
line
Mail access protocols
2: Application Layer
11
user
agent
sender’s mail
server
user
agent
SMTP
SMTP
access
protocol
receiver’s mail
server
POP3 protocol
authorization phase
transaction phase, client:
2: Application Layer
12
C: list
S: 1 498
S: 2 912
S: .
C: retr 1
S: <message 1 contents>
S: .
C: dele 1
C: retr 2
S: <message 1 contents>
S: .
C: dele 2
C: quit
S: +OK POP3 server signing off
S: +OK POP3 server ready
C: user bob
S: +OK
C: pass hungry
S: +OK user successfully logged on
POP3 (more) and IMAP
More about POP3
IMAP
2: Application Layer
13
Chapter 2: Application layer
2: Application Layer
14
DNS: Domain Name System
People: many identifiers:
Internet hosts, routers:
Q: map between IP addresses and name ?
Domain Name System:
2: Application Layer
15
DNS
Why not centralize DNS?
DNS services
2: Application Layer
16
Distributed, Hierarchical Database
Client wants IP for www.amazon.com; 1st approx:
2: Application Layer
17
Root DNS Servers
com DNS servers
org DNS servers
edu DNS servers
poly.edu
DNS servers
umass.edu
DNS servers
yahoo.com
DNS servers
amazon.com
DNS servers
pbs.org
DNS servers
DNS: Root name servers
2: Application Layer
18
13 root name servers worldwide
b USC-ISI Marina del Rey, CA
l ICANN Los Angeles, CA
e NASA Mt View, CA
f Internet Software C. Palo Alto, CA (and 36 other locations)
i Autonomica, Stockholm (plus 28 other locations)
k RIPE London (also 16 other locations)
m WIDE Tokyo (also Seoul, Paris, SF)
a Verisign, Dulles, VA
c Cogent, Herndon, VA (also LA)
d U Maryland College Park, MD
g US DoD Vienna, VA
h ARL Aberdeen, MD
j Verisign, ( 21 locations)
TLD and Authoritative Servers
2: Application Layer
19
Local Name Server
2: Application Layer
20
DNS name �resolution example
2: Application Layer
21
requesting host
cis.poly.edu
gaia.cs.umass.edu
root DNS server
local DNS server
dns.poly.edu
1
2
3
4
5
6
authoritative DNS server
dns.cs.umass.edu
7
8
TLD DNS server
iterated query:
DNS name �resolution example
2: Application Layer
22
requesting host
cis.poly.edu
gaia.cs.umass.edu
root DNS server
local DNS server
dns.poly.edu
1
2
4
5
6
authoritative DNS server
dns.cs.umass.edu
7
8
TLD DNS server
3
recursive query:
DNS: caching and updating records
2: Application Layer
23
DNS records
2: Application Layer
24
DNS: distributed db storing resource records (RR)
RR format: (name, value, type, ttl)
www.ibm.com is really
servereast.backup2.ibm.com
Example 1
(umass.edu, dns.umass.edu, NS)
(dns.umass.edu, 128.119.40.111, A)
2: Application Layer
25
Example 2
(networkutopia.com, dns1.networkutopia.com, NS)
(dns1.networkutopia.com, 212.212.212.1, A)�
2: Application Layer
26