4. • There are many applications protocols. Most provide user services, and new services are always being
added to this layer. Some widely known and implemented applications protocols are
HTTP(Hypertext Transfer Protocol)
DNS(Domain Name System)
FTP(File Transfer Protocol)
TELNET
DHCP(Dynamic Host Configuration Protocol)
SMTP(Simple Mail Transfer Protoco
Application layer protocols
5. Web and HTTP
First, a quick review…
web page consists of objects, each of which can be stored on
different Web servers
object can be HTML file, JPEG image, Java applet, audio file,…
web page consists of base HTML-file which includes several
referenced objects, each addressable by a URL, e.g.,
www.someschool.edu/someDept/pic.gif
host name path name
6. HTTP Protocol
HTTP: hypertext transfer protocol
Web’s application-layer protocol
client/server model:
client: browser that requests, receives, (using HTTP
protocol) and “displays” Web objects
HTTP uses TCP:
client initiates TCP connection (creates socket) to server, port 80
server accepts TCP connection from client
HTTP messages (application-layer protocol messages) exchanged between browser
(HTTP client) and Web server (HTTP server)
TCP connection closed
server: Web server sends (using HTTP
protocol) objects in response to requests
7. HTTP connections: two types
Non-persistent HTTP
1. TCP connection opened
2. at most one object sent over TCP
connection
3. TCP connection closed
downloading multiple objects required
multiple connections
Persistent HTTP
TCP connection opened to a server
multiple objects can be sent over single
TCP connection between client, and
that server
TCP connection closed
8. Non-persistent HTTP: example
User enters URL:
1a. HTTP client initiates TCP
connection to HTTP server
(process) at www.someSchool.edu on
port 80
2. HTTP client sends HTTP
request message (containing
URL) into TCP connection
socket. Message indicates
that client wants object
someDepartment/home.index
1b. HTTP server at host
www.someSchool.edu waiting for TCP
connection at port 80 “accepts”
connection, notifying client
3. HTTP server receives request message,
forms response message containing
requested object, and sends message
into its socket
time
(containing text, references to 10 jpeg images)
www.someSchool.edu/someDepartment/home.ind
ex
5. HTTP client receives response
message containing html file,
displays html. Parsing html file,
finds 10 referenced jpeg objects
6. Steps 1-5 repeated for
each of 10 jpeg objects
4. HTTP server closes TCP
connection.
9. Non-persistent HTTP: response time
RTT (Round Trip Time): time for a small
packet to travel from client to server
and back
HTTP response time (per object):
one RTT to initiate TCP connection
one RTT for HTTP request and first few
bytes of HTTP response to return
object/file transmission time
time to
transmit
file
initiate TCP
connection
RTT
request file
RTT
file received
time time
Non-persistent HTTP response time = 2RTT+ file transmission time
10. Web caches
user configures browser to point to a
(local) Web cache
browser sends all HTTP requests to
cache
if object in cache: cache returns
object to client
else cache requests object from origin
server, caches received object, then
returns object to client
Goal: satisfy client requests without involving origin server
client
Web
cache
client
origin
server
Web cache acts as both client and server
Typically, cache is installed by ISP (internet service provider).
Why Web caching?
reduce response time for client request
reduce traffic on the network
11. E-mail
Three major components:
user agents (mail programs such as outlook)
mail servers
simple mail transfer protocol: SMTP
User Agent
“mail reader”
composing, editing, reading mail messages
e.g., Outlook, iPhone mail client
outgoing, incoming messages stored on
server
mail servers:
mailbox contains incoming messages for user
message queue of outgoing (to be sent) mail
messages
user mailbox
outgoing
message queue
mail
server
mail
server
mail
server
SMTP
SMTP
SMTP
user
agent
user
agent
user
agent
user
agent
user
agent
user
agent
12. E-mail: mail servers
user mailbox
outgoing
message queue
mail
server
mail
server
mail
server
SMTP
SMTP
SMTP
user
agent
user
agent
user
agent
user
agent
user
agent
user
agent
SMTP protocol between mail servers to
send email messages
client: sending mail server
“server”: receiving mail server
SMTP uses TCP to transfer email
message from client to server via port 25
Three phases of transfer
• SMTP handshaking (greeting)
• SMTP transfer messages
• SMTP closure
13. Scenario: Alice sends e-mail to Bob
1) Alice uses UA to compose e-mail
message “to” bob@someschool.edu
4) SMTP client sends Alice’s message over the
TCP connection
user
agent
mail
server
mail
server
1
2 3 4
5
6
Alice’s mail server Bob’s mail server
user
agent
2) Alice’s UA sends message to her mail
server using SMTP; message placed in
message queue
3) client side of SMTP at mail server opens
TCP connection with Bob’s mail server
5) Bob’s mail server places the message in
Bob’s mailbox
6) Bob invokes his user agent to read message
14. E-mail: POP and IMAP
POP (post office protocol) and IMAP (Internet Mail Access Protocol) take the
message from the mail server to user agent (receiver).
POP : authorization and download through two phases: authentication phase
(password and username) and transaction phase (to list the messages, read,
delete, quit). (port 110)
IMAP : more features including manipulation of stored messages on server such
moving message from the spam to inbox … etc.
It is important to note that the IMAP keep all messages in one place at the
server. (Port 143)
15. FTP (File Transfer Protocol)
FTP client contacts FTP server at port 21 using TCP connection
Client browses remote directory, sends commands over control connection (TCP
control connection port 21)
When server receives file transfer command, server opens TCP data connection
(for a file) to client (port 20).
After transferring one file, server closes data connection
Server opens another TCP data connection to transfer another file.
TCP control connection
server port 21
TCP data connection
server port 20
FTP Server
FTP client
16. Domain Name System (DNS) – Port 53
• DNS allows us to use simple names instead of an IP Address.
• The DNS protocol defines an automated service that matches resource names with the
required numeric network address (IP).
• DNS is a client/server service.
• However, instead of the client being a browser or email client application, the DNS client
(Resolver) runs as a service itself.
• The resolver is responsible for issuing requests and processing responses from the DNS
server.
17. Domain Name System (DNS)
1. First, a domain name or URL is entered in the address field of the browser. The browser passes
the name to the resolver.
2. The resolver sends the DNS request to the DNS Server.
3. The server then searches its records and resolves the name with to a corresponding IP Address.
4. The DNS server then sends the IP Address back to the client that made the request.
5. The IP Address will be used in the encapsulation process as the destination address for packets
going to www.cisco.com.
18. DNS: a distributed, hierarchical database
Client wants IP address for www.amazon.com; 1st approximation:
client queries 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
.com DNS servers .org DNS servers .edu DNS servers
… …
Top Level Domain
Root DNS Servers Root
nyu.edu
DNS servers
umass.edu
DNS servers
yahoo.com
DNS servers
amazon.com
DNS servers
pbs.org
DNS servers Authoritative
…
… … …
19. Application Layer Protocols with port
Application / Service Acronym Port
Domain Name System DNS 53
Hypertext Transfer Protocol HTTP 80
Simple Mail Transfer Protocol SMTP 25
Post Office Protocol POP3 110
Telnet Telnet 23
Dynamic Host Configuration Protocol DHCP 67
File Transfer Protocol FTP 20, 21