Chapter 4 - Transport and Application Layer
Chapter 4 - Transport and Application Layer
Chapter 4 - Transport and Application Layer
Application Layer
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 2
4.1 Transport Layer Protocols
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 3
Transportation of Data
Role of the Transport Layer
Responsible for establishing a
temporary communication session
between two applications and
delivering data between them.
Link between the application layer
and the lower layers that are
responsible for network transmission.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 4
Transportation of Data
Transport Layer Responsibilities
Tracking the Conversation -
Tracks each individual
conversation flowing between a
source and a destination
application.
Segmentation - Divides the data
into segments that are easier to
manage and transport. Header
used for reassembly is used for
tracking.
Identifying the Application -
Ensures that even with multiple
applications running on a device,
all applications receive the correct
data via port numbers.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 5
Transportation of Data
Conversation Multiplexing
Segmenting the data into smaller chunks enables many different communications to be
multiplexed on the same network.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 6
Transportation of Data
Transport Layer Reliability
TCP/IP provides two transport
layer protocols:
• Transmission Control Protocol
(TCP)
• Considered reliable which ensures
that all of the data arrives at the
destination.
• Additional fields needed in header
which increases size and delay.
• User Datagram Protocol (UDP)
• Does not provide for reliability.
• Fewer fields and is faster than TCP.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 7
Transportation of Data
TCP TCP transport is similar to
sending tracked packages. If a
shipping order is broken up
into several packages, a
customer can check online to
see the order of the delivery.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 8
Transportation of Data
TCP (Cont.)
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 9
Transportation of Data
TCP (Cont.) TCP Three Responsibilities:
Numbering and tracking data segments
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 10
Transportation of Data
UDP Use UDP for less overhead and
to reduce possible delays.
Best-effort delivery (unreliable)
No acknowledgment
Similar to a non-registered
letter
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 11
Transportation of Data
The Right Transport Layer Protocol for the Right Application
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 13
TCP and UDP Overview
TCP Header 20 Bytes Total
Source and Destination Port used to identify
application
Sequence number used for data reassembly
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 15
TCP and UDP Overview
UDP Header
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 16
TCP and UDP Overview
Multiple Separate Communications
Users expect to simultaneously receive and send email, view websites and make a
VoIP phone call
TCP and UDP manage multiple conversations by using unique identifiers called port
numbers
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 17
TCP and UDP Overview
Port Numbers
Source Port
• Originating application port that is
dynamically generated by sending
device
• Example: Each separate HTTP
conversation is tracked based on the
source ports.
Destination Port
• Tell the destination what service is
being requested
• Example: Port 80 web services are
being requested
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 18
TCP and UDP Overview
Socket Pairs
Source and destination port
placed in segment
Segments encapsulated in IP
packet
IP and port number = socket
Example: 192.168.1.7:80
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 19
TCP and UDP Overview
Port Number Groups
Well Known
Port
Numbers
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 21
TCP and UDP Overview
The netstat Command
Network utility that can
be used to verify
connections
By default, will attempt
to resolve IP
addresses to domain
names and port
numbers to well-known
applications
-n option used to
display IPs and ports
in numerical form
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 22
TCP Communication Process
TCP Server Process
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 23
TCP Communication Process
TCP Server Process (Cont.)
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 24
TCP Communication Process
TCP Connection Establishment
Step 2 – Server
acknowledges and
requests a session with
client. © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 25
TCP Communication Process
TCP Session Termination
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 27
TCP Communication Process
Video Demonstration - Video Demonstration - TCP 3-Way
Handshake
SYN
SYN, ACK
ACK
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 28
Reliability and Flow Control
TCP Reliability – Ordered Delivery
Sequence numbers are assigned
in the header of each packet.
Represents the first data byte of
the TCP segment.
During session setup, an initial
sequence number (ISN) is set -
represents the starting value of the
bytes.
As data is transmitted during the
session, the sequence number is
incremented by the number of
bytes that have been transmitted.
Missing segments can then be
identified.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 29
Reliability and Flow Control
Video Demonstration - TCP Reliability – Sequence Numbers and
Acknowledgments
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 30
Reliability and Flow Control
Video Demonstration – Data Loss and Retransmission
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 31
Reliability and Flow Control
TCP Flow Control – Window Size and Acknowledgments
In the figure, the source is
transmitting 1,460 bytes of
data within each segment.
Window size agreed on
during 3-way handshake.
Typically, PC B will not wait
for 10,000 bytes before
sending an
acknowledgment.
PC A can adjust its send
window as it receives
acknowledgments from PC
B.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 32
Reliability and Flow Control
TCP Flow Control – Congestion Avoidance
Congestion causes
retransmission of lost TCP
segments
Retransmission of segments
can make the congestion
worse
To avoid and control
congestion, TCP employs
several congestion handling
mechanisms, timers, and
algorithms
Example: Reduce the number
of bytes it sends before
receiving an acknowledgment
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 33
UDP Communication
UDP Low Overhead versus Reliability
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 34
UDP Communication
UDP Datagram Reassembly
UDP reassembles
data in order received
and forwards to
application
Application must
identify the proper
sequence
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 36
UDP Communication
UDP Client Processes
TCP frees
applications
from having to
manage
reliability
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 39
TCP or UDP
Applications that use UDP
Three types of
applications best
suited for UDP:
Live video and
multimedia
Simple request
and reply
Handle reliability
themselves
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 40
4.2 Application Layer
Protocols
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 41
Chapter 4 - Sections & Objectives
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 42
Application, Presentation, and Session
Application Layer
Application Layer:
• Closest to the end user.
• Used to exchange data between
programs running on the source and
destination hosts.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 43
Application, Presentation, and Session
Presentation and Session Layer
Presentation Layer function:
• Formatting data at the source device
into a compatible form for the
receiving device.
• Compressing data.
• Encrypting data.
Session Layer Function
• Create and maintain dialogs between
source and destination applications.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 44
Application, Presentation, and Session
TCP/IP Application Layer Protocols • Post Office Protocol (POP) TCP 110 - Enables
clients to retrieve email from a mail server.
• Internet Message Access Protocol (IMAP) TCP
143 - Enables clients to retrieve email from a
mail server, maintains email on server.
• File Transfer Protocol (FTP) TCP 20 and 21 -
Reliable, connection-oriented, and
acknowledged file delivery protocol.
• Trivial File Transfer Protocol (TFTP) UDP 69 –
• Domain Name Server (DNS) TCP,UDP 53 - Translates
domain names, such as cisco.com, into IP addresses. simple connectionless file transfer protocol.
• (BOOTP) – Bootstrap Protocol - BOOTP is being • Hypertext Transfer Protocol (HTTP) TCP 80,
superseded by DHCP. 8080 - Set of rules for exchanging text, graphic
images, etc. on the World Wide Web.
• Dynamic Host Configuration Protocol (DHCP) UDP client
68, server 67 – Dynamically assigns IP addresses to client • Hypertext Transfer Protocol Secure (HTTPS)
stations at start-up. TCP, UDP 443 – Uses encryption and
• Simple Mail Transport Protocol (SMTP) TCP 25 - Enables authentication to secure communication.
clients to send email to a mail server.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 45
How Application Protocols Interact with End-User Applications
Client-Server Model
Client and server processes are
considered to be in the application
layer.
Application layer protocols
describe the format of the
requests and responses between
clients and servers.
Example of a client-server network
is using an ISP’s email service to
send, receive and store email.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 46
How Application Protocols Interact with End-User Applications
Peer-to-Peer Networks
Data is accessed from a peer
device without the use of a
dedicated server.
Each device (known as a peer)
can function as both a server and
a client.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 47
How Application Protocols Interact with End-User Applications
Peer-to-Peer Applications
A P2P application allows a device
to act as both a client and a server
within the same communication.
P2P applications require that each
end device provide a user
interface and run a background
service.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 48
How Application Protocols Interact with End-User Applications
Common P2P Applications
Common P2P networks include:
• G2
• Bitcoin
• BitTorrent
• eDonkey
Some P2P applications are based on
the Gnutella protocol, where each user
shares whole files with other users.
Many P2P applications allow users to
share pieces of many files with each
other at the same time –this is
BitTorrent technology.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 49
Web and Email Protocols
Hypertext Transfer Protocol and Hypertext Markup Language
When a web address or uniform resource
locator (URL) is typed into a web browser,
the web browser establishes a connection
to the web service running on the server,
using the HTTP protocol.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 50
Web and Email Protocols
HTTP and HTTPS
HTTP is a request/response protocol.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 51
Web and Email Protocols
Email Protocols
Email clients communicate with mail
servers to send and receive email.
Mail servers communicate with other
mail servers to transport messages from
one domain to another.
Three protocols for email:
• Simple Mail Transfer Protocol (SMTP) to
send email.
• Post Office Protocol (POP) to retrieve
email.
• Internet Message Access Protocol
(IMAP) to retrieve email.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 52
Web and Email Protocols
SMTP Operation
SMTP is used to send email
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 53
Web and Email Protocols
POP Operation
POP is used to retrieve
email from a mail server.
Email is downloaded from
the server to the client and
then deleted on the server.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 54
Web and Email Protocols
IMAP Operation
IMAP is used to retrieve mail
from a mail server.
Copies of messages are
downloaded from the server
to the client and the original
messages are stored on the
server.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 55
IP Addressing Services
Domain Name Service
Domain names convert the
numeric address into a
simple, recognizable name.
The DNS protocol defines
an automated service that
matches resource names
with the required numeric
network address.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 56
IP Addressing Services
DNS Message Format
When a client makes a query, the
server’s DNS process first looks at its
own records to resolve the name.
If unable to resolve, it contacts other
servers to resolve the name.
The server temporarily stores the
numbered address in the event that
the same name is requested again.
The ipconfig /displaydns command
displays all of the cached DNS
entries on a Windows PC.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 57
IP Addressing Services
DNS Hierarchy
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 58
IP Addressing Services
The nslookup Command
Nslookup - a utility that allows a user
to manually query the name servers
to resolve a given host.
• Can also be used to troubleshoot name
resolution issues and to verify the
current status of the name servers.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 59
IP Addressing Services
Dynamic Host Configuration Protocol
The Dynamic Host Configuration Protocol
(DHCP) for IPv4 automates the
assignment of IPv4 addresses, subnet
masks, gateways, and other parameters.
DHCP-distributed addresses are leased
for a set period of time, then returned to
pool for reuse.
DHCP is usually employed for end user
devices. Static addressing is used for
network devices, such as gateways,
switches, servers, and printers.
DHCPv6 (DHCP for IPv6) provides similar
services for IPv6 clients.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 60
IP Addressing Services
DHCP Operation
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 61