Module V
Module V
Application
Layer
Outline
• peer-to-peer (P2P)
Client-Server Architecture
Server:
always-on host
permanent IP address
data centers for scaling
Clients:
Randomly on
client/server communicate with server
may be intermittently
connected
do not communicate directly
with each other.
Examples: FTP, Web, e-mail
Data Center
A data-center is used to create a powerful virtual server.
In date center, hundreds of servers must be powered and
maintained.
example: Google has around 50 data-centers distributed around the world.
These 50 data-centers handle : search, YouTube, Gmail etc.
P2P architecture
No dedicated server
Pairs of hosts are called peers. peer-peer
The peers communicate directly with each
other.
The peers are not owned by the service-
provider, instead these are laptops
controlled by users.
Ex file sharing (BitTorrent), Internet
telephone (Skype)
self-scalability ,Cost effective
Challenges: ISP friendly : P2P traffic does
not conform to traditional ISP traffic
policies.
Security: Openness & distribution
Incentives: convincing users to volunteer
bandwidth & resources to the applications.
Processes Communicating
Client process: process that
Process: program running within initiates communication
a host.
Server process: process that
• within same host, two
waits to be contacted
processes communicate using
IPC (defined by OS).
• processes in different hosts
communicate by exchanging
messages.
App-layer protocol defines
• types of messages exchanged, open protocols:
– e.g., request, response • defined in RFCs
• message syntax: • allows for interoperability
– what fields in messages • e.g., HTTP, SMTP
& how fields are proprietary protocols:
delineated
• e.g., Skype
• message semantics
– meaning of information
in fields
• rules for when and how
processes send & respond to
messages
3. Timing
• some apps (e.g., Internet 4. Security
telephony, interactive encryption, data integrity,
games) require low delay to …
be “effective”
Internet Transport Protocols Services
2-12
Web and HTTP
web page consists of objects(HTML)
object is a file - HTML file, JPEG image, audio file,…
web page consists of HTML-file & several
referenced objects.
object is addressable by a URL,
www.someschool.edu/someDept/pic.gif
iphone running
Safari browser
HTTP overview (continued)
2-15
HTTP connections
time
Non-persistent HTTP (cont.)
time
6. Steps 1-5 repeated for each of 10
jpeg objects
Non-persistent HTTP: response time
2-20
HTTP message: general format
Two types of HTTP messages: request, response
HTTP request message
GET: Browser requests an object from the server.
POST: User fills out a form & sends to the server.
PUT: Upload objects to servers. DELETE: Allows application to delete object on a
server.
data, e.g.,
requested
HTML file
components: agent
25 user
agent
2-33
Scenario: Alice sends message to Bob
1) Alice uses UA to compose 4) SMTP client sends Alice’s message
message “to” over the TCP connection
[email protected] 5) Bob’s mail server places the
2) Alice’s UA sends message to her message in Bob’s mailbox
mail server; message placed in 6) Bob invokes his UA to read
message queue message
3) client side of SMTP opens TCP
connection with Bob’s mail
server
format:
• header lines, e.g.,
body
– To:
– From:
– Subject:
• Body: the “message”
– ASCII characters only
Mail Access Protocols
mail access
user SMTP SMTP user
protocol
agent agent
(e.g., POP,
IMAP)
… …
Authoritative
2
• host at cis.poly.edu wants 3
TLD DNS server
IP address for 4
gaia.cs.umass.edu
5
gaia.cs.umass.edu
DNS name
resolution example root DNS server
2 3
recursive query: 7
6
puts burden of name TLD DNS
resolution on contacted server
name server local DNS server
heavy load at upper dns.poly.edu 5 4
levels of hierarchy? 1 8
gaia.cs.umass.edu
DNS Record:
Instructions in authoritative DNS servers, provide info( Domain+ IP address )
type=A(Address) type=CNAME
name is hostname name is alias name for some “canonical”
value is IP address (the real) name
value is canonical name
2 bytes 2 bytes
2 bytes 2 bytes