You are on page 1of 44

Trng i Hc Bch Khoa H Ni

Vin in t - Vin thng

Cc H Thng Phn Tn
(Distributed Systems)

TS. H Duyn Trung


B mn in t - Hng khng V tr
Email: haduyentrungvn@gmail.com
https://sites.google.com/site/fethaduyentrung/
H Ni 01/2016

Ni dung
Chng 1 Gii thiu v h phn tn (Introduction)
Chng 2 Truyn thng (Communication)
Chng 3 ng b ha (Synchronization) and
transactions
Chng 4 Chu li v khi phc li (Fault tolerance
and recovery)
Chng 5 Cc h thng ngang hng (Peer-to-peer
systems)

Ti liu tham kho


1. Jean Dollimore, Tim Kindberg, George Coulouris,
Distributed Systems: Concepts and Design (4th Edition),
Addison Wesley, 2005.
2. Andrew S. Tanenbaum, Maarten Van Steen, Distributed
Systems: Principles and Paradigms (2nd Edition),
Prentice Hall, 2006.
3. Sukumar Ghosh, Distributed Systems: An Algorithmic
Approach, Chapman & Hall/CRC, 2006.

Performance evaluation
Paper reading : 40%

Assignment (objective projects): 60%

Chapter 1

Gii Thiu v H Phn Tn

nh ngha, phn loi


Mc tiu, tnh cht ca h phn tn
Khi nhim phn cng, phn mm
M hnh client server
Cc h thng x l giao dch (Transaction processing
systems)
Cc h thng khp ni phn tn (Distributed
Pervasive Systems)
Cc vn m
5

While distributed systems ?


Powerful centralized computer architectures (mainframe,
super computer, etc) fails to gain popularity
High performance computing (HPC) still goes on; deeply
speaking, the system is however truly distributed
On the other hand, distributed computing systems,
networks in particular, are booming

nh ngha v h phn tn (1)


nh ngha v h phn tn:
nh ngha 1: H phn tn l tp hp cc my tnh t
tr c kt ni vi nhau bi mt mng my tnh v
c ci t phn mm h phn tn.

nh ngha 2: H phn tn l mt h thng c chc


nng v d liu phn tn trn cc trm (my tnh)
c kt ni vi nhau bi mt mng my tnh.

nh ngha v h phn tn (2)

A distributed system organized as middleware. The middleware


layer extends over multiple machines, and offers each
application the same interface.
H phn tn = mng my tnh + phn mm h phn tn
8

Phn loi h phn tn


Trc y, h phn tn c chia thnh ba loi: h
iu hnh h phn tn, c s d liu h phn tn v cc
h thng tnh ton h phn tn.
Ngy nay, h phn tn c phn chia nh sau:
H phn tn mang tnh h thng: h iu hnh phn
tn.
H phn tn mang tnh ng dng: cc h thng
truyn tin phn tn.

Mc tiu ca h phn tn
a. Kt ni ngi s dng v ti nguyn
Gii quyt bi ton chia s ti nguyn trong h thng (resource
sharing).

b. Tnh trong sut


n giu s ri rc v nhng nhc im nu c ca h phn
tn i vi ngi s dng (end-user) v nhng nh lp trnh
ng dng (application programmer).
Theo tiu chun ISO cho h phn tn ISO / IS / 10746 tn l
Open distributed processing reference model 1995 c th
ha thnh cc dng trong sut nh sau:
10

b. Tnh Trong Sut


Trong sut truy cp (Access transparency): che giu s khc
bit v cch biu din v cch truy cp ti nguyn.
Trong sut v v tr (Location transparency): che giu v tr

ca ti nguyn.
Trong sut di tr (Migration transparency): che giu kh nng
chuyn v tr ca ti nguyn.
Trong sut v vic nh v li (Relocation transparency): che
giu vic di chuyn ca ti nguyn khi ang c s dng.

11

b. Tnh Trong Sut


Trong sut nhn bn (Replication transparency): che giu
tnh trng s dng bn sao ca ti nguyn.
Trong sut s c (Failure transparency): che giu li h

thng nu c.
Trong sut kh nng di chuyn ti nguyn (Persistence
transparency): che giu vic di chuyn ti nguyn t b nh
ngoi vo b nh trong v ngc li.

12

C. Tnh m (Openness)
H phn tn c gi l m nu n cung cp cc dch v
theo cc quy tc chun m t c php v ng ngha ca
dch v .
Thng thng trong h phn tn cc dch v thng c
t qua cc giao din bng ngn ng c t giao din
(Interface Definition Language- IDL). V th ch quan
tm n c php. Cho php cc dch v khc nhau cng
chung sng. Nu cc giao din ca h phn tn c c
t y v ng n.

13

d. Tnh co gin (Scalability)


Mt h phn tn c gi l c tnh co gin nu n
thch nghi vi s thay i quy m ca h thng. Th
hin trn cc kha cnh sau:
D b sung ngi s dng v ti nguyn h thng
Khi h thng thay i quy m v mt a l dn n s thay
i v v tr a l ca ngi s dng v cc ti nguyn.
H thng c thay i quy m v qun tr.

Nu h phn tn c tnh co gin thng nh hng


n hiu nng ca h thng (hiu nng ca h thng
l hiu qu nng lc hot ng ca i tng).

14

d. Tnh co gin (Scalability)


C ba gii php ph dng gii quyt vn co
gin ca h phn tn:
n giu.
Phn tn: phn nh thnh phn h thng v phn b chng
trn phm vi ca h thng (qun l phn cp). V d: DNS
xc nh theo cch phn cp min ln thnh cc min con.
Vi phng php ny s gii quyt c vn khi thm
ngi dng hay ti nguyn vo h thng.
Nhn bn: nhn bn mt thnh phn no ca h thng.
V d: ti nguyn d liu t ti cc v tr khc nhau trong
h thng.

15

Scaling Techniques (1)

The difference between letting (a) a server or (b) a


client check forms as they are being filled.
16

Scaling Techniques (2)

An example of dividing the DNS


name space into zones.

17

Cc khi nim phn cng


C hai loi my tnh:
Cc loi my tnh c chia s b nh (Shared memory): cc
loi my a x l (multiproccessor).
Cc my tnh khng chia s b nh (Private memory): cc h
thng multicomputors

Mi loi chia tip theo


mng ch c mt ng
kt ni busbased v c
nhiu ng kt ni t
my ny sang my khc
switchbase.
18

Cc khi nim phn cng


H thun nht / h khng thun nht
H thng thun nht: mng my tnh cng s dng
mt cng ngh, cc b x l l nh nhau, truy cp
n cng mt b nh ging nhau. Thng dng
trong h thng c tnh ton song song.
H khng thun nht: nhng my tnh khc nhau kt
ni vi nhau.

19

Cc khi nim phn mm


DOS (Distributed OS)
L h iu hnh cho cc h multiproccessor v cc h ng
nht homogenous multicomputer.
Mc tiu l n giu v cung cp cc dch v qun tr ti
nguyn.
c im l cc dch v c th c thc hin bi cc li
triu gi t xa.

Cu trc chung ca DOS

20

Cc khi nim phn mm


NOS (Network OS)
L h iu hnh cho cc h thng heterogenous
multicomputer (LAN, WAN).
Mc tiu ca NOS l cung cp cc dch v t xa.

Cu trc chung ca NOS

21

Cc khi nim phn mm


Middleware
L tng ph nm gia tng dch v ca NOS v tng ng
dng phn tn.

Cu trc chung ca mt h middleware

22

M hnh client server


M hnh client server trong mt h phn tn c
phn chia thnh hai nhm chnh l nhm cc server
v nhm cc client:
Nhm cc server cha cc dch v c bit.
Nhm cc client l nhm gi yu cu n server c s
dng cc dch v trn server.

M hnh tng tc tng qut gia client v server:

23

M hnh client server


Vic phn nh rch ri chc nng ca client v
server n gi cng rt khc bit v khng thun nht.
Do ngi ta a ra tng l chia thnh ba mc
chc nng:
User interface level: bao gm cc chng trnh cung cp
giao din cho php ngi s dng tng tc vi chng
trnh ng dng.
Processing level: lm nhim v x l cc tc v ca ngi
dng trn c s d liu
Data level: gm cc chng trnh duy tr cc d liu m cc
chng trnh ng dng x l.

24

Cluster Computing Systems


An example of a cluster computing system.

25

Transaction Processing Systems (1)


Example primitives for transactions.

26

Transaction Processing Systems (2)


Characteristic properties of transactions:
Atomic: To the outside world, the transaction happens
indivisibly.
Consistent: The transaction does not violate system
invariants.
Isolated: Concurrent transactions do not interfere with each
other.
Durable: Once a transaction commits, the changes are
permanent.

27

Transaction Processing Systems (3)

A nested transaction.

28

Transaction Processing Systems (4)


The role of a TP monitor in distributed systems.

29

Enterprise Application Integration

Middleware as a communication facilitator in enterprise


application integration.

30

Distributed Pervasive Systems


Requirements for pervasive systems
Embrace contextual changes.
Encourage ad hoc composition.
Recognize sharing as the default.

31

Electronic Health Care Systems (1)


Questions to be addressed for health care systems:

Where and how should monitored data be stored?


How can we prevent loss of crucial data?
What infrastructure is needed to generate and propagate alerts?
How can physicians provide online feedback?
How can extreme robustness of the monitoring system be
realized?
What are the security issues and how can the proper policies be
enforced?

32

Electronic Health Care Systems (2)

Monitoring a person in a pervasive electronic health care system,


using:
(a) a local hub or
(b) a continuous wireless connection.
33

Sensor Networks (1)

Questions concerning sensor networks:


How do we (dynamically) set up an efficient tree in a
sensor network?
How does aggregation of results take place? Can it be
controlled?
What happens when network links fail?

34

Sensor Networks (2)

Organizing a sensor network database, while storing and


processing data (a) only at the operators site or
35

Sensor Networks (3)

Organizing a sensor network database, while storing and


processing data or (b) only at the sensors.
36

Architectural Styles (1)

Important styles of architecture for distributed


systems:

Layered architectures
Object-based architectures
Data-centered architectures
Event-based architectures

37

Centralized Architectures
General interaction between a client and a server.

38

Application Layering
The simplified organization of an Internet search
engine into three different layers.

39

Multitiered Architectures (1)


The simplest organization is to have only two types
of machines:
A client machine containing only the programs
implementing (part of) the user-interface level
A server machine containing the rest,
the programs implementing the processing and data level

40

Multitiered Architectures (2)


Alternative client-server organizations (a)(e).

41

Multitiered Architectures (3)


An example of a server acting as client.

42

Data-centered: structured P2P architecture


The mapping of data
items onto nodes in
Chord.

43

Open issues
High performance computing
systems
Advanced computing technology:
Cloud computing
Distributed communication
middleware
Parallel and distributed processing
Distributed embedded systems

44

You might also like