Models
Models
1. Architectural Models
2. Interaction Model
3. Design Challenges
4. Case Study: Design of a Client-Server System
DTU Compute
Department of Applied Mathematics and Computer Science
‣ client-server systems
‣ peer-to-peer systems
2
DTU Compute
Department of Applied Mathematics and Computer Science
Architectural Models
3
DTU Compute
Department of Applied Mathematics and Computer Science
Communicating Entities
What are the entities that are communicating in the
distributed system?
DTU Compute
Department of Applied Mathematics and Computer Science
Communicating Entities
• System perspective:
‣ two caveats:
5
DTU Compute
Department of Applied Mathematics and Computer Science
Processes VS Devices
Service
3
Service
1
Service
Service 4
2
Client
6
Client Client Client
5 7
Client Client
8 9
6
DTU Compute
Department of Applied Mathematics and Computer Science
Communicating Entities
• Programming perspective:
‣ distributed objects:
7
DTU Compute
Department of Applied Mathematics and Computer Science
Communication Paradigms
How do entities communicate in a distributed
systems?
(What communication paradigm is used?)
DTU Compute
Department of Applied Mathematics and Computer Science
Communication Paradigms
‣ interprocess communication
low level support for communication between processes in the distributed
system, including message-passing primitives, socket programming,
multicast communication
‣ remote invocation
most common communication paradigm, based on a two-way exchange
between communicating entities and resulting in the calling of a remote
operation (procedure or method)
9
DTU Compute
Department of Applied Mathematics and Computer Science
Communication Paradigms
‣ indirect communication
communication is indirect, through a third entity, allowing a strong degree
of decoupling between senders and receivers, in particular:
- space uncoupling: senders do not need to know who they are sending
to
- time uncoupling: senders and receivers do not need to exist at the
same time
10
DTU Compute
Department of Applied Mathematics and Computer Science
11
DTU Compute
Department of Applied Mathematics and Computer Science
13
DTU Compute
Department of Applied Mathematics and Computer Science
request reply
Server
provide
service
14
DTU Compute
Department of Applied Mathematics and Computer Science
Client-Server Interaction
15
DTU Compute
Department of Applied Mathematics and Computer Science
• The World Wide Web is an evolving and open system for publishing and
accessing resources and services across the Internet
16
DTU Compute
Department of Applied Mathematics and Computer Science
17
DTU Compute
Department of Applied Mathematics and Computer Science
3
Home.html
(or error message “404 Not Found”) www2.imm.dtu.dk
2
ndra
public_html
WebNic
Home.html
18
DTU Compute
Department of Applied Mathematics and Computer Science
• The terms “client” and “server” apply only to the roles played in a single
request
19
DTU Compute
Department of Applied Mathematics and Computer Science
• Example 1: a Web server is often a client of a local file server that manages
the files in which the web pages are stored
• Example 2: Web servers and most Internet services are clients of the DNS
service (which translates Internet Domain names to network addresses)
20
DTU Compute
Department of Applied Mathematics and Computer Science
The aim of the P2P architecture is to exploit the resources (both data and
hardware) in a large number of participating computers for the fulfilment of a
given task or activity
21
DTU Compute
Department of Applied Mathematics and Computer Science
22
DTU Compute
Department of Applied Mathematics and Computer Science
Placement
How are entities mapped on to the physical
distributed infrastructure
(i.e., what is their placement)?
DTU Compute
Department of Applied Mathematics and Computer Science
Placement
24
DTU Compute
Department of Applied Mathematics and Computer Science
Placement Strategies
• Mobile code
25
DTU Compute
Department of Applied Mathematics and Computer Science
26
DTU Compute
Department of Applied Mathematics and Computer Science
• A cache is a store of recently used data objects that is closer to one client or
a particular set of clients than the objects themselves
Purpose:
2. To speed up access to a
provides a shared cache
resource (via caching)
of web resources for the
clients
27
DTU Compute
Department of Applied Mathematics and Computer Science
An advantage of running
the downloaded code
locally is that it can give
good interactive
response since it does
B) Client interacts with the applet not suffer from the
delays or variability of
bandwidth associated
with network
communication
28
DTU Compute
Department of Applied Mathematics and Computer Science
Interaction Model
1. Architectural Models
2. Interaction Model
3. Design Challenges
4. Case Study: Design of a Client-Server System
DTU Compute
Department of Applied Mathematics and Computer Science
• Each process has its own state, consisting of the set of data that it can
access and update, including the variables in its program
• The state belonging to each process is completely private (that is, it cannot
be accessed or updated by any other processes)
30
DTU Compute
Department of Applied Mathematics and Computer Science
send m receive
Communication channel
Outgoing message buffer Incoming message buffer
32
DTU Compute
Department of Applied Mathematics and Computer Science
• Latency: the delay between the start of a message’s transmission from one
process and the beginning of its receipt by another
‣ The time taken for the first of a string of bits transmitted through the
network to reach its destination
‣ The delay in accessing the network, which increases significantly when the
network is heavily loaded
http://www.bandwidthplace.com/
34
DTU Compute
Department of Applied Mathematics and Computer Science
No Global Clock!!
35
DTU Compute
Department of Applied Mathematics and Computer Science
• Each computer in a distributed system has its own internal clock, which can
be used by local processes to obtain a value of the current time
• However, even if two processes read their clocks at the same time, their
local clocks may supply different time values
• This is because computer clocks drift from perfect time and, more
importantly, their drift rates differ from one another
• Clock drift rate: rate at which a computer clock deviates from a perfect
reference clock
36
DTU Compute
Department of Applied Mathematics and Computer Science
• In a distributed system it is hard to set time limits on the time taken for
process execution, message delivery or clock drift
37
DTU Compute
Department of Applied Mathematics and Computer Science
‣ the time to execute each step of a process has known lower and upper
bounds
‣ each process has a local clock whose drift rate from real time has a known
bound
38
DTU Compute
Department of Applied Mathematics and Computer Science
‣ process execution speeds: each step may take an arbitrarily long time
• This exactly models the Internet, in which there is no intrinsic bound on server
or network load and therefore on how long it takes, for example, to transfer a
file using ftp, or to receive an email message
39
DTU Compute
Department of Applied Mathematics and Computer Science
Design Challenges
1. Architectural Models
2. Interaction Model
3. Design Challenges
4. Case Study: Design of a Client-Server System
DTU Compute
Department of Applied Mathematics and Computer Science
41
DTU Compute
Department of Applied Mathematics and Computer Science
Heterogeneity of Components
‣ operating systems
‣ programming languages
42
DTU Compute
Department of Applied Mathematics and Computer Science
‣ Specialized hardware
43
DTU Compute
Department of Applied Mathematics and Computer Science
Openness
‣ at the software level by the introduction of new services and the re-
implementation of old ones
44
DTU Compute
Department of Applied Mathematics and Computer Science
Example
• Twitter and Facebook have API that allows developers to develop theirs own
software interactively
45
DTU Compute
Department of Applied Mathematics and Computer Science
Scalability
46
DTU Compute
Department of Applied Mathematics and Computer Science
Example
‣ It is difficult to predict the demand that will be put on a system years ahead
47
DTU Compute
Department of Applied Mathematics and Computer Science
Security
49
DTU Compute
Department of Applied Mathematics and Computer Science
• On August 6, 2009, Twitter was shut down for hours due to a DoS attack:
50
DIGITAL
INNOVATION
BIG
DATA
IOT
- EMBEDDED AI
5G - CONNECTIVITY
WIRELESS
NETWORKING
CLOUD
DTU Compute
Department of Applied Mathematics and Computer Science
52
DTU Compute
Department of Applied Mathematics and Computer Science
Failure Handling
53
DTU Compute
Department of Applied Mathematics and Computer Science
Example: Consensus
54
DTU Compute
Department of Applied Mathematics and Computer Science
Failure Model
• The failure model defines the ways in which failures may occur in order to
provide an understanding of the effects of failures
55
DTU Compute
Department of Applied Mathematics and Computer Science
send m receive
Communication channel
Outgoing message buffer Incoming message buffer
56
DTU Compute
Department of Applied Mathematics and Computer Science
• The term arbitrary or Byzantine failure is used to describe the worst possible
failure semantics, in which any type of error may occur
57
DTU Compute
Department of Applied Mathematics and Computer Science
58
DTU Compute
Department of Applied Mathematics and Computer Science
Concurrency
59
DTU Compute
Department of Applied Mathematics and Computer Science
Transparency
60
DTU Compute
Department of Applied Mathematics and Computer Science
• In terms of commands issued from the terminal and results displayed on the
terminal, the distributed system can be made to look just like a single-
processor system
61
DTU Compute
Department of Applied Mathematics and Computer Science
Transparencies
Network transparency
Access Transparency Enables local and remote resources to be accessed using identical operations
Performance
Allows the system to be reconfigured to improve performance as loads vary
Transparency
Allows the system and applications to expand in scale without change to the
Scaling Transparency
system structure or the application algorithms
62
DTU Compute
Department of Applied Mathematics and Computer Science
PROBLEM
64
DTU Compute
Department of Applied Mathematics and Computer Science
how to map
3 application layers
into a 2-tier architecture?
65
DTU Compute
Department of Applied Mathematics and Computer Science
Presentation Application
Thin processing
Client Data
management
Presentation Data
Thick management
Client
Application
processing
66
DTU Compute
Department of Applied Mathematics and Computer Science
Data management
Presentation
Application account
processing Transaction database
manager
Presentation Presentation
Application Application
processing processing
67
DTU Compute
Department of Applied Mathematics and Computer Science
Presentation
client (Web browser)
Account
HTTP account
Presentation service
provision database
(Web server)
Data management
Application
processing
Presentation
68
DTU Compute
Department of Applied Mathematics and Computer Science
Presentation
HTTP
Presentation Web server Database server
SQL
Account query
account
Presentation service SQL database
provision server
72
DTU Compute
Department of Applied Mathematics and Computer Science
Homework
Consider a hypothetical car hire company and sketch out a three-tier solution
to the provision of their underlying distributed car hire service. Use this to
illustrate the benefits and drawbacks of a three-tier solution considering issues
such as performance, scalability, dealing with failure and also maintaining the
software over time.
74