Chapter 2: Application Layer (PART 2)
1
Computer Networking: A Top Down Approach 6th Edition
Jim Kurose, Keith Ross
FTP
Electronic Mail
SMTP, POP3, IMAP
DNS
P2P Applicaitons
Web and HTTP
Web page consists of objects
Object can be HTML file, JPEG image, Java applet
Web page consists of base HTML-file
which includes several referenced objects
It is web’s application layer protocol
It uses client/server model
Client: The browser that requests, receives and display web objects
Server: Web server sends objects to
requested hosts
Web and HTTP
HTTP: Hypertext transfer protocol
HTTP uses TCP
Client initiates TCP connection to server, port 80
Server accepts TCP connection from client
HTTP messages exchanged between browser and web server
TCP connection closed
Non-persistent HTTP
At most one object sent over TCP connection
Multiple objects required multiple connections
Persistent HTTP
Multiple objects can be sent over single TCP
connection between client server
Web and HTTP
User-server state: Cookies
Many web sites use cookies:
Cookie header line of HTTP response message
Cookie header line in next HTTP request message
Cookie file kept on user’s host
Back-end database at web site
Cookies can be used for:
Authorization
Shopping carts
Recommendations
Web email
They are used to service client without using original server
Browser sends all HTTP requests to cache
If the object is in cache: cache returns object
If the object is not in cache: cache requests
object from origin server, then returns object
to client
FTP
FTP: the file transfer protocol
It is used to transfer to/from remote host
Client/server model
Client side initiates transfer
Server is the remote host
FTP server: port 21
other for data
TCP control connection server port 21
TCP data connection server port 20
The control connection is out of band
Electronic Mail
Three major components
User agents
Mail reader
Composing, editing, reading mail messages
Outlook, Thunderbird
Mail servers
Mailbox contains incoming messages for user
Message queue
Simple mail transfer protocol: SMTP
Between mail servers to send email messages
SMTP requires message to be in 7-bit ASCII
Comparison with HTTP
HTTP: pull
SMTP: push
Both have ASCII command/response
interaction
Electronic Mail
Mail access protocol: Retrieval from server
POP: Post Office Protocol
IMAP: Internet Mail Access Protocol
HTTP: Gmail, Hotmail, Yahoo
Distributed database
Implemented in hierarchy of many name servers
Application-layer protocol
Core internet function
Hostname to IP address translation
Host aliasing
Mail server aliasing
Load distribution
DNS
Domain Name System (DNS)
Why not centralize DNS?
Single point of failure
Traffic volume
Distant centralized database
Maintenance
End systems directly communicate
Peers may change IP addresses
Examples:
File distribution (BitTorrent)
Streaming
VoIP (Skype)
P2P Applications
P2P file distribution: BitTorrent
Tracker: Tracks peers participating in torrent
Torrent: Group of peere exchanging chunks of a file
Churn: Peers may come and go