Application Layer
Application Layer
COSC-3101
Course Instructor: Dr. Madiha Amjad
[email protected]
Client-server
Peer-to-peer (P2P)
Hybrid of Client-server and P2P
25.5
Client-server architecture
server:
Runs server apps on always-on host with permanent IP address
Server farms for scaling—usually clustered computers to serve large
# of clients—
Google cluster is estimated to have about 31,000 computers!
clients:
Communicate with server
May be intermittently connected
May have dynamic IP addresses
Do not communicate directly with each other
No always-on server
Arbitrary end systems directly communicate
Peers are intermittently connected and change IP addresses
‒ Highly scalable
25.8
Hybrid of client-server and P2P
Napster
‒File transfer P2P
‒File search centralized:
•Peers query same central server to locate content
•Peers register content into a directory at central server
Instant messaging
‒Chatting between two users is P2P
‒Presence detection/location centralized:
•User registers its IP address with central server when it comes online
•User contacts central server to find IP addresses of buddies
Skype
‒Internet telephony app—voice & video conferencing
‒Finding address of remote party: centralized server(s)
‒Client-client connection is direct (not through server)
World Wide Web
Persistent HTTP
Nonpersistent HTTP Multiple objects can be
At most one object is sent over single TCP
sent over a TCP connection between
connection. client and server.
HTTP/1.0 uses HTTP/1.1 (1999) uses
nonpersistent HTTP persistent connections
in default mode
Uniform Resource Locator
1 9
2
8
3 7
The user agent at the Bob site
allows Bob to read the received
message. Bob later uses a
5 6
4 message access agent client to
retrieve the message from a
message access agent server
running on the second server.
26.18
Figure 26.14: E-mail address
26.19
Figure 26.15: Protocols used in electronic mail
For MTA, the message needs to be pushed from the client to the server (need a push protocol)
Simple Mail Transfer Protocol (SMTP).
For MAA, the client must pull messages from the server (need a pull protocol) POP and
IMAP.
26.20
Electronic Mail: mail servers
outgoing
message queue
2) Mail Servers user mailbox
mailbox contains user
incoming messages for agent
user mail
user
message queue of server
agent
outgoing (to be sent) mail SMTP
mail
messages server user
SMTP protocol between SMTP agent
server
‒ “server”: receiving mail user
agent
server user
agent
26.22
Figure 26.22: Web-based e-mail, cases I and II
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Distributed, Hierarchical Database
Root servers
TLD servers
Root DNS Servers
Authoritative
DNS
servers
29
TLD and Authoritative Servers
once (any) name server(also dns client) learns mapping, it caches the mapping
‒ cache entries timeout (TTL) after some time
‒ TLD servers typically cached in local name servers
• Thus root name servers not often visited
• Typically a name server may contact a root server every 48 hours on the average
Static or Dynamic DNS
‒ Static DNS – entries on DNS servers manually updated
‒ Dynamic DNS (DDNS—RFC 2136): Hosts register to DNS server in real time—READ
‒ DDNS useful when IP addresses change usually by DHCP
‒ Used in Windows Active Directory
‒ Also popularly used for home computers with DNS names
Type=NS servereast.backup2.ibm.c
‒ name is domain (e.g. om
foo.com) Type=MX
value is canonical name
‒ value is hostname of value is name of
authoritative name server
for this domain mailserver associated with
name
Try http://www.iptools.com/ or http://mydnstools.info/ Any other tools found?
no always-on server
arbitrary end systems directly
communicate
peers are intermittently connected peer-peer
and change IP addresses
‒ File distribution
34
Server-client vs. P2P: example
3.5
P2P
Minimum Distribution Time
3
Client-Server
2.5
1.5
0.5
0
0 5 10 15 20 25 30 35
obtain list
of peers
trading
chunks
peer
36
BitTorrent (1)
file divided into 256KB chunks.
peer joining torrent:
‒ has no chunks, but will accumulate them over time
‒ registers with tracker to get list of peers, connects to
subset of peers (“neighbors”)
while downloading, peer uploads chunks to other peers.
peers may come and go
once peer has entire file, it may (selfishly) leave or
(altruistically) remain
Alice