Application Layer
Application Layer
Functionality and
Functionality and
Protocols
Protocols
4-1 ©2013 Chakchai So-In CS 322 222Khon Kaen University
Chakchai So-In, Ph.D.
Department of Computer Science
Faculty of Science, Khon Kaen University 123 Mitaparb Rd., Naimaung,
Maung, Khon Kaen, 40002 Thailand [email protected]
Agenda
Agenda
Define the application layer as the source and destination of
data for communication across networks.
Explain the role of protocols in supporting communication
between server and client processes.
Describe the features, operation, and use of well-known
TCP/IP application layer services (HTTP, DNS, SMTP).
4-2
©2013 Chakchai So-In CS 322 222
Explain that applications provide the means for generating and
receiving data that can be transported on the network
Applications
Applications -- The Interface Between
The Interface Between
Human and Data Networks
Human and Data Networks
4-3
©2013 Chakchai So-In CS 322 222
Explore the role of applications, services and protocols in
converting communication to data that can be transferred across the data network
Applications
Applications -- The Interface Between
The Interface Between
Human and Data Networks (Cont.)
Human and Data Networks (Cont.)
4-4
©2013 Chakchai So-In CS 322 222
Define the separate roles applications, services and protocols
play in transporting data through networks
Applications
Applications -- The Interface Between
The Interface Between
Human and Data Networks (Cont.)
Human and Data Networks (Cont.)
4-5
©2013 Chakchai So-In CS 322 222
Application layer is the layer that provides
the interface between the applications we use to communicate and the underlying network over which our messages are transmitted.
Application layer protocols are used to
Applications
Applications -- The Interface Between
The Interface Between
Human and Data Networks (Cont.)
Human and Data Networks (Cont.)
Application layer protocols are used to
exchange data between programs running on the source and destination hosts.
Application layer protocols specify the
format and control information necessary for many of the common Internet
Example of application layer protocols
Applications
Applications -- The Interface Between
The Interface Between
Human and Data Networks (Cont.)
Human and Data Networks (Cont.)
4-7
©2013 Chakchai So-In CS 322 222
Khon Kaen University
The protocols in the TCP/IP suite are generally defined by Requests for
The Presentation layer has three primary functions:
Coding and conversion of Application layer data to ensure
that data from the source device can be interpreted by the appropriate application on the destination device.
Compression of the data in a manner that can be
decompressed by the destination device.
Encryption of the data for transmission and the decryption
The Presentation Layer
The Presentation Layer
Encryption of the data for transmission and the decryption
of data upon receipt by the destination.
E,g., Quicktime, MPEG,
The Session Layer
The Session Layer
The Session layer creates and maintains dialogs between source
and destination applications.
The Session layer handles the exchange of information to
initiate dialogs, keep them active, and to restart sessions that are disrupted or idle for a long period of time.
E.g. Network File System (NFC), RPC (Remote Procedure
Applications provide people a way to create messages.
Network-Aware Applications: they implement the application
layer protocols and are able to communicate directly with the lower layers of the protocol stack. E-mail clients and web
browsers.
Application Layer Services: other programs may need the
Applications
Applications -- The Interface Between
The Interface Between
Human and Data Networks (Cont.)
Human and Data Networks (Cont.)
Application Layer Services: other programs may need the
assistance of Application layer services to use network resources, like file transfer or network print spooling.
Application Layer Services establish an interface to the network. Protocols provide the rules and formats that govern how data is
treated. Protocols specify what messages are exchanged between the source and destination hosts, the syntax of the control
Applications
User Applications/Services/Application
User Applications/Services/Application
Layer Protocol [Animation
Layer Protocol [Animation 3
3..1
1..3
3..1
1]]
4-13
©2013 Chakchai So-In CS 322 222
The Role of Protocols in Supporting
The Role of Protocols in Supporting
Communication (Client/Server Models)
Communication (Client/Server Models)
4-15
©2013 Chakchai So-In CS 322 222
A server is usually a computer that contains information to be
shared with many client systems e.g. web pages, documents, databases, pictures, video, and audio files
Different types of server applications may have different
requirements for client access e.g. some servers may require authentication
The server runs a service, or process, sometimes called a server
Servers
Servers
The server runs a service, or process, sometimes called a server
daemon.
Daemons listen for a request from a client
When a daemon "hears" a request from a client, it exchanges
The Role of Protocols in Supporting
The Role of Protocols in Supporting
Communication
Communication
4-17
©2013 Chakchai So-In CS 322 222
Compare and contrast client server networking with
peer-to-peer networks and peer-to-peer-to-peer-to-peer applications
The Role of Protocols in Supporting
The Role of Protocols in Supporting
Compare and contrast client server networking with peer-to-peer
networks and peer-to-peer applications (Centralized vs. Distributed)
Difficulty: User Management/Policy Allow: Hybrid (index; resource)
A peer-to-peer application (P2P), unlike a peer-to-peer network,
The Role of Protocols in Supporting
The Role of Protocols in Supporting
Communication (Cont.)
Communication (Cont.)
A peer-to-peer application (P2P), unlike a peer-to-peer network,
Domain Name System (DNS) - TCP/UDP Port 53 Hypertext Transfer Protocol (HTTP) - TCP Port 80 Simple Mail Transfer Protocol (SMTP) - TCP Port 25 Post Office Protocol (POP) - TCP Port 110
Telnet - TCP Port 23
Dynamic Host Configuration Protocol - UDP Ports 67 and 68
Application Layer Protocols: Examples
Application Layer Protocols: Examples
4-20
©2013 Chakchai So-In CS 322 222
Khon Kaen University
Describe the features of the DNS protocol and how this protocol
supports DNS services [Animation 3.3.1.1]
Features, Operation, and Use of TCP/IP
Features, Operation, and Use of TCP/IP
Application Layer Services
Application Layer Services
4-21
©2013 Chakchai So-In CS 322 222
DNS is a client/server service.
DNS differs from other services - While other services use a
client that is an application (such as web browser, e-mail client), the DNS client runs as a service itself.
The DNS server, sometimes called the DNS resolver, supports
name resolution for our other network applications and other services that need it.
DNS Services and Protocol
DNS Services and Protocol
services that need it.
DNS Verification
A DNS server provides the name resolution using the
name daemon, which is often called named.
The DNS server stores different types of resource records
used to resolve names. These records contain the name, address, and type of record.
A - an end device address
NS - an authoritative name server
DNS Services and Protocol (Cont.)
DNS Services and Protocol (Cont.)
NS - an authoritative name server
CNAME - the canonical name (or Fully Qualified Domain
Name) for an alias; used when multiple services have the single network address but each service has its own entry in DNS
MX - mail exchange record; maps a domain name to a list
DNS uses a hierarchical system to create a name database to
provide name resolution.
At the top of the hierarchy, the root servers maintain records
about how to reach the top-level domain servers, which in turn have records that point to the second-level domain
servers and so on.
The resource records list domain names that the server can
DNS Services and Protocol
DNS Services and Protocol
The resource records list domain names that the server can
resolve and alternative servers that can also process requests.
If a given server has resource records that correspond to its
Describe the features of the HTTP protocol and how this protocol
supports the delivery of web pages to the client
Features, Operation, and Use of TCP/IP
Features, Operation, and Use of TCP/IP
Describe the features of the HTTP protocol and how this protocol
supports the delivery of web pages to the client
Features, Operation, and Use of TCP/IP
Features, Operation, and Use of TCP/IP
HTTP is used across the WWW for data transfer and is one of
the most used application protocols.
HTTP specifies a request/response protocol. Three common message types
GET is a client request for data.
POST and PUT are used to send messages that upload
WWW Service and HTTP
WWW Service and HTTP
POST and PUT are used to send messages that upload data to the web server.
POST includes the data in the message sent to the
server.
The MUA allows messages to be sent and places received
messages into the client's mailbox.
In order to receive mail messages from an mail server, the
e-mail client can use POP.
Sending e-mail from either a client or
a server uses message formats and
E
E--Mail Services and POP/SMTP
Mail Services and POP/SMTP
Protocol
Protocol
a server uses message formats and
Describe the features of the POP and SMTP protocols, and how
these protocols support e-mail services
Mail Transfer Agent (MTA) - forwards e-mail to MDA
Mail Delivery Agent (MDA) - receives all the inbound mail
from the MTA and places it into the appropriate users' mailboxes
Mail User Agent (MUA)
E
E--Mail Services
Mail Services
Some of the commands specified in the SMTP protocol are:
HELO - identifies the SMTP client process to the SMTP
server process
EHLO - Is a newer version of HELO, which includes services
extensions
MAIL FROM - Identifies the sender
E
E--Mail Services and POP/SMTP
Mail Services and POP/SMTP
Protocol (Cont.)
Protocol (Cont.)
MAIL FROM - Identifies the sender RCPT TO - Identifies the recipient
DATA - Identifies the body of the
Describe the features of the FTP protocol and
the role it plays in supporting file sharing (FTPd)
TCP Port 21 (Control) and 20 (Data)
DHCP Services
DHCP Services
Describe the features of the DHCP
protocol and the role it plays in allocating IP addresses to network nodes (IP, Netmask, Gateway, etc.)
Come and Go (Dynamic
Allocation)
IP Pool and Lease IP Pool and Lease Security = Mixed
Describe the features of the SMB protocol and the role it plays
in supporting file sharing in Microsoft-based networks
File Sharing Service/ SMB Protocol
File Sharing Service/ SMB Protocol
(Cont.)
(Cont.)
The Server Message Block (SMB) (IBM/Microsoft) describes
the structure of shared network resources, such as directories, files, printers, and serial ports. (SAMBA = Linux/Unix)
Unlike the file sharing supported by FTP, clients establish a
long term connection to servers. (Map Network Drive)
Once the connection is established, the user of the client can Once the connection is established, the user of the client can
File Sharing Service and SMB Protocol
File Sharing Service and SMB Protocol
The SMB protocol describes file system access and how clients
can make requests for files
All SMB messages share a common format. This format uses a
fixed-sized header followed by a variable-sized parameter and data component.
Start, authenticate, and terminate sessions
Control file and printer access
Control file and printer access
Allow an application to send or receive messages to or from
P
P2
2P Services and Gnutella Protocol
P Services and Gnutella Protocol
Similar to FTP/SMB, P2P = File Sharing (Internet) based on
Gnutella protocol, e.g., BearShare, Gnucleus, LimeWire, Morpheus, WinMX and XoloX
Connected Gnutella service, the client applications will search
for other Gnutella nodes to connect to.
These nodes handle queries for resource locations and replies
to those requests.
Govern control messages, which help the service discover other
nodes. Actual file transfers = HTTP 5 Gnutella Messages
P
P2
2P Services/ Gnutella Protocol (Cont.)
P Services/ Gnutella Protocol (Cont.)
5 Gnutella Messages
ping - for device discovery pong - as a reply to a ping query - for file location
Before = Text-based system (display
terminal) physical
Telnet = virtual terminal (software) based
on TCP/IP to create session (VTY – Virtual Terminal); command line interface (CLI)
Telnet Client E.g., telnet (cmd), hyper
terminal, TeraTerm
Telnet Services and Protocol
Telnet Services and Protocol
Telnet is a client/server protocol; how a VTY session is
established and terminated; provides the syntax and commands used to initiate the Telnet session
Command = at least two bytes.
The first byte is a special character called the Interpret as
Command (IAC) character.
As its name implies, the IAC defines the next byte as a
Telnet Services and Protocol (Cont.)
Telnet Services and Protocol (Cont.)
As its name implies, the IAC defines the next byte as a
Telnet Services and Protocol (Cont.)
Telnet Services and Protocol (Cont.)
Some sample Telnet protocol commands include:
Are You There (AYT) - Lets the user request that
something appear on the terminal screen to indicate that the VTY session is active.
Erase Line (EL) - Deletes all text from the current line. Interrupt Process (IP) - Suspends, interrupts, aborts, or
terminates the process to which the Virtual Terminal is terminates the process to which the Virtual Terminal is connected.
For example, if a user started a program on the Telnet
server via the VTY, he or she could send an IP command to stop the program.
Drawback: Not secure (Plaintext) only authentication
Summary
Summary
4-46
©2013 Chakchai So-In CS 322 222
Thank you and Questions?
Thank you and Questions?
4-47
©2013 Chakchai So-In CS 322 222