150 likes | 304 Views
Chapter 7. The Application Layer. Overview. Processes running in different hosts communicate with an application-layer protocol Popular application-level protocols: DNS HTTP FTP SMTP / POP3 / IMAP Programming network applications socket API. DNS (1).
E N D
Chapter 7 The Application Layer
Overview • Processes running in different hosts communicate with an application-layer protocol • Popular application-level protocols: • DNS • HTTP • FTP • SMTP / POP3 / IMAP • Programming network applications • socket API
DNS (1) • Programs could refer to hosts, mailboxes and other resources by their network IP. • These Numbers are difficult to remember by people? • Also, if moving the servers to different machine? • Use names instead of IP numbers. • Ex. ce.sharif.edu, veisi@yahoo.com • Need a mechanism to convert names to IP Number • Use a file: hosts.txt • As the number of PCs increase? • Size increase, Conflict of host names • Need a central manager: • DNS: Domain Name System
DNS (2) • DNS Name Space • For managing large and changing set of names, need a postal like management, • Ex. No. 4, Azadi St., Tehran, Iran • Hierarchical addressing • Top-level domain: • 200 top-level domains
no server has all name-to-IP address mappings local name servers: each ISP, company has local (default) name server host DNS query first goes to local name server authoritative name server: for a host: stores that host’s IP address, name can perform name/address translation for that host’s name Why not centralize DNS? single point of failure traffic volume distant centralized database maintenance DNS (3)
Example: host surf.eurecom.fr wants IP address of gaia.cs.umass.edu 1. contacts its local DNS server, dns.eurecom.fr 2.dns.eurecom.fr contacts root name server, if necessary 3. root name server contacts authoritative name server, dns.umass.edu, if necessary local name server dns.eurecom.fr DNS (4) root name server 2 4 3 5 authoritative name server dns.umass.edu 1 6 requesting host surf.eurecom.fr gaia.cs.umass.edu
DNS (5) • Once (any) name server learns mapping, it caches mapping • cache entries timeout (disappear) after some time • DNS Records • format: (name, TTL, value, type) • Records types:
Three major components: user agents mail servers simple mail transfer protocol: SMTP User Agent Sometimes is called: “mail reader” composing, editing, reading mail messages e.g., Eudora, Outlook, elm, Netscape Messenger outgoing, incoming messages stored on server user agent user agent user agent user agent user agent user agent SMTP SMTP SMTP mail server mail server mail server outgoing message queue user mailbox E-Mail (1)
Mail Servers mailbox contains incoming messages for user messagequeue of outgoing (to be sent) mail messages SMTP protocol between mail servers to send email messages “client”: sending mail server (sending agent) “server”: receiving mail server (receiving agent) user agent user agent user agent user agent user agent user agent SMTP SMTP SMTP mail server mail server mail server E-Mail (2)
Message Format: SMTP: protocol for exchanging email msgs RFC 822: standard for text message format: header lines, e.g., To: From: Subject: differentfrom SMTP commands! body the “message”, ASCII characters only E-Mail (3) header blank line body
E-Mail (4) • MIME: Multipurpose Internet Mail Extension • For multimedia mail extension • Text • example subtypes: plain, html • Image • example subtypes: jpeg, gif • Audio • example subtypes: basic (8-bit mu-law encoded), 32kadpcm (32 kbps coding) • Video • example subtypes: mpeg, quicktime • Application • other data that must be processed by reader before “viewable” • example subtypes: msword, octet-stream
SMTP: delivery/storage to receiver’s 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. user agent user agent sender’s mail server SMTP E-Mail (5) SMTP access protocol receiver’s mail server
POP3 Previous example uses “download and delete” mode. “Download” brings the mail into client computer. “Delete” removes the mail from the mail server. Mr.X cannot re-read e-mail if he changes client computer. “Download-and-keep”: leaves the message on the mail server. POP3 is stateless across sessions. IMAP Keep all messages in one place: the server Allows user to organize messages in folders IMAP keeps user state across sessions: names of folders and mappings between message IDs and folder name E-Mail (6)
transfer file to/from remote host client/server model client: side that initiates transfer (either to/from remote) server: remote host ftp: RFC 959 ftp server: port 21 FTP user interface FTP client FTP server FTP: File Transfer Protocol file transfer user at host local file system remote file system
WWW: World Wide Web • In 1989, CERN: European Center of Nebular Research, By Berners-Lee. • Accessing linked documents, support Text, Image, Audio, Video, … • People think that this is “Internet” ! • Hypertext Browsers: • Mosaic, Netscape, IE, … • Use HTML (Hyper-Text Markup Language) as a common language of web.