Академический Документы
Профессиональный Документы
Культура Документы
Adnan Iqbal
Spring 2018-19
Namal College, Mianwali
How can we write
networked
applications?
2
Creating a Network App
application
transport
Write programs that network
data link
physical
run on (different) end systems
communicate over network
e.g., web server software
communicates with browser
software
No need to write software for application
transport
network
network-core devices data link
physical
application
transport
controlled
by OS
• API:
(1) choice of transport protocol;
(2) ability to fix a few parameters
Client-server Architecture
server:
always-on host
permanent IP address
server farms for scaling
clients:
communicate with server
may be intermittently
connected client/server
6
Pure P2P Architecture
no always-on server
arbitrary end systems directly
communicate
peers are intermittently
connected and change IP peer-peer
addresses
Security
Timing • encryption, data integrity, …
some apps (e.g.,
Internet telephony,
interactive games)
require low delay to be
“effective”
App-layer Protocol Defines
Types of messages exchanged, Public-domain protocols:
e.g., request, response
Defined in RFCs
Message syntax:
allows for
what fields in messages & how
interoperability
fields are delineated
e.g., HTTP, SMTP,
Message semantics
BitTorrent
meaning of information in fields
Rules for when and how Proprietary protocols:
processes send & respond to e.g., Skype, ppstream
messages
Actions taken on message
HTTP Overview
HTTP: hypertext transfer
protocol
Web’s application layer
protocol PC running
Explorer
client/server model
client: browser that
requests, receives,
Server
“displays” Web objects running
server: Web server sends Apache Web
server
objects in response to
requests Mac running
Navigator
HTTP request message: general format
HTTP response message: general format
13
What is the meaning of following URL?
www.somesite.com/animalsearch?monkeys&banana
14
Method types
HTTP/1.0 HTTP/1.1
GET GET, POST, HEAD
POST PUT
uploads file in entity
HEAD body to path specified
asks server to leave in URL field
requested object out of DELETE
response deletes file specified in
the URL field
Is HTTP a stateless
protocol?
16
HTTP States
HTTP is “stateless”
server maintains no information about past client
requests
17
Which Transport
layer protocol is
used by HTTP?
18
HTTP Overview (continued)
Uses TCP:
client initiates TCP connection (creates socket) to server,
port 80
server accepts TCP connection from client
HTTP messages (application-layer protocol messages)
exchanged between browser (HTTP client) and Web server
(HTTP server)
TCP connection closed!
How does HTTP use
TCP?
Persistent HTTP
Multiple objects can be sent over single TCP
connection between client and server.
(contains text,
Nonpersistent HTTP references to 10
jpeg images)
26