Chapter Seven
APPLICATION LAYER
FUNCTIONALITY AND
PROTOCOLS
1
Application Layer: OSI and TCP/IP Models
The Application layer
Layer seven
Top layer
Interface between the applications we use to communicate and the
underlying network.
2
Email
HTTP HTTP
HTTP
(www)
Application layer protocols
Exchange data between programs running on the source and
destination hosts.
3
Application Layer: OSI and TCP/IP Models
4
The Presentation Layer
The Presentation layer has three primary functions:
Coding and conversion
Compression
Encryption
Compression and Coding formats:
Graphics Interchange Format (GIF)
Joint Photographic Experts Group (JPEG)
Tagged Image File Format (TIFF).
5
The Session Layer
Create and maintain dialogs between source and destination applications.
Handles the exchange of information to:
Initiate dialogs
Keep them active
Restart sessions that are disrupted or idle for a long period of time
Most applications, like web browsers or e-mail clients, incorporate
functionality of the OSI layers 5, 6 and 7.
6
Application Layer: OSI
and TCP/IP Models
Note: Usually a single
server will function as
a server for multiple
applications
Common TCP/IP Protocols
Domain Name Service Protocol (DNS)
Hypertext Transfer Protocol (HTTP)
Simple Mail Transfer Protocol (SMTP)
Telnet
File Transfer Protocol (FTP)
7
Application Layer
Software User
applications
Application layer:
Services
Applications
Services
System
Operations
Network-Aware Applications
Applications to communicate over the network.
They implement the application layer protocols:
Email Clients
Web Browsers
8
Application Layer Software
User
applications
Services
System
Operations
Application layer Services
Network resources such as:
File transfer
Network print spooling
Interface with the network and prepare the data for transfer.
9
Application Layer Software
Applications provide people a way to create messages.
Services establish an interface to the network.
Protocols provide the rules and formats that govern how data is
treated.
Bottom line:
When discussing an application like "Telnet" we could be
referring to the application, the service, or the protocol. 10
Application Layer Protocol Functions
Protocols:
Rules for exchanging data.
Structure of the message
11
Application Layer Protocol Functions
Applications and services can use multiple protocols.
Using a web browser (HTTP):
May invoke:
DNS, ARP, ICMP
May use:
TCP, UDP, Ethernet, PPP(point to point protocol)
Uses
IP
12
Client Server Model
A network application protocol typically has two parts or
"sides", a client side and a server side.
Client: the device requesting the information
Server: the device responding to the request is called a server.
13
Servers
A server contains information to be shared with many client
systems.
Web server
Email server
File or database server
Applications server
May require authentication and vary permissions.
14
Servers
The server runs a service, or process, sometimes called a server
daemon.
Daemons (like other services) typically run in the background and
are not under an end user's direct control.
Daemons are described as "listening" for a request from a client.
When a daemon "hears" a request from a client responds
appropriately.
15
Application Layer Protocols
HTTP DHCP
(WWW) (IP address
We will examine
resolution)
HTTP in detail. DNS
(domain name
FTP resolution)
(file transfer)
SMB
(file sharing)
SMTP
(email)
P2P
Telnet (file sharing)
(remote login)
16
Reminder of encapsulation/decapsulation
Data Link IP TCP HTTP Data Link
Data Trailer
Header Header Header Header
Data Link Data Link
IP Packet
Header Trailer
Data Link Data Link
IP Packet
Header Trailer
Data Link Data Link
IP Packet
Header Trailer
Data Link IP TCP HTTP Data Link
Header Header Header Header
Data Trailer
17
Focus on Application Header and/or Data
HTTP
HTTP
We will examine how the application (header) and/or data communication
with each other between the client and the server.
18
HTTP (HyperText Transfer Protocol)
HTTP HTTP
HTTP
HTTP
Client
Server
HTTP – The Web’s application layer protocol:-defines how messages
are passed between browser and Web server.
RFC 1945 and RFC 2616
Implemented in:
Client program
Server program
Current version: HTTP/1.1
Encapsulated in TCP (more later)
19
HTTP (HyperText Transfer Protocol)
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Rick Graziani, Cabrillo College</title><style type="text/css">
<!--
body {
margin-left: 0px;
The base HTML file references other objects
margin-top: 0px; in the page.
margin-right: 0px;
margin-bottom: 0px;
Web page (also called a html document)
Web page consists of objects
HTML file
JPEG image
JAVA applet
Audio file
20
Web Browser - Client
HTTP
Client
Browser – The user agent for the Web.
Displays requested Web page.
Browser and client may be used interchangeably in this
discussion.
HTTP has nothing to do with how a Web page is interpreted
21
(displayed) by the client (browser).
Web Server
HTTP
Server
Web Server – Stores web objects, each addressable by a URL.
Implement the server side of HTTP.
Examples:
Apache
Microsoft Internet Information Server
22
HTTP Request Message
GET /~rgraziani/ HTTP/1.1 Some data omitted for brevity
Accept-Language: en-us
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET
CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506; InfoPath.1)
Host: [Link]
Connection: Keep-Alive
HTTP
Server
HTTP Client
Request Message
Request line
Header lines
ASCII Text
23
HTTP Response Message
HTTP/1.1 200 OK Some data omitted for brevity
Date: Fri, 22 Feb 2008 16:34:18 GMT
Server: Apache/2.0.52 (Red Hat)
Last-Modified: Thu, 15 Nov 2007 19:33:12 GMT
Content-Length: 15137
Connection: close
Content-Type: text/html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"[Link]
<html xmlns="[Link]
HTTP
Server
HTTP Client
24
HTTP Response Message
HTTP/1.1 200 OK
Date: Fri, 22 Feb 2008 16:34:18 GMT
Server: Apache/2.0.52 (Red Hat)
Last-Modified: Thu, 15 Nov 2007 19:33:12 GMT
Content-Length: 15137
Connection: close
Content-Type: text/html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"[Link]
<html xmlns="[Link]
Response message:
Status line
Header lines
Entity body
25
HTTP Request and Response Messages
GET /~rgraziani/ HTTP/1.1
Accept-Language: en-us
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET
CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506; InfoPath.1)
Host: [Link]
Connection: Keep-Alive
HTTP
HTTP
HTTP
Server
HTTP Client
HTTP/1.1 200 OK
Date: Fri, 22 Feb 2008 16:34:18 GMT
Server: Apache/2.0.52 (Red Hat)
Last-Modified: Thu, 15 Nov 2007 19:33:12 GMT
Content-Length: 15137
Connection: close
Content-Type: text/html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"[Link] 26
<html xmlns="[Link]
HTTPS
HTTPS (Hypertext Transfer Protocol over Secure Socket Layer) is a URL
scheme used to indicate a secure HTTP connection.
HTTPS is not a separate protocol
combination of a normal HTTP interaction over an encrypted:
Secure Sockets Layer (SSL) or
Transport Layer Security (TLS) connection
27
FTP (File Transfer Protocol)
FTP FTP
Client Server
FTP was developed to allow for file transfers between a client and a
server.
Used to push and pull files from a server running the FTP daemon
(FTPd).
RFC 959 28
FTP (File Transfer Protocol) - FYI
TCP control connection port 21
Username and password
Change directory on Server
TCP data connection port 20
Copy file from client to server – Connection Closed
TCP data connection port 20
Copy file from server to client – Connection Closed
TCP control connection port 21
Quit FTP Application – Connection Closed
Client initiates a TCP control connection with FTP server using port 21.
This connection remains open until the user quits the FTP application.
TCP port 21 connection includes:
Username and password is sent over TCP port 21.
Remote directory changes
This state information significantly reduces total number of sessions on
server.
For each file transferred, TCP opens and closes a TCP data connection on port
20.
29
SMTP – Simple Mail Transfer Protocol
Email – One of the killer applications of the Internet.
30
SMTP – Simple Mail Transfer Protocol
User agent Mail server Mail server User agent
SMTP SMTP
POP3
IMAP
Internet mail involves:
User agents
Allows users to read, reply, compose, forward, save, etc., mail messages
GUI user agents: Outlook, Eudora, Messenger
Text user agents: mail, pine, elm
Mail servers
Stores user mail boxes, communicates with local user agents and other
mail servers.
SMTP
Principale application layer protocol for Internet mail
Sent over TCP
31
Mail access protocols: POP3, IMAP, HTTP
SMTP – Simple Mail Transfer Protocol
User agent Mail server Mail server User agent
SMTP SMTP
POP3
IMAP
SMTP
RFC 2821
Transfers messages from sender’s mail server to recipient’s mail
server
Push protocol, not a pull protocol
Push (from client to server or server to server)
Pull (from server to client)
Retrieving email
Historically, users would log into local mail server to read mail.
Since early 1990’s, clients use mail access protocols:
POP3
IMAP
HTTP
32
SMTP – Simple Mail Transfer Protocol
POP3 (Post Office Protocol)
RFC 1939
Limited functionality
Uses TCP port 110
Download-and-delete mode
Retrieves messages on server and store them locally
Delete messages on server
Download-and-keep mode
Does not delete messages on server when retrieved.
Problem
Difficult to access email from multiple computers – work and home.
Some email may have already been downloaded on another
computer (work) – download-and-delete
To read email from another computer, must leave on server –
download-and-keep
Does not provide means for user to create remote folders on mail
server 33
SMTP – Simple Mail Transfer Protocol
User agent Mail server Mail server User agent
SMTP SMTP
IMAP
HTTP
IMAP (Internet Message Access Protocol)
RFC 2060
Mail not downloaded, but kept on server
Received email is associated with user’s INBOX
Users can create and manage remote folders
Users can retrieve portions of the email:
Message header: Subject line and Sender
Web-based email
Introduced with Hotmail in mid-1990’s
Communicates with remote mailbox using HTTP
HTTP is used to push (client to server) and pull the email (server to
client) 34
SMTP
MTA
receives email from the
client's MUA
passes email to the MDA
for final delivery
uses SMTP to route email
between servers
Mail software, processes used: MTA and MDA
MUA (Mail User Agent) – Email client software.
MTA (Mail Transfer Agent) – Software using SMTP that governs transfer
of email between mail servers.
Includes UNIX sendmail, Microsoft Exchange Server, Postfix, and Exim
MDA (Mail Delivery Agent) – Software that governs transfer of email from
mail servers to clients.
35
On Unix systems, procmail and maildrop are the most popular MDAs.
Telnet
Telnet Telnet
Server
TELNET is an abbreviation for TErminaL NETwork and is a client/server
application program.
Telnet provides a standard method of emulating text-based terminal devices
over the data network. 36
Telnet
Telnet Telnet
Server
Allows a user to remotely access another device (host, router,
switch).
Connection called a Virtual Terminal (VTY) session.
Telnet clients:
Putty
Teraterm
Hyperterm
37
Telnet
Supports user authentication,
Does not encrypt data.
Secure Shell (SSH) protocol offers an alternate and secure method for
server access.
Stronger authentication
Encrypts data
38
DHCP – Dynamic Host Configuration Protocol
IP addresses and other information can be obtained:
Statically
Dynamically (DHCP)
39
DHCP
DHCP Information can include:
IP address
Subnet mask
Default gateway
Domain name
DNS Server
DHCP servers can be:
Server on LAN
Router
Server at ISP 40
DNS – Domain Name System
DNS allows users (software) to use domain names instead of IP addresses
41
nslookup
nslookup
Displays default DNS server for your host
Can be used to query a domain name and get the IP address
42
DNS Name
Resolution
ipconfig /displaydns
After a certain amount of time, specified in the Time to Live (TTL)
associated with the DNS resource record, the resolver discards the
record from the cache.
ipconfig /flushdns – Manually deletes entries
The default TTL for positive responses is 86,400 seconds (1 day).
The default TTL for negative responses is 300 seconds.
43
(Missing Info) DNS: [Link]
44