Professional Documents
Culture Documents
Application Layer
Computer Networking: A
Top-Down Approach
8th Edition, Global Edition
Jim Kurose, Keith Ross
Copyright © 2022 Pearson Education
Ltd
Application Layer: 2-1
Internet protocol stack
application application
presentation
transport
session
network transport
link network
link
physical physical
The seven layer OSI/ISO
reference model
Introduction: 1-2
Internet protocol stack
▪ application: supporting network applications
• IMAP, SMTP, HTTP
application
▪ transport: process-process data transfer
(recognize source and dest processes for a
specific message) transport
• TCP, UDP
▪ network: routing of datagrams from source to network
destination
• IP, routing protocols link
▪ link: data transfer between neighboring physical
network elements
• Ethernet, 802.11 (WiFi), PPP
▪ physical: bits “on the wire”
Introduction: 1-3
ISO/OSI reference model
Two layers not found in Internet
application
protocol stack!
presentation
▪ presentation: allow applications to
interpret meaning of data, e.g., encryption, session
compression, machine-specific conventions transport
▪ session: synchronization, checkpointing, network
recovery of data exchange link
▪ Internet stack “missing” these layers! physical
• these services, if needed, must be
implemented in application The seven layer OSI/ISO
reference model
• needed?
Introduction: 1-4
Application layer: overview
enterprise
network Application Layer: 2-8
Principles of Network Applications
Network Application Architectures
▪ Before diving into software coding, you should have a broad architectural plan
for your application
▪ The application architecture will likely draw on one of the two predominant
architectural paradigms used in modern network applications:
➢ The client-server architecture
➢ The peer-to-peer (P2P) architecture
enterprise
network
• Security, performance, and reliability due to their highly home network content
decentralized structure provider
network datacenter
network
enterprise
network
▪ In the context of a communication session between a pair of processes, the process that
initiates the communication (that is, initially contacts the other process at the beginning
of the session) is labeled as the client. The process that waits to be contacted to begin
the session is the server.
▪ A process sends messages into, and receives messages from, the network through a
software interface called a socket
Sockets
▪ Socket is the interface between the application process and the transport-layer protocol.
▪ process sends/receives messages to/from its socket
▪ socket analogous to door
• sending process shoves message out door
• sending process relies on transport infrastructure on other side of door to deliver message to
socket at receiving process
• two sockets involved: one on each side
application application
socket controlled by
process process app developer
transport transport
network network controlled
link by OS
link Internet
physical physical
file transfer/download ? ? ?
e-mail ? ? ?
Web documents ? ? ?
real-time audio/video ? ? ?
?
streaming audio/video ? ? ?
interactive games ? ? ?
text messaging ? ? ?
Application Layer: 2-20
Principles of Network Applications
Transport service requirements: common apps
application data loss throughput time sensitive?
Each URL has two components: the hostname of the server that houses the object and the object’s path name.
Application Layer: 2-28
HTTP overview
HTTP: hypertext transfer protocol
▪ Web’s application layer
protocol PC running
▪ client/server model: Firefox browser
• client: browser that requests,
receives, (using HTTP protocol) and
“displays” Web objects server running
Apache Web
• server: Web server sends (using server
HTTP protocol) objects in response
to requests iPhone running
Safari browser
time time
Non-persistent HTTP response time = 2RTT+ file transmission time
Application Layer: 2-34
Persistent HTTP (HTTP 1.1)
Non-persistent HTTP issues: Persistent HTTP (HTTP1.1):
▪ requires 2 RTTs per object ▪ server leaves connection open after
▪ OS overhead for each TCP sending response
connection ▪ subsequent HTTP messages
▪ browsers often open multiple between same client/server sent
parallel TCP connections to over open connection
fetch referenced objects in ▪ client sends requests as soon as it
parallel encounters a referenced object
▪ as little as one RTT for all the
referenced objects (cutting
response time in half)
Application Layer: 2-35
HTTP request message
▪ two types of HTTP messages: request, response
▪ HTTP request message:
• ASCII (human-readable format)
header
lines
~
~ entity body ~
~ body
header
lines
* Check out the online interactive exercises for more examples: http://gaia.cs.umass.edu/kurose_ross/interactive/
Application Layer: 2-40
HTTP response message
status line (protocol HTTP/1.1 200 OK\r\n
status code status phrase) Date: Sun, 26 Sep 2010 20:09:20 GMT\r\n
Server: Apache/2.0.52 (CentOS)\r\n
Last-Modified: Tue, 30 Oct 2007 17:00:02
GMT\r\n
header ETag: "17dc6-a5c-bf716880"\r\n
Accept-Ranges: bytes\r\n
lines Content-Length: 2652\r\n
Keep-Alive: timeout=10, max=100\r\n
Connection: Keep-Alive\r\n
Content-Type: text/html; charset=ISO-8859-
1\r\n
\r\n
data, e.g., requested data data data data data ...
HTML file
* Check out the online interactive exercises for more examples: http://gaia.cs.umass.edu/kurose_ross/interactive/
Application Layer: 2-41
HTTP response message