Professional Documents
Culture Documents
7. Application layer
• Khái niệm
Application • Web & HTTP
• FTP
Presentation
• Email
Session • Torrent
Transport
Network
Datalink
Physical
Client-server architecture
server:
• always-on host
• permanent IP address
• data centers for scaling
clients:
• communicate with server
client/server • may be intermittently
connected
• may have dynamic IP
addresses
• do not communicate directly
with each other
Học viện Hàng không Việt Nam
106
P2P architecture
• no always-on server peer-peer
• arbitrary end systems
directly communicate
• peers request service from
other peers, provide service
in return to other peers
• self scalability – new peers
bring new service capacity, as
well as new service demands
• peers are intermittently
connected and change IP
addresses
• complex management
Processes communicating
process: program running clients, servers
within a host client process: process that
• within same host, two initiates communication
processes communicate server process: process that
using inter-process waits to be contacted
communication (defined
by OS)
• processes in different aside: applications with P2P
hosts communicate by architectures have client
exchanging messages processes & server
processes
Sockets
• 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
application application
socket controlled by
process process app developer
transport transport
network network controlled
link by OS
link Internet
physical physical
Addressing processes
• to receive messages, process • identifier includes both IP
must have identifier address and port numbers
• host device has unique 32-bit associated with process on
/ 128-bit IP address host.
• Q: does IP address of host • example port numbers:
on which process runs suffice • HTTP server: 80
for identifying the process? • mail server: 25
A: no, many processes • to send HTTP message to
can be running on same gaia.cs.umass.edu web server:
host • IP address: 128.119.245.12
• port number: 80
• more shortly…
Internet apps
application underlying
application layer protocol transport protocol
First, a review…
•web page consists of objects
•object can be HTML file, JPEG image, Java
applet, audio file,…
•web page consists of base HTML-file which
includes several referenced objects
•each object is addressable by a URL, e.g.,
www.someschool.edu/someDept/pic.gif
HTTP overview
HTTP: hypertext
transfer protocol
• Web’s application layer
protocol
• client/server model PC running
•client: browser that Firefox browser
requests, receives,
(using HTTP
protocol) and
“displays” Web server
objects running
•server: Web server Apache Web
sends (using HTTP server
protocol) objects in
response to
requests iphone running
Safari browser
HTTP connections
Persistent HTTP
… …
gaia.cs.umass.edu
gaia.cs.umass.edu
examples:
•file distribution
(BitTorrent)
•Streaming (KanKan)
•VoIP (Skype)
Alice arrives …
… obtains list
of peers from tracker
… and begins exchanging
file chunks with peers in torrent
BitTorrent: tit-for-tat
(1) Alice “optimistically unchokes” Bob
(2) Alice becomes one of Bob’s top-four providers; Bob reciprocates
(3) Bob becomes one of Alice’s top-four providers
IP
IP Header
Header Data 11 Data
IP Header 1 IP Header 1
Frame Header
Frame Header IP
IPHeader
Header 11 II IP Header 1
Frame Header IP Header 1 I
D. OSI vs TCP/IP
Application Layer
Presentation Layer Application Layer
Session Layer
Transport Layer Transport Layer
Network Layer Internet Layer
Datalink Layer
Network Access Layer
Physical Layer
OSI Model TCP/IP Model
OSI vs TCP/IP 4 layers
Học viện Hàng không Việt Nam
149
Application Layer
Presentation Layer Application Layer
Session Layer
Transport Layer Transport Layer
Network Layer Internet Layer
Datalink Layer Datalink Layer
Physical Layer Physical Layer
OSI Model TCP/IP Model
OSI vs TCP/IP 5 layers
Học viện Hàng không Việt Nam
150
TCP/IP model
Học viện Hàng không Việt Nam
152