FTP, SMTP and DNS: 2: Application Layer 1
FTP, SMTP and DNS: 2: Application Layer 1
2: Application Layer 1
FTP: separate control, data connections
TCP control connection
FTP client contacts FTP server port 21
at port 21, specifying TCP as
transport protocol
TCP data connection
Client obtains authorization FTP port 20 FTP
over control connection client server
Client browses remote
directory by sending commands Server opens a second TCP
over control connection. data connection to transfer
When server receives a another file.
command for a file transfer, Control connection: “out of
the server opens a TCP data band”
connection to client FTP server maintains “state”:
After transferring one file, current directory, earlier
server closes connection. authentication
2: Application Layer 2
Electronic Mail outgoing
message queue
user mailbox
user
Three major components: agent
user agents mail
user
mail servers server
agent
simple mail transfer protocol:
SMTP mail
SMTP
server user
2: Application Layer 3
Electronic Mail: mail servers
user
Mail Servers agent
mailbox contains incoming
mail
user
messages for user server
agent
message queue of outgoing
SMTP
(to be sent) mail messages mail
server user
SMTP protocol between mail
servers to send email
SMTP agent
messages SMTP
client: sending mail mail user
agent
server server
“server”: receiving mail
user
server agent
user
agent
2: Application Layer 4
Electronic Mail: SMTP [RFC 2821]
uses TCP to reliably transfer email message from client
to server, port 25
direct transfer: sending server to receiving server
three phases of transfer
handshaking (greeting)
transfer of messages
closure
command/response interaction
commands: ASCII text
response: status code and phrase
2: Application Layer 5
Scenario: Alice sends message to Bob
1) Alice uses UA to compose 4) SMTP client sends Alice’s
message and “to” message over the TCP
[email protected] connection
2) Alice’s UA sends message 5) Bob’s mail server places the
to her mail server; message message in Bob’s mailbox
placed in message queue 6) Bob invokes his user agent
3) Client side of SMTP opens to read message
TCP connection with Bob’s
mail server
1 mail
mail
server user
user server
2 agent
agent 3 6
4 5
2: Application Layer 6
Mail access protocols
SMTP SMTP access user
user
agent protocol agent
2: Application Layer 7
DNS: Domain Name System
2: Application Layer 8
DNS and Applications
Which applications use DNS?
HTTP
Browser extracts hostname
Sends hostname to DNS
DNS does lookup and returns IP address
Browser sends HTTP GET to IP address
2: Application Layer 9
DNS
doesn’t scale!
2: Application Layer 10
Distributed, Hierarchical Database
Root DNS Servers
m WIDE Tokyo
e NASA Mt View, CA
f Internet Software C. Palo Alto,
CA (and 17 other locations)
13 root name
servers worldwide
b USC-ISI Marina del Rey, CA
l ICANN Los Angeles, CA
2: Application Layer 12
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
2: Application Layer 13
Local Name Server
Does not strictly belong to hierarchy
Each ISP (residential ISP, company,
university) has one.
Also called “default name server”
When a host makes a DNS query, query is
sent to its local DNS server
Acts as a proxy, forwards query into hierarchy.
2: Application Layer 14
Example root DNS server
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 15
Recursive queries root DNS server
recursive query:
puts burden of name 2 3
resolution on 7 6
contacted name TLD DNS server
server
heavy load?
local DNS server
4
iterated query: dns.poly.edu 5
contacted server 1 8
replies with name of
server to contact authoritative DNS server
“I don’t know this dns.cs.umass.edu
requesting host
name, but ask this cis.poly.edu
server”
gaia.cs.umass.edu
2: Application Layer 16
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 17
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 “cannonical” (the real) name
Type=NS www.ibm.com is really
name is domain (e.g. foo.com)
servereast.backup2.ibm.com
value is IP address of
value is cannonical name
authoritative name server
for this domain
Type=MX
value is name of mailserver
associated with name
2: Application Layer 18