FTP, SMTP and DNS
2: Application Layer
FTP: separate control, data connections
FTP client contacts FTP
server at port 21, specifying TCP as transport protocol Client obtains authorization over control connection Client browses remote directory by sending commands over control connection. When server receives a command for a file transfer, the server opens a TCP data connection to client After transferring one file, server closes connection.
TCP control connection port 21
FTP client
TCP data connection port 20
FTP server
Server opens a second TCP
data connection to transfer another file. Control connection: out of band FTP server maintains state: current directory, earlier authentication
2: Application Layer 2
Electronic Mail
Three major components:
user agents
mail servers simple mail transfer
mail server user agent
outgoing message queue user mailbox
protocol: SMTP
SMTP SMTP
mail server
user agent mail server
User Agent a.k.a. mail reader composing, editing, reading mail messages e.g., Eudora, Outlook, elm, Netscape Messenger outgoing, incoming messages stored on server
user agent
SMTP
user agent
user agent
user agent
2: Application Layer
Electronic Mail: mail servers
Mail Servers
mailbox contains incoming
user agent mail server user agent mail server user agent
messages for user message queue of outgoing (to be sent) mail messages SMTP protocol between mail servers to send email messages client: sending mail server server: receiving mail server
SMTP SMTP
mail server
SMTP
user agent
user agent
user agent
2: Application Layer
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
messages must be in 7-bit ASCII
2: Application Layer
Scenario: Alice sends message to Bob
1) Alice uses UA to compose message and to
[email protected] 2) Alices UA sends message to her mail server; message placed in message queue 3) Client side of SMTP opens TCP connection with Bobs mail server 4) SMTP client sends Alices message over the TCP connection 5) Bobs mail server places the message in Bobs mailbox 6) Bob invokes his user agent to read message
1 user agent 2
mail server 3
mail server 4 5 6
user agent
2: Application Layer
Mail access protocols
user agent
SMTP
SMTP
access protocol
user agent
senders mail server
receivers mail server
SMTP: delivery/storage to receivers server Mail access protocol: retrieval from server
POP: Post Office Protocol [RFC 1939] authorization (agent <-->server) and download IMAP: Internet Mail Access Protocol [RFC 1730] more features (more complex) manipulation of stored msgs on server HTTP: Hotmail , Yahoo! Mail, etc.
2: Application Layer 7
DNS: Domain Name System
People: many identifiers:
Domain Name System:
SSN, name, passport #
IP address (32 bit) used for addressing datagrams name, e.g., ww.yahoo.com - used by humans
distributed database
Internet hosts, routers:
implemented in hierarchy of many name servers
application-layer protocol
Q: map between IP addresses and name ?
host, routers, name servers to communicate to resolve names (address/name translation) note: core Internet function, implemented as application-layer protocol complexity at networks edge
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
DNS
Why not centralize DNS? single point of failure traffic volume distant centralized database maintenance doesnt scale!
2: Application Layer
10
Distributed, Hierarchical Database
Root DNS Servers
com DNS servers yahoo.com amazon.com DNS servers DNS servers
org DNS servers pbs.org DNS servers
edu 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
2: Application Layer 11
DNS: Root name servers
contacted by local name server that can not resolve name root name server:
contacts authoritative name server if name mapping not known gets mapping returns mapping to local name server
a Verisign, Dulles, VA c Cogent, Herndon, VA (also Los Angeles) d U Maryland College Park, MD k RIPE London (also Amsterdam, g US DoD Vienna, VA Frankfurt) Stockholm (plus 3 i Autonomica, h ARL Aberdeen, MD other locations) j Verisign, ( 11 locations) 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.
Authoritative DNS servers: organizations
Network solutions maintains servers for com TLD Educause for edu TLD
DNS servers, providing authoritative hostname to IP mappings for organizations servers (e.g., Web and mail).
Can be maintained by organization or service provider
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
Host at cis.poly.edu
2
root DNS server
wants IP address for gaia.cs.umass.edu
local DNS server
dns.poly.edu
3 4 5
TLD DNS server
requesting host
cis.poly.edu
authoritative DNS server dns.cs.umass.edu
gaia.cs.umass.edu
2: Application Layer
15
Recursive queries
recursive query:
puts burden of name
root DNS server
resolution on contacted name server heavy load?
6 TLD DNS server
iterated query:
contacted server
local DNS server
dns.poly.edu
replies with name of server to contact I dont know this requesting host name, but ask this cis.poly.edu server
authoritative DNS server dns.cs.umass.edu
gaia.cs.umass.edu
2: Application Layer 16
DNS: caching and updating records
once (any) name server learns mapping, it
mapping cache entries timeout (disappear) after some time TLD servers typically cached in local name servers
Thus root name servers not often visited
caches
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,
Type=A name is hostname value is IP address
value, type, ttl)
Type=NS servereast.backup2.ibm.com name is domain (e.g. value is cannonical name foo.com) value is IP address of Type=MX authoritative name value is name of mailserver server for this domain associated with name
2: Application Layer 18
Type=CNAME name is alias name for some cannonical (the real) name www.ibm.com is really